LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/llvm.cpp
// Function: llvm_phi_node(Type*, llvalue_t, llvalue_t, llvm_label_t, llvm_label_t, long)
llvalue_t llvm_phi_node(Type *type, llvalue_t val1,
                    llvalue_t val2, llvm_label_t lbl1,
                    llvm_label_t lbl2, long reg) {
    llvalue_t phi_value;
    phi_value.kind = LLVALUE::REG;
    if (reg == -1) {
        phi_value.reg = gen_reg();
    } else {
        phi_value.reg = reg;
    }
    print_codegen_indentation();
    emit("%%%ld = phi ", phi_value.reg);
    cgen_print_lltype(type);
    emit(" [ ");
    cgen_print_llvalue(val1);
    emit(", %%%s ], [ ", lbl1.lbl);
    cgen_print_llvalue(val2);
    emit(", %%%s ]\n", lbl2.lbl);
    return phi_value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r13
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
movl $0x0, 0x10(%rdi)
movl $0x2, (%rdi)
cmpq $-0x1, %r8
jne 0x5545
movq 0x154ee(%rip), %r13     # 0x1aa28
leaq 0x1(%r13), %rax
movq %rax, 0x154e3(%rip)     # 0x1aa28
leaq 0x50(%rsp), %r14
movq %r13, 0x18(%rbx)
movl $0x4, %r15d
leaq 0xcafb(%rip), %rbp      # 0x12056
movq %rbp, %rdi
xorl %eax, %eax
callq 0x47a5
decl %r15d
jne 0x555b
leaq 0xcf35(%rip), %rdi      # 0x124a6
movq %r13, %rsi
xorl %eax, %eax
callq 0x47a5
movq %r12, %rdi
callq 0x4b5d
leaq 0xcf32(%rip), %rdi      # 0x124bc
xorl %eax, %eax
callq 0x47a5
movq 0x18(%r14), %rsi
cmpl $0x1, (%r14)
jne 0x55ab
leaq 0xd39a(%rip), %rdi      # 0x1293c
xorl %eax, %eax
callq 0x47a5
jmp 0x55b9
leaq 0xd090(%rip), %rdi      # 0x12642
xorl %eax, %eax
callq 0x47a5
leaq 0xcef3(%rip), %rdi      # 0x124b3
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x47a5
leaq 0x70(%rsp), %rax
movq 0x18(%rax), %rsi
cmpl $0x1, (%rax)
jne 0x55ea
leaq 0xd35b(%rip), %rdi      # 0x1293c
xorl %eax, %eax
callq 0x47a5
jmp 0x55f8
leaq 0xd051(%rip), %rdi      # 0x12642
xorl %eax, %eax
callq 0x47a5
leaq 0xcec1(%rip), %rdi      # 0x124c0
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x47a5
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/llvm.cpp
// Function: llvm_alloca(Type*)
llvalue_t llvm_alloca(Type *type) {
    llvalue_t v;
    v.reg = gen_reg();
    v.kind = LLVALUE::REG;
    print_codegen_indentation();
    switch (type->kind) {
    case TY::BOOL:
    {
        emit("%%%ld = alloca i1\n", v.reg);
    } break;
    case TY::INT:
    {
        emit("%%%ld = alloca i32, align 4\n", v.reg);
    } break;
    case TY::ARR:
    {
        emit("%%%ld = alloca i32*, align 8\n", v.reg);
    } break;
    case TY::ID:
    {
        IdType *idtype = (IdType*) type;
        assert(idtype->is_IdType());
        emit("%%%ld = alloca %%class.%s*, align 8\n", v.reg, idtype->id);
    } break;
    // We don't actually want to assert here because we might have an undefined
    // type. The error has been issued elsewhere.
    default: break;
    }
    return v;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movl $0x0, 0x10(%rdi)
movq 0x15217(%rip), %r14     # 0x1aa28
leaq 0x1(%r14), %rax
movq %rax, 0x1520c(%rip)     # 0x1aa28
movq %r14, 0x18(%rdi)
movl $0x2, (%rdi)
movl $0x4, %ebp
leaq 0xc824(%rip), %r12      # 0x12056
movq %r12, %rdi
xorl %eax, %eax
callq 0x47a5
decl %ebp
jne 0x5832
movl 0x4(%r15), %eax
decl %eax
cmpl $0x3, %eax
ja 0x5895
leaq 0xc48a(%rip), %rcx      # 0x11cdc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xcd28(%rip), %rdi      # 0x1258a
jmp 0x588b
leaq 0xcd0c(%rip), %rdi      # 0x12577
jmp 0x588b
movq 0x8(%r15), %rdx
leaq 0xcd4d(%rip), %rdi      # 0x125c5
movq %r14, %rsi
xorl %eax, %eax
callq 0x47a5
jmp 0x5895
leaq 0xcd1c(%rip), %rdi      # 0x125a7
movq %r14, %rsi
xorl %eax, %eax
callq 0x47a5
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/llvm.cpp
// Function: llvm_store(Type*, llvalue_t, llvalue_t)
void llvm_store(Type *type, llvalue_t value, llvalue_t ptr) {
    assert(ptr.kind == LLVALUE::REG);
    print_codegen_indentation();
    emit("store ");
    cgen_print_lltype(type);
    emit(" ");
    cgen_print_llvalue(value);
    emit(", ");
    cgen_print_lltype(type);
    emit("* ");
    cgen_print_llvalue(ptr);
    emit("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x2, 0x50(%rsp)
jne 0x5975
movq %rdi, %rbx
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
movl $0x4, %ebp
leaq 0xc789(%rip), %r14      # 0x12056
movq %r14, %rdi
xorl %eax, %eax
callq 0x47a5
decl %ebp
jne 0x58cd
leaq 0xcd36(%rip), %rdi      # 0x12618
xorl %eax, %eax
callq 0x47a5
movq %rbx, %rdi
callq 0x4b5d
leaq 0xc75e(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x47a5
movq 0x18(%r12), %rsi
cmpl $0x1, (%r12)
jne 0x591b
leaq 0xd02a(%rip), %rdi      # 0x1293c
xorl %eax, %eax
callq 0x47a5
jmp 0x5929
leaq 0xcd20(%rip), %rdi      # 0x12642
xorl %eax, %eax
callq 0x47a5
leaq 0xe400(%rip), %rdi      # 0x13d30
xorl %eax, %eax
callq 0x47a5
movq %rbx, %rdi
callq 0x4b5d
leaq 0xc70f(%rip), %rdi      # 0x12055
xorl %eax, %eax
callq 0x47a5
movq 0x18(%r15), %rsi
leaq 0xccea(%rip), %rdi      # 0x12642
xorl %eax, %eax
callq 0x47a5
leaq 0xcb2e(%rip), %rdi      # 0x12494
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x47a5
leaq 0xc7bd(%rip), %rdi      # 0x12139
leaq 0xc57e(%rip), %rsi      # 0x11f01
leaq 0xcc60(%rip), %rcx      # 0x125ea
movl $0x1d1, %edx            # imm = 0x1D1
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/llvm.cpp
// Function: cgen_cast_value(llvalue_t, Type*, Type*)
llvalue_t cgen_cast_value(llvalue_t value, Type *from_ty, Type *to_ty) {
    long reg = gen_reg();
    print_codegen_indentation();
    emit("%%%ld = bitcast ", reg);
    cgen_print_lltype(from_ty);
    emit(" ");
    cgen_print_llvalue(value);
    emit(" to ");
    cgen_print_lltype(to_ty);
    emit("\n");
    value.kind = LLVALUE::REG;
    value.reg = reg;
    return value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x40(%rsp), %rbp
movq 0x14ed1(%rip), %r14     # 0x1aa28
leaq 0x1(%r14), %rax
movq %rax, 0x14ec6(%rip)     # 0x1aa28
movl $0x4, %r15d
leaq 0xc4e7(%rip), %r13      # 0x12056
movq %r13, %rdi
xorl %eax, %eax
callq 0x47a5
decl %r15d
jne 0x5b6f
leaq 0xcadd(%rip), %rdi      # 0x12662
movq %r14, %rsi
xorl %eax, %eax
callq 0x47a5
movq %r12, %rdi
callq 0x4b5d
leaq 0xc4b8(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x47a5
movq 0x18(%rbp), %rsi
cmpl $0x1, (%rbp)
jne 0x5bbf
leaq 0xcd86(%rip), %rdi      # 0x1293c
xorl %eax, %eax
callq 0x47a5
jmp 0x5bcd
leaq 0xca7c(%rip), %rdi      # 0x12642
xorl %eax, %eax
callq 0x47a5
leaq 0xc514(%rip), %rdi      # 0x120e8
xorl %eax, %eax
callq 0x47a5
movq (%rsp), %rdi
callq 0x4b5d
leaq 0xc8a9(%rip), %rdi      # 0x12494
xorl %eax, %eax
callq 0x47a5
movl $0x2, (%rbp)
movq %r14, 0x18(%rbp)
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rbx)
movq 0x18(%rbp), %rax
movq %rax, 0x18(%rbx)
movl (%rbp), %eax
movl %eax, (%rbx)
movq 0x4(%rbp), %rax
movq %rax, 0x4(%rbx)
movl 0xc(%rbp), %eax
movl %eax, 0xc(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/llvm.cpp
// Function: llvm_ret(Type*, llvalue_t)
void llvm_ret(Type *ty, llvalue_t val) {
    print_codegen_indentation();
    emit("ret ");
    cgen_print_lltype(ty);
    emit(" ");
    cgen_print_llvalue(val);
    emit("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x4, %ebp
leaq 0x30(%rsp), %r15
leaq 0xc409(%rip), %r14      # 0x12056
movq %r14, %rdi
xorl %eax, %eax
callq 0x47a5
decl %ebp
jne 0x5c4d
leaq 0xca11(%rip), %rdi      # 0x12673
xorl %eax, %eax
callq 0x47a5
movq %rbx, %rdi
callq 0x4b5d
leaq 0xc3de(%rip), %rdi      # 0x12056
xorl %eax, %eax
callq 0x47a5
movq 0x18(%r15), %rsi
cmpl $0x1, (%r15)
jne 0x5c99
leaq 0xccac(%rip), %rdi      # 0x1293c
xorl %eax, %eax
callq 0x47a5
jmp 0x5ca7
leaq 0xc9a2(%rip), %rdi      # 0x12642
xorl %eax, %eax
callq 0x47a5
leaq 0xc7e6(%rip), %rdi      # 0x12494
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x47a5
nop
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/main.cpp
// Function: parse_and_return_goal()
Goal parse_and_return_goal() {
    std::ifstream input_file(filename);
    if (!input_file.good()) {
        assert(0);
    }
    std::stringstream sstr;
    sstr << input_file.rdbuf();
    std::string file_contents_str = sstr.str();
    input_file.close();

    const char *file_contents = file_contents_str.c_str();

    parse_init(file_contents, filename);
    Goal goal = parse_goal();
    return goal;
    // Here `file_contents_str` memory gets deallocated because
    // of destructor.
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x3b8, %rsp            # imm = 0x3B8
movq %rdi, %rbx
movq 0x14d6c(%rip), %rsi     # 0x1aa40
leaq 0x1b0(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x1d0(%rsp,%rax)
jne 0x5da3
leaq 0x28(%rsp), %rdi
callq 0x20c0
leaq 0x38(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x2060
leaq 0x40(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x21a0
leaq 0x1b0(%rsp), %rdi
callq 0x2050
movq 0x8(%rsp), %rdi
movq 0x14cfe(%rip), %rsi     # 0x1aa40
callq 0x65c8
movq %rbx, %rdi
callq 0x5f20
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5d6a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2100
movq 0x1425f(%rip), %rsi     # 0x19fd0
leaq 0x28(%rsp), %rdi
callq 0x20d0
leaq 0xa8(%rsp), %rdi
callq 0x2080
leaq 0x1b0(%rsp), %rdi
callq 0x2070
movq %rbx, %rax
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r14
retq
leaq 0xd878(%rip), %rdi      # 0x13622
leaq 0xc92f(%rip), %rsi      # 0x126e0
leaq 0xc931(%rip), %rcx      # 0x126e9
movl $0x18, %edx
callq 0x20b0
jmp 0x5dd0
jmp 0x5dc6
movq %rax, %rbx
jmp 0x5dee
movq %rax, %rbx
jmp 0x5e0c
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5dee
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2100
movq 0x141db(%rip), %rsi     # 0x19fd0
leaq 0x28(%rsp), %rdi
callq 0x20d0
leaq 0xa8(%rsp), %rdi
callq 0x2080
leaq 0x1b0(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/main.cpp
// Function: main
int main(int argc, char **argv) {
    filename = argv[1];

    config.log = false;
    config.ansi_style = true;
    config.unused = true;
    config.offsets = false;
    config.codegen = false;

    for (int i = 1; i != argc; ++i) {
        if (!strcmp(argv[i], "-v")) {
            config.log = true;
        }
        if (!strcmp(argv[i], "-unused")) {
            config.unused = false;
        }
        if (!strcmp(argv[i], "-no-style")) {
            config.ansi_style = false;
        }
        if (!strcmp(argv[i], "-offsets")) {
            config.offsets = true;
        }
        if (!strcmp(argv[i], "-codegen")) {
            config.codegen = true;
        }
    }

    Goal goal = parse_and_return_goal();

    // TODO: Check for fatal parsing errors here and don't continue
    // if they exist.
    
    typecheck(&goal);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq 0x8(%rsi), %rax
movq %rax, 0x14c06(%rip)     # 0x1aa40
movl $0x10100, 0x14bf4(%rip) # imm = 0x10100
movb $0x0, 0x14bf1(%rip)     # 0x1aa3c
cmpl $0x1, %edi
je 0x5ef7
movq %rsi, %rbx
movl %edi, %r14d
movl $0x1, %r15d
leaq 0xc8b1(%rip), %r12      # 0x12718
leaq 0xc8b3(%rip), %r13      # 0x12721
movq (%rbx,%r15,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x5e8b
cmpb $0x76, 0x1(%rbp)
jne 0x5e8b
cmpb $0x0, 0x2(%rbp)
jne 0x5e8b
movb $0x1, 0x14bad(%rip)     # 0x1aa38
movq %rbp, %rdi
leaq 0xc871(%rip), %rsi      # 0x12706
callq 0x2170
testl %eax, %eax
jne 0x5ea5
movb $0x0, 0x14b95(%rip)     # 0x1aa3a
movq %rbp, %rdi
leaq 0xc85f(%rip), %rsi      # 0x1270e
callq 0x2170
testl %eax, %eax
jne 0x5ebf
movb $0x0, 0x14b7a(%rip)     # 0x1aa39
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2170
testl %eax, %eax
jne 0x5ed5
movb $0x1, 0x14b66(%rip)     # 0x1aa3b
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2170
testl %eax, %eax
jne 0x5eeb
movb $0x1, 0x14b51(%rip)     # 0x1aa3c
incq %r15
cmpq %r15, %r14
jne 0x5e6e
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x5cc0
movq %rbx, %rdi
callq 0x8aaf
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/parse.cpp
// Function: parse_init(char const*, char const*)
void parse_init(const char *file_contents, const char *filename) {
    lexer_init(file_contents, filename);
    // TODO: Move this to some general initialization.
    EOI_has_been_found = false;
    main_method_string = str_intern("main");
    length_ = str_intern("length");
    set_indent_char('-');
}

// Assembly:
pushq %rax
callq 0x43c8
movb $0x0, 0x1447b(%rip)     # 0x1aa50
leaq 0xc1cb(%rip), %rdi      # 0x127a7
callq 0x8130
movq %rax, 0x14460(%rip)     # 0x1aa48
leaq 0xc1bd(%rip), %rdi      # 0x127ac
callq 0x8130
movq %rax, 0x1445d(%rip)     # 0x1aa58
movl $0x2d, %edi
popq %rax
jmp 0x368b
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/parse.cpp
// Function: expect_token_in_rule(TOK, char const*, bool)
static bool expect_token_in_rule(TOK kind, const char *rule, bool advance = false) {
    if (EOI_has_been_found) return false;
    if (is_token(TOK::EOI)) {
        EOI_has_been_found = true;
    }
    bool res;
    if (is_token(kind)) {
        next_token();
        return true;
    } else {
        syntax_error("Expected `", kind, "` in: ", rule, ", found `", token, "`");
        res = false;
    }
    if (advance) {
        next_token();
    }
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, 0x14438(%rip)     # 0x1aa50
je 0x6622
xorl %r12d, %r12d
jmp 0x674b
movq %rsi, %rbx
movl %edi, %r15d
leaq 0x14069(%rip), %rax     # 0x1a698
movl (%rax), %ebp
cmpl $0x1, %ebp
jne 0x663d
movb $0x1, 0x14413(%rip)     # 0x1aa50
cmpl %r15d, %ebp
jne 0x664f
callq 0x3a62
movb $0x1, %r12b
jmp 0x674b
movq 0x8(%rax), %r14
leaq 0x14036(%rip), %rax     # 0x1a690
movl (%rax), %edx
leaq 0x143dd(%rip), %rax     # 0x1aa40
movq (%rax), %rsi
leaq 0xb605(%rip), %rdi      # 0x11c72
xorl %eax, %eax
callq 0x2030
leaq 0x143bd(%rip), %r12     # 0x1aa38
movb 0x1(%r12), %al
cmpb $0x1, %al
jne 0x6697
leaq 0xae74(%rip), %rdi      # 0x114ff
xorl %eax, %eax
callq 0x2030
movb 0x1(%r12), %al
testb $0x1, %al
je 0x66a9
leaq 0xb5d9(%rip), %rdi      # 0x11c7b
xorl %eax, %eax
callq 0x2030
leaq 0xad04(%rip), %rdi      # 0x113b4
leaq 0xb5ab(%rip), %rsi      # 0x11c62
xorl %eax, %eax
callq 0x2030
movb 0x1(%r12), %al
cmpb $0x1, %al
jne 0x66da
leaq 0xae37(%rip), %rdi      # 0x11505
xorl %eax, %eax
callq 0x2030
movb 0x1(%r12), %al
testb $0x1, %al
je 0x66ec
leaq 0xae20(%rip), %rdi      # 0x11505
xorl %eax, %eax
callq 0x2030
leaq 0xacc1(%rip), %r13      # 0x113b4
leaq 0xc22f(%rip), %rsi      # 0x12929
xorl %r12d, %r12d
movq %r13, %rdi
xorl %eax, %eax
callq 0x2030
movl %r15d, %edi
callq 0x8150
movq %r13, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0xc211(%rip), %rsi      # 0x12934
movq %r13, %rdi
xorl %eax, %eax
callq 0x2030
leaq 0xc290(%rip), %rsi      # 0x129c4
movq %rbx, %rdi
movl %ebp, %edx
movq %r14, %rcx
callq 0x6b86
movl $0xa, %edi
callq 0x2160
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/./error.cpp
// Function: void syntax_error_no_ln<char const*>(char const*)
static void syntax_error_no_ln(Args... args) {
    log(loc);
    red_on();
    bold_on();
    log(" Syntax Error: ");
    bold_off();
    red_off();
    log(args...);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x13f25(%rip), %rax     # 0x1a690
movl (%rax), %edx
leaq 0x142cc(%rip), %rax     # 0x1aa40
movq (%rax), %rsi
leaq 0xb4f4(%rip), %rdi      # 0x11c72
xorl %eax, %eax
callq 0x2030
leaq 0x142ac(%rip), %r14     # 0x1aa38
movb 0x1(%r14), %al
cmpb $0x1, %al
jne 0x67a6
leaq 0xad64(%rip), %rdi      # 0x114ff
xorl %eax, %eax
callq 0x2030
movb 0x1(%r14), %al
testb $0x1, %al
je 0x67b8
leaq 0xb4ca(%rip), %rdi      # 0x11c7b
xorl %eax, %eax
callq 0x2030
leaq 0xabf5(%rip), %rdi      # 0x113b4
leaq 0xb49c(%rip), %rsi      # 0x11c62
xorl %eax, %eax
callq 0x2030
movb 0x1(%r14), %al
cmpb $0x1, %al
jne 0x67e7
leaq 0xad29(%rip), %rdi      # 0x11505
xorl %eax, %eax
callq 0x2030
movb 0x1(%r14), %al
testb $0x1, %al
je 0x67f9
leaq 0xad13(%rip), %rdi      # 0x11505
xorl %eax, %eax
callq 0x2030
leaq 0xabb4(%rip), %rdi      # 0x113b4
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2030
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/parse.cpp
// Function: starts_local()
static bool starts_local() {
    if (!starts_type(token.kind)) {
        return false;
    } else if (is_token(TOK::ID)) {
        // A little bit of hackiness:
        // An identifer can start both a statement
        // and a type. So, you have to peek a token
        // and see. The logic of peeking
        // is hidden in the lexer.
        token_t save_token = peek_token();
        if (save_token.kind == TOK::ASGN ||
            save_token.kind == TOK::LBRACKET)
        {
            return false;
        }
        return true;
    } else {
        return true;
    }
}

// Assembly:
leaq 0x13d8e(%rip), %rax     # 0x1a698
movl (%rax), %eax
leal -0x5(%rax), %ecx
cmpl $0x2, %ecx
jae 0x6917
movb $0x1, %al
retq
cmpl $0x8, %eax
jne 0x6935
pushq %rax
callq 0x4296
cmpl $0x18, %eax
setne %cl
cmpl $0x24, %eax
setne %al
andb %cl, %al
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/./error.cpp
// Function: log(token_t)
static void log(token_t tok) {
    printf("%s", token_name(tok.kind));
    if (tok.kind == TOK::INTLIT) {
        printf(" %d", tok.val);
    } else if (tok.kind == TOK::ID) {
        printf(" %s", tok.id);
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x8150
leaq 0xa7cc(%rip), %rdi      # 0x113b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
cmpl $0x8, %ebp
je 0x6c12
cmpl $0x2, %ebp
jne 0x6c29
leaq 0xbd38(%rip), %rdi      # 0x1293b
movl %ebx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2030
leaq 0xa79a(%rip), %rdi      # 0x113b3
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2030
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/parse.cpp
// Function: parse_typespec()
static Typespec parse_typespec() {
    Typespec tspec;
    tspec.kind = TYSPEC::UNDEFINED;
    // The contract is that if the caller called this function,
    // then a type _must_ follow. In other words, the caller
    // is responsible to check whether a type follows.
    // The caller is also responsible for checking whether
    // an TYSPEC::UNDEFINED was returned.
    if (!starts_type(token.kind)) {
        syntax_error("Expected start of type specifier"
                     " (`int` or `boolean`), found ", token);
        return tspec;
    }
    switch (token.kind) {
    case TOK::INT:
    {
        next_token();
        if (match_token(TOK::LBRACKET)) {
            expect_token_in_rule(TOK::RBRACKET, "int array type specifier");
            tspec.kind = TYSPEC::ARR;
        } else {
            tspec.kind = TYSPEC::INT;
        }
    } break;
    case TOK::BOOLEAN:
    {
        next_token();
        tspec.kind = TYSPEC::BOOL;
        if (match_token(TOK::LBRACKET)) {
            syntax_error("You can't have arrays of `boolean` type, only of `int`.");
            match_token(TOK::RBRACKET);
        }
    } break;
    case TOK::ID:
    {
        tspec.id = token.id;
        tspec.kind = TYSPEC::ID;
        next_token();
    } break;
    default: tspec.kind = TYSPEC::UNDEFINED;
    }
    // The caller is responsible for recognizing
    // an UNDEFINED type specifier and issuing
    // a message.
    return tspec;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1394d(%rip), %r14     # 0x1a698
movl (%r14), %edi
cmpl $0x5, %edi
je 0x6d95
cmpl $0x6, %edi
je 0x6d6d
cmpl $0x8, %edi
jne 0x6dcd
movq 0x8(%r14), %r14
callq 0x3a62
movl $0x4, %ebx
jmp 0x6ddf
callq 0x3a62
cmpl $0x24, (%r14)
jne 0x6dda
callq 0x3a62
leaq 0xbcb3(%rip), %rsi      # 0x12a37
movl $0x1b, %edi
callq 0x6606
movl $0x1, %ebx
jmp 0x6ddf
callq 0x3a62
movl $0x3, %ebx
cmpl $0x24, (%r14)
jne 0x6ddf
callq 0x3a62
leaq 0xbc9f(%rip), %rdi      # 0x12a50
callq 0x675d
movl $0xa, %edi
callq 0x2160
cmpl $0x1b, (%r14)
jne 0x6ddf
callq 0x3a62
jmp 0x6ddf
movq 0x8(%r14), %rsi
callq 0x6dec
xorl %ebx, %ebx
jmp 0x6ddf
movl $0x2, %ebx
movl %ebx, %eax
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/parse.cpp
// Function: expect_token(TOK, bool)
static bool expect_token(TOK kind, bool advance = false) {
    if (EOI_has_been_found) return false;
    if (is_token(TOK::EOI)) {
        EOI_has_been_found = true;
    }
    bool res;
    if (is_token(kind)) {
        next_token();
        return true;
    } else {
        syntax_error("Expected `", kind, "`, found `", token, "`");
        res = false;
    }
    if (advance) {
        next_token();
    }
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x13762(%rip)     # 0x1aa50
je 0x72fb
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %edi, %ebp
leaq 0x13394(%rip), %rax     # 0x1a698
movl (%rax), %ebx
cmpl $0x1, %ebx
jne 0x7312
movb $0x1, 0x1373e(%rip)     # 0x1aa50
cmpl %ebp, %ebx
jne 0x7325
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3a62
movq 0x8(%rax), %r14
leaq 0x13360(%rip), %rax     # 0x1a690
movl (%rax), %edx
leaq 0x13707(%rip), %rax     # 0x1aa40
movq (%rax), %rsi
leaq 0xa92f(%rip), %rdi      # 0x11c72
xorl %eax, %eax
callq 0x2030
leaq 0x136e7(%rip), %r15     # 0x1aa38
movb 0x1(%r15), %al
cmpb $0x1, %al
jne 0x736b
leaq 0xa19f(%rip), %rdi      # 0x114ff
xorl %eax, %eax
callq 0x2030
movb 0x1(%r15), %al
testb $0x1, %al
je 0x737d
leaq 0xa905(%rip), %rdi      # 0x11c7b
xorl %eax, %eax
callq 0x2030
leaq 0xa030(%rip), %rdi      # 0x113b4
leaq 0xa8d7(%rip), %rsi      # 0x11c62
xorl %eax, %eax
callq 0x2030
movb 0x1(%r15), %al
cmpb $0x1, %al
jne 0x73ac
leaq 0xa164(%rip), %rdi      # 0x11505
xorl %eax, %eax
callq 0x2030
movb 0x1(%r15), %al
testb $0x1, %al
je 0x73be
leaq 0xa14e(%rip), %rdi      # 0x11505
xorl %eax, %eax
callq 0x2030
leaq 0x9fef(%rip), %r15      # 0x113b4
leaq 0xb55d(%rip), %rsi      # 0x12929
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
movl %ebp, %edi
callq 0x8150
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0xb8c2(%rip), %rsi      # 0x12cb3
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
movl %ebx, %edi
movq %r14, %rsi
callq 0x6bd4
movl $0x60, %edi
callq 0x2160
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/./buf.h
// Function: Buf<LocalDeclaration*>::_grow(unsigned long)
void _grow(size_t new_len) {
        constexpr size_t size_t_max = std::numeric_limits<size_t>::max();
        assert(cap <= (size_t_max - 1) / 2);
        size_t new_cap = MAX(MAX(2*cap, new_len), 16);
        assert(new_len <= new_cap);
        assert(new_cap <= (size_t_max) / sizeof(T));
        size_t new_size = new_cap * sizeof(T);
        data = (T *) realloc(data, new_size);
        assert(data);
        cap = new_cap;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rax
testq %rax, %rax
js 0x7ccc
addq %rax, %rax
cmpq %rsi, %rax
cmovbeq %rsi, %rax
cmpq $0x11, %rax
movl $0x10, %r14d
cmovaeq %rax, %r14
shrq $0x3d, %rax
jne 0x7ceb
movq %rdi, %rbx
leaq (,%r14,8), %rsi
movq 0x10(%rdi), %rdi
callq 0x21b0
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x7d0a
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xadb5(%rip), %rdi      # 0x12a88
leaq 0xadca(%rip), %rsi      # 0x12aa4
leaq 0xadcb(%rip), %rcx      # 0x12aac
movl $0x21, %edx
callq 0x20b0
leaq 0xadff(%rip), %rdi      # 0x12af1
leaq 0xadab(%rip), %rsi      # 0x12aa4
leaq 0xadac(%rip), %rcx      # 0x12aac
movl $0x24, %edx
callq 0x20b0
leaq 0xae04(%rip), %rdi      # 0x12b15
leaq 0xad8c(%rip), %rsi      # 0x12aa4
leaq 0xad8d(%rip), %rcx      # 0x12aac
movl $0x27, %edx
callq 0x20b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: install_type_declarations(Goal*)
TypeTable install_type_declarations(Goal *goal) {
    DeclarationVisitor decl_visitor(goal->type_decls.len);
    goal->accept(&decl_visitor);

    // Free memory that was used for allocating objects
    // for parsing that doenot persist in pass 2 of type-checking.
    deallocate(MEM::PARSE_TEMP);

    return decl_visitor.type_table;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x50(%rsi), %rsi
xorps %xmm0, %xmm0
leaq 0x8(%rsp), %r15
movups %xmm0, 0x60(%r15)
movups %xmm0, 0x50(%r15)
movups %xmm0, 0x40(%r15)
movups %xmm0, 0x30(%r15)
movq $0x0, 0x70(%r15)
incq %rsi
movq %r15, %rdi
callq 0x8f22
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8fbc
movl $0x1, %edi
callq 0x2406
movl $0xf, %ecx
movq %r14, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: check_method_for_overriding(Method*, IdType*, VirtualTable*)
bool check_method_for_overriding(Method *method, IdType *type, VirtualTable *vtable) {
    VMethod *vmethod = vtable->find(method->id);
    if (!vmethod) {
      return false;
    }
    Method *method_parent = vmethod->method;
    assert(method_parent);
    if (!methods_have_same_signature(method, method_parent)) {
        typecheck_error_no_ln(method->loc, method->ret_type->name(), " ", method->id, "(");
        print_param_types(method);
        printf(") in `%s` can't override %s %s(", type->id, method_parent->ret_type->name(),
               method_parent->id);
        print_param_types(method_parent);
        printf(") in `%s`\n", vmethod->enclosing);
        return false;
    }
    vmethod->enclosing = type->id;
    method->offset = method_parent->offset;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rsi
movl $0xbebca0a0, %eax       # imm = 0xBEBCA0A0
imulq %rsi, %rax
shrq $0x20, %rax
andl $0x1f, %eax
imulq $0x98, %rax, %rax
leaq (%rdx,%rax), %rdi
addq $0x8, %rdi
callq 0xfc66
cmpq $-0x1, %rax
sete %cl
movq 0x1318(%r15), %r12
testq %r12, %r12
sete %dl
orb %cl, %dl
je 0x8306
xorl %ebx, %ebx
jmp 0x83af
shlq $0x4, %rax
addq %rax, %r12
movq (%r12), %r15
testq %r15, %r15
je 0x83ba
movq %r14, %rdi
movq %r15, %rsi
callq 0x8244
testb %al, %al
je 0x833e
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r12)
movq 0x48(%r15), %rax
movq %rax, 0x48(%r14)
movb $0x1, %bl
jmp 0x83af
movl 0x50(%r14), %ebp
movq 0x8(%r14), %rdi
callq 0x83da
movq (%r14), %rcx
leaq 0x9d01(%rip), %rdx      # 0x12056
leaq 0xb206(%rip), %r8       # 0x13562
movl %ebp, %edi
movq %rax, %rsi
callq 0xf3c8
movq %r14, %rdi
callq 0x8438
movq 0x8(%rbx), %r14
movq 0x8(%r15), %rdi
callq 0x83da
movq (%r15), %rcx
leaq 0xb0cc(%rip), %rdi      # 0x13451
xorl %ebx, %ebx
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2030
movq %r15, %rdi
callq 0x8438
movq 0x8(%r12), %rsi
leaq 0xb0c9(%rip), %rdi      # 0x13471
xorl %eax, %eax
callq 0x2030
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb02f(%rip), %rdi      # 0x133f0
leaq 0xb036(%rip), %rsi      # 0x133fe
leaq 0xb03d(%rip), %rcx      # 0x1340c
movl $0x115, %edx            # imm = 0x115
callq 0x20b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: Type::name() const
const char *Type::name() const {
    switch (kind) {
    case TY::UNDEFINED: return "Undefined Type (Error)";
    case TY::INT: return "int";
    case TY::ARR: return "int[]";
    case TY::BOOL: return "boolean";
    case TY::ID: return ((IdType *)this)->id; 
    default: assert(0);
    }
}

// Assembly:
movl 0x4(%rdi), %eax
cmpq $0x4, %rax
ja 0x8418
leaq 0xae72(%rip), %rcx      # 0x1325c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xc210(%rip), %rax      # 0x1460a
retq
movq 0x8(%rdi), %rax
retq
leaq 0x8f92(%rip), %rax      # 0x11399
retq
leaq 0x8f94(%rip), %rax      # 0x113a3
retq
leaq 0x8f88(%rip), %rax      # 0x1139f
retq
pushq %rax
leaq 0xb202(%rip), %rdi      # 0x13622
leaq 0xafd7(%rip), %rsi      # 0x133fe
leaq 0xc1f3(%rip), %rcx      # 0x14621
movl $0x8f6, %edx            # imm = 0x8F6
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: print_param_types(Method*)
static void print_param_types(Method *method) {
    size_t param_len = method->param_len;
    for (size_t i = 0; i != param_len; ++i) {
        Local *param = method->locals[i];
        printf("%s", param->type->name());
        if (i + 1 != param_len) {
            printf(", ");
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x10(%rdi), %r12
testq %r12, %r12
je 0x84b8
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
callq 0x83da
leaq 0x8f50(%rip), %rdi      # 0x113b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
cmpq $0x1, %r12
je 0x84b8
movl $0x1, %r13d
leaq 0xb8af(%rip), %r14      # 0x13d30
leaq 0x8f2c(%rip), %r15      # 0x113b4
movq %r14, %rdi
xorl %eax, %eax
callq 0x2030
movq 0x30(%rbx), %rax
movq (%rax,%r13,8), %rax
movq 0x8(%rax), %rdi
callq 0x83da
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
incq %r13
cmpq %r13, %r12
jne 0x8488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: TypeTable::offset_computation()
void TypeTable::offset_computation() {
    VirtualTable vtable;
    for (IdType *type : inher_roots) {
        //printf("-- Inheritance root: %s -- \n\n", type->id);
        constexpr size_t start_fields = 0;
        constexpr size_t start_methods = 0;
        compute_and_print_offsets_for_type(type, start_fields, start_methods, &vtable);
        vtable.clear();
        //printf("\n");
    }
    deallocate(MEM::CHILDREN);
    emit("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1328, %rsp           # imm = 0x1328
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
xorl %eax, %eax
xorps %xmm0, %xmm0
leaq (%r15,%rax), %rcx
movups %xmm0, 0x90(%rsp,%rax)
movq %rcx, 0xa0(%rsp,%rax)
addq $0x98, %rax
cmpq $0x1300, %rax           # imm = 0x1300
jne 0x89be
leaq 0x1310(%rsp), %r14
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
xorl %r12d, %r12d
movq %r12, 0x10(%r14)
movl $0x20, %esi
movq %r14, %rdi
callq 0xfe9c
movq %r12, -0x1308(%r14)
movq 0x14067(%rip), %rax     # 0x1ca78
testq %rax, %rax
je 0x8a85
movq 0x14063(%rip), %r12     # 0x1ca80
leaq (%r12,%rax,8), %r13
leaq 0xa0(%rsp), %rbp
xorl %r14d, %r14d
movq (%r12), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x8(%rsp), %r8
callq 0x84c2
movq %r14, 0x8(%rsp)
movq %r14, 0x1318(%rsp)
xorl %eax, %eax
xorps %xmm0, %xmm0
leaq (%r15,%rax), %rcx
movups %xmm0, -0x10(%rbp,%rax)
movq %rcx, 0xa0(%rsp,%rax)
addq $0x98, %rax
cmpq $0x1300, %rax           # imm = 0x1300
jne 0x8a53
movl $0x5, %edi
callq 0x2406
addq $0x8, %r12
cmpq %r13, %r12
jne 0x8a2c
movl $0x6, %edi
callq 0x2406
leaq 0x99fe(%rip), %rdi      # 0x12494
xorl %eax, %eax
callq 0x47a5
addq $0x1328, %rsp           # imm = 0x1328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: typecheck(Goal*)
bool typecheck(Goal *goal) {
    typecheck_init();
    constexpr int approximated_num_of_classes_per_inheritance_tree = 8;
    // +1 for the main class
    int type_decls_len = goal->type_decls.len + 1;
    inher_roots.reserve(type_decls_len /
                        approximated_num_of_classes_per_inheritance_tree);
    // Pass 1
    TypeTable type_table = install_type_declarations(goal);
    if (config.log) {
        printf("\n");
    }

    // TODO: How able we are to continue?
    // Print types that could not be inserted. This can
    // happen if the types used are more than the type
    // declarations. See TypeTable.
    // TODO: The types in `could_not_be_inserted` might actually have a
    // declaration. Consider that if say we have space in the table for 2
    // type declarations. The declarations that _exist_ are for A and D.
    // In A, let's say we use A, B, C and D in that order. D will be inserted
    // last and it won't be in the type table. It will be in the
    // `could_not_be_inserted` because of lack of space. But D
    // actually has a declaration.
    for (IdType *type : type_table.could_not_be_inserted) {
        typecheck_error(type->loc, "Type `", type->id, "` has not been ",
                        "defined");
    }

    // Offset computation
    type_table.offset_computation();

    // Print calloc declarations etc.
    cgen_init();

    // Pass 2
    full_typecheck(goal, type_table);
    
    if (num_global_typecheck_errors == 0) {
        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
movl $0x2a, %edi
callq 0x368b
movl 0x50(%rbx), %eax
leal 0x1(%rax), %ecx
addl $0x8, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x3, %eax
movslq %eax, %rsi
leaq 0x13f88(%rip), %rdi     # 0x1ca70
callq 0xf50c
leaq 0x8(%rsp), %rdi
movq %rbx, (%rsp)
movq %rbx, %rsi
callq 0x8192
leaq 0x11f33(%rip), %rax     # 0x1aa38
cmpb $0x1, (%rax)
jne 0x8b14
movl $0xa, %edi
callq 0x2160
movq 0x70(%rsp), %r13
testq %r13, %r13
je 0x8b60
movq 0x78(%rsp), %rbp
shlq $0x3, %r13
xorl %ebx, %ebx
leaq 0xaa54(%rip), %r14      # 0x13584
leaq 0xaa54(%rip), %r15      # 0x1358b
leaq 0xb6e4(%rip), %r12      # 0x14222
movq (%rbp,%rbx), %rax
movl (%rax), %edi
movq 0x8(%rax), %rdx
movq %r14, %rsi
movq %r15, %rcx
movq %r12, %r8
callq 0x8bb7
addq $0x8, %rbx
cmpq %rbx, %r13
jne 0x8b3e
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x89a0
callq 0x483f
leaq 0x80(%rsp), %rax
movl $0xf, %ecx
movq %rax, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rax)
movq %rax, %rdi
movq (%rsp), %rsi
callq 0xa2a4
cmpl $0x0, 0x13ee6(%rip)     # 0x1ca88
sete %al
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: void typecheck_error<char const*, char, char const*, char const*, char const*>(location_t, char const*, char, char const*, char const*, char const*)
static void typecheck_error(location_t __loc, Args... args) {
    ++num_global_typecheck_errors;
    log(__loc);
    yellow_on();
    bold_on();
    log(" Semantic Error: ");
    bold_off();
    yellow_off();
    log(args...);
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
incl 0xf77c(%rip)            # 0x1ca88
movq %rsi, %r14
movl %edi, %edx
leaq 0xd728(%rip), %rax      # 0x1aa40
movq (%rax), %rsi
leaq 0x4950(%rip), %rdi      # 0x11c72
xorl %eax, %eax
callq 0x2030
leaq 0xd708(%rip), %r15      # 0x1aa38
movb 0x1(%r15), %al
cmpb $0x1, %al
jne 0xd34a
leaq 0x78be(%rip), %rdi      # 0x14bfd
xorl %eax, %eax
callq 0x2030
movb 0x1(%r15), %al
testb $0x1, %al
je 0xd35c
leaq 0x4926(%rip), %rdi      # 0x11c7b
xorl %eax, %eax
callq 0x2030
leaq 0x4051(%rip), %rdi      # 0x113b4
leaq 0x7881(%rip), %rsi      # 0x14beb
xorl %eax, %eax
callq 0x2030
movb 0x1(%r15), %al
cmpb $0x1, %al
jne 0xd38b
leaq 0x4185(%rip), %rdi      # 0x11505
xorl %eax, %eax
callq 0x2030
movb 0x1(%r15), %al
testb $0x1, %al
je 0xd39d
leaq 0x416f(%rip), %rdi      # 0x11505
xorl %eax, %eax
callq 0x2030
leaq 0x4010(%rip), %rdi      # 0x113b4
movq %r14, %rsi
xorl %eax, %eax
callq 0x2030
movzbl %bpl, %edi
callq 0x2160
leaq 0x6ba2(%rip), %rdi      # 0x13f60
leaq 0x558c(%rip), %rdx      # 0x12951
movq %rbx, %rsi
callq 0xf2e8
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: DeclarationVisitor::id_to_type(char const*, location_t)
IdType* DeclarationVisitor::id_to_type(const char *id, location_t loc) {
    // Check if it already exists.
    IdType *type = this->type_table.find(id);
    if (type) {
        return type;
    }
    // Otherwise construct a new one and
    // save it in the table.
    type = new IdType(id);
    type->loc = loc;
    this->type_table.insert(type->id, type);
    return type;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x8cf7
testq %r14, %r14
je 0x8d34
imull $0x5f5e505, %r14d, %ecx # imm = 0x5F5E505
imulq %rax, %rcx
shrq $0x20, %rcx
movq 0x38(%rbx), %rdx
xorl %edi, %edi
movq %rcx, %rsi
movq (%rdx,%rsi,8), %r8
cmpq %r14, %r8
je 0x8cea
testq %r8, %r8
je 0x8cf7
incq %rsi
cmpq %rax, %rsi
cmoveq %rdi, %rsi
cmpq %rcx, %rsi
jne 0x8ccb
jmp 0x8cf7
movq 0x40(%rbx), %rax
movq (%rax,%rsi,8), %r15
testq %r15, %r15
jne 0x8d26
movl $0x90, %edi
movl $0x3, %esi
callq 0x23ef
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0xf54e
movl %ebp, (%r15)
movq 0x8(%r15), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8d6c
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xba4a(%rip), %rdi      # 0x14785
leaq 0xba47(%rip), %rsi      # 0x14789
leaq 0xba4f(%rip), %rcx      # 0x14798
movl $0x5e, %edx
callq 0x20b0
movq %rax, %rbx
movl $0x90, %esi
movq %r15, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x21c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: TypeTable::insert(char const*, IdType*)
void TypeTable::insert(const char *id, IdType* v) {
    if (!type_table.insert(id, v)) {
        // Search in the auxiliary buffer
        for (IdType *type : could_not_be_inserted) {
            if (type->id == id) {
                return;
            }
        }
        could_not_be_inserted.push(v);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq 0x50(%rdi), %rax
cmpq 0x58(%rdi), %rax
je 0x8dd0
testq %rsi, %rsi
je 0x8e6f
movq 0x30(%rbx), %rcx
testq %rcx, %rcx
je 0x8e8e
imull $0x5f5e505, %esi, %edx  # imm = 0x5F5E505
imulq %rcx, %rdx
shrq $0x20, %rdx
movq 0x38(%rbx), %rdi
xorl %r9d, %r9d
movq %rdx, %r8
movq (%rdi,%r8,8), %r10
testq %r10, %r10
je 0x8e21
cmpq %rsi, %r10
je 0x8e42
incq %r8
cmpq %rcx, %r8
cmoveq %r9, %r8
cmpq %rdx, %r8
jne 0x8daf
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
testq %rax, %rax
je 0x8dfa
leaq (,%rax,8), %rdx
xorl %edi, %edi
movq (%rcx,%rdi), %r8
cmpq %rsi, 0x8(%r8)
je 0x8e3c
addq $0x8, %rdi
cmpq %rdi, %rdx
jne 0x8de7
leaq 0x60(%rbx), %rdi
leaq 0x1(%rax), %r15
cmpq (%rdi), %r15
jbe 0x8e17
movq %r15, %rsi
callq 0x10112
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
movq %r14, (%rcx,%rax,8)
movq %r15, 0x68(%rbx)
jmp 0x8e3c
movq %rsi, (%rdi,%r8,8)
movq 0x40(%rbx), %rcx
movq %r14, (%rcx,%r8,8)
movq 0x48(%rbx), %rcx
movq %r14, (%rcx,%rax,8)
incq %rax
movq %rax, 0x50(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0xbedb(%rip), %rdi      # 0x14d24
xorl %eax, %eax
callq 0x2030
leaq 0x984b(%rip), %rdi      # 0x126a2
leaq 0xb92b(%rip), %rsi      # 0x14789
leaq 0xbe4d(%rip), %rcx      # 0x14cb2
movl $0x53, %edx
callq 0x20b0
leaq 0xb90f(%rip), %rdi      # 0x14785
leaq 0xb90c(%rip), %rsi      # 0x14789
leaq 0xbe2e(%rip), %rcx      # 0x14cb2
movl $0x46, %edx
callq 0x20b0
leaq 0xbe86(%rip), %rdi      # 0x14d1b
leaq 0xb8ed(%rip), %rsi      # 0x14789
leaq 0xbe0f(%rip), %rcx      # 0x14cb2
movl $0x47, %edx
callq 0x20b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: DeclarationVisitor::typespec_to_type(Typespec, location_t)
Type* DeclarationVisitor::typespec_to_type(Typespec tspec, location_t loc) {
    switch (tspec.kind) {
    case TYSPEC::UNDEFINED: assert(0);
    case TYSPEC::INT: return type_table.int_type;
    case TYSPEC::ARR: return type_table.int_arr_type;
    case TYSPEC::BOOL: return type_table.bool_type;
    case TYSPEC::ID: return this->id_to_type(tspec.id, loc);
    default: assert(0);
    }
}

// Assembly:
pushq %rax
cmpl $0x4, %esi
ja 0x8f02
movl %esi, %eax
leaq 0xa3b3(%rip), %rsi      # 0x13270
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
movq 0x18(%rdi), %rax
jmp 0x8ee1
movq 0x10(%rdi), %rax
jmp 0x8ee1
movq %rdx, %rsi
movl %ecx, %edx
popq %rax
jmp 0x8c92
movq 0x8(%rdi), %rax
popq %rcx
retq
leaq 0xa738(%rip), %rdi      # 0x13622
leaq 0xa50d(%rip), %rsi      # 0x133fe
leaq 0xa6a3(%rip), %rcx      # 0x1359b
movl $0x1de, %edx            # imm = 0x1DE
callq 0x20b0
leaq 0xa719(%rip), %rdi      # 0x13622
leaq 0xa4ee(%rip), %rsi      # 0x133fe
leaq 0xa684(%rip), %rcx      # 0x1359b
movl $0x1e3, %edx            # imm = 0x1E3
callq 0x20b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: TypeTable::initialize(unsigned long)
void TypeTable::initialize(size_t n) {
    type_table.reserve(n);
    undefined_type = new Type(TY::UNDEFINED);
    bool_type = new Type(TY::BOOL);
    int_type = new Type(TY::INT);
    int_arr_type = new Type(TY::ARR);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x30, %rdi
callq 0xf5c2
movl $0x8, %edi
movl $0x3, %esi
callq 0x23ef
movl $0x0, 0x4(%rax)
movq %rax, (%rbx)
movl $0x8, %edi
movl $0x3, %esi
callq 0x23ef
movl $0x3, 0x4(%rax)
movq %rax, 0x8(%rbx)
movl $0x8, %edi
movl $0x3, %esi
callq 0x23ef
movl $0x1, 0x4(%rax)
movq %rax, 0x10(%rbx)
movl $0x8, %edi
movl $0x3, %esi
callq 0x23ef
movl $0x2, 0x4(%rax)
movq %rax, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: DeclarationVisitor::visit(Goal*)
void DeclarationVisitor::visit(Goal *goal) {
    LOG_SCOPE;
    debug_print("Pass1::Goal\n");
    goal->main_class.accept(this);
    for (TypeDeclaration *type_decl : goal->type_decls) {
        type_decl->accept(this);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7(%rsp), %rdi
callq 0x34c8
leaq 0xa601(%rip), %rdi      # 0x135dc
xorl %eax, %eax
callq 0x3539
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x9044
movq 0x50(%r14), %r15
testq %r15, %r15
je 0x9017
movq 0x58(%r14), %r14
shlq $0x3, %r15
xorl %r12d, %r12d
movq (%r14,%r12), %rsi
movq %rbx, %rdi
callq 0x93aa
addq $0x8, %r12
cmpq %r12, %r15
jne 0x9002
leaq 0x7(%rsp), %rdi
callq 0x34dc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x902f
movq %rax, %rbx
leaq 0x7(%rsp), %rdi
callq 0x34dc
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: DeclarationVisitor::visit(MainClass*)
void DeclarationVisitor::visit(MainClass *main_class) {
    LOG_SCOPE;
    debug_print("Pass1::MainClass: %s\n", main_class->id);
    // Assert that we visit this first i.e., no types have been created
    assert(this->type_table.len_inserted() == 0);
    IdType *main_cls_type = new IdType(main_class->id,
                                       /* nfields = */ 0,
                                       /* nmethods = */ 0);
    main_cls_type->loc = main_class->loc;

    this->type_table.main_cls_type = main_cls_type;
    this->type_table.insert(main_class->id, main_cls_type);
    inher_roots.push(main_cls_type);

    // Construct a custom method for `main()`
    Method *main_method = Method::construct_main_method(this, main_class);
    this->type_table.main_method = main_method;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7(%rsp), %rdi
callq 0x34c8
movq 0x8(%r14), %rsi
leaq 0xa582(%rip), %rdi      # 0x135e9
xorl %eax, %eax
callq 0x3539
cmpq $0x0, 0x50(%rbx)
jne 0x9115
movl $0x90, %edi
movl $0x3, %esi
callq 0x23ef
movq %rax, %r15
movq 0x8(%r14), %rsi
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf712
movl (%r14), %eax
movl %eax, (%r15)
movq %r15, 0x20(%rbx)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8d6c
movq 0x139bd(%rip), %rax     # 0x1ca78
leaq 0x1(%rax), %r12
cmpq 0x139aa(%rip), %r12     # 0x1ca70
jbe 0x90de
leaq 0x139a1(%rip), %rdi     # 0x1ca70
movq %r12, %rsi
callq 0x10112
movq 0x1399a(%rip), %rax     # 0x1ca78
movq 0x1399b(%rip), %rcx     # 0x1ca80
movq %r15, (%rcx,%rax,8)
movq %r12, 0x13988(%rip)     # 0x1ca78
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9160
movq %rax, 0x28(%rbx)
leaq 0x7(%rsp), %rdi
callq 0x34dc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xa4e3(%rip), %rdi      # 0x135ff
leaq 0xa2db(%rip), %rsi      # 0x133fe
leaq 0xa4fa(%rip), %rcx      # 0x13624
movl $0x212, %edx            # imm = 0x212
callq 0x20b0
jmp 0x914a
movq %rax, %rbx
movl $0x90, %esi
movq %r15, %rdi
callq 0x2100
jmp 0x914d
jmp 0x914a
movq %rax, %rbx
leaq 0x7(%rsp), %rdi
callq 0x34dc
movq %rbx, %rdi
callq 0x21c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: DeclarationVisitor::visit(LocalDeclaration*)
Local *DeclarationVisitor::visit(LocalDeclaration *local_decl) {
    // Note: It's responsibility of the one who calls this visit
    // to have assured that a local declaration with the same
    // id does not exist.
    LOG_SCOPE;
    assert(!local_decl->is_undefined());
    print_indentation();
    debug_log(local_decl->loc, "LocalDeclaration: ", local_decl->id, "\n");
    if (local_decl->typespec.id != NULL
        && local_decl->typespec.id == this->type_table.main_cls_type->id)
    {
        typecheck_error(local_decl->loc, "You can't declare a local of type of",
                        " the main class.");
    }
    Type *type = typespec_to_type(local_decl->typespec, local_decl->loc);
    Local *local = new Local(local_decl->id, type);
    return local;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf(%rsp), %rdi
callq 0x34c8
cmpq $0x0, 0x18(%rbx)
je 0x9cd7
callq 0x34ef
movl (%rbx), %edi
movq 0x18(%rbx), %rdx
leaq 0x9b76(%rip), %rsi      # 0x137d4
callq 0x9942
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x9c91
movq 0x20(%r14), %rax
cmpq 0x8(%rax), %rdx
jne 0x9c93
movl (%rbx), %edi
leaq 0x9b68(%rip), %rsi      # 0x137e7
leaq 0x9fad(%rip), %rdx      # 0x13c33
callq 0x9d0f
movq 0x10(%rbx), %rdx
jmp 0x9c93
xorl %edx, %edx
movl (%rbx), %ecx
movl 0x8(%rbx), %esi
movq %r14, %rdi
callq 0x8eae
movq %rax, %r14
movl $0x40, %edi
movl $0x3, %esi
callq 0x23ef
movq %rax, %r15
movq 0x18(%rbx), %rax
movq %rax, (%r15)
movq %r14, 0x8(%r15)
leaq 0xf(%rsp), %rdi
callq 0x34dc
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x9aa5(%rip), %rdi      # 0x13783
leaq 0x9719(%rip), %rsi      # 0x133fe
leaq 0x9ab3(%rip), %rcx      # 0x1379f
movl $0x293, %edx            # imm = 0x293
callq 0x20b0
jmp 0x9cfa
jmp 0x9cfa
movq %rax, %rbx
leaq 0xf(%rsp), %rdi
callq 0x34dc
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: DeclarationVisitor::gen_id()
const char *DeclarationVisitor::gen_id() {
    static int count = 0;
    char buf[64];
    sprintf(buf, "a%d", count);
    count++;
    return str_intern(buf);
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movl 0x12ca3(%rip), %edx     # 0x1ca8c
leaq 0x9a1c(%rip), %rsi      # 0x1380c
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2040
incl 0x12c89(%rip)           # 0x1ca8c
movq %rbx, %rdi
callq 0x8130
addq $0x40, %rsp
popq %rbx
retq
nop