// File: /workspace/github_cpp_makefile_star2_O2/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 0x4222(%rip), %r15      # 0xcfa4
leaq 0x36ad(%rip), %r12      # 0xc436
testq %rbx, %rbx
je 0x8ebe
cmpb $0x6f, 0x8(%rbx)
je 0x8eb5
movl 0x20(%rbx), %eax
decl %eax
cmpl $0x11, %eax
ja 0x8eb5
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x32a0
movl (%rbx), %edx
movq %r14, %rdi
testl %eax, %eax
je 0x8e43
leaq 0xb7ff(%rip), %rsi      # 0x145ce
xorl %eax, %eax
callq 0x32b0
movq 0x10(%rbx), %rdx
movl (%rbx), %ecx
movq %r14, %rdi
leaq 0xb88e(%rip), %rsi      # 0x14674
jmp 0x8e61
movq 0x10(%rbx), %rsi
movl (%rbx), %edx
movq %r14, %rdi
callq 0x8409
jmp 0x8eb5
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8b1c
jmp 0x8eb5
movq 0x10(%rbx), %r13
movq %r13, %rdi
leaq 0x3c6e(%rip), %rsi      # 0xca87
callq 0x32a0
testl %eax, %eax
je 0x8e6d
movq %r13, %rdi
leaq 0x3c74(%rip), %rsi      # 0xcaa0
callq 0x32a0
movl (%rbx), %ecx
movq %r14, %rdi
testl %eax, %eax
je 0x8e9f
leaq 0xb5a3(%rip), %rsi      # 0x143e4
jmp 0x8ea6
leaq 0xb6ab(%rip), %rsi      # 0x144f5
xorl %eax, %eax
callq 0x32b0
movq 0x10(%rbx), %rdx
movl (%rbx), %ecx
movq %r14, %rdi
leaq 0xb73a(%rip), %rsi      # 0x1459b
movl %ecx, %r8d
xorl %eax, %eax
callq 0x32b0
jmp 0x8eb5
movl (%rbx), %ecx
movq %r14, %rdi
leaq 0xb342(%rip), %rsi      # 0x141bb
jmp 0x8ea6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8c9e
jmp 0x8eb5
movl (%rbx), %ecx
movq %r14, %rdi
leaq 0xb80c(%rip), %rsi      # 0x146a0
movl %ecx, %edx
xorl %eax, %eax
callq 0x32b0
jmp 0x8eb5
leaq 0xb42d(%rip), %rsi      # 0x142d3
movl %ecx, %edx
movq %r13, %r8
movl %ecx, %r9d
xorl %eax, %eax
callq 0x32b0
movq 0x30(%rbx), %rbx
jmp 0x8d89
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq