You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spm_eeg_cfc.m
    path of file: ./repos/spm
    
    the code of the file until where you have to start completion: function spm_eeg_cfc(S)
% Compute GLM for phase-amplitude and amplitude-amplitude coupling
% FORMAT spm_eeg_cfc(S)
%
% Xamp = independent variable to be explained:
%        Xamp = B1*sin(Xphase) + B2*cos(Xphase) + B3*Xlowamp
%
% Additional regressors may be included
% - overall estimates of PAC & AMP are obtained from continuous (or
%   concatenated) data
% - statistical inference of these estimates is performed by dividing the
%   continuous time series into shorter epochs
% - function writes out images of the estimated PAC & AMP, as well as their
%   p-values
%__________________________________________________________________________
%
% References:
% van Wijk et al. 2015 J Neurosci Methods
%__________________________________________________________________________

% Bernadette van Wijk, Vladimir Litvak
% Copyright (C) 2014-2022 Wellcome Centre for Human Neuroimaging



    
function spm_eeg_cfc(S)
% Compute GLM for phase-amplitude and amplitude-amplitude coupling
% FORMAT spm_eeg_cfc(S)
%
% Xamp = independent variable to be explained:
%        Xamp = B1*sin(Xphase) + B2*cos(Xphase) + B3*Xlowamp
%
% Additional regressors may be included
% - overall estimates of PAC & AMP are obtained from continuous (or
%   concatenated) data
% - statistical inference of these estimates is performed by dividing the
%   continuous time series into shorter epochs
% - function writes out images of the estimated PAC & AMP, as well as their
%   p-values
%__________________________________________________________________________
%
% References:
% van Wijk et al. 2015 J Neurosci Methods
%__________________________________________________________________________

% Bernadette van Wijk, Vladimir Litvak
% Copyright (C) 2014-2022 Wellcome Centre for Human Neuroimaging


%-Startup
%--------------------------------------------------------------------------
spm('FnBanner', mfilename);
spm('FigName','Cross-frequency coupling'); spm('Pointer','Watch');

D = spm_eeg_load(S.D);

if ~isfield(S, 'conditions') || isempty(S.conditions),  S.conditions = D.condlist;  end