// File: /workspace/github_c_makefile_star2_O0/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
subq $0x1f90, %rsp           # imm = 0x1F90
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xb46a
movq -0x8(%rbp), %rax
movl 0x4(%rax), %esi
leaq 0x1a192(%rip), %rdi     # 0x255f0
movb $0x0, %al
callq 0x60f0
jmp 0xb6dc
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xb4b0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xb430
leaq 0x18f30(%rip), %rdi     # 0x243bf
movb $0x0, %al
callq 0x60f0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xb430
jmp 0xb6da
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xb4f6
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xb430
leaq 0x18eee(%rip), %rdi     # 0x243c3
movb $0x0, %al
callq 0x60f0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xb430
jmp 0xb6d8
movq -0x8(%rbp), %rax
cmpl $0x3, (%rax)
jne 0xb5c3
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x6c10
movq %rax, %rsi
leaq 0x18db0(%rip), %rdi     # 0x242cd
movb $0x0, %al
callq 0x60f0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x1f78(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb790
movl %eax, %ecx
movl -0x1f78(%rbp), %eax
cmpl %ecx, %eax
jge 0xb5b0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x1c(%rbp), %esi
callq 0xbb50
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xb430
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f7c(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb790
movl %eax, %ecx
movl -0x1f7c(%rbp), %eax
cmpl %ecx, %eax
jge 0xb5a0
leaq 0x195fd(%rip), %rdi     # 0x24b96
movb $0x0, %al
callq 0x60f0
jmp 0xb5a2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb52b
leaq 0x196fa(%rip), %rdi     # 0x24cb1
movb $0x0, %al
callq 0x60f0
jmp 0xb6d6
movq -0x8(%rbp), %rax
cmpl $0x4, (%rax)
jne 0xb60b
movq -0x18(%rbp), %rax
movq %rax, -0x1f88(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x81e0
movq -0x1f88(%rbp), %rdi
movl (%rax), %esi
callq 0x6c10
movq %rax, %rsi
leaq 0x18cd2(%rip), %rdi     # 0x242d1
movb $0x0, %al
callq 0x60f0
jmp 0xb6d4
jmp 0xb60d
leaq 0x189f0(%rip), %rdi     # 0x24004
leaq 0x18c07(%rip), %rsi     # 0x24222
movl $0x13e, %edx            # imm = 0x13E
leaq 0x18da0(%rip), %rcx     # 0x243c7
movb $0x0, %al
callq 0x60f0
leaq 0x189f7(%rip), %rdi     # 0x2402c
leaq 0x18d96(%rip), %rsi     # 0x243d2
movb $0x0, %al
callq 0x60f0
leaq -0x1f60(%rbp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x60d0
movl %eax, -0x1f64(%rbp)
leaq -0x1f60(%rbp), %rdi
movl -0x1f64(%rbp), %esi
callq 0x60a0
movq %rax, -0x1f70(%rbp)
leaq 0x189d1(%rip), %rdi     # 0x2404b
movb $0x0, %al
callq 0x60f0
movl $0x0, -0x1f74(%rbp)
movl -0x1f74(%rbp), %eax
cmpl -0x1f64(%rbp), %eax
jge 0xb6ca
movq -0x1f70(%rbp), %rax
movslq -0x1f74(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x1897a(%rip), %rdi     # 0x2402c
movb $0x0, %al
callq 0x60f0
movl -0x1f74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f74(%rbp)
jmp 0xb68b
movl $0x1, %edi
callq 0x61a0
jmp 0xb6d6
jmp 0xb6d8
jmp 0xb6da
jmp 0xb6dc
addq $0x1f90, %rsp           # imm = 0x1F90
popq %rbp
retq
nopw %cs:(%rax,%rax)