// File: /workspace/github_c_makefile_star2_O1/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 0x115b3(%rip), %r12     # 0x1b224
leaq 0x1174f(%rip), %r13     # 0x1b3c7
movl (%r15), %eax
cmpq $0x4, %rax
ja 0x9db2
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq 0x8(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x9c4d
leaq 0x1171f(%rip), %rdi     # 0x1b3c3
jmp 0x9cb8
movq 0x8(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x9c4d
movq %r13, %rdi
xorl %eax, %eax
callq 0x6100
movq 0x10(%r15), %r15
jmp 0x9c78
movl 0x4(%r15), %esi
movq %r14, %rdi
callq 0x787d
movl (%rax), %esi
movq %rbx, %rdi
callq 0x693b
leaq 0x11605(%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 0x1290c(%rip), %rdi     # 0x1c614
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 0x693b
leaq 0x115b0(%rip), %rdi     # 0x1b2e3
movq %rax, %rsi
xorl %eax, %eax
callq 0x6100
movq 0x18(%r15), %rdi
callq 0x9eba
testl %eax, %eax
jle 0x9d97
leaq 0x11e5b(%rip), %r12     # 0x1bbac
xorl %r13d, %r13d
movq 0x18(%r15), %rdi
movl %r13d, %esi
callq 0xa14b
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x9c4d
incl %r13d
movq 0x18(%r15), %rdi
callq 0x9eba
cmpl %eax, %r13d
jge 0x9d89
movq %r12, %rdi
xorl %eax, %eax
callq 0x6100
movq 0x18(%r15), %rdi
callq 0x9eba
cmpl %eax, %r13d
jl 0x9d54
movl $0x29, %edi
addq $0x1f48, %rsp           # imm = 0x1F48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6040
leaq 0x1124b(%rip), %rdi     # 0x1b004
leaq 0x11478(%rip), %rsi     # 0x1b238
leaq 0x11604(%rip), %rcx     # 0x1b3cb
movl $0x13e, %edx            # imm = 0x13E
xorl %eax, %eax
callq 0x6100
leaq 0x11252(%rip), %rdi     # 0x1b02c
leaq 0x115f5(%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 0x11403(%rip), %rdi     # 0x1b216
callq 0x6070
testl %r14d, %r14d
jle 0x9e40
movl %r14d, %r15d
leaq 0x11205(%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 0x9e2a
movl $0x1, %edi
callq 0x61a0