LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/ir.c
// Function: ir_bb_terminate
static void ir_bb_terminate(IRBB* bb, IRInst inst) {
    assert(bb->term == NULL);
    // Set terminal
    bb->term = (IRInst*)malloc(sizeof(IRInst));
    *bb->term = inst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x6631
jmp 0x6650
leaq 0x5288(%rip), %rdi      # 0xb8c0
leaq 0x4fb1(%rip), %rsi      # 0xb5f0
movl $0xf, %edx
leaq 0x5286(%rip), %rcx      # 0xb8d1
callq 0x10b0
movl $0x30, %edi
callq 0x1120
movq -0x10(%rbp), %rsi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x30, %edx
callq 0x1110
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/ir.c
// Function: ir_builder_build_local
static IRSymbolID ir_builder_build_local(IRBuilder* builder) {
    IRFunction* f = builder->current_func;
    IRSymbolID sym_id = f->locals_id;
    f->locals_id++;

    return sym_id;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/analyzer.c
// Function: env_new
Env* env_new(Token* name_tok, Env* parent) {
    Env* e = (Env*)malloc(sizeof(Env));
    e->parent = parent;
    e->name_tok = name_tok;
    e->name = e->name_tok ? token_to_string(e->name_tok) : NULL;
    e->children = string_map_new(sizeof(Env*), env_elem_dtor);

    return e;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x28, %edi
callq 0x1120
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x6783
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1bd0
movq %rax, -0x20(%rbp)
jmp 0x678b
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x678b
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x8, %edi
leaq 0x1d(%rip), %rsi        # 0x67c0
callq 0x97d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/analyzer.c
// Function: env_drop
void env_drop(Env* env) {
    if (env->name) {
        free((char*)env->name);
    }
    string_map_drop(env->children);
    free(env);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x6804
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1040
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x9800
movq -0x8(%rbp), %rdi
callq 0x1040
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/analyzer.c
// Function: env_insert
Env* env_insert(Env* env, Env* child) {
    int found;
    assert(child->name);

    Env** e = string_map_insert(env->children, child->name, &found);
    assert(found == 0);
    *e = child;

    return *e;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x683d
jmp 0x685c
leaq 0x50e4(%rip), %rdi      # 0xb928
leaq 0x50e9(%rip), %rsi      # 0xb934
movl $0x36, %edx
leaq 0x50e8(%rip), %rcx      # 0xb93f
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x14(%rbp), %rdx
callq 0x9820
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x6881
jmp 0x68a0
leaq 0x50d5(%rip), %rdi      # 0xb95d
leaq 0x50a5(%rip), %rsi      # 0xb934
movl $0x39, %edx
leaq 0x50a4(%rip), %rcx      # 0xb93f
callq 0x10b0
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/analyzer.c
// Function: env_lookup
Env* env_lookup(Env* env, Token* name_tok) {
    char const* name = token_to_string(name_tok);
    Env* found_env = string_map_find(env->children, name);
    free((char*)name);

    if (found_env) {
        return found_env;
    }

    if (env->parent == NULL) {
        return NULL;
    }

    return env_lookup(env->parent, name_tok);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1bd0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x98d0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1040
cmpq $0x0, -0x28(%rbp)
je 0x690c
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6934
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x6920
movq $0x0, -0x8(%rbp)
jmp 0x6934
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x68c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: asm_x86_64_new
ASM_X86_64* asm_x86_64_new(IRModule* m) {
    ASM_X86_64* a = (ASM_X86_64*)malloc(sizeof(ASM_X86_64));
    a->insts = vector_new(sizeof(ASM_X86_64_Inst));
    a->values = vector_new(sizeof(ASM_X86_64_Var));
    a->global_values = vector_new(sizeof(ASM_X86_64_Var));
    a->offsets = vector_new(sizeof(size_t));
    a->string_label_count = 0;
    a->code_label_count = 0;
    a->labels = uint_map_new(sizeof(char const*), NULL);

    built_from_ir(a, m);

    return a;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x38, %edi
callq 0x1120
movq %rax, -0x10(%rbp)
movl $0x70, %edi
callq 0x42c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x20, %edi
callq 0x42c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x20, %edi
callq 0x42c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x8, %edi
callq 0x42c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movl $0x8, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x94d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x7150
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: built_from_ir
void built_from_ir(ASM_X86_64 *a, IRModule* m) {
    for(size_t i=0; i<vector_len(m->definitions); ++i) {
        IRInst* inst = vector_at(m->definitions, i);
        built_from_ir_global_inst(a, inst);
    }

    for(size_t i=0; i<vector_len(m->functions); ++i) {
        IRFunction* f = vector_at(m->functions, i);
        built_from_ir_function(a, f);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x71b7
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x4530
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7ac0
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7168
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x7210
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x4530
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x7d60
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x71bf
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: asm_x86_64_drop
void asm_x86_64_drop(ASM_X86_64 *a) {
    for(size_t i=0; i<vector_len(a->insts); ++i) {
        ASM_X86_64_Inst* inst = vector_at(a->insts, i);
        asm_x86_64_inst_destruct(inst);
    }
    vector_drop(a->insts);

    vector_drop(a->values);
    vector_drop(a->global_values);
    vector_drop(a->offsets);
    uint_map_drop(a->labels);

    free(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0x727f
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4530
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x72d0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7234
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x4440
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4440
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4440
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x4440
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x9560
movq -0x8(%rbp), %rdi
callq 0x1040
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: asm_x86_64_inst_destruct
static void asm_x86_64_inst_destruct(ASM_X86_64_Inst* inst) {
    switch(inst->kind) {
    case ASM_X86_64_INST_KIND_LABEL:
        if (inst->value.label.generated) {
            free((char*)inst->value.label.name);
        }
        break;

    default:
        // DO NOTHING
        break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
subl $0x5, %eax
jne 0x7302
jmp 0x72e9
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x7300
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1040
jmp 0x7304
jmp 0x7304
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: fprint_inst_op
void fprint_inst_op(FILE* fp, char const* op, int num, ...) {
    va_list ap;

    fprintf(fp, "%s", op);

    va_start(ap, num);
    for(int i=0; i<num; ++i) {
        if (i == 0) {
            fprintf(fp, "\t");
        } else {
            fprintf(fp, ", ");
        }
        ASM_X86_64_Value* arg = va_arg(ap, ASM_X86_64_Value*);
        fprint_value(fp, arg);
    }
    va_end(ap);

    fprintf(fp, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
testb %al, %al
je 0x76fb
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3f33(%rip), %rsi      # 0xb65d
movb $0x0, %al
callq 0x10e0
leaq -0x30(%rbp), %rax
leaq -0xf0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x18, (%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x7815
cmpl $0x0, -0x34(%rbp)
jne 0x7782
movq -0x8(%rbp), %rdi
leaq 0x4403(%rip), %rsi      # 0xbb7c
movb $0x0, %al
callq 0x10e0
jmp 0x7794
movq -0x8(%rbp), %rdi
leaq 0x3f3c(%rip), %rsi      # 0xb6c9
movb $0x0, %al
callq 0x10e0
leaq -0x30(%rbp), %rax
movq %rax, -0x100(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0xf4(%rbp)
cmpl $0x28, %eax
ja 0x77cf
movq -0x100(%rbp), %rcx
movl -0xf4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x108(%rbp)
jmp 0x77ec
movq -0x100(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x7830
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x775c
movq -0x8(%rbp), %rdi
leaq 0x4850(%rip), %rsi      # 0xc070
xorl %eax, %eax
callq 0x10e0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: fprint_value
void fprint_value(FILE* fp, ASM_X86_64_Value* v) {
    switch(v->kind) {
    case ASM_X86_64_VALUE_KIND_SYMBOL:
        fprintf(fp, "%s", v->value.symbol);
        break;

    case ASM_X86_64_VALUE_KIND_IMM_INT:
        fprintf(fp, "$%d", v->value.imm_int);
        break;

    case ASM_X86_64_VALUE_KIND_STRING:
        fprintf(fp, "%s(%%rip)", v->value.string.label);
        break;

    case ASM_X86_64_VALUE_KIND_REG:
        fprint_reg(fp, v->value.reg);
        break;

    case ASM_X86_64_VALUE_KIND_DISP_REG:
        if (v->value.disp_reg.symbol) {
            fprintf(fp, "%s", v->value.disp_reg.symbol);
        } else {
            fprintf(fp, "%d", v->value.disp_reg.disp);
        }
        fprintf(fp, "(");
        fprint_reg(fp, v->value.disp_reg.reg);
        fprintf(fp, ")");
        break;

    default:
        fprintf(stderr, "Unknown kind: %d", v->kind);
        assert(0); // TODO: error handling...
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x18(%rbp)
subq $0x4, %rax
ja 0x794f
movq -0x18(%rbp), %rax
leaq 0x4285(%rip), %rcx      # 0xbae4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x3de2(%rip), %rsi      # 0xb65d
movb $0x0, %al
callq 0x10e0
jmp 0x798c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x4386(%rip), %rsi      # 0xbc1f
movb $0x0, %al
callq 0x10e0
jmp 0x798c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x436b(%rip), %rsi      # 0xbc23
movb $0x0, %al
callq 0x10e0
jmp 0x798c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x79a0
jmp 0x798c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x7900
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x3d66(%rip), %rsi      # 0xb65d
movb $0x0, %al
callq 0x10e0
jmp 0x7919
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x4182(%rip), %rsi      # 0xba94
movb $0x0, %al
callq 0x10e0
movq -0x8(%rbp), %rdi
leaq 0x3c61(%rip), %rsi      # 0xb585
movb $0x0, %al
callq 0x10e0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %esi
callq 0x79a0
movq -0x8(%rbp), %rdi
leaq 0x42d7(%rip), %rsi      # 0xbc1d
movb $0x0, %al
callq 0x10e0
jmp 0x798c
movq 0x76a2(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %edx
leaq 0x4120(%rip), %rsi      # 0xba86
movb $0x0, %al
callq 0x10e0
leaq 0x3ff2(%rip), %rdi      # 0xb966
leaq 0x426a(%rip), %rsi      # 0xbbe5
movl $0x186, %edx            # imm = 0x186
leaq 0x42a6(%rip), %rcx      # 0xbc2d
callq 0x10b0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: fprint_reg
void fprint_reg(FILE* fp, ASM_X86_64_Reg reg) {
    char const* reg_name;
    switch(reg) {
    case ASM_X86_64_REG_RAX:
        reg_name = "rax";
        break;

    case ASM_X86_64_REG_RBX:
        reg_name = "rbx";
        break;

    case ASM_X86_64_REG_RCX:
        reg_name = "rcx";
        break;

    case ASM_X86_64_REG_RDX:
        reg_name = "rdx";
        break;

    case ASM_X86_64_REG_RSP:
        reg_name = "rsp";
        break;

    case ASM_X86_64_REG_RBP:
        reg_name = "rbp";
        break;

    case ASM_X86_64_REG_RSI:
        reg_name = "rsi";
        break;

    case ASM_X86_64_REG_RDI:
        reg_name = "rdi";
        break;

    case ASM_X86_64_REG_RIP:
        reg_name = "rip";
        break;

    case ASM_X86_64_REG_EAX:
        reg_name = "eax";
        break;

    default:
        fprintf(stderr, "Unexpected kind: %d\n", reg);
        assert(0); // TODO: error handling...
    }

    fprintf(fp, "%%%s", reg_name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x20(%rbp)
subq $0x9, %rax
ja 0x7a62
movq -0x20(%rbp), %rax
leaq 0x412d(%rip), %rcx      # 0xbaf8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4280(%rip), %rax      # 0xbc5b
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x4274(%rip), %rax      # 0xbc5f
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x4268(%rip), %rax      # 0xbc63
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x425c(%rip), %rax      # 0xbc67
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x4250(%rip), %rax      # 0xbc6b
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x4247(%rip), %rax      # 0xbc6f
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x423e(%rip), %rax      # 0xbc73
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x4235(%rip), %rax      # 0xbc77
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x422c(%rip), %rax      # 0xbc7b
movq %rax, -0x18(%rbp)
jmp 0x7a9c
leaq 0x4223(%rip), %rax      # 0xbc7f
movq %rax, -0x18(%rbp)
jmp 0x7a9c
movq 0x758f(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movl -0xc(%rbp), %edx
leaq 0x420d(%rip), %rsi      # 0xbc83
movb $0x0, %al
callq 0x10e0
leaq 0x3ee2(%rip), %rdi      # 0xb966
leaq 0x415a(%rip), %rsi      # 0xbbe5
movl $0x1b7, %edx            # imm = 0x1B7
leaq 0x4201(%rip), %rcx      # 0xbc98
callq 0x10b0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x4215(%rip), %rsi      # 0xbcc0
movb $0x0, %al
callq 0x10e0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: asm_x86_64_set_val
static void asm_x86_64_set_val(ASM_X86_64 *a, IRSymbolID id, ASM_X86_64_Value value, int is_global) {
    Vector* mem = a->values;
    if (is_global) {
        mem = a->global_values;
    }

    while(vector_len(mem) <= id) {
        void* e = vector_append(mem);
        assert(e);
    }

    ASM_X86_64_Var* var = vector_at(mem, id);
    var->kind = ASM_X86_64_VAR_VAL;
    var->value.val = value;

    fprintf(DEBUGOUT, "SET = %ld <- ", id);
    fprint_value(DEBUGOUT, &var->value.val);
    fprintf(DEBUGOUT, "\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x8019
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x801b
movq -0x20(%rbp), %rdi
callq 0x4580
cmpq -0x10(%rbp), %rax
ja 0x8061
movq -0x20(%rbp), %rdi
callq 0x4480
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x8040
jmp 0x805f
leaq 0x3009(%rip), %rdi      # 0xb050
leaq 0x3b97(%rip), %rsi      # 0xbbe5
movl $0xc6, %edx
leaq 0x3ced(%rip), %rcx      # 0xbd47
callq 0x10b0
jmp 0x801b
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4530
movq -0x38(%rbp), %rcx
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
movq -0x30(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq 0x6f36(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3ce0(%rip), %rsi      # 0xbd90
movb $0x0, %al
callq 0x10e0
movq 0x6f1a(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
addq $0x8, %rsi
callq 0x7830
movq 0x6f03(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x3f91(%rip), %rsi      # 0xc070
movb $0x0, %al
callq 0x10e0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: asm_x86_64_set_local
static void asm_x86_64_set_local(ASM_X86_64 *a, IRSymbolID id, size_t offset) {
    while(vector_len(a->offsets) <= id) {
        void* e = vector_append(a->offsets);
        assert(e);
    }

    fprintf(DEBUGOUT, "SET LOCAL = %ld <- %ld\n", id, offset);
    size_t* o = vector_at(a->offsets, id);
    *o = offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x4580
cmpq -0x10(%rbp), %rax
ja 0x8152
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x4480
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x8131
jmp 0x8150
leaq 0x2f18(%rip), %rdi      # 0xb050
leaq 0x3aa6(%rip), %rsi      # 0xbbe5
movl $0xe5, %edx
leaq 0x3ca2(%rip), %rcx      # 0xbded
callq 0x10b0
jmp 0x8104
movq 0x6e7f(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x3cbe(%rip), %rsi      # 0xbe29
movb $0x0, %al
callq 0x10e0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4530
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: collect_labels_from_ir_bb
void collect_labels_from_ir_bb(ASM_X86_64 *a, IRBB* bb) {
    char const* label_id = make_code_label(a->code_label_count);
    char const** m = uint_map_insert(a->labels, bb->id, NULL);
    *m = label_id;

    a->code_label_count++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x8260
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x9620
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: built_from_ir_bb
void built_from_ir_bb(ASM_X86_64 *a, IRBB* bb) {
    char const** m = uint_map_find(a->labels, bb->id);
    assert(m);
    char const* label_id = *m;

    {
        // .label 'label_id'
        ASM_X86_64_Inst* inst = (ASM_X86_64_Inst*)vector_append(a->insts);
        inst->kind = ASM_X86_64_INST_KIND_LABEL;
        inst->value.label.name = label_id;
        inst->value.label.generated = 1;
    }

    for(size_t i=0; i<vector_len(bb->insts); ++i) {
        IRInst* inst = vector_at(bb->insts, i);
        built_from_ir_inst(a, inst);
    }
    assert(bb->term);
    built_from_ir_inst(a, bb->term);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x96d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x82d1
jmp 0x82f0
leaq 0x3dc4(%rip), %rdi      # 0xc09c
leaq 0x3906(%rip), %rsi      # 0xbbe5
movl $0x22f, %edx            # imm = 0x22F
leaq 0x3b5e(%rip), %rcx      # 0xbe49
callq 0x10b0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x4480
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl $0x5, (%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movl $0x1, 0x10(%rax)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x8385
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x4530
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x83d0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x8334
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8392
jmp 0x83b1
leaq 0x3adc(%rip), %rdi      # 0xbe75
leaq 0x3845(%rip), %rsi      # 0xbbe5
movl $0x23e, %edx            # imm = 0x23E
leaq 0x3a9d(%rip), %rcx      # 0xbe49
callq 0x10b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x83d0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: asm_x86_64_get_val
static ASM_X86_64_Value* asm_x86_64_get_val(ASM_X86_64 *a, IRSymbolID id, int is_global) {
    Vector* mem = a->values;
    if (is_global) {
        mem = a->global_values;
    }

    fprintf(DEBUGOUT, "GET = %ld\n", id);
    assert(id <= vector_len(mem));
    ASM_X86_64_Var* var = vector_at(mem, id);
    if (var->kind == ASM_X86_64_VAR_VAL) {
        return &var->value.val;
    }

    assert(0); // TODO: implement
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x8f91
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq 0x6040(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x2f42(%rip), %rsi      # 0xbee8
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
ja 0x8fcc
jmp 0x8feb
leaq 0x2f20(%rip), %rdi      # 0xbef3
leaq 0x2c0b(%rip), %rsi      # 0xbbe5
movl $0xd9, %edx
leaq 0x2f23(%rip), %rcx      # 0xbf09
callq 0x10b0
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4530
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x9013
movq -0x28(%rbp), %rax
addq $0x8, %rax
addq $0x30, %rsp
popq %rbp
retq
leaq 0x294c(%rip), %rdi      # 0xb966
leaq 0x2bc4(%rip), %rsi      # 0xbbe5
movl $0xdf, %edx
leaq 0x2edc(%rip), %rcx      # 0xbf09
callq 0x10b0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/asm_x86_64.c
// Function: asm_x86_64_get_local
static size_t asm_x86_64_get_local(ASM_X86_64 *a, IRSymbolID id) {
    fprintf(DEBUGOUT, "GET LOCAL = %ld\n", id);
    assert(id <= vector_len(a->offsets));

    size_t* o = vector_at(a->offsets, id);
    return *o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x5f81(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x2ee8(%rip), %rsi      # 0xbf4d
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
ja 0x908f
jmp 0x90ae
leaq 0x2ec8(%rip), %rdi      # 0xbf5e
leaq 0x2b48(%rip), %rsi      # 0xbbe5
movl $0xef, %edx
leaq 0x2ed2(%rip), %rcx      # 0xbf7b
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4530
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/ir_bb.c
// Function: ir_bb_construct
void ir_bb_construct(IRBB* bb, IRBBID id) {
    bb->id = id;
    bb->prevs = vector_new(sizeof(IRBB*));
    bb->insts = vector_new(sizeof(IRInst));
    bb->term = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movl $0x8, %edi
callq 0x42c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x30, %edi
callq 0x42c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/ir_bb.c
// Function: ir_bb_destruct
void ir_bb_destruct(IRBB* bb) {
    vector_drop(bb->prevs);

    for(size_t i=0; i<vector_len(bb->insts); ++i) {
        IRInst* inst = vector_at(bb->insts, i);
        ir_inst_destruct(inst);
    }
    vector_drop(bb->insts);

    if (bb->term) {
        ir_inst_destruct(bb->term);
        free(bb->term);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4440
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0x919e
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4530
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x94a0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9151
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4440
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x91d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x94a0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1040
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/ir_bb.c
// Function: ir_bb_foreach_nexts
void ir_bb_foreach_nexts(IRBB* bb, void(*f)(IRBB*, void*), void* args) {
    if (bb->term == NULL) {
        return;
    }

    switch(bb->term->kind) {
    case IR_INST_KIND_RET:
        return;

    case IR_INST_KIND_BRANCH:
    {
        f( bb->term->value.branch.then_bb, args);
        if (bb->term->value.branch.else_bb) {
            f(bb->term->value.branch.else_bb, args);
        }
        return;
    }

    case IR_INST_KIND_JUMP:
    {
        f(bb->term->value.jump.next_bb, args);
        return;
    }

    default:
        assert(0); // TODO: error handling
        return;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x9204
jmp 0x92a2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
subl $0x1, %eax
je 0x922c
jmp 0x9218
movl -0x1c(%rbp), %eax
subl $0x2, %eax
je 0x922e
jmp 0x9222
movl -0x1c(%rbp), %eax
subl $0x3, %eax
je 0x926b
jmp 0x9283
jmp 0x92a2
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x10(%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x9269
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x18(%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
jmp 0x92a2
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x8(%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
jmp 0x92a2
leaq 0x26dc(%rip), %rdi      # 0xb966
leaq 0x2d20(%rip), %rsi      # 0xbfb1
movl $0x36, %edx
leaq 0x2d1c(%rip), %rcx      # 0xbfb9
callq 0x10b0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/ir_bb.c
// Function: ir_bb_visit
void ir_bb_visit(IRBB* initial_bb, void(*f)(IRBB* bb, void*), void* args) {
    struct ir_bb_visit_iter_arg_t state = {
        .visited = uint_map_new(1, NULL),
        .bbs = vector_new(sizeof(IRBB*)), // Vector<IRBB*>
        .head = 0,
    };

    IRBB** bb = vector_append(state.bbs);
    *bb = initial_bb;

    while(state.head < vector_len(state.bbs)) {
        bb = vector_at(state.bbs, state.head);
        state.head++;

        f(*bb, args);

        ir_bb_foreach_nexts(*bb, ir_bb_visit_iter, &state);
    }

    vector_drop(state.bbs);
    uint_map_drop(state.visited);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x94d0
movq %rax, -0x30(%rbp)
movl $0x8, %edi
callq 0x42c0
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4480
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x9368
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4530
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
movq -0x38(%rbp), %rax
movq (%rax), %rdi
leaq 0x23(%rip), %rsi        # 0x9380
leaq -0x30(%rbp), %rdx
callq 0x91e0
jmp 0x9304
movq -0x28(%rbp), %rdi
callq 0x4440
movq -0x30(%rbp), %rdi
callq 0x9560
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/ir_bb.c
// Function: ir_bb_visit_iter
static void ir_bb_visit_iter(IRBB* next, void* args) {
    struct ir_bb_visit_iter_arg_t* state = (struct ir_bb_visit_iter_arg_t*)args;

    int exist;
    uint_map_insert(state->visited, next->id, &exist);
    if (exist == 0) {
        IRBB** t = vector_append(state->bbs);
        *t = next;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq -0x1c(%rbp), %rdx
callq 0x9620
cmpl $0x0, -0x1c(%rbp)
jne 0x93d1
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4480
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/ir_inst.c
// Function: ir_inst_value_destruct
void ir_inst_value_destruct(IRInstValue* v) {
    switch(v->kind) {
    case IR_INST_VALUE_KIND_SYMBOL:
        free((char*)v->value.symbol);
        break;

    case IR_INST_VALUE_KIND_STRING:
    case IR_INST_VALUE_KIND_REF:
    case IR_INST_VALUE_KIND_ADDR_OF:
    case IR_INST_VALUE_KIND_IMM_INT:
    case IR_INST_VALUE_KIND_OP_BIN:
        break; // DO NOTHING

    case IR_INST_VALUE_KIND_CALL:
        vector_drop(v->value.call.args);
        break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xc(%rbp)
testl %eax, %eax
je 0x9471
jmp 0x945b
movl -0xc(%rbp), %eax
decl %eax
subl $0x5, %eax
jb 0x9480
jmp 0x9467
movl -0xc(%rbp), %eax
subl $0x6, %eax
je 0x9482
jmp 0x948f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1040
jmp 0x948f
jmp 0x948f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4440
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/map.c
// Function: map_new
static Map* map_new(size_t elem_size, void (*dtor)(void*)) {
    Map* m = (Map*)malloc(sizeof(Map));
    m->elem_size = elem_size;
    m->elems = vector_new(sizeof(Elem));
    m->dtor = dtor;

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x18, %edi
callq 0x1120
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x10, %edi
callq 0x42c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/map.c
// Function: map_drop
static void map_drop(UintMap* m) {
    for(size_t i=0; i<vector_len(m->elems); ++i) {
        Elem* elem = vector_at(m->elems, i);
        if (m->dtor) {
            m->dtor((void*)elem->buffer);
        }
        free(elem->buffer);
    }
    vector_drop(m->elems);

    free(m);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0x9602
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4530
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x95e7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *%rax
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1040
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9594
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4440
movq -0x8(%rbp), %rdi
callq 0x1040
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/map.c
// Function: uint_map_insert
void* uint_map_insert(UintMap* m, size_t key, int* exist) {
    // TODO: improve performance
    void* content = uint_map_find(m, key);
    if (content) {
        if (exist) { *exist = 1; };
        return content;
    }

    if (exist) { *exist = 0; };
    Elem* elem = (Elem*)vector_append(m->elems);
    elem->key.num = key;
    elem->buffer = (char*)malloc(m->elem_size); // TODO: consider alignment

    return (void*)elem->buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x96d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9667
cmpq $0x0, -0x20(%rbp)
je 0x965d
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x96b7
cmpq $0x0, -0x20(%rbp)
je 0x9678
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4480
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1120
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/map.c
// Function: map_find
static void* map_find(UintMap* m, int (*cmp)(Elem*, void*), void* arg) {
    // TODO: improve performance
    for(size_t i=0; i<vector_len(m->elems); ++i) {
        Elem* elem = vector_at(m->elems, i);
        if (cmp(elem, arg)) {
            return (void*)elem->buffer;
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4580
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x9783
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x4530
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq *%rax
cmpl $0x0, %eax
je 0x9773
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x978b
jmp 0x9775
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x971c
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/map.c
// Function: string_map_insert
void* string_map_insert(StringMap* m, char const* key, int* exist) {
    // TODO: improve performance
    void* content = string_map_find(m, key);
    if (content) {
        if (exist) { *exist = 1; };
        return content;
    }

    if (exist) { *exist = 0; };
    Elem* elem = (Elem*)vector_append(m->elems);
    elem->key.name = key;
    elem->buffer = (char*)malloc(m->elem_size); // TODO: consider alignment

    return (void*)elem->buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x98d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9867
cmpq $0x0, -0x20(%rbp)
je 0x985d
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x98b7
cmpq $0x0, -0x20(%rbp)
je 0x9878
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4480
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1120
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/cc.c
// Function: cc_new
CC* cc_new(char const* buffer, char const* fpath) {
    CC* cc = malloc(sizeof(CC));
    cc->buffer = buffer;
    cc->fpath = fpath;
    cc->tokens = NULL;
    cc->nodes = NULL;
    cc->parser = NULL;
    cc->types = NULL;
    cc->analyzer = NULL;
    cc->ir_builder = NULL;
    cc->ir_mod = NULL;
    cc->state = CC_STATE_INIT;

    return cc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x50, %edi
callq 0x1120
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/cc.c
// Function: cc_drop
void cc_drop(CC* cc) {
    if (cc->ir_mod) {
        ir_module_drop(cc->ir_mod);
    }
    if (cc->ir_builder) {
        ir_builder_drop(cc->ir_builder);
    }

    if (cc->analyzer) {
        analyzer_drop(cc->analyzer);

        assert(cc->types);
        type_arena_drop(cc->types);
    }

    if (cc->parser) {
        parser_drop(cc->parser);

        assert(cc->nodes);
        node_arena_drop(cc->nodes);
    }

    if (cc->tokens) {
        vector_drop(cc->tokens);
    }

    free(cc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x9a74
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x4f50
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x9a8c
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x50b0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x9add
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x6970
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x9ab1
jmp 0x9ad0
leaq 0x2544(%rip), %rdi      # 0xbffc
leaq 0x2547(%rip), %rsi      # 0xc006
movl $0x37, %edx
leaq 0x2540(%rip), %rcx      # 0xc00b
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x9970
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x9b2e
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x1e30
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x9b02
jmp 0x9b21
leaq 0x2515(%rip), %rdi      # 0xc01e
leaq 0x24f6(%rip), %rsi      # 0xc006
movl $0x3e, %edx
leaq 0x24ef(%rip), %rcx      # 0xc00b
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x4de0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x9b46
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4440
movq -0x8(%rbp), %rdi
callq 0x1040
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/cc.c
// Function: cc_parse
ParserResult cc_parse(CC* cc) {
    cc_lex(cc); // TODO: pass lexer to parser

    cc->nodes = node_arena_new();
    cc->parser = parser_new(cc->tokens, cc->nodes);

    return parser_parse(cc->parser);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x18(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9bd0
movb $0x0, %al
callq 0x4dc0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x1db0
movq -0x18(%rbp), %rdi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movb $0x0, %al
callq 0x1e70
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/cc.c
// Function: cc_lex
static void cc_lex(CC* cc) {
    cc->tokens = vector_new(sizeof(Token)); // Vector<Token>

    Lexer* lex = lexer_new(cc->buffer, cc->fpath);
    for(;;) {
        Token tok = lexer_read(lex);

        token_fprint(DEBUGOUT, &tok); printf("\n");

        Token* elem = (Token*)vector_append(cc->tokens);
        assert(elem);
        *elem = tok;

        if (tok.kind == TOK_KIND_EOF) {
            break;
        }
    }
    lexer_delete(lex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x20, %edi
callq 0x42c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x14e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x1560
movq 0x53bb(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c40
leaq 0x2440(%rip), %rdi      # 0xc070
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4480
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x9c51
jmp 0x9c70
leaq 0x2441(%rip), %rdi      # 0xc099
leaq 0x23a7(%rip), %rsi      # 0xc006
movl $0x53, %edx
leaq 0x2433(%rip), %rcx      # 0xc09e
callq 0x10b0
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x18(%rax)
cmpl $0x1f, -0x30(%rbp)
jne 0x9c9b
jmp 0x9ca0
jmp 0x9c09
movq -0x10(%rbp), %rdi
callq 0x1540
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yutopp[P]cc/cc.c
// Function: cc_build_ir
static IRModule* cc_build_ir(CC* cc, Node* node) {
    cc->ir_builder = ir_builder_new();
    cc->ir_mod = ir_builder_new_module(cc->ir_builder, node);

    fprintf(DEBUGOUT,"= IR =\n");
    ir_module_fprint(DEBUGOUT, cc->ir_mod);
    fprintf(DEBUGOUT, "\n");
    fflush(DEBUGOUT);

    return cc->ir_mod;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, %al
callq 0x5070
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x50d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq 0x5013(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x20e1(%rip), %rsi      # 0xc0b0
movb $0x0, %al
callq 0x10e0
movq 0x4ffb(%rip), %rax      # 0xefd8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x51f0
movq 0x4fe4(%rip), %rax      # 0xefd8
movq (%rax), %rdi
leaq 0x2072(%rip), %rsi      # 0xc070
movb $0x0, %al
callq 0x10e0
movq 0x4fcc(%rip), %rax      # 0xefd8
movq (%rax), %rdi
callq 0x1130
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
addq $0x10, %rsp
popq %rbp
retq