// File: /workspace/github_c_makefile_star2_O3/alexj136[P]minijit/src/syntax.c
// Function: Expr_print
void Expr_print(Expr *expr, IntRefVector *local_name_map,
        charVector *global_name_map) {

    if(Expr_isInt(expr)) {
        printf("%d", Int_value(expr));
    }
    else if(Expr_isAdd(expr)) {
        Expr_print(Add_lhs(expr), local_name_map, global_name_map);
        printf(" + ");
        Expr_print(Add_rhs(expr), local_name_map, global_name_map);
    }
    else if(Expr_isSub(expr)) {
        Expr_print(Sub_lhs(expr), local_name_map, global_name_map);
        printf(" - ");
        Expr_print(Sub_rhs(expr), local_name_map, global_name_map);
    }
    else if(Expr_isCall(expr)) {
        printf("%s(", charVector_get(global_name_map, Call_name(expr)));
        int idx;
        for(idx = 0; idx < Call_num_args(expr); idx++) {
            Expr_print(Call_arg(expr, idx), local_name_map, global_name_map);
            if(idx + 1 < Call_num_args(expr)) { printf(", "); }
        }
        printf(")");
    }
    else if(Expr_isVar(expr)) {
        printf("%s", charVector_get(global_name_map,
                IntRef_value(IntRefVector_get(local_name_map,
                Var_name(expr)))));
    }
    else {
        ERROR("Expr type not recognised.");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f48, %rsp           # imm = 0x1F48
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x11580(%rip), %r13     # 0x1b224
movl (%r15), %eax
cmpq $0x4, %rax
ja 0x9dd5
movslq (%r13,%rax,4), %rax
addq %r13, %rax
leaq 0x11707(%rip), %r12     # 0x1b3c7
jmpq *%rax
leaq 0x116fa(%rip), %r12     # 0x1b3c3
movq 0x8(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x9c80
movq %r12, %rdi
xorl %eax, %eax
callq 0x6100
movq 0x10(%r15), %r15
jmp 0x9ca4
movl 0x4(%r15), %esi
movq %r14, %rdi
callq 0x7887
movl (%rax), %esi
movq %rbx, %rdi
callq 0x6937
leaq 0x115e2(%rip), %rdi     # 0x1b2e7
movq %rax, %rsi
xorl %eax, %eax
addq $0x1f48, %rsp           # imm = 0x1F48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6100
movl 0x4(%r15), %esi
leaq 0x128d9(%rip), %rdi     # 0x1c604
xorl %eax, %eax
addq $0x1f48, %rsp           # imm = 0x1F48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6100
movl 0x4(%r15), %esi
movq %rbx, %rdi
callq 0x6937
leaq 0x1158d(%rip), %rdi     # 0x1b2e3
movq %rax, %rsi
xorl %eax, %eax
callq 0x6100
movq 0x18(%r15), %rdi
callq 0x9edd
testl %eax, %eax
jle 0x9dba
leaq 0x11e38(%rip), %r12     # 0x1bbac
xorl %r13d, %r13d
movq 0x18(%r15), %rdi
movl %r13d, %esi
callq 0xa170
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x9c80
incl %r13d
movq 0x18(%r15), %rdi
callq 0x9edd
cmpl %eax, %r13d
jge 0x9dac
movq %r12, %rdi
xorl %eax, %eax
callq 0x6100
movq 0x18(%r15), %rdi
callq 0x9edd
cmpl %eax, %r13d
jl 0x9d77
movl $0x29, %edi
addq $0x1f48, %rsp           # imm = 0x1F48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6040
leaq 0x11228(%rip), %rdi     # 0x1b004
leaq 0x11455(%rip), %rsi     # 0x1b238
leaq 0x115e1(%rip), %rcx     # 0x1b3cb
movl $0x13e, %edx            # imm = 0x13E
xorl %eax, %eax
callq 0x6100
leaq 0x1122f(%rip), %rdi     # 0x1b02c
leaq 0x115d2(%rip), %rsi     # 0x1b3d6
xorl %eax, %eax
callq 0x6100
leaq -0x1f70(%rbp), %rbx
movq %rbx, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x60e0
movl %eax, %r14d
movq %rbx, %rdi
movl %eax, %esi
callq 0x60b0
movq %rax, %rbx
leaq 0x113e0(%rip), %rdi     # 0x1b216
callq 0x6070
testl %r14d, %r14d
jle 0x9e63
movl %r14d, %r15d
leaq 0x111e2(%rip), %r14     # 0x1b02c
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x6100
incq %r12
cmpq %r12, %r15
jne 0x9e4d
movl $0x1, %edi
callq 0x61a0