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_shoot3d_nojac.m
    path of file: ./repos/bspm/thirdparty/spm12/toolbox/Shoot
    
    the code of the file until where you have to start completion: function varargout = spm_shoot3d_nojac(v0,prm,args)
% Geodesic shooting
% FORMAT [phi,v1,theta] = spm_shoot3d_nojac(v0,prm,args)
% v0   - Initial velocity field n1*n2*n3*3 (single prec. float)
% prm  - Differential operator parameters
% prm  - 7 parameters (settings)
%        - [1] Regularisation type (ie the form of the differential
%          operator), can take values of
%           - 0 Linear elasticity
%           - 1 Membrane energy
%           - 2 Bending energy
%        - [2][3][4] Voxel sizes
%        - [5][6][7] Regularisation parameters
%           - For "membrane energy", the parameters are
%             lambda, unused and id.
%           -
    
function
% K = L^{-1} (see e.g. Bro-Nielson).
%
%________________________________________________________
% (c) Wellcome Trust Centre for NeuroImaging (2009)

% John Ashburner
% $Id: spm_shoot3d_nojac.m 4925 2012-09-14 11:17:01Z guillaume $

args0 = [8 1 1];
if nargin<3,
    args = args0;
else
    if numel(args)<numel(args0),
        args = [args args0((numel(args)+1):end)];
    end
end
verb     = false;
N        = args(1);   % # Time steps
fmg_args = args(2:3); % Multigrid params
d        = size(v0);
d        = d(1:3);
vt       = v0;

m0       = spm_diffeo('vel2mom',v0,prm); % Initial momentum (m_0 = L v_0)
phi      = spm_diffeo('smalldef', vt,1/N);

%crap=spm_diffeo('mom2vel',m0,[prm,fmg_args]);
%fprintf('---------\n\n');

%crap=spm_diffeo('mom2vel',m0,[prm,fmg_args],v0);
%fprintf('---------\n\n');

if nargout>=3, theta = spm_diffeo('smalldef', vt,-1/N); end