LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_zcopiers(_IO_FILE*, char const*, char const*)
void mex_define_zcopiers(FILE* fp, const char* name, const char* ztype)
{
    /* Define complex copiers */
    fprintf(fp,
            "mxWrapGetScalarZDef(mxWrapGetScalar_%s, %s,\n"
            "                    %s, setz_%s)\n",
            name, name, ztype, name);
    fprintf(fp,
            "mxWrapGetArrayZDef (mxWrapGetArray_%s, %s,\n"
            "                    %s, setz_%s)\n",
            name, name, ztype, name);
    fprintf(fp,
            "mxWrapCopyZDef     (mxWrapCopy_%s, %s,\n"
            "                    real_%s, imag_%s)\n",
            name, name, name, name);
    fprintf(fp,
            "mxWrapReturnZDef   (mxWrapReturn_%s, %s,\n"
            "                    real_%s, imag_%s)\n",
            name, name, name, name);

    /* Single precision */
    fprintf(fp,
            "mxWrapGetScalarZDef_single(mxWrapGetScalar_single_%s, %s,\n"
            "                    %s, setz_%s)\n",
            name, name, ztype, name);
    fprintf(fp,
            "mxWrapGetArrayZDef_single (mxWrapGetArray_single_%s, %s,\n"
            "                    %s, setz_%s)\n",
            name, name, ztype, name);
    fprintf(fp,
            "mxWrapCopyZDef_single     (mxWrapCopy_single_%s, %s,\n"
            "                    real_%s, imag_%s)\n",
            name, name, name, name);
    fprintf(fp,
            "mxWrapReturnZDef_single   (mxWrapReturn_single_%s, %s,\n"
            "                    real_%s, imag_%s)\n",
            name, name, name, name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb65a(%rip), %rsi      # 0x12faa
movq %rbx, %rdx
movq %rbx, %rcx
movq %r15, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x32b0
leaq 0xb68e(%rip), %rsi      # 0x12ff8
movq %r14, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
movq %r15, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x32b0
leaq 0xb6be(%rip), %rsi      # 0x13045
movq %r14, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
movq %rbx, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x32b0
leaq 0xb6ef(%rip), %rsi      # 0x13093
movq %r14, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
movq %rbx, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x32b0
leaq 0xb722(%rip), %rsi      # 0x130e3
movq %r14, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
movq %r15, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x32b0
leaq 0xb761(%rip), %rsi      # 0x1313f
movq %r14, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
movq %r15, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x32b0
leaq 0xb79f(%rip), %rsi      # 0x1319a
movq %r14, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
movq %rbx, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x32b0
leaq 0xb7de(%rip), %rsi      # 0x131f6
movq %r14, %rdi
movq %rbx, %rdx
movq %rbx, %rcx
movq %rbx, %r8
movq %rbx, %r9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x32b0
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_copiers(_IO_FILE*)
void mex_define_copiers(FILE* fp)
{
    fprintf(fp, "\n\n\n");
    fprintf(fp, "/* Array copier definitions */\n");
    for( set<string>::iterator iter = scalar_decls.begin();
         iter != scalar_decls.end();
         ++iter){
        mex_define_copiers(fp, iter->c_str());
    }
    for( set<string>::iterator iter = cscalar_decls.begin();
         iter != cscalar_decls.end();
         ++iter)
        mex_define_zcopiers(fp, iter->c_str(), "float");
    for( set<string>::iterator iter = zscalar_decls.begin();
         iter != zscalar_decls.end();
         ++iter)
        mex_define_zcopiers(fp, iter->c_str(), "double");
    fprintf(fp, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0xb807(%rip), %rdi      # 0x13254
pushq $0x3
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0xb7f2(%rip), %rdi      # 0x13258
pushq $0x1f
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0x13a1d(%rip), %r15     # 0x1b498
movq 0x18(%r15), %r14
addq $0x8, %r15
cmpq %r15, %r14
je 0x7aa1
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x77ba
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
jmp 0x7a83
leaq 0x13a20(%rip), %r12     # 0x1b4c8
movq 0x18(%r12), %r15
addq $0x8, %r12
leaq 0x4fcf(%rip), %r14      # 0xca87
cmpq %r12, %r15
je 0x7ad9
movq 0x20(%r15), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x7936
movq %r15, %rdi
callq 0x3210
movq %rax, %r15
jmp 0x7ab8
leaq 0x13a18(%rip), %r12     # 0x1b4f8
movq 0x18(%r12), %r15
addq $0x8, %r12
leaq 0x4f90(%rip), %r14      # 0xca80
cmpq %r12, %r15
je 0x7b11
movq 0x20(%r15), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x7936
movq %r15, %rdi
callq 0x3210
movq %rax, %r15
jmp 0x7af0
pushq $0xa
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3250
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_caps_fname(_IO_FILE*, Func*)
void mex_define_caps_fname(FILE* fp, Func* f)
{
    fprintf(fp, "#define MWF77_%s ", f->funcv);
    for (char* s = f->funcv; *s; ++s)
        fputc(toupper(*s), fp);
    fprintf(fp, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rsi), %rdx
leaq 0xb73c(%rip), %rsi      # 0x13278
xorl %eax, %eax
callq 0x32b0
movq 0x40(%r14), %r14
movsbl (%r14), %edi
testl %edi, %edi
je 0x7b63
callq 0x3360
movl %eax, %edi
movq %rbx, %rsi
callq 0x3250
incq %r14
jmp 0x7b47
pushq $0xa
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x3250
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_caps_fnames(_IO_FILE*, Func*)
void mex_define_caps_fnames(FILE* fp, Func* f)
{
    set<string> fnames;
    for (; f; f = f->next) {
        if (f->fort && fnames.find(f->funcv) == fnames.end()) {
            mex_define_caps_fname(fp, f);
            fnames.insert(f->funcv);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
leaq -0x60(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rdi, -0x38(%rbp)
leaq -0x88(%rbp), %r15
leaq -0x29(%rbp), %r12
leaq -0x68(%rbp), %r13
testq %rbx, %rbx
je 0x7c1f
cmpb $0x1, 0x24(%rbx)
jne 0x7c19
movq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6828
movq %rax, %r14
movq %r15, %rdi
callq 0x33c8
leaq -0x60(%rbp), %rax
cmpq %rax, %r14
jne 0x7c19
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x7b24
movq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6666
movq %r15, %rdi
callq 0x33c8
movq 0x58(%rbx), %rbx
jmp 0x7bb2
leaq -0x68(%rbp), %rdi
callq 0x615a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7c3b
jmp 0x7c4c
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x33c8
jmp 0x7c4f
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x615a
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_underscore1_fname(_IO_FILE*, Func*)
void mex_define_underscore1_fname(FILE* fp, Func* f)
{
    fprintf(fp, "#define MWF77_%s ", f->funcv);
    for (char* s = f->funcv; *s; ++s)
        fputc(tolower(*s), fp);
    fprintf(fp, "_\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rsi), %rdx
leaq 0xb600(%rip), %rsi      # 0x13278
xorl %eax, %eax
callq 0x32b0
movq 0x40(%r14), %r14
movsbl (%r14), %edi
testl %edi, %edi
je 0x7c9f
callq 0x32c0
movl %eax, %edi
movq %rbx, %rsi
callq 0x3250
incq %r14
jmp 0x7c83
leaq 0xb5e5(%rip), %rdi      # 0x1328b
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %rbp
jmp 0x33a0
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_underscore1_fnames(_IO_FILE*, Func*)
void mex_define_underscore1_fnames(FILE* fp, Func* f)
{
    set<string> fnames;
    for (; f; f = f->next) {
        if (f->fort && fnames.find(f->funcv) == fnames.end()) {
            mex_define_underscore1_fname(fp, f);
            fnames.insert(f->funcv);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
leaq -0x60(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rdi, -0x38(%rbp)
leaq -0x88(%rbp), %r15
leaq -0x29(%rbp), %r12
leaq -0x68(%rbp), %r13
testq %rbx, %rbx
je 0x7d65
cmpb $0x1, 0x24(%rbx)
jne 0x7d5f
movq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6828
movq %rax, %r14
movq %r15, %rdi
callq 0x33c8
leaq -0x60(%rbp), %rax
cmpq %rax, %r14
jne 0x7d5f
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x7c60
movq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6666
movq %r15, %rdi
callq 0x33c8
movq 0x58(%rbx), %rbx
jmp 0x7cf8
leaq -0x68(%rbp), %rdi
callq 0x615a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7d81
jmp 0x7d92
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x33c8
jmp 0x7d95
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x615a
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_underscore0_fname(_IO_FILE*, Func*)
void mex_define_underscore0_fname(FILE* fp, Func* f)
{
    fprintf(fp, "#define MWF77_%s ", f->funcv);
    for (char* s = f->funcv; *s; ++s)
        fputc(tolower(*s), fp);
    fprintf(fp, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rsi), %rdx
leaq 0xb4ba(%rip), %rsi      # 0x13278
xorl %eax, %eax
callq 0x32b0
movq 0x40(%r14), %r14
movsbl (%r14), %edi
testl %edi, %edi
je 0x7de5
callq 0x32c0
movl %eax, %edi
movq %rbx, %rsi
callq 0x3250
incq %r14
jmp 0x7dc9
pushq $0xa
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x3250
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_underscore0_fnames(_IO_FILE*, Func*)
void mex_define_underscore0_fnames(FILE* fp, Func* f)
{
    set<string> fnames;
    for (; f; f = f->next) {
        if (f->fort && fnames.find(f->funcv) == fnames.end()) {
            mex_define_underscore0_fname(fp, f);
            fnames.insert(f->funcv);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
leaq -0x60(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rdi, -0x38(%rbp)
leaq -0x88(%rbp), %r15
leaq -0x29(%rbp), %r12
leaq -0x68(%rbp), %r13
testq %rbx, %rbx
je 0x7ea1
cmpb $0x1, 0x24(%rbx)
jne 0x7e9b
movq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6828
movq %rax, %r14
movq %r15, %rdi
callq 0x33c8
leaq -0x60(%rbp), %rax
cmpq %rax, %r14
jne 0x7e9b
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x7da6
movq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6666
movq %r15, %rdi
callq 0x33c8
movq 0x58(%rbx), %rbx
jmp 0x7e34
leaq -0x68(%rbp), %rdi
callq 0x615a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7ebd
jmp 0x7ece
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x33c8
jmp 0x7ed1
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x615a
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_f2c_fname(_IO_FILE*, Func*)
void mex_define_f2c_fname(FILE* fp, Func* f)
{
    fprintf(fp, "#define MWF77_%s ", f->funcv);
    bool has_underscore = false;
    for (char* s = f->funcv; *s; ++s) {
        has_underscore = (has_underscore || (*s == '_'));
        fputc(tolower(*s), fp);
    }
    if (has_underscore)
        fprintf(fp, "__\n");
    else
        fprintf(fp, "_\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rsi), %rdx
leaq 0xb37b(%rip), %rsi      # 0x13278
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x32b0
movq 0x40(%r14), %r14
movsbl (%r14), %edi
testl %edi, %edi
je 0x7f31
cmpb $0x5f, %dil
sete %al
orb %al, %r15b
callq 0x32c0
movl %eax, %edi
movq %rbx, %rsi
callq 0x3250
incq %r14
jmp 0x7f0b
testb $0x1, %r15b
je 0x7f42
leaq 0xb34c(%rip), %rdi      # 0x1328a
pushq $0x3
jmp 0x7f4b
leaq 0xb342(%rip), %rdi      # 0x1328b
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x33a0
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_f2c_fnames(_IO_FILE*, Func*)
void mex_define_f2c_fnames(FILE* fp, Func* f)
{
    set<string> fnames;
    for (; f; f = f->next) {
        if (f->fort && fnames.find(f->funcv) == fnames.end()) {
            mex_define_f2c_fname(fp, f);
            fnames.insert(f->funcv);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
leaq -0x60(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rdi, -0x38(%rbp)
leaq -0x88(%rbp), %r15
leaq -0x29(%rbp), %r12
leaq -0x68(%rbp), %r13
testq %rbx, %rbx
je 0x800e
cmpb $0x1, 0x24(%rbx)
jne 0x8008
movq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6828
movq %rax, %r14
movq %r15, %rdi
callq 0x33c8
leaq -0x60(%rbp), %rax
cmpq %rax, %r14
jne 0x8008
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x7ee2
movq 0x40(%rbx), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6666
movq %r15, %rdi
callq 0x33c8
movq 0x58(%rbx), %rbx
jmp 0x7fa1
leaq -0x68(%rbp), %rdi
callq 0x615a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x802a
jmp 0x803b
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x33c8
jmp 0x803e
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x615a
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_fnames(_IO_FILE*, Func*)
void mex_define_fnames(FILE* fp, Func* f)
{
    fprintf(fp, "#if defined(MWF77_CAPS)\n");
    mex_define_caps_fnames(fp, f);
    fprintf(fp, "#elif defined(MWF77_UNDERSCORE1)\n");
    mex_define_underscore1_fnames(fp, f);
    fprintf(fp, "#elif defined(MWF77_UNDERSCORE0)\n");
    mex_define_underscore0_fnames(fp, f);
    fprintf(fp, "#else /* f2c convention */\n");
    mex_define_f2c_fnames(fp, f);
    fprintf(fp, "#endif\n\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xb227(%rip), %rdi      # 0x1328e
pushq $0x18
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x33a0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7b72
leaq 0xb21c(%rip), %rdi      # 0x132a7
pushq $0x21
popq %r12
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x33a0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7cb8
leaq 0xb21a(%rip), %rdi      # 0x132c9
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x33a0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7df4
leaq 0xb21c(%rip), %rdi      # 0x132eb
pushq $0x1b
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x33a0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7f61
leaq 0xb2e7(%rip), %rdi      # 0x133d6
pushq $0x8
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x33a0
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_fortran_arg(_IO_FILE*, Var*)
void mex_fortran_arg(FILE* fp, Var* v)
{
    if (!v)
        return;
    if (v->tinfo == VT_mx)
        fprintf(fp, "const mxArray*");
    else
        fprintf(fp, "%s*", v->basetype);
    if (v->next) {
        fprintf(fp, ", ");
        mex_fortran_arg(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
pushq $0x1
popq %r13
leaq 0xca90(%rip), %r15      # 0x14bb4
pushq $0x2
popq %r12
testq %rbx, %rbx
je 0x817d
cmpl $0xa, 0x20(%rbx)
jne 0x814a
leaq 0xb1cd(%rip), %rdi      # 0x13307
pushq $0xe
popq %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x33a0
jmp 0x815f
movq 0x10(%rbx), %rdx
movq %r14, %rdi
leaq 0xb604(%rip), %rsi      # 0x1375c
xorl %eax, %eax
callq 0x32b0
cmpq $0x0, 0x30(%rbx)
je 0x817d
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x33a0
movq 0x30(%rbx), %rbx
jmp 0x8128
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_fortran_decl(_IO_FILE*, Func*)
void mex_fortran_decl(FILE* fp, Func* f)
{
    if (f->ret)
        fprintf(fp, "%s ", f->ret->basetype);
    else
        fprintf(fp, "MWF77_RETURN ");
    fprintf(fp, "MWF77_%s(", f->funcv);
    mex_fortran_arg(fp, f->args);
    fprintf(fp, ");\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x50(%rsi), %rax
testq %rax, %rax
je 0x81b9
movq 0x10(%rax), %rdx
leaq 0xb0d9(%rip), %rsi      # 0x13286
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
jmp 0x81ce
leaq 0xb156(%rip), %rdi      # 0x13316
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x33a0
movq 0x40(%r14), %rdx
leaq 0xb14b(%rip), %rsi      # 0x13324
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
movq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x8105
leaq 0xd705(%rip), %rdi      # 0x158fb
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %rbp
jmp 0x33a0
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_fortran_decls(_IO_FILE*, Func*)
void mex_fortran_decls(FILE* fp, Func* f)
{
    fprintf(fp,
            "#ifdef __cplusplus\n"
            "extern \"C\" { /* Prevent C++ name mangling */\n"
            "#endif\n\n"
            "#ifndef MWF77_RETURN\n"
            "#define MWF77_RETURN int\n"
            "#endif\n\n");

    set<string> fnames;
    for (; f; f = f->next) {
        if (f->fort && fnames.find(f->funcv) == fnames.end()) {
            mex_fortran_decl(fp, f);
            fnames.insert(f->funcv);
        }
    }

    fprintf(fp,
            "\n#ifdef __cplusplus\n"
            "} /* end extern C */\n"
            "#endif\n\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rcx
leaq 0xb108(%rip), %rdi      # 0x1332e
pushq $0x7e
popq %rsi
pushq $0x1
popq %rdx
movq %rcx, -0x38(%rbp)
callq 0x33a0
leaq -0x60(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x88(%rbp), %r15
leaq -0x29(%rbp), %r12
leaq -0x68(%rbp), %r13
testq %r14, %r14
je 0x82cb
cmpb $0x1, 0x24(%r14)
jne 0x82c5
movq 0x40(%r14), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6828
movq %rax, %rbx
movq %r15, %rdi
callq 0x33c8
leaq -0x60(%rbp), %rax
cmpq %rax, %rbx
jne 0x82c5
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x818c
movq 0x40(%r14), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6014
movq %r13, %rdi
movq %r15, %rsi
callq 0x6666
movq %r15, %rdi
callq 0x33c8
movq 0x58(%r14), %r14
jmp 0x825d
leaq 0xb0db(%rip), %rdi      # 0x133ad
pushq $0x31
popq %rsi
pushq $0x1
popq %rdx
movq -0x38(%rbp), %rcx
callq 0x33a0
leaq -0x68(%rbp), %rdi
callq 0x615a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x82fd
jmp 0x830e
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x33c8
jmp 0x8311
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x615a
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_casting_getter(_IO_FILE*, char const*, InheritsDecl*)
void mex_casting_getter(FILE* fp, const char* cname,
                        InheritsDecl* inherits)
{
    fprintf(fp, "\n%s* mxWrapGetP_%s(const mxArray* a, const char** e)\n",
            cname, cname);
    fprintf(fp,
            "{\n"
            "    char pbuf[128];\n"
            "    if (mxGetClassID(a) == mxDOUBLE_CLASS &&\n"
            "        mxGetM(a)*mxGetN(a) == 1 &&\n"
            "#if MX_HAS_INTERLEAVED_COMPLEX\n"
	    "        ((mxIsComplex(a) ? *mxGetComplexDoubles(a) == 0 : *mxGetDoubles(a) == 0)\n"
	    "#else\n"
	    "        *mxGetPr(a) == 0\n"
	    "#endif\n"
            "        )\n"
            "        return NULL;\n"
            "    if (!mxIsChar(a)) {\n"
            "#ifdef R2008OO\n"
            "        mxArray* ap = mxGetProperty(a, 0, \"mwptr\");\n"
            "        if (ap)\n"
            "            return mxWrapGetP_%s(ap, e);\n"
            "#endif\n"
            "        *e = \"Invalid pointer\";\n"
            "        return NULL;\n"
            "    }\n"
            "    mxGetString(a, pbuf, sizeof(pbuf));\n\n", cname);

    mex_casting_getter_type(fp, cname);
    for (InheritsDecl* i = inherits; i; i = i->next)
        mex_casting_getter_type(fp, i->name);

    fprintf(fp,
            "    *e = \"Invalid pointer to %s\";\n"
            "    return NULL;\n"
            "}\n\n", cname);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb0dc(%rip), %rsi      # 0x1343c
movq %rbx, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x32b0
leaq 0xb0fe(%rip), %rsi      # 0x13472
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x32b0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8322
testq %r15, %r15
je 0x83a2
movq (%r15), %rsi
movq %r14, %rdi
callq 0x8322
movq 0x8(%r15), %r15
jmp 0x838c
leaq 0xb2e5(%rip), %rsi      # 0x1368e
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x32b0
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_cast_get_p(_IO_FILE*, char const*, int)
void mex_cast_get_p(FILE* fp, const char* basetype, int input_label)
{
    fprintf(fp, "    in%d_ = ", input_label);
    if (is_mxarray_type(basetype))
        fprintf(fp, "mxWrapGet_%s(prhs[%d], &mw_err_txt_);\n",
                basetype, input_label);
    else if (class_decls.find(basetype) == class_decls.end())
        fprintf(fp, "(%s*) mxWrapGetP(prhs[%d], \"%s:%%p\", &mw_err_txt_);\n",
                basetype, input_label, basetype);
    else
        fprintf(fp, "mxWrapGetP_%s(prhs[%d], &mw_err_txt_);\n",
                basetype, input_label);
    fprintf(fp,
            "    if (mw_err_txt_)\n"
            "        goto mw_err_label;\n\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xb29b(%rip), %rsi      # 0x136c5
xorl %eax, %eax
callq 0x32b0
movq %r15, %rdi
callq 0x5781
testb %al, %al
je 0x8446
leaq 0xb28e(%rip), %rsi      # 0x136d2
jmp 0x8487
leaq -0x50(%rbp), %r13
leaq -0x29(%rbp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x6014
leaq 0x13008(%rip), %r12     # 0x1b468
movq %r12, %rdi
movq %r13, %rsi
callq 0xa338
movq %rax, %r13
addq $0x8, %r12
leaq -0x50(%rbp), %rdi
callq 0x33c8
cmpq %r12, %r13
je 0x84bb
leaq 0xb2a7(%rip), %rsi      # 0x1372e
movq %rbx, %rdi
movq %r15, %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x32b0
leaq 0xbe03(%rip), %rdi      # 0x142a1
pushq $0x31
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x33a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb237(%rip), %rsi      # 0x136f9
movq %rbx, %rdi
movq %r15, %rdx
movl %r14d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x32b0
jmp 0x8497
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x33c8
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_declare_type(char*, Var*)
void mex_declare_type(char* typebuf, Var* v)
{
    if (is_obj(v->tinfo) || is_array(v->tinfo)){
        if(v->devicespec == 'g'){
            sprintf(typebuf, "%s*", basetype_to_cucomplex(v->basetype));
        }
        else{
            sprintf(typebuf, "%s*", v->basetype);
        }
    }
    else if (v->tinfo == VT_rarray){
        if(v->devicespec == 'g'){
            sprintf(typebuf, "const %s*", basetype_to_cucomplex(v->basetype));
        }
        else{
            sprintf(typebuf, "const %s*", v->basetype);
        }
    }
    else if (v->tinfo == VT_scalar ||
             v->tinfo == VT_cscalar ||
             v->tinfo == VT_zscalar ||
             v->tinfo == VT_r_scalar ||
             v->tinfo == VT_r_cscalar ||
             v->tinfo == VT_r_zscalar ||
             v->tinfo == VT_p_scalar ||
             v->tinfo == VT_p_cscalar ||
             v->tinfo == VT_p_zscalar)
        sprintf(typebuf, "%s", v->basetype);
    else if (v->tinfo == VT_string)
        sprintf(typebuf, "char*");
    else if (v->tinfo == VT_mx && v->iospec == 'i')
        sprintf(typebuf, "const mxArray*");
    else if (v->tinfo == VT_mx && v->iospec == 'o')
        sprintf(typebuf, "mxArray*");
    else {
        fprintf(stderr, "v->tinfo == %d; v->name = %s\n", v->tinfo, v->name);
        assert(0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x20(%rsi), %edx
leal -0x1(%rdx), %eax
cmpl $0x11, %eax
ja 0x85d2
movq %rdi, %rbx
leaq 0x4a52(%rip), %rcx      # 0xcf5c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rsi), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3170
cmpb $0x67, 0x9(%rsi)
movq 0x10(%rsi), %rdx
jne 0x8546
movq %rdx, %rdi
callq 0x7500
leaq 0xb21e(%rip), %rsi      # 0x1375c
movq %rbx, %rdi
movq %rax, %rdx
jmp 0x8550
leaq 0xb20f(%rip), %rsi      # 0x1375c
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3080
cmpb $0x67, 0x9(%rsi)
movq 0x10(%rsi), %rdx
jne 0x85b1
movq %rdx, %rdi
callq 0x7500
leaq 0xb1e0(%rip), %rsi      # 0x13756
jmp 0x853e
movzbl 0x8(%rsi), %eax
cmpl $0x6f, %eax
je 0x85ba
cmpl $0x69, %eax
jne 0x85d2
movabsq $0x2a796172724178, %rax # imm = 0x2A796172724178
movq %rax, 0x7(%rbx)
movabsq $0x786d2074736e6f63, %rax # imm = 0x786D2074736E6F63
movq %rax, (%rbx)
jmp 0x85cb
movw $0x2a, 0x4(%rbx)
movl $0x72616863, (%rbx)     # imm = 0x72616863
jmp 0x85cb
leaq 0xb19e(%rip), %rsi      # 0x13756
jmp 0x854d
movabsq $0x2a7961727241786d, %rax # imm = 0x2A7961727241786D
movq %rax, (%rbx)
movb $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x129ff(%rip), %rax     # 0x1afd8
movq (%rax), %rdi
movq 0x28(%rsi), %rcx
leaq 0xb17f(%rip), %rsi      # 0x13766
xorl %eax, %eax
callq 0x32b0
leaq 0x4941(%rip), %rdi      # 0xcf36
leaq 0xb188(%rip), %rsi      # 0x13784
leaq 0xb18f(%rip), %rcx      # 0x13792
movl $0x241, %edx            # imm = 0x241
callq 0x3110
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_declare_in_args(_IO_FILE*, Var*)
void mex_declare_in_args(FILE* fp, Var* v)
{
    if (!v)
        return;
    if ((v->iospec == 'i' || v->iospec == 'b') && v->tinfo != VT_const) {
        char typebuf[128];
        mex_declare_type(typebuf, v);
        if (is_array(v->tinfo) || is_obj(v->tinfo) || v->tinfo == VT_string) {
            fprintf(fp, "    %-10s  in%d_ =0; /* %-10s */\n",
                    typebuf, v->input_label, v->name);
            if(v->devicespec == 'g'){
                fprintf(fp, "    %-10s *mxGPUArray_in%d_ =0; /* %-10s */\n",
                       "mxGPUArray const", v->input_label, v->name);
            }
        } else {
            fprintf(fp, "    %-10s  in%d_;    /* %-10s */\n",
                    typebuf, v->input_label, v->name);
        }
    }
    mex_declare_in_args(fp, v->next);
}

// Assembly:
testq %rsi, %rsi
je 0x86d8
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x8(%rsi), %eax
cmpl $0x69, %eax
je 0x863c
cmpl $0x62, %eax
jne 0x86c1
cmpl $0x13, 0x20(%r14)
je 0x86c1
leaq -0x90(%rbp), %rdi
movq %r14, %rsi
callq 0x84eb
movl 0x20(%r14), %eax
cmpl $0xf, %eax
ja 0x86a2
movl $0x8a1e, %ecx           # imm = 0x8A1E
btl %eax, %ecx
jae 0x86a2
movl (%r14), %ecx
movq 0x28(%r14), %r8
leaq 0xb144(%rip), %rsi      # 0x137b7
leaq -0x90(%rbp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
cmpb $0x67, 0x9(%r14)
jne 0x86c1
movl (%r14), %ecx
movq 0x28(%r14), %r8
leaq 0xb140(%rip), %rsi      # 0x137d9
leaq 0xb166(%rip), %rdx      # 0x13806
jmp 0x86b7
movl (%r14), %ecx
movq 0x28(%r14), %r8
leaq 0xb167(%rip), %rsi      # 0x13817
leaq -0x90(%rbp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x860d
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_declare_out_args(_IO_FILE*, Var*)
void mex_declare_out_args(FILE* fp, Var* v)
{
    if (!v)
        return;
    if (v->iospec == 'o' && v->tinfo != VT_mx) {
        char typebuf[128];
        mex_declare_type(typebuf, v);
        if (is_array(v->tinfo) || is_obj(v->tinfo) || v->tinfo == VT_string) {
            fprintf(fp, "    %-10s  out%d_=0; /* %-10s */\n",
                    typebuf, v->output_label, v->name);
            if(v->devicespec == 'g'){
                fprintf(fp, "    %-10s *mxGPUArray_out%d_ =0; /* %-10s */\n",
                       "mxGPUArray", v->output_label, v->name);
                fprintf(fp, "    %-10s gpu_outdims%d_[2] = {0,0}; /* %-10s dims*/\n",
                       "mwSize", v->output_label, v->name);
            }
        } else {
            fprintf(fp, "    %-10s  out%d_;   /* %-10s */\n",
                    typebuf, v->output_label, v->name);
        }
    }
    mex_declare_out_args(fp, v->next);
}

// Assembly:
testq %rsi, %rsi
je 0x87c3
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x6f, 0x8(%rsi)
jne 0x87ac
cmpl $0xa, 0x20(%r14)
je 0x87ac
leaq -0x90(%rbp), %rdi
movq %r14, %rsi
callq 0x84eb
movl 0x20(%r14), %eax
cmpl $0xf, %eax
ja 0x878c
movl $0x8a1e, %ecx           # imm = 0x8A1E
btl %eax, %ecx
jae 0x878c
movl 0x4(%r14), %ecx
movq 0x28(%r14), %r8
leaq 0xb0fd(%rip), %rsi      # 0x13839
leaq -0x90(%rbp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
cmpb $0x67, 0x9(%r14)
jne 0x87ac
movl 0x4(%r14), %ecx
movq 0x28(%r14), %r8
leaq 0xb0f8(%rip), %rsi      # 0x1385b
leaq 0xb11f(%rip), %rdx      # 0x13889
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
movl 0x4(%r14), %ecx
movq 0x28(%r14), %r8
leaq 0xb111(%rip), %rsi      # 0x13894
leaq 0xb140(%rip), %rdx      # 0x138ca
jmp 0x87a2
movl 0x4(%r14), %ecx
movq 0x28(%r14), %r8
leaq 0xb136(%rip), %rsi      # 0x138d1
leaq -0x90(%rbp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x86d9
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_declare_dim_args(_IO_FILE*, Expr*)
void mex_declare_dim_args(FILE* fp, Expr* e)
{
    if (!e)
        return;
    fprintf(fp, "    %-10s  dim%d_;   /* %-10s */\n",
            "mwSize", e->input_label, e->value);
    mex_declare_dim_args(fp, e->next);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb117(%rip), %r15      # 0x138f3
leaq 0xb0e7(%rip), %r12      # 0x138ca
testq %rbx, %rbx
je 0x8804
movl (%rbx), %ecx
movq 0x8(%rbx), %r8
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x32b0
movq 0x10(%rbx), %rbx
jmp 0x87e3
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_declare_dim_args(_IO_FILE*, Var*)
void mex_declare_dim_args(FILE* fp, Var* v)
{
    if (!v)
        return;
    if (v->qual)
        mex_declare_dim_args(fp, v->qual->args);
    mex_declare_dim_args(fp, v->next);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rbx, %rbx
je 0x883a
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x8834
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0x87c4
movq 0x30(%rbx), %rbx
jmp 0x881a
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_declare_args(_IO_FILE*, Func*)
void mex_declare_args(FILE* fp, Func* f)
{
    if (f->thisv) {
        char typebuf[128];
        strcpy(typebuf, f->classv);
        strcat(typebuf, "*");
        fprintf(fp, "    %-10s  in%d_ =0; /* %-10s */\n",
                typebuf, 0, f->thisv);
    }
    mex_declare_in_args(fp, f->args);
    if (!nullable_return(f))
        mex_declare_return(fp, f->ret);
    mex_declare_out_args(fp, f->args);
    mex_declare_dim_args(fp, f->ret);
    mex_declare_dim_args(fp, f->args);
    if (f->ret || f->args || f->thisv)
        fprintf(fp, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x30(%rsi), %r15
testq %r15, %r15
je 0x88a8
movq 0x38(%r14), %rsi
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
callq 0x3170
movq %r12, %rdi
callq 0x30e0
movw $0x2a, -0xa0(%rbp,%rax)
leaq 0xaf21(%rip), %rsi      # 0x137b7
movq %rbx, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x32b0
movq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x860d
movq %r14, %rdi
callq 0x766a
testb %al, %al
jne 0x88cc
movq 0x50(%r14), %rsi
movq %rbx, %rdi
callq 0x86d9
movq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x86d9
movq 0x50(%r14), %rsi
movq %rbx, %rdi
callq 0x880d
movq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x880d
cmpq $0x0, 0x50(%r14)
jne 0x8905
cmpq $0x0, 0x48(%r14)
jne 0x8905
cmpq $0x0, 0x30(%r14)
je 0x8910
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x3250
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_unpack_dims(_IO_FILE*, Expr*)
int mex_unpack_dims(FILE* fp, Expr* e)
{
    if (!e)
        return 0;
    fprintf(fp,
            "    dim%d_ = (mwSize) mxWrapGetScalar(prhs[%d], &mw_err_txt_);\n",
            e->input_label, e->input_label);
    return mex_unpack_dims(fp, e->next)+1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xafdd(%rip), %r12      # 0x13915
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x895a
movl (%rbx), %ecx
movq %r14, %rdi
movq %r12, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x32b0
movq 0x10(%rbx), %rbx
incl %r15d
jmp 0x893b
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_unpack_dims(_IO_FILE*, Var*)
int mex_unpack_dims(FILE* fp, Var* v)
{
    if (!v)
        return 0;
    if (v->qual)
        return
            mex_unpack_dims(fp, v->qual->args) +
            mex_unpack_dims(fp, v->next);
    return mex_unpack_dims(fp, v->next);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x89a2
movq 0x18(%rbx), %rax
testq %rax, %rax
jne 0x898d
movq 0x30(%rbx), %rbx
jmp 0x8979
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x8920
movq 0x30(%rbx), %rbx
addl %eax, %r14d
jmp 0x8979
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_check_dims(_IO_FILE*, Var*)
void mex_check_dims(FILE* fp, Var* v)
{
    if (!v)
        return;
    if (v->iospec != 'o' && is_array(v->tinfo) && v->qual && v->qual->args && v->devicespec != 'g') {
        Expr* a = v->qual->args;
        if (a->next) {
            fprintf(fp,
                    "    if (mxGetM(prhs[%d]) != dim%d_ ||\n"
                    "        mxGetN(prhs[%d]) != dim%d_) {\n"
                    "        mw_err_txt_ = \"Bad argument size: %s\";\n"
                    "        goto mw_err_label;\n"
                    "    }\n\n",
                    v->input_label, a->input_label,
                    v->input_label, a->next->input_label,
                    v->name);
        } else {
            fprintf(fp,
                    "    if (mxGetM(prhs[%d])*mxGetN(prhs[%d]) != dim%d_) {\n"
                    "        mw_err_txt_ = \"Bad argument size: %s\";"
                    "        goto mw_err_label;\n"
                    "    }\n\n",
                    v->input_label, v->input_label, a->input_label,
                    v->name);
        }
    }
    mex_check_dims(fp, v->next);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xafe9(%rip), %r15      # 0x139f3
leaq 0xaf44(%rip), %r12      # 0x13955
testq %rbx, %rbx
je 0x8a86
cmpb $0x6f, 0x8(%rbx)
je 0x8a80
movl 0x20(%rbx), %eax
addl $-0x2, %eax
cmpl $0x2, %eax
ja 0x8a80
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x8a80
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x8a80
cmpb $0x67, 0x9(%rbx)
je 0x8a80
movq 0x10(%rax), %rcx
movl (%rbx), %edx
movl (%rax), %r8d
testq %rcx, %rcx
je 0x8a6d
movl (%rcx), %r9d
movq 0x28(%rbx), %rax
movq %rax, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
movl %r8d, %ecx
movl %edx, %r8d
xorl %eax, %eax
callq 0x32b0
jmp 0x8a80
movq 0x28(%rbx), %r9
movq %r14, %rdi
movq %r15, %rsi
movl %edx, %ecx
xorl %eax, %eax
callq 0x32b0
movq 0x30(%rbx), %rbx
jmp 0x8a11
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_alloc_size1(_IO_FILE*, Expr*)
void mex_alloc_size1(FILE* fp, Expr* e)
{
    if (!e)
        return;
    fprintf(fp, "dim%d_", e->input_label);
    if (e->next) {
        fprintf(fp, "*");
        mex_alloc_size1(fp, e->next);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc2cb(%rip), %r15      # 0x14d8b
pushq $0x2a
popq %r12
testq %rbx, %rbx
je 0x8af0
movl (%rbx), %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x32b0
cmpq $0x0, 0x10(%rbx)
je 0x8af0
movl %r12d, %edi
movq %r14, %rsi
callq 0x3250
movq 0x10(%rbx), %rbx
jmp 0x8ac4
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_unpack_input_string(_IO_FILE*, Var*)
void mex_unpack_input_string(FILE* fp, Var* v)
{
    if (!(v->qual && v->qual->args))
        fprintf(fp,
                "    in%d_ = mxWrapGetString(prhs[%d], &mw_err_txt_);\n"
                "    if (mw_err_txt_)\n"
                "        goto mw_err_label;\n",
                v->input_label, v->input_label);
    else {
        fprintf(fp, "    in%d_ = (char*) mxMalloc(",
                v->input_label);
        mex_alloc_size(fp, v->qual->args);
        fprintf(fp, "*sizeof(char));\n");
        fprintf(fp, "    if (mxGetString(prhs[%d], in%d_, ",
                v->input_label, v->input_label);
        mex_alloc_size(fp, v->qual->args);
        fprintf(fp, ") != 0) {\n"
                "        mw_err_txt_ = \"Invalid string argument\";\n"
                "        goto mw_err_label;\n"
                "    }\n");
    }
    fprintf(fp, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %rax
testq %rax, %rax
je 0x8d3c
cmpq $0x0, 0x8(%rax)
je 0x8d3c
movl (%r14), %edx
leaq 0xb43d(%rip), %rsi      # 0x14109
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
movq 0x18(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x8af9
leaq 0xb43a(%rip), %rdi      # 0x14127
pushq $0x10
popq %rsi
pushq $0x1
popq %r15
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
movl (%r14), %ecx
leaq 0xb42f(%rip), %rsi      # 0x14138
movq %rbx, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x32b0
movq 0x18(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x8af9
leaq 0xb432(%rip), %rdi      # 0x1415e
pushq $0x5c
popq %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
jmp 0x8d52
movl (%r14), %ecx
leaq 0xb35d(%rip), %rsi      # 0x140a3
movq %rbx, %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x32b0
pushq $0xa
popq %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3250
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_check_inputs(_IO_FILE*, Var*)
void mex_check_inputs(FILE* fp, Var* v)
{
    if (!v)
        return;
    if (v->iospec != 'o' && (v->tinfo == VT_obj || v->tinfo == VT_r_obj))
        fprintf(fp,
                "    if (!in%d_) {\n"
                "        mw_err_txt_ = \"Argument %s cannot be null\";\n"
                "        goto mw_err_label;\n"
                "    }\n",
                v->input_label, v->name);
    mex_check_inputs(fp, v->next);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb7a2(%rip), %r15      # 0x146b8
testq %rbx, %rbx
je 0x8f47
cmpb $0x6f, 0x8(%rbx)
je 0x8f41
movl 0x20(%rbx), %eax
cmpl $0xf, %eax
je 0x8f2e
cmpl $0x1, %eax
jne 0x8f41
movl (%rbx), %edx
movq 0x28(%rbx), %rcx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x32b0
movq 0x30(%rbx), %rbx
jmp 0x8f16
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_make_call(_IO_FILE*, Var*, int)
void mex_make_call(FILE* fp, Var* v, int first)
{
    if (!v)
        return;
    if (!first)
        fprintf(fp, ", ");

    char namebuf[128];
    if (v->tinfo == VT_obj || v->tinfo == VT_r_obj)
        fprintf(fp, "*%s", vname(v, namebuf));
    else if (v->tinfo == VT_mx && v->iospec == 'o')
        fprintf(fp, "plhs+%d", v->output_label);
    else if (v->tinfo == VT_p_scalar ||
             v->tinfo == VT_p_cscalar ||
             v->tinfo == VT_p_zscalar)
        fprintf(fp, "&%s", vname(v, namebuf));
    else if (v->tinfo == VT_const)
        fprintf(fp, "%s", v->name);
    else
        fprintf(fp, "%s", vname(v, namebuf));
    mex_make_call(fp, v->next, 0);
}

// Assembly:
testq %rsi, %rsi
je 0x92ec
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testl %edx, %edx
jne 0x922c
leaq 0xb996(%rip), %rdi      # 0x14bb4
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x33a0
movl 0x20(%r14), %ecx
leal -0xa(%rcx), %eax
cmpl $0x9, %eax
ja 0x9263
leaq 0x3dad(%rip), %rcx      # 0xcfec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0xa0(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x769c
leaq 0xb690(%rip), %rsi      # 0x148f1
jmp 0x9281
cmpl $0x1, %ecx
jne 0x92b4
leaq -0xa0(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x769c
leaq 0xb664(%rip), %rsi      # 0x148e5
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x32b0
jmp 0x92d1
movq 0x28(%r14), %rdi
jmp 0x92c9
cmpb $0x6f, 0x8(%r14)
jne 0x92b4
movl 0x4(%r14), %edx
leaq 0xb641(%rip), %rsi      # 0x148e9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
jmp 0x92d1
leaq -0xa0(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x769c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3200
movq 0x30(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x91f4
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_make_call(_IO_FILE*, Func*)
void mex_make_call(FILE* fp, Func* f)
{
    if (f->thisv)
        fprintf(fp, "in0_->");
    if (strcmp(f->funcv, "new") == 0)
        fprintf(fp, "new %s(", f->classv);
    else {
        if (f->fort)
            fprintf(fp, "MWF77_");
        fprintf(fp, "%s(", f->funcv);
    }
    mex_make_call(fp, f->args, 1);
    fprintf(fp, ")");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x30(%rsi)
je 0x9319
leaq 0xb5ea(%rip), %rdi      # 0x148f5
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x33a0
movq 0x40(%r14), %r15
leaq 0x313f(%rip), %rsi      # 0xc463
movq %r15, %rdi
callq 0x32a0
testl %eax, %eax
je 0x935f
cmpb $0x1, 0x24(%r14)
jne 0x9350
leaq 0xb5be(%rip), %rdi      # 0x148fc
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x33a0
movq 0x40(%r14), %r15
leaq 0xb64d(%rip), %rsi      # 0x149a4
movq %rbx, %rdi
movq %r15, %rdx
jmp 0x936d
movq 0x38(%r14), %rdx
leaq 0xb636(%rip), %rsi      # 0x149a0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x32b0
movq 0x48(%r14), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x91f4
pushq $0x29
popq %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3250
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_marshal_results(_IO_FILE*, Var*, bool)
void mex_marshal_results(FILE* fp, Var* v, bool return_flag)
{
    if (!v)
        return;
    if (v->iospec != 'i')
        mex_marshal_result(fp, v, return_flag);
    mex_marshal_results(fp, v->next, return_flag);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzbl %dl, %r15d
testq %rbx, %rbx
je 0x9cec
cmpb $0x69, 0x8(%rbx)
je 0x9ce6
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x9ace
movq 0x30(%rbx), %rbx
jmp 0x9ccd
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: print_c_comment(_IO_FILE*, Func*)
void print_c_comment(FILE* fp, Func* f)
{
    fprintf(fp, "/* ---- %s: %d ----\n * ", f->fname.c_str(), f->line);
    print(fp, f);
    for (Func* fsame = f->same_next; fsame; fsame = fsame->next)
        fprintf(fp, " * Also at %s: %d\n", fsame->fname.c_str(), fsame->line);
    fprintf(fp, " */\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdx
movl 0x20(%rsi), %ecx
leaq 0xb29b(%rip), %rsi      # 0x151a0
xorl %eax, %eax
callq 0x32b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x59b0
addq $0x60, %r14
leaq 0xb296(%rip), %r15      # 0x151b8
movq (%r14), %r14
testq %r14, %r14
je 0x9f44
movq (%r14), %rdx
movl 0x20(%r14), %ecx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x32b0
addq $0x58, %r14
jmp 0x9f22
leaq 0x93b7(%rip), %rdi      # 0x13302
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x33a0