LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do_begin
static int compiler_do_begin(compiler_t *comp, ast_t *body, ins_t *ins)
{
    while (body->kind == AST_CONS && AST_CONS_CDR(body)->kind != AST_END_OF_CONS) {
        ast_t *expr = AST_CONS_CAR(body);
        if (compiler_do(comp, expr, ins) == ERR)
            return ERR;
        ins_push(ins, bc_pop_new());
        body = AST_CONS_CDR(body);
    }
    return compiler_do(comp, AST_CONS_CAR(body), ins);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x1, (%r15)
jne 0x4976
movq 0x18(%r15), %rax
cmpl $0x2, (%rax)
je 0x4976
movq 0x10(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4e26
testl %eax, %eax
je 0x498a
callq 0x44f7
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
movq 0x18(%r15), %r15
jmp 0x493e
movq 0x10(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x4e26
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do_set
static int compiler_do_set(compiler_t *comp, ast_t *body, ins_t *ins)
{
    ast_t *var = AST_CONS_CAR(body);
    ast_t *expr = AST_CONS_CAR( AST_CONS_CDR(body) );
    if (is_valof_form(var)) {
        if (compiler_do(comp, expr, ins) == ERR)
            return ERR;
        if (compiler_do(comp, AST_CONS_CADR(var), ins) == ERR)
            return ERR;
        ins_push(ins, bc_aset_new());
        return OK;
    }

    bytecode_t *bc = NULL;
    int i = 0, j = 0;
    char *name = AST_IDENT_NAME(var);
    if (env_locate(comp->env, name, &i, &j) == OK) {
        /* In the current lexical environment */
        bc = bc_set_new(i, j, name);
    } else if (env_locate(comp->global_env, name, &i, &j) == OK) {
        /* In the global environment */
        bc = bc_gset_new(i, j, name);
    } else {
        /* Define in current lexical environment */
        env_push(comp->env, name, NULL, NULL, NULL);
        bc = bc_set_new(-1, -1, name);
    }
    if (compiler_do(comp, expr, ins) == ERR)
        return ERR;
    ins_push(ins, bc);
    return OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %r12
movq 0x18(%rsi), %rax
movq 0x10(%rax), %r15
movq %r12, %rdi
callq 0x571a
testl %eax, %eax
je 0x4a00
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4e26
xorl %ebp, %ebp
testl %eax, %eax
je 0x4aa7
movq 0x18(%r12), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4e26
testl %eax, %eax
je 0x4aa7
callq 0x440f
movq %rbx, %rdi
movq %rax, %rsi
jmp 0x4a9b
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x8(%rsp), %rcx
andl $0x0, (%rcx)
movq 0x10(%r12), %rax
movq (%rax), %r12
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x5399
cmpl $0x1, %eax
jne 0x4a33
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
jmp 0x4a78
movq 0x10(%r14), %rdi
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r12, %rsi
callq 0x5399
cmpl $0x1, %eax
jne 0x4a60
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
movq %r12, %rdx
callq 0x448c
jmp 0x4a80
movq 0x8(%r14), %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x52d2
pushq $-0x1
popq %rdi
movl %edi, %esi
movq %r12, %rdx
callq 0x4545
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4e26
testl %eax, %eax
je 0x4aa5
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5de3
pushq $0x1
popq %rbp
jmp 0x4aa7
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do_if
static int compiler_do_if(compiler_t *comp, ast_t *body, ins_t *ins)
{
    ast_t *pred = AST_CONS_CAR(body);
    ast_t *p = AST_CONS_CAR( AST_CONS_CDR(body) );
    ast_t *e = AST_CONS_CAR( AST_CONS_CDR( AST_CONS_CDR(body) ) );
    if (compiler_do(comp, pred, ins) == ERR)
        return ERR;
    bytecode_t *label_else = compiler_mklabel(comp);
    bytecode_t *label_end = compiler_mklabel(comp);
    ins_push(ins, bc_fjump_new(label_else));
    if (compiler_do(comp, p, ins) == ERR)
        return ERR;
    ins_push(ins, bc_jump_new(label_end));
    ins_push(ins, label_else);
    if (compiler_do(comp, e, ins) == ERR)
        return ERR;
    ins_push(ins, label_end);
    ins_push(ins, bc_nope_new());
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rax
movq 0x18(%rsi), %rcx
movq 0x10(%rcx), %r15
movq 0x18(%rcx), %rcx
movq 0x10(%rcx), %r12
movq %rax, %rsi
callq 0x4e26
xorl %ebp, %ebp
testl %eax, %eax
je 0x4b7b
movq %r12, (%rsp)
movq %r14, %rdi
callq 0x50d4
movq %rax, %r13
movq %r14, %rdi
callq 0x50d4
movq %rax, %r12
movq %r13, %rdi
callq 0x444d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4e26
testl %eax, %eax
je 0x4b7b
movq %r12, %rdi
callq 0x44b0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5de3
movq %r14, %rdi
movq (%rsp), %rsi
movq %rbx, %rdx
callq 0x4e26
testl %eax, %eax
je 0x4b7b
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5de3
callq 0x44ef
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do_lambda
static int compiler_do_lambda(compiler_t *comp, ast_t *body, ins_t *ins)
{
    ast_t *pars = AST_CONS_CAR(body);
    body = AST_CONS_CDR(body);
    int arity = compiler_extend_scope(comp, pars);
    ins_t *code = ins_new();
    ins_push(code, bc_args_new(arity));
    if (compiler_do_begin(comp, body, code) == ERR) {
        compiler_exit_scope(comp);
        return ERR;
    }
    ins_push(code, bc_return_new());
    compiler_exit_scope(comp);
    code = compiler_assemby(comp, code);
    value_t *f = value_ucf_new(arity, code);
    ins_push(ins, bc_push_new(f));
    ins_push(ins, bc_func_new());
    return OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %r13
movq 0x18(%rsi), %r12
movq 0x8(%rdi), %rdi
callq 0x5297
movq %rax, 0x8(%r14)
xorl %r15d, %r15d
cmpl $0x1, (%r13)
jne 0x4bde
movq 0x10(%r13), %rax
movq 0x8(%r14), %rdi
movq 0x10(%rax), %rax
movq (%rax), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x52d2
movq 0x18(%r13), %r13
incl %r15d
jmp 0x4bb3
callq 0x5dbb
movq %rax, %r13
movl %r15d, %edi
callq 0x43ff
movq %r13, %rdi
movq %rax, %rsi
callq 0x5de3
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x4930
testl %eax, %eax
je 0x4c65
callq 0x453d
movq %r13, %rdi
movq %rax, %rsi
callq 0x5de3
movq 0x8(%r14), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%r14)
movq %r14, %rdi
movq %r13, %rsi
callq 0x5020
movl %r15d, %edi
movq %rax, %rsi
callq 0x25ad
movq %rax, %rdi
callq 0x4507
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
callq 0x4463
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
pushq $0x1
popq %rax
jmp 0x4c73
movq 0x8(%r14), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%r14)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do_dset
static int compiler_do_dset(compiler_t *comp, ast_t *body, ins_t *ins)
{
    ast_t *var = AST_CONS_CAR(body);
    ast_t *expr = AST_CONS_CAR( AST_CONS_CDR(body) );
    if (compiler_do(comp, expr, ins) == ERR)
        return ERR;
    ins_push(ins, bc_dset_new(AST_IDENT_NAME(var)));
    return OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x10(%rsi), %r14
movq 0x18(%rsi), %rax
movq 0x10(%rax), %rsi
callq 0x4e26
testl %eax, %eax
je 0x4cd9
movq 0x10(%r14), %rax
movq (%rax), %rdi
callq 0x443b
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
pushq $0x1
popq %rax
jmp 0x4cdb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do_define
static int compiler_do_define(compiler_t *comp, ast_t *body, ins_t *ins)
{
    /* 构造符合set语法的表达式并再次编译 */
    ast_t *name = AST_CONS_CAR(body);
    ast_t *lpart = AST_CONS_CDR(body);
    ast_t *lexpr = ast_cons_new(ast_ident_new("lambda"), lpart);
    ast_t *sexpr = ast_cons_new(name, ast_cons_new(lexpr, ast_eoc_new()));
    return compiler_do_set(comp, sexpr, ins);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %r15
movq 0x18(%rsi), %r12
leaq 0x16e3(%rip), %rdi      # 0x63e3
callq 0x5587
movq %rax, %rdi
movq %r12, %rsi
callq 0x555b
movq %rax, %r12
callq 0x557d
movq %r12, %rdi
movq %rax, %rsi
callq 0x555b
movq %r15, %rdi
movq %rax, %rsi
callq 0x555b
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4992
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do_refof
static int compiler_do_refof(compiler_t *comp, ast_t *body, ins_t *ins)
{
    ast_t *var = AST_CONS_CAR(body);
    if (var->kind != AST_IDENTIFIER) {
        string_printf(comp->error, "Line %d, column %d: Operand of & must be an identifier", var->line, var->column);
        return ERR;
    }
    ins_push(ins, bc_addr_new(AST_IDENT_NAME(var)));
    return OK;
}

// Assembly:
pushq %rbx
movq 0x10(%rsi), %rax
cmpl $0x4, (%rax)
jne 0x4d70
movq %rdx, %rbx
movq 0x10(%rax), %rax
movq (%rax), %rdi
callq 0x43c8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
pushq $0x1
popq %rbx
jmp 0x4d8a
movq 0x30(%rdi), %rdi
movl 0x4(%rax), %edx
movl 0x8(%rax), %ecx
leaq 0x16b5(%rip), %rsi      # 0x6436
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x5cd4
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do_trace
static int compiler_do_trace(compiler_t *comp, ast_t *body, ins_t *ins)
{
    ast_t *expr = AST_CONS_CAR(body);
    if (compiler_do(comp, expr, ins) == ERR)
        return ERR;
    ident_t *id = NULL;
    if (expr->kind == AST_IDENTIFIER)
        id = ident_intern(AST_IDENT_NAME(expr));
    ins_push(ins, bc_trace_new(id));
    return OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x10(%rsi), %r14
movq %r14, %rsi
callq 0x4e26
testl %eax, %eax
je 0x4de6
cmpl $0x4, (%r14)
jne 0x4dea
movq 0x10(%r14), %rax
movq (%rax), %rdi
callq 0x27bc
movq %rax, %rdi
jmp 0x4dec
xorl %eax, %eax
jmp 0x4dff
xorl %edi, %edi
callq 0x4569
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_do
int compiler_do(compiler_t *comp, ast_t *ast, ins_t *ins)
{
    assert(ins != NULL);
    int status = ERR;
    switch (ast->kind) {
        case AST_IDENTIFIER:
            status = compiler_do_ident(comp, ast, ins);
            break;
        case AST_INTEGER:
            status = compiler_do_int(comp, ast, ins);
            break;
        case AST_CONS:
            status = compiler_do_cons(comp, ast, ins);
            break;
        default :
            string_printf(comp->error, "Don't know how to compile: %d", ast->kind);
            return ERR;
    }
    ins_t *asm_ins = compiler_assemby(comp, ins);
    /* FIXME: 此处需要一个复制操作，将汇编后的指令复制到作为结果的ins变量中 */
    memcpy(ins, asm_ins, sizeof(ins_t));
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x5001
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl (%rsi), %edx
cmpl $0x1, %edx
je 0x4eb7
cmpl $0x5, %edx
je 0x4e93
cmpl $0x4, %edx
jne 0x4f4e
leaq 0x4(%rsp), %rdx
andl $0x0, (%rdx)
movq %rsp, %rcx
andl $0x0, (%rcx)
movq 0x10(%r15), %rax
movq (%rax), %r12
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x5399
cmpl $0x1, %eax
jne 0x4f87
movl 0x4(%rsp), %edi
movl (%rsp), %esi
movq %r12, %rdx
callq 0x4519
jmp 0x4ea4
movl 0x10(%r15), %edi
callq 0x2562
movq %rax, %rdi
callq 0x4507
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
pushq $0x1
popq %rbp
jmp 0x4fd7
movq 0x10(%r15), %r12
movl (%r12), %r8d
cmpl $0x4, %r8d
jne 0x4f67
movq 0x10(%r12), %rax
movq (%rax), %rsi
movq 0x28(%r14), %rdi
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x59c8
testq %rax, %rax
je 0x4f11
movq 0x18(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *%rax
movl %eax, %ebp
jmp 0x4fd7
movq 0x10(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4e26
testl %eax, %eax
je 0x4fd5
incl %r13d
movq 0x18(%r15), %r15
cmpl $0x1, (%r15)
je 0x4ef7
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x4e26
testl %eax, %eax
je 0x4fd5
movl %r13d, %edi
callq 0x4414
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5de3
callq 0x4424
jmp 0x4ea4
movq 0x30(%r14), %rdi
leaq 0x184b(%rip), %rsi      # 0x67a4
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x5cd4
jmp 0x4ff0
movq 0x30(%r14), %rdi
movl 0x4(%r12), %edx
movl 0x8(%r12), %ecx
leaq 0x184e(%rip), %rsi      # 0x67ca
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x5cd4
jmp 0x4fd7
movq 0x10(%r14), %rdi
leaq 0x4(%rsp), %rdx
movq %rsp, %rcx
movq %r12, %rsi
callq 0x5399
cmpl $0x1, %eax
jne 0x4fb4
movl 0x4(%rsp), %edi
movl (%rsp), %esi
movq %r12, %rdx
callq 0x4468
jmp 0x4ea4
movq 0x30(%r14), %rdi
movl 0x4(%r15), %edx
movl 0x8(%r15), %ecx
leaq 0x1442(%rip), %rsi      # 0x6409
xorl %ebp, %ebp
movq %r12, %r8
xorl %eax, %eax
callq 0x5cd4
jmp 0x4fd7
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5020
movups (%rax), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1755(%rip), %rdi      # 0x675d
leaq 0x175a(%rip), %rsi      # 0x6769
leaq 0x175e(%rip), %rcx      # 0x6774
movl $0x158, %edx            # imm = 0x158
callq 0x2060
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/compiler.c
// Function: compiler_mklabel
static bytecode_t *compiler_mklabel(compiler_t *comp)
{
    char name[32] = {0};
    snprintf(name, sizeof(name), "LABEL%d", comp->counter);
    bytecode_t *label = bc_label_new(name);
    comp->counter++;
    return label;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movl (%rdi), %ecx
leaq 0x16cc(%rip), %rdx      # 0x67c2
pushq $0x20
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2050
movq %r14, %rdi
callq 0x44c6
incl (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/parser.c
// Function: parser_getast
ast_kind_t parser_getast(parser_t *parser, ast_t **ast)
{
    lexer_t *l = parser->lexer;
    token_t token = lexer_gettoken(l);
    switch (token) {
        case TOKEN_EOF:
            return AST_END_OF_FILE;
        case TOKEN_IDENTIFIER:
            return parser_getidentifier(parser, ast);
        case TOKEN_INTEGER:
            return parser_getinteger(parser, ast);
        case TOKEN_LEFT_PAREN:
            return parser_getcons(parser, ast);
        case TOKEN_RIGHT_PAREN:
            return AST_RIGHT_PAREN;
        case TOKEN_INVALID:
            if (ast != NULL)
                *ast = ast_invalid_new();
            return AST_INVALID;
        default :
            fprintf(stderr, "Unknown token: %d", token);
            exit(1);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x57a7
cmpl $0x5, %eax
ja 0x51d0
movl %eax, %eax
leaq 0x16b9(%rip), %rcx      # 0x680c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %ebx, %ebx
testq %r14, %r14
je 0x51c8
callq 0x5548
movq %rax, (%r14)
jmp 0x51c8
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x51f2
pushq $0x4
popq %rbx
testq %r14, %r14
je 0x51c8
movq (%r15), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0x5587
jmp 0x51b1
pushq $0x5
popq %rbx
testq %r14, %r14
je 0x51c8
movq (%r15), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
callq 0x2120
movl %eax, %edi
callq 0x55b8
movq %rax, (%r14)
movq (%r15), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x4(%rax)
jmp 0x51c8
pushq $0x3
jmp 0x51c7
pushq $0x6
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x4e21(%rip), %rcx      # 0x9ff8
movq (%rcx), %rdi
leaq 0x1643(%rip), %rsi      # 0x6824
movl %eax, %edx
xorl %eax, %eax
callq 0x20d0
pushq $0x1
popq %rdi
callq 0x2130
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/parser.c
// Function: parser_getcons
static ast_kind_t parser_getcons(parser_t *parser, ast_t **ast)
{
    int line = parser->lexer->tk_line;
    int column = parser->lexer->tk_column;

    ast_t *car = NULL;
    ast_kind_t kind = parser_getast(parser, &car);
    if (kind == AST_INVALID) {
        if (ast != NULL)
            *ast = car;
        return AST_INVALID;
    }
    if (kind == AST_RIGHT_PAREN) {
        if (ast != NULL)
            *ast = ast_eoc_new();
        return AST_END_OF_CONS;
    }
    ast_t *cdr = NULL;
    if (parser_getcons(parser, &cdr) == AST_INVALID) {
        if (ast != NULL)
            *ast = cdr;
        return AST_INVALID;
    }
    if (ast != NULL) {
        *ast = ast_cons_new(car, cdr);
        (*ast)->line = line;
        (*ast)->column = column;
    }
    return AST_CONS;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movsd 0x18(%rax), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x8(%rsp), %rsi
andq $0x0, (%rsi)
callq 0x512e
cmpl $0x6, %eax
je 0x5232
testl %eax, %eax
jne 0x5241
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x5286
movq 0x8(%rsp), %rax
jmp 0x5283
pushq $0x2
popq %rbp
testq %rbx, %rbx
je 0x5286
callq 0x557d
jmp 0x5283
movq %rsp, %rsi
andq $0x0, (%rsi)
movq %r14, %rdi
callq 0x51f2
testl %eax, %eax
je 0x5278
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x5286
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x555b
movq %rax, (%rbx)
movaps 0x10(%rsp), %xmm0
movlps %xmm0, 0x4(%rax)
jmp 0x5286
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x5286
movq (%rsp), %rax
movq %rax, (%rbx)
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: env_new
env_t *env_new(env_t *outer)
{
    env_t *env = malloc(sizeof(env_t));
    vector_init(&env->data);
    env->outer = outer;
    return env;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x20e0
movq %rax, %r14
movq %rax, %rdi
callq 0x5dac
movq %rbx, 0x18(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: env_push
void env_push(env_t *env, const char *name, value_t *value, int *index, int *offset)
{
    if (index != NULL)
        *index = 0;
    if (offset != NULL)
        *offset = env->data.count;
    binding_t *b = binding_new(name, value);
    vector_push(&env->data, (intptr_t)b);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rcx, %rcx
je 0x52de
andl $0x0, (%rcx)
testq %r8, %r8
je 0x52e9
movl 0x10(%rbx), %eax
movl %eax, (%r8)
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x5300
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x5de3
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: binding_new
static binding_t *binding_new(const char *name, void *value)
{
    binding_t *b = malloc(sizeof(binding_t));
    b->name = name;
    b->value = value;
    return b;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x10
popq %rdi
callq 0x20e0
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: env_set
void env_set(env_t *env, const char *name, value_t *value)
{
    for (int i = 0; i < env->data.count; i++) {
        binding_t *b = (binding_t *)vector_ref(&env->data, i);
        if (b->name != NULL && strcmp(b->name, name) == 0) {
            b->value = value;
            return;
        }
    }
    binding_t *b = binding_new(name, value);
    vector_push(&env->data, (intptr_t)b);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %r12d, %r12d
cmpq %r12, 0x10(%r14)
jbe 0x5363
movq %r14, %rdi
movq %r12, %rsi
callq 0x5e9f
movq (%rax), %rdi
testq %rdi, %rdi
je 0x535e
movq %rax, %r13
movq %r15, %rsi
callq 0x20c0
testl %eax, %eax
je 0x5382
incq %r12
jmp 0x5336
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5300
movq %r14, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5de3
movq %rbx, 0x8(%r13)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: env_locate
int env_locate(env_t *env, const char *name, int *index, int *offset)
{
    int i = 0;
    while (!env_isempty(env)) {
        for (int j = 0; j < env->data.count; j++) {
            binding_t *b = (binding_t *)vector_ref(&env->data, j);
            if (b->name != NULL && strcmp(b->name, name) == 0) {
                if (index != NULL)
                    *index = i;
                if (offset != NULL)
                    *offset = j;
                return OK;
            }
        }
        env = env->outer;
        i++;
    }
    return ERR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %r14d, %r14d
xorl %ebx, %ebx
testq %r13, %r13
je 0x5406
xorl %ebp, %ebp
cmpq %rbp, 0x10(%r13)
jbe 0x53e7
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5e9f
movq (%rax), %rdi
testq %rdi, %rdi
je 0x53e2
movq %r12, %rsi
callq 0x20c0
testl %eax, %eax
je 0x53ef
incq %rbp
jmp 0x53bd
movq 0x18(%r13), %r13
incl %ebx
jmp 0x53b6
testq %r15, %r15
je 0x53f7
movl %ebx, (%r15)
pushq $0x1
popq %r14
movq (%rsp), %rax
testq %rax, %rax
je 0x5406
movl %ebp, (%rax)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: env_update
int env_update(env_t *env, int index, int offset, value_t *value)
{
    for (int i = 0; i < index && env != NULL; i++)
        env = env->outer;
    if (env == NULL || offset > env->data.count - 1)
        return ERR;
    binding_t *b = (binding_t *)vector_ref(&env->data, offset);
    b->value = value;
    return OK;
}

// Assembly:
pushq %rbx
movq %rcx, %rbx
xorl %eax, %eax
cmpl %esi, %eax
jge 0x542f
testq %rdi, %rdi
je 0x542f
movq 0x18(%rdi), %rdi
incl %eax
jmp 0x541e
xorl %eax, %eax
testq %rdi, %rdi
je 0x5451
movslq %edx, %rsi
movq 0x10(%rdi), %rcx
decq %rcx
cmpq %rsi, %rcx
jb 0x5451
callq 0x5e9f
movq %rbx, 0x8(%rax)
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: env_get
value_t *env_get(env_t *env, const char *name)
{
    while (!env_isempty(env)) {
        for (int i = 0; i < env->data.count; i++) {
            binding_t *b = (binding_t *)vector_ref(&env->data, i);
            if (b->name != NULL && strcmp(b->name, name) == 0)
                return b->value;
        }
        env = env->outer;
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
testq %r15, %r15
je 0x54a3
xorl %r12d, %r12d
cmpq %r12, 0x10(%r15)
jbe 0x5499
movq %r15, %rdi
movq %r12, %rsi
callq 0x5e9f
movq (%rax), %rdi
testq %rdi, %rdi
je 0x5494
movq %rax, %r13
movq %r14, %rsi
callq 0x20c0
testl %eax, %eax
je 0x549f
incq %r12
jmp 0x546c
movq 0x18(%r15), %r15
jmp 0x5464
movq 0x8(%r13), %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: env_ref
value_t *env_ref(env_t *env, int index, int offset)
{
    for (int i = 0; i < index && env != NULL; i++)
        env = env->outer;
    if (env == NULL || offset > env->data.count - 1)
        return NULL;
    binding_t *b = (binding_t *)vector_ref(&env->data, offset);
    return (value_t *)b->value;
}

// Assembly:
pushq %rax
xorl %eax, %eax
cmpl %esi, %eax
jge 0x54c4
testq %rdi, %rdi
je 0x54c4
movq 0x18(%rdi), %rdi
incl %eax
jmp 0x54b3
testq %rdi, %rdi
je 0x54d8
movslq %edx, %rsi
movq 0x10(%rdi), %rax
decq %rax
cmpq %rsi, %rax
jae 0x54dc
xorl %eax, %eax
jmp 0x54e5
callq 0x5e9f
movq 0x8(%rax), %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/env.c
// Function: env_getaddr
value_t **env_getaddr(env_t *env, const char *name)
{
    while (!env_isempty(env)) {
        for (int i = 0; i < env->data.count; i++) {
            binding_t *b = (binding_t *)vector_ref(&env->data, i);
            if (b->name != NULL && strcmp(b->name, name) == 0)
                return (value_t **)&b->value;
        }
        env = env->outer;
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
testq %r15, %r15
je 0x553a
xorl %r12d, %r12d
cmpq %r12, 0x10(%r15)
jbe 0x552d
movq %r15, %rdi
movq %r12, %rsi
callq 0x5e9f
movq (%rax), %rdi
testq %rdi, %rdi
je 0x5528
movq %rax, %r13
movq %r14, %rsi
callq 0x20c0
testl %eax, %eax
je 0x5533
incq %r12
jmp 0x5500
movq 0x18(%r15), %r15
jmp 0x54f8
addq $0x8, %r13
movq %r13, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/ast.c
// Function: ast_cons_new
ast_t *ast_cons_new(ast_t *car, ast_t *cdr)
{
    ast_t *a = ast_alloc(AST_CONS);
    a->u.cons_val.car = car;
    a->u.cons_val.cdr = cdr;
    return a;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rdi
callq 0x554c
movq %r14, 0x10(%rax)
movq %rbx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/ast.c
// Function: ast_ident_new
ast_t *ast_ident_new(const char *id)
{
    ast_t *a = ast_alloc(AST_IDENTIFIER);
    a->u.ident_val = string_new();
    string_assign(a->u.ident_val, id);
    return a;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x4
popq %rdi
callq 0x554c
movq %rax, %r14
callq 0x5c20
movq %rax, 0x10(%r14)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5c89
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/ast.c
// Function: ast_free
void ast_free(ast_t *a)
{
    switch (a->kind) {
        case AST_CONS:
            ast_free(a->u.cons_val.car);
            ast_free(a->u.cons_val.cdr);
            break;
        case AST_IDENTIFIER:
            string_free(a->u.ident_val);
            break;
        default :;
    }
    free(a);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x4, %eax
je 0x55ec
cmpl $0x1, %eax
jne 0x55f5
movq 0x10(%rbx), %rdi
callq 0x55c8
movq 0x18(%rbx), %rdi
callq 0x55c8
jmp 0x55f5
movq 0x10(%rbx), %rdi
callq 0x5c32
movq %rbx, %rdi
popq %rbx
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/ast.c
// Function: ast_print
void ast_print(ast_t *a, FILE *output)
{
    switch (a->kind) {
        case AST_CONS:
            ast_print_cons(a, output);
            break;
        case AST_END_OF_CONS:
            fprintf(output, "()");
            break;
        case AST_IDENTIFIER:
            fprintf(output, "%s", a->u.ident_val->text);
            break;
        case AST_INTEGER:
            fprintf(output, "%d", AST_INT_VALUE(a));
            break;
        default :
            fprintf(stderr, "Don't know how to print: %d", a->kind);
            exit(1);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl (%rdi), %edx
leal -0x1(%rdx), %eax
cmpl $0x4, %eax
ja 0x56bf
movq %rsi, %rbx
leaq 0x121d(%rip), %rcx      # 0x6838
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rdi), %r15
movq 0x18(%rdi), %r14
pushq $0x28
popq %rdi
movq %rbx, %rsi
callq 0x20a0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x55fe
cmpl $0x2, (%r14)
je 0x5668
leaq 0xabb(%rip), %rdi       # 0x610a
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2140
movq %r14, %rdi
movq %rbx, %rsi
callq 0x55fe
pushq $0x29
popq %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x20a0
movq 0x10(%rdi), %rax
movq (%rax), %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2070
movl 0x10(%rdi), %edx
leaq 0x1129(%rip), %rsi      # 0x67bf
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x20d0
leaq 0xa17(%rip), %rdi       # 0x60c3
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x2140
movq 0x4932(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x117c(%rip), %rsi      # 0x684c
xorl %eax, %eax
callq 0x20d0
pushq $0x1
popq %rdi
callq 0x2130
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/ast.c
// Function: ast_cons_length
int ast_cons_length(ast_t *cons)
{
    assert(cons->kind == AST_CONS || cons->kind == AST_END_OF_CONS);
    int i = 0;
    while (cons->kind != AST_END_OF_CONS) {
        i++;
        cons = AST_CONS_CDR(cons);
    }
    return i;
}

// Assembly:
pushq %rax
movl (%rdi), %ecx
leal -0x1(%rcx), %eax
cmpl $0x1, %eax
ja 0x56fd
xorl %eax, %eax
cmpl $0x2, %ecx
je 0x56fb
incl %eax
movq 0x18(%rdi), %rdi
movl (%rdi), %ecx
jmp 0x56ec
popq %rcx
retq
leaq 0x1164(%rip), %rdi      # 0x6868
leaq 0x1195(%rip), %rsi      # 0x68a0
leaq 0x1194(%rip), %rcx      # 0x68a6
pushq $0x72
popq %rdx
callq 0x2060
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/ast.c
// Function: is_valof_form
int is_valof_form(ast_t *expr)
{
    if (expr->kind == AST_CONS
            && AST_CONS_CAR(expr)->kind == AST_IDENTIFIER
            && strcmp(AST_IDENT_NAME( AST_CONS_CAR(expr) ), "valof") == 0
            && AST_CONS_CADR(expr)->kind == AST_IDENTIFIER)
        return 1;
    else
        return 0;
}

// Assembly:
pushq %rbx
cmpl $0x1, (%rdi)
jne 0x5755
movq %rdi, %rbx
movq 0x10(%rdi), %rax
cmpl $0x4, (%rax)
jne 0x5755
movq 0x10(%rax), %rax
movq (%rax), %rdi
leaq 0xcc3(%rip), %rsi       # 0x63fd
callq 0x20c0
testl %eax, %eax
jne 0x5755
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rax
cmpl $0x4, (%rax)
jne 0x5755
pushq $0x1
popq %rax
jmp 0x5757
xorl %eax, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/lexer.c
// Function: lexer_new
lexer_t *lexer_new(FILE *src)
{
    lexer_t *l = malloc(sizeof(lexer_t));
    l->src = src;
    l->text = string_new();
    l->tk_line = l->line = 1;
    l->tk_column = l->column = 0;
    return l;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x20e0
movq %rax, %r14
movq %rbx, (%rax)
callq 0x5c20
movq %rax, 0x8(%r14)
movaps 0x114f(%rip), %xmm0     # 0x68d0
movups %xmm0, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/lexer.c
// Function: lexer_gettoken
token_t lexer_gettoken(lexer_t *l)
{
    int c = lexer_getc(l);
    switch (c) {
        case EOF: return TOKEN_EOF;
        case ' ': case '\n': case '\t': return lexer_gettoken(l);
        case '(': return TOKEN_LEFT_PAREN;
        case ')': return TOKEN_RIGHT_PAREN;
        case ';':
            lexer_skip_comment(l);
            return lexer_gettoken(l);
        default :
            if (isdigit(c))
                return lexer_getinteger(l, c);
            else
                return lexer_getidentifier(l, c);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x58c3
movl %eax, %r14d
leal -0x9(%r14), %eax
cmpl $0x2, %eax
jb 0x57b2
cmpl $0x20, %r14d
je 0x57b2
cmpl $0x3b, %r14d
jne 0x57e6
movq %rbx, %rdi
callq 0x58c3
cmpl $-0x1, %eax
je 0x57b2
cmpl $0xa, %eax
jne 0x57d2
jmp 0x57b2
cmpl $-0x1, %r14d
je 0x5806
cmpl $0x28, %r14d
je 0x57ff
cmpl $0x29, %r14d
jne 0x580d
pushq $0x5
jmp 0x58b9
pushq $0x4
jmp 0x58b9
pushq $0x1
jmp 0x58b9
callq 0x2150
movq %rax, %r15
movq (%rax), %rax
movslq %r14d, %rcx
movzwl (%rax,%rcx,2), %ebp
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rax
movq %rax, 0x18(%rbx)
callq 0x5cbb
btl $0xb, %ebp
jb 0x5887
movabsq $0x60000000001, %r12    # imm = 0x60000000001
movq 0x8(%rbx), %rdi
movsbl %r14b, %esi
callq 0x5c47
movq %rbx, %rdi
callq 0x58c3
movl %eax, %r14d
movq (%r15), %rax
movslq %r14d, %rcx
movzwl (%rax,%rcx,2), %eax
btl $0xd, %eax
jb 0x5878
movl %r14d, %eax
incl %eax
cmpl $0x2a, %eax
ja 0x5840
btq %rax, %r12
jae 0x5840
movq %rbx, %rdi
movl %r14d, %esi
callq 0x58e2
pushq $0x2
jmp 0x58b9
movq 0x8(%rbx), %rdi
movsbl %r14b, %esi
callq 0x5c47
movq %rbx, %rdi
callq 0x58c3
movl %eax, %r14d
movq (%r15), %rax
movslq %r14d, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x5887
movq %rbx, %rdi
movl %r14d, %esi
callq 0x58e2
pushq $0x3
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/lexer.c
// Function: lexer_getc
static int lexer_getc(lexer_t *l)
{
    int c = fgetc(l->src);
    if (c == '\n') {
        l->line++;
        l->column = 0;
    } else
        l->column++;
    return c;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2090
cmpl $0xa, %eax
jne 0x58dd
incl 0x10(%rbx)
andl $0x0, 0x14(%rbx)
jmp 0x58e0
incl 0x14(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/lexer.c
// Function: lexer_ungetc
static int lexer_ungetc(lexer_t *l, int c)
{
    if (c == '\n') {
        l->line--;
        /* XXX: 此处l->column应当设置为上一行的长度 */
    } else
        l->column--;
    return ungetc(c, l->src);
}

// Assembly:
movl %esi, %eax
cmpl $0xa, %esi
jne 0x58ee
decl 0x10(%rdi)
jmp 0x58f1
decl 0x14(%rdi)
movq (%rdi), %rsi
movl %eax, %edi
jmp 0x2100
nop
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/hash_table.c
// Function: hash_table_new
hash_table_t *hash_table_new(hash_func_t hash_func, comp_func_t comp_func)
{
#define TABLE_SIZE 11
    hash_table_t *tbl = malloc(sizeof(hash_table_t));
    tbl->capacity = TABLE_SIZE;
    tbl->slots = calloc(tbl->capacity, sizeof(table_entry_t *));
    tbl->count = 0;
    tbl->comp_func = comp_func;
    tbl->hash_func = hash_func;
    return tbl;
#undef TABLE_SIZE
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x28
popq %rdi
callq 0x20e0
movq %rax, %r15
movq $0xb, 0x8(%rax)
pushq $0xb
popq %rdi
pushq $0x8
popq %rsi
callq 0x20b0
movq %rax, (%r15)
andq $0x0, 0x10(%r15)
movq %rbx, 0x20(%r15)
movq %r14, 0x18(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/hash_table.c
// Function: hash_table_set
void hash_table_set(hash_table_t *tbl, void *key, void *value)
{
    size_t i = hash_table_hash(tbl, key);
    table_entry_t *ent = tbl->slots[i];
    while (ent != NULL) {
        if (hash_table_iseq(tbl, ent->key, key))
            break;
        ent = ent->next;
    }
    if (ent == NULL) {
        ent = malloc(sizeof(table_entry_t));
        ent->key = key;
        ent->next = tbl->slots[i];
        tbl->slots[i] = ent;
    }
    ent->value = value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq *0x18(%r14)
xorl %edx, %edx
divq 0x8(%r14)
movq %rdx, %r12
movq %rdx, %r13
shlq $0x3, %r13
addq (%r14), %r13
movq (%r13), %r13
testq %r13, %r13
je 0x599d
movq (%r13), %rdi
movq %r15, %rsi
callq *0x20(%r14)
testl %eax, %eax
jne 0x59ba
addq $0x10, %r13
jmp 0x597f
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %r13
movq %r15, (%rax)
movq (%r14), %rax
movq (%rax,%r12,8), %rcx
movq %rcx, 0x10(%r13)
movq %r13, (%rax,%r12,8)
movq %rbx, 0x8(%r13)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/hash_table.c
// Function: hash_table_get
void *hash_table_get(hash_table_t *tbl, void *key, int *is_found)
{
    size_t i = hash_table_hash(tbl, key);
    table_entry_t *ent = tbl->slots[i];
    while (ent != NULL) {
        if (hash_table_iseq(tbl, ent->key, key)) {
            if (is_found != NULL)
                *is_found = 1;
            return ent->value;
        }
        ent = ent->next;
    }
    if (is_found != NULL)
        *is_found = 0;
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq *0x18(%r15)
xorl %edx, %edx
divq 0x8(%r15)
movq %rdx, %r12
shlq $0x3, %r12
addq (%r15), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x5a0e
movq (%r12), %rdi
movq %r14, %rsi
callq *0x20(%r15)
testl %eax, %eax
jne 0x5a1a
addq $0x10, %r12
jmp 0x59f0
testq %rbx, %rbx
je 0x5a16
andl $0x0, (%rbx)
xorl %eax, %eax
jmp 0x5a2a
testq %rbx, %rbx
je 0x5a25
movl $0x1, (%rbx)
movq 0x8(%r12), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/hash_table.c
// Function: hash_str
size_t hash_str(void *str)
{
    const char *_str = str;
    unsigned int seed = 131;
    unsigned int hash = 0;
    while (*_str != '\0') {
        hash = hash * seed + (*_str);
        _str++;
    }
    return hash & 0x7FFFFFFF;
}

// Assembly:
xorl %eax, %eax
movsbl (%rdi), %ecx
testl %ecx, %ecx
je 0x5a50
imull $0x83, %eax, %eax
addl %ecx, %eax
incq %rdi
jmp 0x5a3c
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_new
seg_vector_t *seg_vector_new(seg_vector_t *next)
{
    seg_vector_t *sv = malloc(sizeof(*sv));
    sv->data = vector_new();
    sv->next = next;
    return sv;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
callq 0x5dbb
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_locate
int seg_vector_locate(seg_vector_t *sv, const void *key, vec_comp_func_t comp_func, int *seg_index, int *vector_index)
{
    int si = 0;
    while (sv != NULL) {
        int vi = vector_posif(sv->data, (intptr_t)key, comp_func);
        if (vi != -1) {
            if (seg_index != NULL)
                *seg_index = si;
            if (vector_index != NULL)
                *vector_index = vi;
            return 1;
        }
        sv = sv->next;
        si++;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebp, %ebp
xorl %ebx, %ebx
testq %r13, %r13
je 0x5b0c
movq (%r13), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x5e30
cmpl $-0x1, %eax
jne 0x5af6
movq 0x8(%r13), %r13
incl %ebx
jmp 0x5ad5
testq %r14, %r14
je 0x5afe
movl %ebx, (%r14)
pushq $0x1
popq %rbp
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x5b0c
movl %eax, (%rcx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_locate2
int seg_vector_locate2(seg_vector_t *sv, const void *key, vec_comp_func_t comp_func, int *seg_index, int *vector_index, int *is_last_seg)
{
    int si = 0;
    while (sv != NULL) {
        int vi = vector_posif(sv->data, (intptr_t)key, comp_func);
        if (vi != -1) {
            if (seg_index != NULL)
                *seg_index = si;
            if (vector_index != NULL)
                *vector_index = vi;
            if (is_last_seg != NULL) {
                if (sv->next == NULL)
                    *is_last_seg = 1;
                else
                    *is_last_seg = 0;
            }
            return 1;
        }
        sv = sv->next;
        si++;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
testq %r14, %r14
je 0x5b95
movq (%r14), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x5e30
cmpl $-0x1, %eax
jne 0x5b67
movq 0x8(%r14), %r14
incl %r15d
jmp 0x5b46
testq %r12, %r12
je 0x5b70
movl %r15d, (%r12)
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
movq 0x10(%rsp), %rcx
je 0x5b81
movl %eax, (%rdx)
pushq $0x1
popq %rbp
testq %rcx, %rcx
je 0x5b95
xorl %eax, %eax
cmpq $0x0, 0x8(%r14)
sete %al
movl %eax, (%rcx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_set
int seg_vector_set(seg_vector_t *sv, void *obj, int i, int j)
{
    while (i > 0 && sv != NULL) {
        sv = sv->next;
        i--;
    }
    if (sv->data->count < j)
        return 0;
    vector_set(sv->data, (intptr_t)obj, j);
    return 1;
}

// Assembly:
pushq %rax
testl %edx, %edx
jle 0x5bb8
testq %rdi, %rdi
je 0x5bb8
movq 0x8(%rdi), %rdi
decl %edx
jmp 0x5ba7
movq (%rdi), %rdi
movslq %ecx, %rdx
xorl %eax, %eax
cmpq %rdx, 0x10(%rdi)
jb 0x5bd0
movl %ecx, %edx
callq 0x5dce
pushq $0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/seg_vector.c
// Function: seg_vector_ref
void *seg_vector_ref(seg_vector_t *sv, int i, int j)
{
    while (i > 0 && sv != NULL) {
        sv = sv->next;
        i--;
    }
    if (sv->data->count < j)
        return NULL;
    return (void *)vector_ref(sv->data, j);
}

// Assembly:
pushq %rax
testl %esi, %esi
jle 0x5be4
testq %rdi, %rdi
je 0x5be4
movq 0x8(%rdi), %rdi
decl %esi
jmp 0x5bd3
movq (%rdi), %rdi
movslq %edx, %rsi
cmpq %rsi, 0x10(%rdi)
jae 0x5bf4
xorl %eax, %eax
jmp 0x5bf9
callq 0x5e9f
popq %rcx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/string.c
// Function: string_init
string_t *string_init(string_t *s)
{
    s->capacity = DELTA;
    s->length = 0;
    s->text = calloc(s->capacity, sizeof(char));
    return s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0xa, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
pushq $0xa
popq %rdi
pushq $0x1
popq %rsi
callq 0x20b0
movq %rax, (%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/string.c
// Function: string_addc
void string_addc(string_t *s, char c)
{
    if (string_isfull(s))
        string_incr(s, DELTA);
    s->text[s->length] = c;
    s->length++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x10(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
cmpq %rsi, %rdx
jb 0x5c7a
addq $0xa, %rsi
movq %rsi, 0x8(%rbx)
movq %rax, %rdi
callq 0x2110
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movb %bpl, (%rax,%rcx)
incq 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/string.c
// Function: string_assign
void string_assign(string_t *str, const char *src)
{
    while (*src != '\0') {
        string_addc(str, *src);
        src++;
    }
    string_addc(str, '\0');
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb (%r14), %al
testb %al, %al
je 0x5caa
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5c47
incq %r14
jmp 0x5c93
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5c47
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/string.c
// Function: string_printf
int string_printf(string_t *s, const char *fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);
    int len = vsnprintf(s->text, s->capacity - 1, fmt, ap);
    if (len >= s->capacity - 1) {
        s->capacity = len + DELTA;
        s->text = realloc(s->text, s->capacity * sizeof(char));
    }
    return vsnprintf(s->text, s->capacity - 1, fmt, ap);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x5d34
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 %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
movq (%rdi), %rdi
movq 0x8(%r14), %rsi
decq %rsi
movq %rbx, %rdx
callq 0x2040
movslq %eax, %rcx
movq (%r14), %rdi
movq 0x8(%r14), %rsi
decq %rsi
cmpq %rcx, %rsi
ja 0x5d94
addl $0xa, %eax
movslq %eax, %rsi
movq %rsi, 0x8(%r14)
callq 0x2110
movq %rax, %rdi
movq %rax, (%r14)
movq 0x8(%r14), %rsi
decq %rsi
movq %rsp, %rcx
movq %rbx, %rdx
callq 0x2040
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/vector.c
// Function: vector_push
void vector_push(vector_t *v, intptr_t data)
{
#define DELTA 10
    if (vector_isfull(v))
        vector_incr(v, DELTA);
    v->slots[v->count] = data;
    v->count++;
#undef DELTA
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rcx
leaq 0x1(%rcx), %rsi
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
cmpq %rdx, %rsi
jb 0x5e20
leaq 0xa(%rdx), %rcx
movq %rcx, 0x8(%rbx)
leaq 0x50(,%rdx,8), %rsi
movq %rax, %rdi
callq 0x2110
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
incq 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Liutos[P]Eloquent/utils/vector.c
// Function: vector_posif
int vector_posif(vector_t *v, intptr_t key, vec_comp_func_t comp_func)
{
    int i = 0;
    while (i < v->count) {
        if ((*comp_func)(v->slots[i], key))
            return i;
        i++;
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
pushq $-0x1
popq %rbx
cmpq %r13, 0x10(%r12)
jbe 0x5e69
movq (%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r15, %rsi
callq *%r14
testl %eax, %eax
jne 0x5e66
incq %r13
jmp 0x5e48
movl %r13d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Cotix[P]cReddit/src/global.c
// Function: alloc_sprintf
char *alloc_sprintf (const char *format, ...)
{
    char *ret;
    va_list lst;

    va_start(lst, format);
    ret = valloc_sprintf(format, lst);
    va_end(lst);

    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xf0, %rsp
movq %rdi, %rbx
leaq 0x40(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x2515
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
leaq 0x20(%rsp), %rcx
movq %rdi, 0x10(%rcx)
movq (%rsp), %rax
movq %rax, (%rcx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rcx)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2150
incl %eax
movslq %eax, %r15
movq %r15, %rdi
callq 0x2260
movq %rax, %r14
testq %rax, %rax
je 0x2584
movb $0x0, (%r14)
movq %rsp, %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2150
movq %r14, %rax
addq $0xf0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Cotix[P]cReddit/src/main.c
// Function: linkScreenFree
void linkScreenFree(LinkScreen *screen)
{
    int i;
    if (screen == NULL)
        return ;
    for (i = 0; i < screen->allocLineCount; i++)
        free(screen->screenLines[i]);

    free(screen->screenLines);
    free(screen);
}

// Assembly:
testq %rdi, %rdi
je 0x25fd
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x18(%rbx), %rax
movq 0x20(%rbx), %rdi
cmpq %rax, %r14
jge 0x25e9
movq (%rdi,%r14,8), %rdi
callq 0x2230
incq %r14
jmp 0x25ce
callq 0x2230
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2230
retq