LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/llvm.cpp
// Function: llvm_getelementptr_i32(llvalue_t, llvalue_t)
llvalue_t llvm_getelementptr_i32(llvalue_t ptr, llvalue_t index) {
    assert(ptr.kind == LLVALUE::REG);
    llvalue_t v;
    v.reg = gen_reg();
    v.kind = LLVALUE::REG;
    print_codegen_indentation();
    emit("%%%ld = getelementptr inbounds i32, i32* %%%ld, i32 ", v.reg, ptr.reg);
    cgen_print_llvalue(index);
    emit("\n");
    return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x2, 0x50(%rsp)
jne 0x4b91
movq %rdi, %rbx
leaq 0x70(%rsp), %r15
leaq 0x50(%rsp), %r12
andl $0x0, 0x10(%rdi)
movq 0x13efd(%rip), %r14     # 0x18a28
leaq 0x1(%r14), %rax
movq %rax, 0x13ef2(%rip)     # 0x18a28
movq %r14, 0x18(%rdi)
movl $0x2, (%rdi)
callq 0x44e4
movq 0x18(%r12), %rdx
leaq 0xa739(%rip), %rdi      # 0xf28a
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x442e
leaq 0xa8ed(%rip), %rdi      # 0xf468
xorl %eax, %eax
callq 0x42fe
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xa575(%rip), %rdi      # 0xf10d
leaq 0xa336(%rip), %rsi      # 0xeed5
leaq 0xa6ad(%rip), %rcx      # 0xf253
movl $0x125, %edx            # imm = 0x125
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/llvm.cpp
// Function: llvm_load(Type*, llvalue_t)
llvalue_t llvm_load(Type *type, llvalue_t ptr) {
    assert(ptr.kind == LLVALUE::REG);
    llvalue_t v;
    v.reg = gen_reg();
    v.kind = LLVALUE::REG;
    print_codegen_indentation();
    switch (type->kind) {
    case TY::BOOL:
    {
        emit("%%%ld = load i1, i1* %%%ld\n", v.reg, ptr.reg);
    } break;
    case TY::INT:
    {
        emit("%%%ld = load i32, i32* %%%ld, align 4\n", v.reg, ptr.reg);
    } break;
    case TY::ARR:
    {
        emit("%%%ld = load i32*, i32** %%%ld, align 8\n", v.reg, ptr.reg);
    } break;
    case TY::ID:
    {
        emit("%%%ld = load i8*, i8** %%%ld\n", v.reg, ptr.reg);
    } break;
    default: assert(0);
    }
    return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x2, 0x20(%rsp)
jne 0x4c1e
movq %rsi, %r15
movq %rdi, %rbx
andl $0x0, 0x10(%rdi)
movq 0x13e5b(%rip), %r14     # 0x18a28
leaq 0x1(%r14), %rax
movq %rax, 0x13e50(%rip)     # 0x18a28
movq %r14, 0x18(%rdi)
movl $0x2, (%rdi)
callq 0x44e4
movl 0x4(%r15), %eax
decl %eax
cmpl $0x4, %eax
jae 0x4c3d
leaq 0x20(%rsp), %rcx
movl %eax, %eax
leaq 0xa0e0(%rip), %rdx      # 0xece0
movslq (%rdx,%rax,4), %rdi
addq %rdx, %rdi
movq 0x18(%rcx), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0xa4e8(%rip), %rdi      # 0xf10d
leaq 0xa2a9(%rip), %rsi      # 0xeed5
leaq 0xa6c3(%rip), %rcx      # 0xf2f6
movl $0x13a, %edx            # imm = 0x13A
callq 0x20b0
leaq 0xb9ce(%rip), %rdi      # 0x10612
leaq 0xa28a(%rip), %rsi      # 0xeed5
leaq 0xa6a4(%rip), %rcx      # 0xf2f6
movl $0x150, %edx            # imm = 0x150
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/llvm.cpp
// Function: not_llvalue(llvalue_t)
llvalue_t not_llvalue(llvalue_t v) {
    assert(v.kind == LLVALUE::REG);
    long reg = gen_reg();
    print_codegen_indentation();
    emit("%%%ld = icmp eq i1 %%%ld, 0\n", reg, v.reg);
    v.reg = reg;
    return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x2, 0x20(%rsp)
jne 0x4cc0
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq 0x13db1(%rip), %r14     # 0x18a28
leaq 0x1(%r14), %rax
movq %rax, 0x13da6(%rip)     # 0x18a28
callq 0x44e4
movq 0x18(%r15), %rdx
leaq 0xa72f(%rip), %rdi      # 0xf3c1
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
movq %r14, 0x18(%r15)
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%r15), %rax
movq %rax, 0x10(%rbx)
movq 0x18(%r15), %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0xa6c2(%rip), %rdi      # 0xf389
leaq 0xa207(%rip), %rsi      # 0xeed5
leaq 0xa6cb(%rip), %rcx      # 0xf3a0
movl $0x156, %edx            # imm = 0x156
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/llvm.cpp
// Function: llvm_calloc(llvalue_t)
llvalue_t llvm_calloc(llvalue_t sz) {
    llvalue_t v = register_llv(gen_reg(), {});
    print_codegen_indentation();
    if (sz.kind == LLVALUE::CONST) {
        emit("%%%ld = call noalias i8* @calloc(i32 1, i32 %d)\n", v.reg, sz.val);
    } else {
        emit("%%%ld = call noalias i8* @calloc(i32 1, i32 %%%ld)\n", v.reg, sz.reg);
    }
    return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq 0x13d35(%rip), %r14     # 0x18a28
leaq 0x1(%r14), %rax
movl $0x2, (%rdi)
movq %r14, 0x18(%rdi)
andq $0x0, 0x8(%rdi)
movq %rax, 0x13d1b(%rip)     # 0x18a28
andl $0x0, 0x10(%rdi)
callq 0x44e4
cmpl $0x1, (%r15)
jne 0x4d33
movl 0x18(%r15), %edx
leaq 0xa6b7(%rip), %rdi      # 0xf3de
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
jmp 0x4d48
movq 0x18(%r15), %rdx
leaq 0xa6d1(%rip), %rdi      # 0xf40f
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/llvm.cpp
// Function: llvm_branch_cond(llvalue_t, llvm_label_t, llvm_label_t)
void llvm_branch_cond(llvalue_t cond, llvm_label_t l1, llvm_label_t l2) {
    print_codegen_indentation();
    emit("br i1 ");
    cgen_print_llvalue(cond);
    emit(", label %%%s, label %%%s\n\n", l1.lbl, l2.lbl);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x44e4
leaq 0xa6c0(%rip), %rdi      # 0xf448
xorl %eax, %eax
callq 0x42fe
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x442e
leaq 0xa69f(%rip), %rdi      # 0xf44f
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x42fe
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x28, %rsp
movq %r8, %r13
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
andl $0x0, 0x10(%rdi)
leaq 0x60(%rsp), %rbp
movl $0x2, (%rdi)
cmpq $-0x1, %r8
jne 0x4e23
movq 0x13c10(%rip), %r13     # 0x18a28
leaq 0x1(%r13), %rax
movq %rax, 0x13c05(%rip)     # 0x18a28
movq %r13, 0x18(%rbx)
callq 0x44e4
leaq 0xa647(%rip), %rdi      # 0xf47a
movq %r13, %rsi
xorl %eax, %eax
callq 0x42fe
movq %r12, %rdi
callq 0x465e
leaq 0xa644(%rip), %rdi      # 0xf490
xorl %eax, %eax
callq 0x42fe
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x442e
leaq 0xa615(%rip), %rdi      # 0xf487
movq %r15, %rsi
xorl %eax, %eax
callq 0x42fe
leaq 0x80(%rsp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x442e
leaq 0xa5f2(%rip), %rdi      # 0xf494
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
andl $0x0, 0x10(%rdi)
movq 0x139a6(%rip), %r14     # 0x18a28
leaq 0x1(%r14), %rax
movq %rax, 0x1399b(%rip)     # 0x18a28
movq %r14, 0x18(%rdi)
movl $0x2, (%rdi)
callq 0x44e4
movl 0x4(%r15), %eax
decl %eax
cmpl $0x3, %eax
ja 0x50f1
leaq 0x9c02(%rip), %rcx      # 0xecb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa4a0(%rip), %rdi      # 0xf55e
jmp 0x50e7
leaq 0xa484(%rip), %rdi      # 0xf54b
jmp 0x50e7
movq 0x8(%r15), %rdx
leaq 0xa4c5(%rip), %rdi      # 0xf599
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
jmp 0x50f1
leaq 0xa494(%rip), %rdi      # 0xf57b
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0x2, 0x60(%rsp)
jne 0x51b1
movq %rdi, %rbx
leaq 0x60(%rsp), %r14
leaq 0x40(%rsp), %r15
callq 0x44e4
leaq 0xa4c5(%rip), %rdi      # 0xf5ec
xorl %eax, %eax
callq 0x42fe
movq %rbx, %rdi
callq 0x465e
leaq 0x9eed(%rip), %rdi      # 0xf02a
xorl %eax, %eax
callq 0x42fe
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x442e
leaq 0xbbbc(%rip), %rdi      # 0x10d20
xorl %eax, %eax
callq 0x42fe
movq %rbx, %rdi
callq 0x465e
leaq 0x9eaf(%rip), %rdi      # 0xf029
xorl %eax, %eax
callq 0x42fe
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x442e
leaq 0xa2c7(%rip), %rdi      # 0xf468
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x42fe
leaq 0x9f55(%rip), %rdi      # 0xf10d
leaq 0x9d16(%rip), %rsi      # 0xeed5
leaq 0xa3f8(%rip), %rcx      # 0xf5be
movl $0x1d1, %edx            # imm = 0x1D1
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x136d2(%rip), %r14     # 0x18a28
leaq 0x1(%r14), %rax
movq %rax, 0x136c7(%rip)     # 0x18a28
callq 0x44e4
leaq 0xa2c9(%rip), %rdi      # 0xf636
movq %r14, %rsi
xorl %eax, %eax
callq 0x42fe
movq %r12, %rdi
callq 0x465e
leaq 0x9ca4(%rip), %rdi      # 0xf02a
xorl %eax, %eax
callq 0x42fe
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x442e
leaq 0x9d0e(%rip), %rdi      # 0xf0bc
xorl %eax, %eax
callq 0x42fe
movq %r15, %rdi
callq 0x465e
leaq 0xa0a4(%rip), %rdi      # 0xf468
xorl %eax, %eax
callq 0x42fe
movl $0x2, 0x50(%rsp)
movq %r14, 0x68(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rbx)
movq 0x68(%rsp), %rax
movq %rax, 0x18(%rbx)
movl 0x50(%rsp), %eax
movl %eax, (%rbx)
movq 0x54(%rsp), %rax
movq %rax, 0x4(%rbx)
movl 0x5c(%rsp), %eax
movl %eax, 0xc(%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x44e4
leaq 0xa224(%rip), %rdi      # 0xf647
xorl %eax, %eax
callq 0x42fe
movq %rbx, %rdi
callq 0x465e
leaq 0x9bf1(%rip), %rdi      # 0xf02a
xorl %eax, %eax
callq 0x42fe
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorl %edi, %edi
callq 0x442e
leaq 0xa007(%rip), %rdi      # 0xf468
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
jmp 0x42fe
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x1355c(%rip), %rsi     # 0x18a40
leaq 0x1b0(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x1d0(%rsp,%rax)
jne 0x558c
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 0x134f0(%rip), %rsi     # 0x18a40
callq 0x5cd1
movq %rbx, %rdi
callq 0x56dc
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x28(%rsp), %rdi
callq 0x20d0
leaq 0x1b0(%rsp), %rdi
callq 0x2070
movq %rbx, %rax
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r14
retq
leaq 0xb07f(%rip), %rdi      # 0x10612
leaq 0xa1ce(%rip), %rsi      # 0xf768
leaq 0xa1d0(%rip), %rcx      # 0xf771
pushq $0x18
popq %rdx
callq 0x20b0
jmp 0x55b7
jmp 0x55ad
movq %rax, %rbx
jmp 0x55c4
movq %rax, %rbx
jmp 0x55ce
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x28(%rsp), %rdi
callq 0x20d0
leaq 0x1b0(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, %rbx
movq 0x8(%rsi), %rax
movq %rax, 0x13441(%rip)     # 0x18a40
movl $0x10100, 0x1342f(%rip) # imm = 0x10100
movb $0x0, 0x1342c(%rip)     # 0x18a3c
movl %edi, %r14d
pushq $0x1
popq %r15
leaq 0xa182(%rip), %r12      # 0xf7a0
leaq 0xa184(%rip), %r13      # 0xf7a9
cmpq %r15, %r14
je 0x56b3
movq (%rbx,%r15,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x564b
cmpb $0x76, 0x1(%rbp)
jne 0x564b
cmpb $0x0, 0x2(%rbp)
jne 0x564b
movb $0x1, 0x133ed(%rip)     # 0x18a38
movq %rbp, %rdi
leaq 0xa139(%rip), %rsi      # 0xf78e
callq 0x2170
testl %eax, %eax
jne 0x5665
movb $0x0, 0x133d5(%rip)     # 0x18a3a
movq %rbp, %rdi
leaq 0xa127(%rip), %rsi      # 0xf796
callq 0x2170
testl %eax, %eax
jne 0x567f
movb $0x0, 0x133ba(%rip)     # 0x18a39
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2170
testl %eax, %eax
jne 0x5695
movb $0x1, 0x133a6(%rip)     # 0x18a3b
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2170
testl %eax, %eax
jne 0x56ab
movb $0x1, 0x13391(%rip)     # 0x18a3c
incq %r15
jmp 0x5625
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x54d0
movq %rbx, %rdi
callq 0x7af8
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_O2/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 0x3f0c
movb $0x0, 0x12d72(%rip)     # 0x18a50
leaq 0x9b52(%rip), %rdi      # 0xf837
callq 0x733c
movq %rax, 0x12d57(%rip)     # 0x18a48
leaq 0x9b44(%rip), %rdi      # 0xf83c
callq 0x733c
movq %rax, 0x12d54(%rip)     # 0x18a58
pushq $0x2d
popq %rdi
popq %rax
jmp 0x32cb
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/parse.cpp
// Function: match_token(TOK)
static bool match_token(TOK kind) {
    if (is_token(kind)) {
        next_token();
        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x1297f(%rip), %rax     # 0x18698
movl (%rax), %ebp
cmpl %edi, %ebp
jne 0x5d24
callq 0x351d
cmpl %ebx, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
cmpb $0x0, 0x12d19(%rip)     # 0x18a50
je 0x5d3c
xorl %eax, %eax
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x12948(%rip), %rax     # 0x18698
movl (%rax), %ebp
cmpl $0x1, %ebp
jne 0x5d5e
movb $0x1, 0x12cf2(%rip)     # 0x18a50
cmpl %r14d, %ebp
jne 0x5d6c
callq 0x351d
movb $0x1, %al
jmp 0x5dd7
movq 0x8(%rax), %r15
leaq 0x12919(%rip), %rax     # 0x18690
movl (%rax), %edi
callq 0x6085
callq 0x609f
callq 0x60bb
leaq 0x8ea7(%rip), %rdi      # 0xec36
callq 0x60d7
callq 0x60e8
callq 0x6104
leaq 0x9c14(%rip), %rdi      # 0xf9b9
callq 0x60d7
movl %r14d, %edi
callq 0x6120
leaq 0x9c0b(%rip), %rdi      # 0xf9c4
leaq 0x9c94(%rip), %rdx      # 0xfa54
movq %rbx, %rsi
movl %ebp, %ecx
movq %r15, %r8
callq 0x6138
pushq $0xa
popq %rdi
callq 0x2160
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/./error.cpp
// Function: void syntax_error_no_ln<char const*, char const*, char const*>(char const*, 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 %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x11bc9(%rip), %rax     # 0x18690
movl (%rax), %edi
callq 0x6085
callq 0x609f
callq 0x60bb
leaq 0x8157(%rip), %rdi      # 0xec36
callq 0x60d7
callq 0x60e8
callq 0x6104
movq %r15, %rdi
callq 0x60d7
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6ce9
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/parse.cpp
// Function: skip_tokens(TOK, bool)
static void skip_tokens(TOK kind, bool eat = true) {
    int num_errors = 0;
    constexpr int lim = 5;
    TOK last;
    while (!is_token(TOK::EOI) && token.kind != kind) {
        if (num_errors == 0) {
            printf(";  skipping ");
        }
        ++num_errors;
        if (num_errors < lim) {
            if (num_errors > 1) {
                printf(", ");
            }
            log("`", token, "`");
        }
        last = token.kind;
        next_token();
    }
    if (eat) {
        next_token();
    }
    if (num_errors >= lim) {
        log(" ... `", last, "`");
    }
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, 0x4(%rsp)
movl %edi, %ebp
leaq 0x12854(%rip), %r12     # 0x18698
xorl %ebx, %ebx
movl (%r12), %r15d
cmpl $0x1, %r15d
je 0x5ea4
cmpl %ebp, %r15d
je 0x5ea4
leaq 0x9b73(%rip), %rdi      # 0xf9cf
pushq $0x1
popq %r13
testl %ebx, %ebx
je 0x5e74
leal 0x1(%rbx), %r13d
leaq 0xaeb1(%rip), %rdi      # 0x10d20
cmpl $0x3, %ebx
ja 0x5e97
xorl %eax, %eax
callq 0x2030
movl (%r12), %esi
movq 0x8(%r12), %rdx
leaq 0x9b56(%rip), %rcx      # 0xf9e1
movq %rcx, %rdi
callq 0x618c
movl (%r12), %r15d
callq 0x351d
movl %r15d, %r14d
movl %r13d, %ebx
jmp 0x5e46
cmpb $0x0, 0x4(%rsp)
je 0x5eb0
callq 0x351d
cmpl $0x5, %ebx
jb 0x5ecb
leaq 0x9b20(%rip), %rdi      # 0xf9dc
leaq 0x9b1e(%rip), %rdx      # 0xf9e1
movl %r14d, %esi
callq 0x620f
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/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 0x127b0(%rip), %rax     # 0x18698
movl (%rax), %eax
leal -0x5(%rax), %ecx
cmpl $0x2, %ecx
jae 0x5ef5
movb $0x1, %al
retq
cmpl $0x8, %eax
jne 0x5f13
pushq %rax
callq 0x3dda
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_O2/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 0x735c
leaq 0x81ed(%rip), %rdi      # 0xe3b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
cmpl $0x8, %ebp
je 0x61f1
cmpl $0x2, %ebp
jne 0x6208
leaq 0x97e9(%rip), %rdi      # 0xf9cb
movl %ebx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2030
leaq 0x81bb(%rip), %rdi      # 0xe3b3
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_O2/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 0x123fa(%rip), %rax     # 0x18698
movl (%rax), %edi
cmpl $0x5, %edi
je 0x62e1
cmpl $0x6, %edi
je 0x62bd
cmpl $0x8, %edi
jne 0x630b
movq 0x8(%rax), %r14
callq 0x351d
pushq $0x4
popq %rbx
jmp 0x631b
callq 0x351d
pushq $0x24
popq %rdi
callq 0x5d0d
testb %al, %al
je 0x6318
leaq 0x97f2(%rip), %rsi      # 0xfac7
pushq $0x1b
popq %rdi
callq 0x5d30
pushq $0x1
jmp 0x631a
callq 0x351d
pushq $0x24
popq %rdi
callq 0x5d0d
pushq $0x3
popq %rbx
testb %al, %al
je 0x631b
leaq 0x97e4(%rip), %rdi      # 0xfae0
callq 0x5de2
pushq $0x1b
popq %rdi
callq 0x5d0d
jmp 0x631b
movq 0x8(%rax), %rsi
callq 0x6328
xorl %ebx, %ebx
jmp 0x631b
pushq $0x2
popq %rbx
movl %ebx, %eax
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
cmpb $0x0, 0x12301(%rip)     # 0x18a50
je 0x6756
popq %rbx
popq %r14
popq %rbp
retq
movl %edi, %ebp
leaq 0x11f39(%rip), %rax     # 0x18698
movl (%rax), %ebx
cmpl $0x1, %ebx
jne 0x676d
movb $0x1, 0x122e3(%rip)     # 0x18a50
cmpl %ebp, %ebx
jne 0x677a
popq %rbx
popq %r14
popq %rbp
jmp 0x351d
movq 0x8(%rax), %r14
leaq 0x11f0b(%rip), %rax     # 0x18690
movl (%rax), %edi
callq 0x6085
callq 0x609f
callq 0x60bb
leaq 0x8499(%rip), %rdi      # 0xec36
callq 0x60d7
callq 0x60e8
callq 0x6104
leaq 0x9206(%rip), %rdi      # 0xf9b9
callq 0x60d7
movl %ebp, %edi
callq 0x6120
leaq 0x957d(%rip), %rdi      # 0xfd43
leaq 0x9214(%rip), %rcx      # 0xf9e1
movl %ebx, %esi
movq %r14, %rdx
callq 0x618c
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/parse.cpp
// Function: parse_expr_clause()
static Expression *parse_expr_clause() {
    Expression *expr;
    if (match_token(TOK::NOT)) {
        expr = new Expression;
        expr->loc = loc;
        expr->kind = EXPR::NOT;
        expr->e1 = parse_expr_clause();
    } else {
        expr = parse_expr_primary();
    }
    return expr;
}

// Assembly:
pushq %rbx
pushq $0x4
popq %rdi
callq 0x5d0d
testb %al, %al
je 0x6b4d
pushq $0x18
popq %rdi
callq 0x6f0a
movq %rax, %rbx
leaq 0x11b5c(%rip), %rax     # 0x18690
movl (%rax), %eax
movl %eax, (%rbx)
movl $0x9, 0x4(%rbx)
callq 0x6b15
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
popq %rbx
jmp 0x6b50
// File: /workspace/github_cpp_makefile_star2_O2/baziotis[P]minijava-cpp/./buf.h
// Function: Buf<TypeDeclaration*>::push(TypeDeclaration*)
void push(T v) {
        size_t new_len = len + 1;
        if(new_len > cap) _grow(new_len);
        data[len] = v;
        len = new_len;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %r15
cmpq (%rdi), %r15
jbe 0x6ddb
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7166
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
movq %r14, (%rcx,%rax,8)
movq %r15, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6e80
addq %rax, %rax
cmpq %rsi, %rax
cmovbeq %rsi, %rax
cmpq $0x11, %rax
pushq $0x10
popq %r14
cmovaeq %rax, %r14
shrq $0x3d, %rax
jne 0x6e99
movq %rdi, %rbx
leaq (,%r14,8), %rsi
movq 0x10(%rdi), %rdi
callq 0x21b0
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x6eb2
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x8c91(%rip), %rdi      # 0xfb18
leaq 0x8ca6(%rip), %rsi      # 0xfb34
leaq 0x8ca7(%rip), %rcx      # 0xfb3c
pushq $0x21
jmp 0x6ec9
leaq 0x8ce1(%rip), %rdi      # 0xfb81
leaq 0x8c8d(%rip), %rsi      # 0xfb34
leaq 0x8c8e(%rip), %rcx      # 0xfb3c
pushq $0x24
jmp 0x6ec9
leaq 0x8cec(%rip), %rdi      # 0xfba5
leaq 0x8c74(%rip), %rsi      # 0xfb34
leaq 0x8c75(%rip), %rcx      # 0xfb3c
pushq $0x27
popq %rdx
callq 0x20b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7dee
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7e0e
pushq $0x1
popq %rdi
callq 0x23f5
pushq $0xf
popq %rcx
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_O2/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 %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rsi
movq %rdx, %rdi
callq 0xc8ee
testq %rax, %rax
je 0x74d1
movq %rax, %rbx
movq (%rax), %r14
testq %r14, %r14
je 0x7553
movq %r12, %rdi
movq %r14, %rsi
callq 0x7426
testb %al, %al
je 0x74d5
movq 0x8(%r15), %rax
movq %rax, 0x8(%rbx)
movq 0x48(%r14), %rax
movq %rax, 0x48(%r12)
movb $0x1, %bpl
jmp 0x7548
xorl %ebp, %ebp
jmp 0x7548
movl 0x50(%r12), %ebp
movq 0x8(%r12), %rdi
callq 0x7572
movq (%r12), %rcx
leaq 0x7b3b(%rip), %rdx      # 0xf02a
leaq 0x905c(%rip), %r8       # 0x10552
movl %ebp, %edi
movq %rax, %rsi
callq 0xc932
movq %r12, %rdi
callq 0x75d0
movq 0x8(%r15), %r15
movq 0x8(%r14), %rdi
callq 0x7572
movq (%r14), %rcx
leaq 0x8f22(%rip), %rdi      # 0x10441
xorl %ebp, %ebp
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2030
movq %r14, %rdi
callq 0x75d0
movq 0x8(%rbx), %rsi
leaq 0x8f20(%rip), %rdi      # 0x10461
xorl %eax, %eax
callq 0x2030
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8e86(%rip), %rdi      # 0x103e0
leaq 0x8e8d(%rip), %rsi      # 0x103ee
leaq 0x8e94(%rip), %rcx      # 0x103fc
movl $0x115, %edx            # imm = 0x115
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x75b0
leaq 0x8d6a(%rip), %rcx      # 0x102ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa068(%rip), %rax      # 0x115fa
retq
movq 0x8(%rdi), %rax
retq
leaq 0x6dfa(%rip), %rax      # 0xe399
retq
leaq 0x6dfc(%rip), %rax      # 0xe3a3
retq
leaq 0x6df0(%rip), %rax      # 0xe39f
retq
pushq %rax
leaq 0x905a(%rip), %rdi      # 0x10612
leaq 0x8e2f(%rip), %rsi      # 0x103ee
leaq 0xa04b(%rip), %rcx      # 0x11611
movl $0x8f6, %edx            # imm = 0x8F6
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r12
leaq -0x1(%r12), %r13
leaq 0x6dc6(%rip), %r14      # 0xe3b4
leaq 0x972b(%rip), %r15      # 0x10d20
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0x762e
movq 0x30(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq 0x8(%rax), %rdi
callq 0x7572
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
cmpq %rbp, %r13
je 0x7629
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
incq %rbp
jmp 0x75f7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1320, %rsp           # imm = 0x1320
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0xcae0
movq 0x12fe3(%rip), %r15     # 0x1aa80
movq 0x12fd4(%rip), %r12     # 0x1aa78
shlq $0x3, %r12
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x7ad1
movq (%r15,%r13), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x763e
movq %r14, %rdi
callq 0xcb38
addq $0x8, %r13
jmp 0x7aab
pushq $0x6
popq %rdi
callq 0x23f5
leaq 0x7988(%rip), %rdi      # 0xf468
xorl %eax, %eax
callq 0x42fe
addq $0x1320, %rsp           # imm = 0x1320
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
callq 0x7394
movl 0x50(%rbx), %eax
incl %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
movslq %eax, %rsi
leaq 0x12f4a(%rip), %rdi     # 0x1aa70
callq 0xcb7c
leaq 0x8(%rsp), %rdi
movq %rbx, (%rsp)
movq %rbx, %rsi
callq 0x739c
leaq 0x10ef5(%rip), %rax     # 0x18a38
cmpb $0x1, (%rax)
jne 0x7b50
pushq $0xa
popq %rdi
callq 0x2160
movq 0x70(%rsp), %r13
movq 0x78(%rsp), %rbp
shlq $0x3, %r13
xorl %ebx, %ebx
leaq 0x8a0d(%rip), %r14      # 0x10574
leaq 0x8a0d(%rip), %r15      # 0x1057b
leaq 0x969d(%rip), %r12      # 0x11212
cmpq %rbx, %r13
je 0x7b99
movq (%rbp,%rbx), %rax
movl (%rax), %edi
movq 0x8(%rax), %rdx
movq %r14, %rsi
movq %r15, %rcx
movq %r12, %r8
callq 0x7bee
addq $0x8, %rbx
jmp 0x7b75
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x7a78
callq 0x4398
pushq $0xf
popq %rcx
leaq 0x80(%rsp), %rax
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 0x8810
cmpl $0x0, 0x12eaf(%rip)     # 0x1aa88
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_O2/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 %r14
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
incl 0x10092(%rip)           # 0x1aa88
callq 0xc769
callq 0xc783
callq 0xc79f
leaq 0x71c5(%rip), %rdi      # 0x11bd1
callq 0xc7bb
callq 0xc7cc
callq 0xc7e8
movq %r14, %rdi
callq 0xc7bb
movl %ebp, %edi
callq 0x2160
leaq 0x651f(%rip), %rdi      # 0x10f50
leaq 0x4fa9(%rip), %rdx      # 0xf9e1
movq %rbx, %rsi
callq 0xc827
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq %rdi, %r14
addq $0x30, %rdi
callq 0xd46e
movq %rax, %rbx
testq %rax, %rax
jne 0x7c9b
movl $0x90, %edi
callq 0xcbbc
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcbc4
movl %ebp, (%rbx)
movq 0x8(%rbx), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x7cc2
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x90, %esi
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x21c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0x30, %rdi
callq 0xcc4e
testb %al, %al
jne 0x7d02
leaq 0x60(%r15), %rdi
movq 0x68(%r15), %rax
movq 0x70(%r15), %rcx
shlq $0x3, %rax
xorl %edx, %edx
cmpq %rdx, %rax
je 0x7d08
movq (%rcx,%rdx), %rsi
addq $0x8, %rdx
cmpq %r14, 0x8(%rsi)
jne 0x7cef
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xcc90
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x7d6a
movl %esi, %eax
leaq 0x85db(%rip), %rsi      # 0x10300
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
movq 0x18(%rdi), %rax
jmp 0x7d49
movq 0x10(%rdi), %rax
jmp 0x7d49
movq %rdx, %rsi
movl %ecx, %edx
popq %rax
jmp 0x7c52
movq 0x8(%rdi), %rax
popq %rcx
retq
leaq 0x88c0(%rip), %rdi      # 0x10612
leaq 0x8695(%rip), %rsi      # 0x103ee
leaq 0x882b(%rip), %rcx      # 0x1058b
movl $0x1de, %edx            # imm = 0x1DE
callq 0x20b0
leaq 0x88a1(%rip), %rdi      # 0x10612
leaq 0x8676(%rip), %rsi      # 0x103ee
leaq 0x880c(%rip), %rcx      # 0x1058b
movl $0x1e3, %edx            # imm = 0x1E3
callq 0x20b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x30, %rdi
callq 0xcbf6
pushq $0x8
popq %r14
movq %r14, %rdi
callq 0xcbbc
andl $0x0, 0x4(%rax)
movq %rax, (%rbx)
movq %r14, %rdi
callq 0xcbbc
movl $0x3, 0x4(%rax)
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0xcbbc
movl $0x1, 0x4(%rax)
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0xcbbc
movl $0x2, 0x4(%rax)
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3108
leaq 0x879f(%rip), %rdi      # 0x105cc
xorl %eax, %eax
callq 0x317b
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x7e94
movq 0x50(%r14), %r15
movq 0x58(%r14), %r14
shlq $0x3, %r15
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x7e66
movq (%r14,%r12), %rsi
movq %rbx, %rdi
callq 0x8082
addq $0x8, %r12
jmp 0x7e4f
leaq 0x7(%rsp), %rdi
callq 0x311c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x7e7e
movq %rax, %rbx
leaq 0x7(%rsp), %rdi
callq 0x311c
movq %rbx, %rdi
callq 0x21c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xf(%rsp), %rdi
callq 0x3108
movq 0x8(%r14), %rsi
leaq 0x8721(%rip), %rdi      # 0x105d9
xorl %eax, %eax
callq 0x317b
cmpq $0x0, 0x50(%rbx)
jne 0x7f2e
movl $0x90, %edi
callq 0xcbbc
movq %rax, %r15
movq 0x8(%r14), %rsi
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xccca
movl (%r14), %eax
movl %eax, (%r15)
movq %r15, 0x20(%rbx)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x7cc2
leaq 0x12b6d(%rip), %rdi     # 0x1aa70
movq %r15, %rsi
callq 0xcc90
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7f78
movq %rax, 0x28(%rbx)
leaq 0xf(%rsp), %rdi
callq 0x311c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x86ba(%rip), %rdi      # 0x105ef
leaq 0x84b2(%rip), %rsi      # 0x103ee
leaq 0x86d1(%rip), %rcx      # 0x10614
movl $0x212, %edx            # imm = 0x212
callq 0x20b0
jmp 0x7f63
movq %rax, %rbx
movl $0x90, %esi
movq %r15, %rdi
callq 0x2100
jmp 0x7f66
jmp 0x7f63
movq %rax, %rbx
leaq 0xf(%rsp), %rdi
callq 0x311c
movq %rbx, %rdi
callq 0x21c0