// File: /workspace/github_cpp_makefile_star2_O1/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_unpack_inputs(_IO_FILE*, Var*)
void mex_unpack_inputs(FILE* fp, Var* v)
{
    if (!v)
        return;
    if (v->iospec == 'o') {
        mex_unpack_inputs(fp, v->next);
        return;
    }

    if (is_obj(v->tinfo))
        mex_cast_get_p(fp, v->basetype, v->input_label);
    else if (is_array(v->tinfo))
        mex_unpack_input_array(fp, v);
    else if (v->tinfo == VT_scalar ||
             v->tinfo == VT_r_scalar ||
             v->tinfo == VT_p_scalar)
      {
	if ( strcmp(v->basetype,"float") == 0 )
        fprintf(fp,
                "    if( mxGetClassID(prhs[%d]) != mxSINGLE_CLASS )\n"
		"        mw_err_txt_ = \"Invalid scalar argument, mxSINGLE_CLASS expected\";\n"
		"    if (mw_err_txt_) goto mw_err_label;\n"
                "    in%d_ = (%s) mxWrapGetScalar_single(prhs[%d], &mw_err_txt_);\n"
                "    if (mw_err_txt_)\n"
                "        goto mw_err_label;\n\n",
                v->input_label, v->input_label, v->basetype, v->input_label);
	else if ( strcmp(v->basetype,"char") == 0 )
        fprintf(fp,
                "    if( mxGetClassID(prhs[%d]) != mxCHAR_CLASS )\n"
		"        mw_err_txt_ = \"Invalid scalar argument, mxCHAR_CLASS expected\";\n"
		"    if (mw_err_txt_) goto mw_err_label;\n"
                "    in%d_ = (%s) mxWrapGetScalar_char(prhs[%d], &mw_err_txt_);\n"
                "    if (mw_err_txt_)\n"
                "        goto mw_err_label;\n",
                v->input_label, v->input_label, v->basetype, v->input_label);
	else
        fprintf(fp,
                "    if( mxGetClassID(prhs[%d]) != mxDOUBLE_CLASS )\n"
		"        mw_err_txt_ = \"Invalid scalar argument, mxDOUBLE_CLASS expected\";\n"
		"    if (mw_err_txt_) goto mw_err_label;\n"
                "    in%d_ = (%s) mxWrapGetScalar(prhs[%d], &mw_err_txt_);\n"
                "    if (mw_err_txt_)\n"
                "        goto mw_err_label;\n\n",
                v->input_label, v->input_label, v->basetype, v->input_label);
      }
    else if (v->tinfo == VT_cscalar   || v->tinfo == VT_zscalar   ||
             v->tinfo == VT_r_cscalar || v->tinfo == VT_r_zscalar ||
             v->tinfo == VT_p_cscalar || v->tinfo == VT_p_zscalar)
      {
	if ( strcmp(v->basetype,"fcomplex") == 0 )
	  {
	    fprintf(fp,
		    "    if( mxGetClassID(prhs[%d]) != mxSINGLE_CLASS )\n"
		    "        mw_err_txt_ = \"Invalid scalar argument, mxSINGLE_CLASS expected\";\n"
		    "    if (mw_err_txt_) goto mw_err_label;\n",
		    v->input_label);
	    fprintf(fp,
		    "    mxWrapGetScalar_single_%s(&in%d_, prhs[%d]);\n\n",
		    v->basetype, v->input_label, v->input_label);
	  }
	else
	  {
	    fprintf(fp,
		    "    if( mxGetClassID(prhs[%d]) != mxDOUBLE_CLASS )\n"
		    "        mw_err_txt_ = \"Invalid scalar argument, mxDOUBLE_CLASS expected\";\n"
		    "    if (mw_err_txt_) goto mw_err_label;\n",
		    v->input_label);
	    fprintf(fp,
		    "    mxWrapGetScalar_%s(&in%d_, prhs[%d]);\n\n",
		    v->basetype, v->input_label, v->input_label);
	  }
      }
    else if (v->tinfo == VT_string)
        mex_unpack_input_string(fp, v);
    else if (v->tinfo == VT_mx)
        fprintf(fp, "    in%d_ = prhs[%d];\n\n",
                v->input_label, v->input_label);

    mex_unpack_inputs(fp, v->next);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x45f5(%rip), %r15      # 0xdfc4
leaq 0x3a60(%rip), %r12      # 0xd436
testq %rbx, %rbx
je 0x9b0b
cmpb $0x6f, 0x8(%rbx)
je 0x9b02
movl 0x20(%rbx), %eax
decl %eax
cmpl $0x11, %eax
ja 0x9b02
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x3260
movl (%rbx), %edx
movq %r14, %rdi
testl %eax, %eax
je 0x9a90
leaq 0xbbd2(%rip), %rsi      # 0x155ee
xorl %eax, %eax
callq 0x3270
movq 0x10(%rbx), %rdx
movl (%rbx), %ecx
movq %r14, %rdi
leaq 0xbc61(%rip), %rsi      # 0x15694
jmp 0x9aae
movq 0x10(%rbx), %rsi
movl (%rbx), %edx
movq %r14, %rdi
callq 0x904b
jmp 0x9b02
movq %r14, %rdi
movq %rbx, %rsi
callq 0x976a
jmp 0x9b02
movq 0x10(%rbx), %r13
movq %r13, %rdi
leaq 0x4051(%rip), %rsi      # 0xdab7
callq 0x3260
testl %eax, %eax
je 0x9aba
movq %r13, %rdi
leaq 0x4057(%rip), %rsi      # 0xdad0
callq 0x3260
movl (%rbx), %ecx
movq %r14, %rdi
testl %eax, %eax
je 0x9aec
leaq 0xb976(%rip), %rsi      # 0x15404
jmp 0x9af3
leaq 0xba7e(%rip), %rsi      # 0x15515
xorl %eax, %eax
callq 0x3270
movq 0x10(%rbx), %rdx
movl (%rbx), %ecx
movq %r14, %rdi
leaq 0xbb0d(%rip), %rsi      # 0x155bb
movl %ecx, %r8d
xorl %eax, %eax
callq 0x3270
jmp 0x9b02
movl (%rbx), %ecx
movq %r14, %rdi
leaq 0xb715(%rip), %rsi      # 0x151db
jmp 0x9af3
movq %r14, %rdi
movq %rbx, %rsi
callq 0x98ee
jmp 0x9b02
movl (%rbx), %ecx
movq %r14, %rdi
leaq 0xbbdf(%rip), %rsi      # 0x156c0
movl %ecx, %edx
xorl %eax, %eax
callq 0x3270
jmp 0x9b02
leaq 0xb800(%rip), %rsi      # 0x152f3
movl %ecx, %edx
movq %r13, %r8
movl %ecx, %r9d
xorl %eax, %eax
callq 0x3270
movq 0x30(%rbx), %rbx
jmp 0x99d6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq