LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/yutopp[P]cc/ir.c
// Function: ir_bb_fprint
void ir_bb_fprint(FILE* fp, IRBB* bb) {
    fprint_indent(fp, 1); fprintf(fp, "%ld:\n", bb->id);

    for(size_t i=0; i<vector_len(bb->insts); ++i) {
        IRInst* inst = vector_at(bb->insts, i);
        fprint_indent(fp, 2); ir_inst_fprint(fp, inst);
    }

    if (bb->term != NULL) {
        fprint_indent(fp, 2); ir_inst_fprint(fp, bb->term);
    } else {
        fprint_indent(fp, 2); fprintf(fp, "NOT TERMINATED\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x2, %ebp
movl $0x20, %edi
movq %rbx, %rsi
callq 0x10f0
decl %ebp
jne 0x3e98
movq (%r14), %rdx
leaq 0x3654(%rip), %rsi      # 0x7507
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1110
movq 0x10(%r14), %rdi
callq 0x322b
testq %rax, %rax
je 0x3f0f
xorl %r15d, %r15d
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x3216
movq %rax, %r12
movl $0x4, %ebp
movl $0x20, %edi
movq %rbx, %rsi
callq 0x10f0
decl %ebp
jne 0x3ee2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3c1a
incq %r15
movq 0x10(%r14), %rdi
callq 0x322b
cmpq %rax, %r15
jb 0x3ece
cmpq $0x0, 0x18(%r14)
je 0x3f40
movl $0x4, %ebp
movl $0x20, %edi
movq %rbx, %rsi
callq 0x10f0
decl %ebp
jne 0x3f1b
movq 0x18(%r14), %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3c1a
movl $0x4, %ebp
movl $0x20, %edi
movq %rbx, %rsi
callq 0x10f0
decl %ebp
jne 0x3f45
leaq 0x35b0(%rip), %rdi      # 0x750d
movl $0xf, %esi
movl $0x1, %edx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x11b0
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x28, %edi
callq 0x1150
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
testq %r14, %r14
je 0x4642
movq %r14, %rdi
callq 0x1b54
jmp 0x4644
xorl %eax, %eax
movq %rax, 0x10(%rbx)
leaq 0x17(%rip), %rsi        # 0x4666
movl $0x8, %edi
callq 0x61c5
movq %rax, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x4680
callq 0x1040
movq 0x20(%rbx), %rdi
callq 0x61fb
movq %rbx, %rdi
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
je 0x46c7
movq 0x20(%rdi), %rdi
leaq 0x4(%rsp), %r14
movq %r14, %rdx
callq 0x6200
cmpl $0x0, (%r14)
jne 0x46e6
movq %rbx, (%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3122(%rip), %rdi      # 0x77f0
leaq 0x3127(%rip), %rsi      # 0x77fc
leaq 0x312b(%rip), %rcx      # 0x7807
movl $0x36, %edx
callq 0x10d0
leaq 0x3138(%rip), %rdi      # 0x7825
leaq 0x3108(%rip), %rsi      # 0x77fc
leaq 0x310c(%rip), %rcx      # 0x7807
movl $0x39, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rbx, %rdi
callq 0x1b54
movq %rax, %r12
movq 0x20(%r14), %rdi
movq %rax, %rsi
callq 0x6253
movq %rax, %r15
movq %r12, %rdi
callq 0x1040
testq %r15, %r15
jne 0x4745
movq (%r14), %r14
testq %r14, %r14
jne 0x4713
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x322b
testq %rax, %rax
je 0x50d8
xorl %r14d, %r14d
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x3216
cmpl $0x5, (%rax)
jne 0x50c8
cmpl $0x0, 0x10(%rax)
je 0x50c8
movq 0x8(%rax), %rdi
callq 0x1040
incq %r14
movq (%rbx), %rdi
callq 0x322b
cmpq %rax, %r14
jb 0x50a9
movq (%rbx), %rdi
callq 0x31af
movq 0x8(%rbx), %rdi
callq 0x31af
movq 0x10(%rbx), %rdi
callq 0x31af
movq 0x18(%rbx), %rdi
callq 0x31af
movq 0x30(%rbx), %rdi
callq 0x60aa
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x53f1
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x10e0
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, 0x10(%rsp)
testl %ebp, %ebp
jle 0x548d
xorl %r15d, %r15d
leaq 0x216f(%rip), %r14      # 0x7599
testl %r15d, %r15d
je 0x5446
movl $0x2, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x11b0
jmp 0x5453
movl $0x9, %edi
movq %rbx, %rsi
callq 0x10f0
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x546c
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x547a
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x54a8
incl %r15d
cmpl %r15d, %ebp
jne 0x542a
movl $0xa, %edi
movq %rbx, %rsi
callq 0x10f0
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rsi), %edi
cmpq $0x4, %rdi
ja 0x557e
movq %rsi, %r14
leaq 0x24e7(%rip), %rax      # 0x79ac
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10e0
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x553c
movq %rbx, %rsi
callq 0x10e0
jmp 0x5551
movq 0x8(%r14), %rdx
leaq 0x25ea(%rip), %rsi      # 0x7ae9
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1110
movl 0x8(%r14), %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5583
movl 0x8(%r14), %edx
leaq 0x25ba(%rip), %rsi      # 0x7ae5
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1110
movl 0x10(%r14), %edx
leaq 0x23fe(%rip), %rsi      # 0x7945
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1110
movl $0x28, %edi
movq %rbx, %rsi
callq 0x10f0
movl 0x14(%r14), %esi
movq %rbx, %rdi
callq 0x5583
movl $0x29, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10f0
callq 0x13b3
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
leaq 0x20(%rsp), %r15
xorl %eax, %eax
testl %edx, %edx
setne %al
movq 0x8(%rdi,%rax,8), %r14
movq %r14, %rdi
callq 0x322b
cmpq %rbx, %rax
ja 0x5600
movq %r14, %rdi
callq 0x31d0
testq %rax, %rax
jne 0x55c7
leaq 0x1a68(%rip), %rdi      # 0x7050
leaq 0x24bc(%rip), %rsi      # 0x7aab
leaq 0x2617(%rip), %rcx      # 0x7c0d
movl $0xc6, %edx
callq 0x10d0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3216
movl $0x1, (%rax)
leaq 0x8(%rax), %r14
movups (%r15), %xmm0
movups %xmm0, 0x8(%rax)
movq 0x10(%r15), %rcx
movq %rcx, 0x18(%rax)
movq 0x59ac(%rip), %r15      # 0xafd8
movq (%r15), %rdi
leaq 0x2620(%rip), %rsi      # 0x7c56
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
movq (%r15), %rdi
movq %r14, %rsi
callq 0x54a8
movq (%r15), %rsi
movl $0xa, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %eax, %eax
testl %edx, %edx
setne %al
movq 0x8(%rdi,%rax,8), %r14
movq 0x52c4(%rip), %rax      # 0xafd8
movq (%rax), %rdi
leaq 0x2090(%rip), %rsi      # 0x7dae
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
movq %r14, %rdi
callq 0x322b
cmpq %rbx, %rax
jb 0x5d51
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3216
cmpl $0x1, (%rax)
jne 0x5d70
addq $0x8, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2061(%rip), %rdi      # 0x7db9
leaq 0x1d4c(%rip), %rsi      # 0x7aab
leaq 0x2069(%rip), %rcx      # 0x7dcf
movl $0xd9, %edx
callq 0x10d0
leaq 0x1ab7(%rip), %rdi      # 0x782e
leaq 0x1d2d(%rip), %rsi      # 0x7aab
leaq 0x204a(%rip), %rcx      # 0x7dcf
movl $0xdf, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x5238(%rip), %rax      # 0xafd8
movq (%rax), %rdi
leaq 0x2069(%rip), %rsi      # 0x7e13
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
movq 0x18(%r14), %rdi
callq 0x322b
cmpq %rbx, %rax
jb 0x5dd9
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x3216
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2044(%rip), %rdi      # 0x7e24
leaq 0x1cc4(%rip), %rsi      # 0x7aab
leaq 0x2053(%rip), %rcx      # 0x7e41
movl $0xef, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
movq %rsi, (%rdi)
movl $0x8, %edi
callq 0x30b4
movq %rax, 0x8(%rbx)
movl $0x30, %edi
callq 0x30b4
movq %rax, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x31af
movq 0x10(%rbx), %rdi
callq 0x322b
testq %rax, %rax
je 0x5e6b
xorl %r14d, %r14d
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x3216
movq %rax, %rdi
callq 0x6062
incq %r14
movq 0x10(%rbx), %rdi
callq 0x322b
cmpq %rax, %r14
jb 0x5e46
movq 0x10(%rbx), %rdi
callq 0x31af
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x5e92
callq 0x6062
movq 0x18(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1040
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x5ee8
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x5ee8
movq %rdx, %rbx
movq %rsi, %rdx
cmpl $0x3, %ecx
je 0x5eee
cmpl $0x2, %ecx
jne 0x5efc
movq %rdi, %r14
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %rdx, %r15
callq *%rdx
movq 0x18(%r14), %rax
movq 0x18(%rax), %rdi
testq %rdi, %rdi
je 0x5ee8
movq %r15, %rcx
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rcx
popq %rbx
popq %r14
popq %r15
retq
movq 0x8(%rax), %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rdx
leaq 0x192b(%rip), %rdi      # 0x782e
leaq 0x1f86(%rip), %rsi      # 0x7e90
leaq 0x1f87(%rip), %rcx      # 0x7e98
movl $0x36, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
xorl %esi, %esi
callq 0x6074
movq %rax, 0x8(%rsp)
movl $0x8, %edi
callq 0x30b4
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, %rdi
callq 0x31d0
movq %r15, (%rax)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %r15
callq 0x322b
cmpq %rax, %r15
jae 0x5fc8
leaq 0x6a(%rip), %r15        # 0x5fea
leaq 0x8(%rsp), %r12
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x3216
movq %rax, %r13
incq 0x18(%rsp)
movq (%rax), %rdi
movq %rbx, %rsi
callq *%r14
movq (%r13), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5e9a
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %r13
callq 0x322b
cmpq %rax, %r13
jb 0x5f85
movq 0x10(%rsp), %rdi
callq 0x31af
movq 0x8(%rsp), %rdi
callq 0x60aa
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
movq (%rbx), %rsi
leaq 0xc(%rsp), %r15
movq %r15, %rdx
callq 0x6113
cmpl $0x0, (%r15)
jne 0x601e
movq 0x8(%r14), %rdi
callq 0x31d0
movq %rbx, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x322b
testq %rax, %rax
je 0x60fd
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x3216
movq %rax, %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x60e3
movq 0x8(%r15), %rdi
callq *%rax
movq 0x8(%r15), %rdi
callq 0x1040
incq %r14
movq 0x8(%rbx), %rdi
callq 0x322b
cmpq %rax, %r14
jb 0x60c5
movq 0x8(%rbx), %rdi
callq 0x31af
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x6166
testq %rax, %rax
je 0x6139
testq %r15, %r15
je 0x6160
movl $0x1, (%r15)
jmp 0x6160
testq %r15, %r15
je 0x6145
movl $0x0, (%r15)
movq 0x8(%rbx), %rdi
callq 0x31d0
movq %rax, %r15
movq %r14, (%rax)
movq (%rbx), %rdi
callq 0x1150
movq %rax, 0x8(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x6253
testq %rax, %rax
je 0x6226
testq %r15, %r15
je 0x624d
movl $0x1, (%r15)
jmp 0x624d
testq %r15, %r15
je 0x6232
movl $0x0, (%r15)
movq 0x8(%rbx), %rdi
callq 0x31d0
movq %rax, %r15
movq %r14, (%rax)
movq (%rbx), %rdi
callq 0x1150
movq %rax, 0x8(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x50, %edi
callq 0x1150
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x3c(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
testq %rdi, %rdi
je 0x6324
callq 0x391b
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x6332
callq 0x39d2
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x634e
callq 0x4767
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x6381
callq 0x62d1
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x636a
callq 0x1d03
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x63a0
callq 0x3871
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x6378
callq 0x31af
movq %rbx, %rdi
popq %rbx
jmp 0x1040
leaq 0x1b53(%rip), %rdi      # 0x7edb
leaq 0x1b56(%rip), %rsi      # 0x7ee5
leaq 0x1b54(%rip), %rcx      # 0x7eea
movl $0x37, %edx
callq 0x10d0
leaq 0x1b56(%rip), %rdi      # 0x7efd
leaq 0x1b37(%rip), %rsi      # 0x7ee5
leaq 0x1b35(%rip), %rcx      # 0x7eea
movl $0x3e, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x20, %edi
callq 0x30b4
movq %rax, 0x10(%r14)
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x1790
movq %rax, %r15
movq %rsp, %r12
movq 0x4bdf(%rip), %r13      # 0xafd8
movq %r12, %rdi
movq %r15, %rsi
callq 0x17c8
movq (%r13), %rdi
movq %r12, %rsi
callq 0x1b9c
movl $0xa, %edi
callq 0x1050
movq 0x10(%r14), %rdi
callq 0x31d0
testq %rax, %rax
je 0x647f
movups (%rsp), %xmm0
movups 0x10(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
cmpl $0x1f, (%rsp)
jne 0x63f9
movq %r15, %rdi
callq 0x17c3
xorl %eax, %eax
callq 0x3860
movq %rax, 0x18(%r14)
movq 0x10(%r14), %rdi
movq %rax, %rsi
callq 0x1cbc
movq %rax, 0x20(%r14)
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1d1f
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1af2(%rip), %rdi      # 0x7f78
leaq 0x1a58(%rip), %rsi      # 0x7ee5
leaq 0x1ae9(%rip), %rcx      # 0x7f7d
movl $0x53, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/tunstall/tunstall.hpp
// Function: Tunstall::getProbabilities(unsigned char*, int)
void Tunstall::getProbabilities(unsigned char *data, int size) {

//#define DEBUG_ENTROPY
#ifdef DEBUG_ENTROPY
	double e = 0;
#endif
	probabilities.clear();

	std::vector<int> probs(256, 0);
	for(int i = 0; i < size; i++)
		probs[data[i]]++;
//	int max = 0;
	for(size_t i = 0; i < probs.size(); i++) {
		if(probs[i] > 0) {
//			max = i;
			//TODO scaling probabilities to MAX would result in better accuracy (compression)?


#ifdef DEBUG_ENTROPY
			double p = probs[i]/(double)size;
			e -= p * log2(p);
			cout << (char)(i + 65) << " P: " << p << endl;
#endif
			probabilities.push_back(Symbol(i, probs[i]*255/size));
		}
	}

	std::sort(probabilities.begin(), probabilities.end(),
			  [](const Symbol &a, const Symbol &b)->bool { return a.probability > b.probability; });
#ifdef DEBUG_ENTROPY
	cout << "Entropy: " << e << " theorical compression: " << e*size/8 << endl;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0x244d
movq %rax, 0x18(%r14)
movl $0x400, %edi            # imm = 0x400
callq 0x2170
movq %rax, %rbx
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
xorl %esi, %esi
callq 0x20c0
testl %ebp, %ebp
jle 0x2481
movl %ebp, %eax
xorl %ecx, %ecx
movzbl (%r15,%rcx), %edx
incl (%rbx,%rdx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x2471
leaq 0x10(%r14), %r15
xorl %r13d, %r13d
leaq 0x6(%rsp), %r12
movl (%rbx,%r13,4), %ecx
testl %ecx, %ecx
jle 0x24cc
movl %ecx, %eax
shll $0x8, %eax
subl %ecx, %eax
cltd
idivl %ebp
movb %r13b, 0x6(%rsp)
movb %al, 0x7(%rsp)
movq 0x18(%r14), %rsi
cmpq 0x20(%r14), %rsi
je 0x24c1
movzwl 0x6(%rsp), %eax
movw %ax, (%rsi)
addq $0x2, 0x18(%r14)
jmp 0x24cc
movq %r15, %rdi
movq %r12, %rdx
callq 0x43f4
incq %r13
cmpq $0x100, %r13            # imm = 0x100
jne 0x248d
movq 0x10(%r14), %r12
movq 0x18(%r14), %r14
cmpq %r14, %r12
je 0x2560
movq %r14, %r15
subq %r12, %r15
movq %r15, %rax
sarq %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x3d6c
cmpq $0x21, %r15
jl 0x2555
leaq 0x20(%r12), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x3fec
cmpq %r14, %r15
je 0x2560
movzwl (%r15), %eax
movl %eax, %ecx
shrl $0x8, %ecx
movq %r15, %rdx
cmpb %cl, -0x1(%r15)
jae 0x254c
movq %r15, %rsi
leaq -0x2(%rsi), %rdx
movzwl -0x2(%rsi), %edi
movw %di, (%rsi)
cmpb %cl, -0x3(%rsi)
movq %rdx, %rsi
jb 0x2539
movw %ax, (%rdx)
addq $0x2, %r15
jmp 0x251f
movq %r12, %rdi
movq %r14, %rsi
callq 0x3fec
movq %rbx, %rdi
callq 0x2160
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2160
movq %r14, %rdi
callq 0x2280
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/tunstall/tunstall.hpp
// Function: Tunstall::setProbabilities(float*, int)
void Tunstall::setProbabilities(float *probs, int n_symbols) {
	probabilities.clear();
	for(int i = 0; i < n_symbols; i++) {
		if(probs[i] <= 0) continue;
		probabilities.push_back(Symbol(i, probs[i]*255));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0x25a9
movq %rax, 0x18(%r14)
testl %edx, %edx
jle 0x2618
leaq 0x10(%r14), %r15
movl %edx, %r13d
xorl %ebp, %ebp
xorps %xmm1, %xmm1
movss 0x3a43(%rip), %xmm2     # 0x6004
leaq 0x6(%rsp), %r12
movss (%rbx,%rbp,4), %xmm0
ucomiss %xmm0, %xmm1
jae 0x2610
mulss %xmm2, %xmm0
cvttss2si %xmm0, %eax
movb %bpl, 0x6(%rsp)
movb %al, 0x7(%rsp)
movq 0x18(%r14), %rsi
cmpq 0x20(%r14), %rsi
je 0x25fa
movzwl 0x6(%rsp), %eax
movw %ax, (%rsi)
addq $0x2, 0x18(%r14)
jmp 0x2610
movq %r15, %rdi
movq %r12, %rdx
callq 0x43f4
movss 0x39f7(%rip), %xmm2     # 0x6004
xorps %xmm1, %xmm1
incq %rbp
cmpq %rbp, %r13
jne 0x25c6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/tunstall/tunstall.hpp
// Function: Tunstall::decompress(unsigned char*, int, unsigned char*, int)
void Tunstall::decompress(unsigned char *data, int input_size, unsigned char *output, int output_size) {
	unsigned char *end_output = output + output_size;
	unsigned char *end_data = data + input_size -1;
	if(probabilities.size() == 1) {
		memset(output, probabilities[0].symbol, output_size);
		return;
	}
	//index.push_back(index.back() + lengths.back()); //TODO WHY?
	while(data < end_data) {
		int symbol = *data++;
		int start = index[symbol];
		int length = lengths[symbol];
		//int length = index[symbol+1] - start;
		memcpy(output, &table[start], length);
		output += length;
	}
	//last symbol might override so we check.
	int symbol = *data;
	int start = index[symbol];
	int length = (*end_output - *output);
	//cout << (end_output - output) << endl;
	//cout << (*end_output - *output) << endl;
	memcpy(output, &table[start], length);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movslq %r8d, %r8
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
subq %rax, %rcx
cmpq $0x2, %rcx
jne 0x35f4
movzbl (%rax), %esi
movq %r14, %rdi
movq %r8, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20c0
movq %rsi, %r12
movq %rdi, %rbx
movq %r8, (%rsp)
movslq %edx, %r15
leaq (%rsi,%r15), %rax
decq %rax
cmpq %rsi, %rax
jbe 0x3647
decq %r15
movq %r14, %r13
movzbl (%r12), %eax
incq %r12
shll $0x2, %eax
movq 0x28(%rbx), %rcx
movq 0x40(%rbx), %rdx
movslq (%rcx,%rax), %rsi
movslq (%rdx,%rax), %rbp
addq 0x58(%rbx), %rsi
movq %r13, %rdi
movq %rbp, %rdx
callq 0x2120
addq %rbp, %r13
decq %r15
jne 0x3613
jmp 0x364a
movq %r14, %r13
movzbl (%r12), %eax
movq 0x28(%rbx), %rcx
movslq (%rcx,%rax,4), %rsi
movq (%rsp), %rax
movzbl (%r14,%rax), %edx
movzbl (%r13), %eax
addq 0x58(%rbx), %rsi
subq %rax, %rdx
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/tunstall/readfile.hpp
// Function: readchar2buf(char const*, unsigned char*&, unsigned int*)
int readchar2buf(const char* path, unsigned char*& buf, unsigned int* length)
{
	ifstream inFile;
	inFile.open(path, ios::in|ios::binary|ios::ate);
	if (!inFile.is_open()) return 0;

	inFile.seekg(0, ios::end);
	unsigned int size = inFile.tellg();
	inFile.seekg(0, ios::beg);

	buf = new unsigned char[size+1];
	inFile.read((char*)buf, size);
	buf[size] = '\0';
	*length = strlen((char*)buf);

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x2190
movq %r12, %rdi
movq %r15, %rsi
movl $0xe, %edx
callq 0x20e0
leaq 0x80(%rsp), %rdi
callq 0x2040
xorl %ebp, %ebp
testb %al, %al
je 0x37e9
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21e0
leaq 0x8(%rsp), %rdi
callq 0x2270
movq %rax, %r15
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21e0
leal 0x1(%r15), %edi
callq 0x2030
movq %rax, (%r14)
movl %r15d, %r15d
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x21c0
movq (%r14), %rax
movb $0x0, (%rax,%r15)
movq (%r14), %rdi
callq 0x20a0
movl %eax, (%rbx)
movl $0x1, %ebp
leaq 0x8(%rsp), %rdi
callq 0x2050
movl %ebp, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3809
jmp 0x3809
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/tunstall/readfile.hpp
// Function: readint2buf(char const*, unsigned char*&, unsigned int*)
int readint2buf(const char* path, unsigned char*& buf, unsigned int* length)
{
	int tmp;
	unsigned int cnt = 0;
	ifstream inFile;

	inFile.open(path);
	if (!inFile.is_open()) return 0;

	*length = 0;
	while (inFile >> tmp) (*length) = (*length)+1;
	inFile.seekg(0, ios::beg);

	buf = new unsigned char[(*length)+1];
	while (inFile >> tmp) buf[cnt++] = tmp;
	buf[cnt] = '\0';

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x2190
movq %r12, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x20e0
leaq 0x80(%rsp), %rdi
callq 0x2040
xorl %ebp, %ebp
testb %al, %al
je 0x38f5
xorl %eax, %eax
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %r12
movl %eax, (%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x20d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3899
movl (%r14), %eax
incl %eax
jmp 0x3876
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21e0
movl (%r14), %edi
incl %edi
callq 0x2030
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x8(%rsp), %r14
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x20d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
movl %ebp, %eax
jne 0x38e9
movb 0x4(%rsp), %cl
movq (%rbx), %rdx
incl %ebp
movb %cl, (%rdx,%rax)
jmp 0x38c0
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
movl $0x1, %ebp
leaq 0x8(%rsp), %rdi
callq 0x2050
movl %ebp, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3915
jmp 0x3915
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_c_makefile_star2_O1/vanhauser-thc[P]vulntest/double_free.cpp
// Function: DF_01::otherx()
void otherx() {
  FoobarClass otherxClassObject("One");

  /* FLAW: There is no copy constructor in the class - this will cause a double
   * free in the destructor */
  FoobarClass otherxClassObjectCopy(otherxClassObject);

  otherxClassObjectCopy.printData();
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xe4c(%rip), %rsi       # 0x2004
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x1226
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x10a0
testq %rbx, %rbx
je 0x11dd
movq %rbx, %rdi
callq 0x1090
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11ec
callq 0x1090
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/vanhauser-thc[P]vulntest/double_free.cpp
// Function: main
int main(int argc, char *argv[]) {
  /* seed randomness */
  srand((unsigned)time(NULL));
  printf("Calling otherx()...");
  otherx();
  printf("Finished otherx()");
  return 0;
}

// Assembly:
pushq %rax
xorl %edi, %edi
callq 0x1060
movl %eax, %edi
callq 0x1080
leaq 0xe00(%rip), %rdi       # 0x2008
xorl %eax, %eax
callq 0x1040
callq 0x11ac
leaq 0xe01(%rip), %rdi       # 0x201c
xorl %eax, %eax
callq 0x1040
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/vanhauser-thc[P]vulntest/double_free.cpp
// Function: DF_01::FoobarClass::FoobarClass(char const*)
FoobarClass(const char *data) {
    if (data) {
      this->data = new char[strlen(data) + 1];
      strcpy(this->data, data);
    } else {
      this->data = new char[1];
      *(this->data) = '\0';
    }
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x125b
movq %rsi, %r14
movq %rsi, %rdi
callq 0x1050
leaq 0x1(%rax), %rdi
callq 0x1030
movq %rax, (%rbx)
movq %rax, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1070
movl $0x1, %edi
callq 0x1030
movq %rax, (%rbx)
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/CSerxzm[P]WindowstoLinuxInterface/src/COPY.c
// Function: main
int main(int argc, char** argv){
    char lines[argc+1][255];
    predealLine(argc, argv, lines);
    char* srcname = lines[1];
    char* dstname = lines[2];
    char option[5];
    FILE *src, *dst;
	
	if(access(srcname, F_OK)==-1) {
		printf("源文件不存在\n");
		return 0;
    }
    if(!access(dstname, F_OK)) {
        while(1) {
            printf("覆盖 %s 吗?(Yes/No/All):", dstname);
            scanf("%s", option);
            if(strcmp("No", option) == 0) {
                printf("已复制 0 个文件\n");
                return 0;
            } 
            else if(strcmp("Yes", option) == 0) {
                break;
            }
        }
    }
    src = fopen(srcname, "rb");
    dst = fopen(dstname, "wb");
    int bufferLen = 1024;
    int readCount = 0;
    char *buffer = (char*)malloc(bufferLen);
    while((readCount=fread(buffer, 1, bufferLen, src)) > 0) {
        fwrite(buffer, readCount, 1, dst);
    }
    printf("已复制 1 个文件\n");
    free(buffer);
    fclose(src);
    fclose(dst);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leal 0x1(%rdi), %eax
movq %rax, %rcx
shlq $0x8, %rcx
subq %rax, %rcx
addq $0xf, %rcx
movabsq $0x1fffffffff0, %r14    # imm = 0x1FFFFFFFFF0
andq %rcx, %r14
movq %rsp, %r15
movq %r15, %rbx
subq %r14, %rbx
movq %rbx, %rsp
movq %rbx, %rdx
callq 0x11fc
negq %r14
addq %r15, %r14
addq $0xff, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x10a0
cmpl $-0x1, %eax
je 0x1450
addq $0x1fe, %rbx            # imm = 0x1FE
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10a0
testl %eax, %eax
jne 0x13b9
leaq 0xc8f(%rip), %r15       # 0x2004
leaq 0xca4(%rip), %r12       # 0x2020
leaq -0x2d(%rbp), %r13
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1080
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x10c0
movzwl -0x2d(%rbp), %eax
xorl $0x6f4e, %eax           # imm = 0x6F4E
movzbl -0x2b(%rbp), %ecx
orw %ax, %cx
je 0x1459
cmpl $0x736559, -0x2d(%rbp)  # imm = 0x736559
jne 0x1380
leaq 0xc6a(%rip), %rsi       # 0x202a
movq %r14, %rdi
callq 0x10b0
movq %rax, %r14
leaq 0xc5b(%rip), %rsi       # 0x202d
movq %rbx, %rdi
callq 0x10b0
movq %rax, %rbx
movl $0x400, %edi            # imm = 0x400
callq 0x1090
movq %rax, %r15
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
movq %r14, %rcx
callq 0x1050
testl %eax, %eax
jle 0x142a
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x10d0
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
jmp 0x13f7
leaq 0xc15(%rip), %rdi       # 0x2046
callq 0x1040
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1060
movq %rbx, %rdi
callq 0x1060
jmp 0x1465
leaq 0xc05(%rip), %rdi       # 0x205c
jmp 0x1460
leaq 0xbd0(%rip), %rdi       # 0x2030
callq 0x1040
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/motet-a[P]libforks/tests/sigkill_parent_process.c
// Function: main
int main() {
  check(pipe(pipe_fds) == 0);

  pid_t child_pid = fork();
  check(child_pid != -1);
  if (child_pid == 0) {
    check(close(pipe_fds[0]) == 0);
    parent_main();
    abort();
  }

  check(close(pipe_fds[1]) == 0);

  pid_t serv_pid;
  check(read(pipe_fds[0], &serv_pid, sizeof serv_pid) == sizeof serv_pid);

  check(kill(child_pid, SIGKILL) == 0);

  int wait_status;
  check(wait(&wait_status) == child_pid);
  check(WIFSIGNALED(wait_status));
  check(WTERMSIG(wait_status) == SIGKILL);

  while (true) {
    if (kill(serv_pid, 0) == -1) {
      check(errno == ESRCH);
      break;
    }
  }

  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x4de4(%rip), %rdi      # 0x611c
callq 0x10e0
testl %eax, %eax
jne 0x1404
callq 0x1200
testl %eax, %eax
je 0x1415
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x1432
movl 0x4dbd(%rip), %edi      # 0x6120
callq 0x10c0
testl %eax, %eax
jne 0x1443
movl 0x4da6(%rip), %edi      # 0x611c
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq 0x10f0
cmpq $0x4, %rax
jne 0x1454
movl %ebx, %edi
movl $0x9, %esi
callq 0x1150
testl %eax, %eax
jne 0x1465
leaq 0x8(%rsp), %rdi
callq 0x11f0
cmpl %ebx, %eax
jne 0x1476
movl 0x8(%rsp), %eax
andl $0x7f, %eax
movl %eax, %ecx
shll $0x18, %ecx
addl $0x1000000, %ecx        # imm = 0x1000000
cmpl $0x1ffffff, %ecx        # imm = 0x1FFFFFF
jle 0x1487
cmpl $0x9, %eax
jne 0x1498
movl 0xc(%rsp), %ebx
movl %ebx, %edi
xorl %esi, %esi
callq 0x1150
cmpl $-0x1, %eax
jne 0x13e0
callq 0x1050
cmpl $0x3, (%rax)
jne 0x14a9
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x1bf9(%rip), %rdi      # 0x3004
movl $0x10, %esi
callq 0x14cb
movl 0x4d01(%rip), %edi      # 0x611c
callq 0x10c0
testl %eax, %eax
jne 0x14ba
callq 0x14f6
callq 0x1040
leaq 0x1bfe(%rip), %rdi      # 0x3037
movl $0x13, %esi
callq 0x14cb
leaq 0x1c15(%rip), %rdi      # 0x305f
movl $0x1a, %esi
callq 0x14cb
leaq 0x1c1c(%rip), %rdi      # 0x3077
movl $0x1d, %esi
callq 0x14cb
leaq 0x1c4c(%rip), %rdi      # 0x30b8
movl $0x1f, %esi
callq 0x14cb
leaq 0x1c59(%rip), %rdi      # 0x30d6
movl $0x22, %esi
callq 0x14cb
leaq 0x1c68(%rip), %rdi      # 0x30f6
movl $0x23, %esi
callq 0x14cb
leaq 0x1c70(%rip), %rdi      # 0x310f
movl $0x24, %esi
callq 0x14cb
leaq 0x1c80(%rip), %rdi      # 0x3130
movl $0x28, %esi
callq 0x14cb
leaq 0x1b86(%rip), %rdi      # 0x3047
movl $0x15, %esi
callq 0x14cb
// File: /workspace/github_c_makefile_star2_O1/motet-a[P]libforks/tests/sigkill_parent_process.c
// Function: parent_main
static void parent_main(void) {
  libforks_ServerConn conn;
  check(libforks_start(&conn) == libforks_OK);

  pid_t serv_pid = libforks_get_server_pid(conn);
  check(write(pipe_fds[1], &serv_pid, sizeof serv_pid) == sizeof serv_pid);

  sleep(999);
}

// Assembly:
subq $0x18, %rsp
leaq 0x8(%rsp), %rdi
callq 0x18cf
testl %eax, %eax
jne 0x153e
movq 0x8(%rsp), %rdi
callq 0x2320
leaq 0x14(%rsp), %rsi
movl %eax, (%rsi)
movl 0x4c01(%rip), %edi      # 0x6120
movl $0x4, %edx
callq 0x1080
cmpq $0x4, %rax
jne 0x154f
movl $0x3e7, %edi            # imm = 0x3E7
callq 0x11e0
addq $0x18, %rsp
retq
leaq 0x1c16(%rip), %rdi      # 0x315b
movl $0x7, %esi
callq 0x14cb
leaq 0x1c2a(%rip), %rdi      # 0x3180
movl $0xa, %esi
callq 0x14cb
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.1/shm.c
// Function: main
int main ()
{
  int segment_id;
  char* shared_memory;
  struct shmid_ds shmbuffer;
  int segment_size;
  const int shared_segment_size = 0x6400;

  /* Allocate a shared memory segment. */
  segment_id = shmget ( IPC_PRIVATE, shared_segment_size,
                        IPC_CREAT | IPC_EXCL | S_IRUSR | S_IWUSR);
  /* Attach the shared memory segment. */
  shared_memory = (char*) shmat (segment_id, 0, 0);
  printf ("shared memory attached at address %p\n", shared_memory);
  /* Determine the segment’s size. */
  shmctl (segment_id, IPC_STAT, &shmbuffer);
  segment_size = shmbuffer.shm_segsz;
  printf ("segment size: %d\n", segment_size);
  /* Write a string to the shared memory segment. */
  sprintf (shared_memory, "Hello, world.");
  /* Detach the shared memory segment. */
  shmdt (shared_memory);

  /* Reattach the shared memory segment, at a different address. */
  shared_memory = (char*) shmat (segment_id, (void*) 0x5000000, 0);
  printf ("shared memory reattached at address %p\n", shared_memory);
  /* Print out the string from shared memory. */
  printf ("%s\n", shared_memory);
  /* Detach the shared memory segment. */
  shmdt (shared_memory);

  /* Deallocate the shared memory segment. */
  shmctl (segment_id, IPC_RMID, 0);

  return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl $0x6400, %esi           # imm = 0x6400
xorl %edi, %edi
movl $0x780, %edx            # imm = 0x780
callq 0x1080
movl %eax, %ebx
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1070
movq %rax, %r14
leaq 0xe43(%rip), %rdi       # 0x2004
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
leaq -0x88(%rbp), %r15
movl %ebx, %edi
movl $0x2, %esi
movq %r15, %rdx
callq 0x1060
movl 0x30(%r15), %esi
leaq 0xe3e(%rip), %rdi       # 0x202a
xorl %eax, %eax
callq 0x1050
movabsq $0x77202c6f6c6c6548, %rax # imm = 0x77202C6F6C6C6548
movq %rax, (%r14)
movabsq $0x2e646c726f7720, %rax # imm = 0x2E646C726F7720
movq %rax, 0x6(%r14)
movq %r14, %rdi
callq 0x1040
movl $0x5000000, %esi        # imm = 0x5000000
movl %ebx, %edi
xorl %edx, %edx
callq 0x1070
movq %rax, %r14
leaq 0xe1c(%rip), %rdi       # 0x204a
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq %r14, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1040
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1060
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/veltzer[P]xmeltdown/src/xmeltdown.c
// Function: calc_xloc
int calc_xloc(int width) {
	int xloc;
	/* give values near edges a better chance */
	xloc=rnd(DisplayWidth(dpy, screen)+MIN_WIDTH)-MIN_WIDTH;
	if ((xloc+width) > DisplayWidth(dpy, screen))
		xloc=DisplayWidth(dpy, screen)-width;
	else if (xloc < 0)
		xloc=0;
	return xloc;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x1130
movq 0x28a6(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x28a0(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
movslq 0x18(%rcx,%rdx), %rcx
movq %rcx, %rsi
addq $0x1e, %rsi
cqto
idivq %rsi
leal -0x1e(%rdx), %esi
addl %ebx, %edx
addl $-0x1e, %edx
movl %ecx, %edi
subl %ebx, %edi
xorl %eax, %eax
testl %esi, %esi
cmovgl %esi, %eax
cmpl %ecx, %edx
cmovgl %edi, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_05/strncpy.c
// Function: main
int main(void)
{
  char s[100] = "This is the first string";
  char *t = "Test is the second string, that is cool";
  size_t nr_chars = 26;

  strcpy_ptr(s, t, nr_chars);

  puts(s);

  return 0;
}

// Assembly:
subq $0x68, %rsp
leaq 0xec9(%rip), %rsi       # 0x2010
movq %rsp, %rax
movl $0xc, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl $0x0, 0x60(%rax)
movups 0xf11(%rip), %xmm0      # 0x2074
movaps %xmm0, (%rax)
movups 0xf11(%rip), %xmm0      # 0x207e
movups %xmm0, 0xa(%rax)
movq %rax, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x68, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/openshmem-org[P]openshmem-examples/c++/buffon.cxx
// Function: buffon_laplace_simulate(double, double, double, int)
int
buffon_laplace_simulate(double a, double b, double l, int trial_num)
{
    double angle;
    int hits;
    int trial;
    double x1;
    double x2;
    double y1;
    double y2;

    hits = 0;

    for (trial = 1; trial <= trial_num; ++trial) {
        //
        // Randomly choose the location of the eye of the needle in
        // [0,0]x[A,B],
        // and the angle the needle makes.
        //
        x1 = a * (double) rand() / (double) RAND_MAX;
        y1 = b * (double) rand() / (double) RAND_MAX;
        angle = 2.0 * PI * (double) rand() / (double) RAND_MAX;
        //
        // Compute the location of the point of the needle.
        //
        x2 = x1 + l * cos(angle);
        y2 = y1 + l * sin(angle);
        //
        // Count the end locations that lie outside the cell.
        //
        if (x2 <= 0.0 || a <= x2 || y2 <= 0.0 || b <= y2) {
            ++hits;
        }
    }
    return hits;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x20(%rsp)
testl %edi, %edi
jle 0x1338
movl %edi, %ebx
xorl %ebp, %ebp
callq 0x1040
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0x20(%rsp), %xmm1
movsd 0xd7c(%rip), %xmm0      # 0x2008
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x1040
movl %eax, %r14d
callq 0x1040
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0xd5e(%rip), %xmm0      # 0x2010
divsd 0xd4e(%rip), %xmm0      # 0x2008
movsd %xmm0, 0x28(%rsp)
callq 0x1100
mulsd 0x18(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x1030
movsd 0x8(%rsp), %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
jae 0x132c
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
mulsd 0x10(%rsp), %xmm1
divsd 0xd00(%rip), %xmm1      # 0x2008
ucomisd 0x20(%rsp), %xmm2
jae 0x132c
mulsd 0x18(%rsp), %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x132c
ucomisd 0x10(%rsp), %xmm0
jb 0x132e
incl %ebp
decl %ebx
jne 0x1272
jmp 0x133a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq