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: stam_order.m
    path of file: ./repos/gptoolbox/mesh
    
    the code of the file until where you have to start completion: function [I,J] = stam_order(F,A)
  % STAM_ORDER For a regular patch of 13 faces and 12 vertices of a mesh (V,F)
  % around a "center" facet f determined by all its corners having valence 6,
  % determine the reordering of vertices, so that the reordered mesh
  % (V(I,:),J(F)) will fit Jos Stam's ordering in "Evaluation of Loop
  % Subdivision Surfaces". The facet F(f,:) is mapped to [4 7 8] in Stam's
  % patch.
  %
  % [I,J] = stam_order(F)
  % [I,J] = stam_order(F,A)

    
function [I,J] = stam_order(F,A)
  % STAM_ORDER For a regular patch of 13 faces and 12 vertices of a mesh (V,F)
  % around a "center" facet f determined by all its corners having valence 6,
  % determine the reordering of vertices, so that the reordered mesh
  % (V(I,:),J(F)) will fit Jos Stam's ordering in "Evaluation of Loop
  % Subdivision Surfaces". The facet F(f,:) is mapped to [4 7 8] in Stam's
  % patch.
  %
  % [I,J] = stam_order(F)
  % [I,J] = stam_order(F,A)
  %
  % Input:
  %   F  13 by 3 list of triangle indices into some V
  %   A  max(F) by max(F) adjacency matrix {[]}
  % Output:
  %   I  12 long list of indices such that V(I,:) are the reorderd vertices.
  %   J  12 long list of indices such that J(F) are the reordered faces,
  %     {J=full(sparse(I,1,1:12))}
  %
  % Example:
  %   % Canonical regular patch
  %   WV = [-1 0;0 -1;-1 1;0 0;1 -1;-1 2;0 1;1 0;2 -1;0 2;1 1;2 0];
  %   F = [ ...
  %     1 3 4;4 2 1;4 5 2; ...
  %     6 7 3;7 4 3;4 7 8;8 5 4;8 9 5; ...
  %     6 10 7;10 11 7;7 11 8;11 12 8;12 9 8];
  %   % Scramble patch vertex order and face order
  %   R = randperm(size(WV,1));
  %   G = R(F(randperm(end