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: a_adimat_sol_qr.m
    path of file: ./repos/d2d/arFramework3/ThirdParty/StrucID/adimat/runtime
    
    the code of the file until where you have to start completion: % Generated by ADiMat 0.6.0-4867
% © 2001-2008 Andre Vehreschild <vehreschild@sc.rwth-aachen.de>
% © 2009-2013 Johannes Willkomm <johannes.willkomm@sc.tu-darmstadt.de>
% RWTH Aachen University, 52056 Aachen, Germany
% TU Darmstadt, 64289 Darmstadt, Germany
% Visit us on the web at http://www.adimat.de/
% Report bugs to adimat-users@lists.sc.informatik.tu-darmstadt.de
%
%                             DISCLAIMER
% 
% ADiMat was prepared as part of an employment at the Institute for Scientific Computing,
% RWTH Aachen University, Germany and at the Institute for Scientific Computing,
% TU Darmstadt, Germany and is provided AS IS. 
% NEITHER THE AUTHOR(S), THE GOVERNMENT OF THE FEDERAL REPUBLIC OF GERMANY
% NOR ANY AGENCY THEREOF, NOR THE RWTH AACHEN UNIVERSITY, NOT THE TU DARMSTADT,
% INCLUDING ANY OF THEIR EMPLOYEES OR OFFICERS, MAKES ANY WARRANTY, EXPRESS OR IMPLIED,
% OR ASSUMES ANY LEGAL LIAB
    
function [a_a a_b nr_z] = a_adimat_sol_qr(a, b, a_z)
   tmpda3 = 0;
   tmpda2 = 0;
   tmpda1 = 0;
   tmpda4 = 0;
   tmpca1 = 0;
   z = 0;
   q = 0;
   r = 0;
   r1 = 0;
   t = 0;
   q1 = 0;
   [m n] = size(a);
   tmpba1 = 0;
   if m < n
      tmpba1 = 1;
      adimat_push(q, r);
      [q r] = qr(a');
      adimat_push1(r1);
      r1 = r(1 : m, :);
      adimat_push1(tmpda3);
      tmpda3 = true;
      adimat_push1(tmpda2);
      tmpda2 = true;
      adimat_push1(tmpda1);
      tmpda1 = struct('UT', tmpda2, 'TRANSA', tmpda3);
      adimat_push1(t);
      t = linsolve(r1, b, tmpda1);
      adimat_push1(tmpda4);
      tmpda4 = size(b, 2);
      adimat_push1(tmpda3);
      tmpda3 = n - m;
      adimat_push1(tmpda2);
      tmpda2 = zeros(tmpda3, tmpda4);
      adimat_push1(tmpca1);
      tmpca1 = [t
            tmpda2];
      adimat_push1(z);
      z = q * tmpca1;
   else
      adimat_push(q, r);
      [q r] = qr(a);
      adimat_push1(q1);
      q1 = q(:, 1 : n);
      adimat_push1(r1);
      r1 = r(1 : n, :);
      adimat_push1(tmpda3);
      tmpda3 = true;
      adimat_push1(tmpda2);
      tmpda2 = struct('UT', tmpda3);
      adimat_push1(tmpca1);
      tmpca1 = q1' * b;
      adimat_push1(z);
      z = linsolve(r1, tmpca1, tmpda2);
   end