LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/parser.c
// Function: parse_id
ParserResult parse_id(Parser *parser) {
    ParserResult res;
    state_t _parser_state = save_state(parser);

    res = current_token(parser); ErrProp;
    forward_token(parser);

    debug_print_current_token(parser);

    Token* t = res.value.token;
    switch (t->kind) {
    case TOK_KIND_ID:
    {
        Node* node = node_arena_malloc(parser->arena);
        node->kind = NODE_ID;
        node->value.id.tok = t;

        res.result = PARSER_OK;
        res.value.node = node;

        return res;
    }

    default:
        res.result = PARSER_ERROR;
        res.error.kind = PARSER_ERROR_KIND_UNEXPECTED;
        res.error.value.unexpected.token = t;

        rewind_state(parser, _parser_state);
        return res;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %r15
callq 0x1ee7
cmpl $0x1, (%rbx)
je 0x1bbb
incq 0x10(%r14)
movq %r14, %rdi
callq 0x1f12
movq 0x18(%rbx), %r12
cmpl $0x18, (%r12)
jne 0x1baf
movq 0x8(%r14), %rdi
callq 0x2f4c
movl $0xa, (%rax)
movq %r12, 0x8(%rax)
andl $0x0, (%rbx)
movq %rax, 0x18(%rbx)
jmp 0x1bbf
pushq $0x1
popq %rax
movl %eax, (%rbx)
movl %eax, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %r15, 0x10(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/parser.c
// Function: parse_stmt_compound
ParserResult parse_stmt_compound(Parser *parser) {
    ParserResult res;
    state_t _parser_state = save_state(parser);

    res = assume_token(parser, TOK_KIND_LBRACE); ErrProp;
    forward_token(parser);

    res = combinator_more1(parser, parse_block_item); ErrProp;
    Vector* nodes = res.value.nodes;

    res = assume_token(parser, TOK_KIND_RBRACE); ErrProp;
    forward_token(parser);

    Node* node = node_arena_malloc(parser->arena);
    node->kind = NODE_STMT_COMPOUND;
    node->value.stmt_compound.stmts = nodes;

    res.result = PARSER_OK;
    res.value.node = node;

    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %r15
pushq $0x8
popq %rdx
callq 0x1f9f
cmpl $0x1, (%rbx)
je 0x1eb4
incq 0x10(%r14)
leaq 0x1b0(%rip), %rdx       # 0x203d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a5a
cmpl $0x1, (%rbx)
je 0x1eb4
movq 0x18(%rbx), %r12
pushq $0x9
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f9f
cmpl $0x1, (%rbx)
jne 0x1ec7
movq %r15, 0x10(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
incq 0x10(%r14)
movq 0x8(%r14), %rdi
callq 0x2f4c
movl $0x2, (%rax)
movq %r12, 0x8(%rax)
andl $0x0, (%rbx)
movq %rax, 0x18(%rbx)
jmp 0x1eb8
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/parser.c
// Function: current_token
ParserResult current_token(Parser *parser) {
    ParserResult res;

    Token* t = (Token*)vector_at(parser->tokens, parser->position);
    if (!t) {
        res.result = PARSER_ERROR;
        res.error.kind = PARSER_ERROR_KIND_EOF;

        // This function does not consume any tokens, not rewind

        return res;
    }

    res.result = PARSER_OK;
    res.value.token = t;

    return res;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rdi
movq 0x10(%rsi), %rsi
callq 0x29c6
testq %rax, %rax
je 0x1f04
movq %rax, 0x18(%rbx)
xorl %eax, %eax
jmp 0x1f0b
andl $0x0, 0x8(%rbx)
pushq $0x1
popq %rax
movl %eax, (%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/parser.c
// Function: debug_print_current_token
void debug_print_current_token(Parser *parser) {
    fprintf(DEBUGOUT, "DEBUG_PRINT: CURRENT_TOKEN ");

    ParserResult res = current_token(parser);
    if (res.result == PARSER_ERROR) {
        fprintf(DEBUGOUT, "ERR!\n");
        return;
    }

    fprintf(DEBUGOUT, "OK! -> ");
    token_fprint_buf(DEBUGOUT, res.value.token);
    fprintf(DEBUGOUT, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x90b3(%rip), %r15      # 0xafd8
movq (%r15), %rcx
leaq 0x43d0(%rip), %rdi      # 0x62ff
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x11c0
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ee7
cmpl $0x1, (%r14)
movq (%r15), %rcx
jne 0x1f6c
leaq 0x43c3(%rip), %rdi      # 0x631b
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x11c0
leaq 0x43ae(%rip), %rdi      # 0x6321
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x11c0
movq (%r15), %rdi
movq 0x18(%rsp), %rsi
callq 0x18e4
movq (%r15), %rsi
pushq $0xa
popq %rdi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/parser.c
// Function: assume_token
ParserResult assume_token(Parser *parser, TokenKind kind) {
    ParserResult res = current_token(parser);
    if (res.result == PARSER_ERROR) {
        return res;
    }

    Token* t = res.value.token;

    if (t->kind != kind) {
        res.result = PARSER_ERROR;
        res.error.kind = PARSER_ERROR_KIND_UNEXPECTED;
        res.error.value.unexpected.token = t;

        // This function does not consume any tokens, not rewind

        return res;
    }

    return res;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
callq 0x1ee7
cmpl $0x1, (%rbx)
je 0x1fc5
movq 0x18(%rbx), %rax
cmpl %ebp, (%rax)
je 0x1fc5
pushq $0x1
popq %rcx
movl %ecx, (%rbx)
movl %ecx, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/parser.c
// Function: parse_parameter_declaration
ParserResult parse_parameter_declaration(Parser *parser) {
    ParserResult res;
    state_t _parser_state = save_state(parser);

    res = parse_declaration_specifiers(parser); ErrProp;
    Node* spec = res.value.node;

    Node* node = node_arena_malloc(parser->arena);
    node->kind = NODE_PARAM_DECL;
    node->value.param_decl.spec = spec;

    res = parse_declarator(parser);
    if (res.result == PARSER_ERROR) {
        goto next_phase;
    }
    node->value.param_decl.decl = res.value.node;

    res.result = PARSER_OK;
    res.value.node = node;

    return res;

next_phase:
    // TODO: support 'abstract-declarator opt'
    node->value.param_decl.decl = NULL;

    res.result = PARSER_OK;
    res.value.node = node;

    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %r15
callq 0x1b60
cmpl $0x1, (%rbx)
jne 0x1ff1
movq %r15, 0x10(%r14)
jmp 0x202e
movq 0x18(%rbx), %r12
movq 0x8(%r14), %rdi
callq 0x2f4c
movq %rax, %r15
movl $0xe, (%rax)
movq %r12, 0x8(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1bce
cmpl $0x1, (%rbx)
je 0x2021
movq 0x18(%rbx), %rax
jmp 0x2023
xorl %eax, %eax
movq %rax, 0x10(%r15)
andl $0x0, (%rbx)
movq %r15, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/arena.c
// Function: arena_new
Arena* arena_new(size_t elem_size, void (*dtor)(void*)) {
    Arena* v = (Arena*)malloc(sizeof(Arena));
    if (!v) {
        return 0;
    }
    v->current = vector_new_with_cap(elem_size, 128);
    v->chain = vector_new(sizeof(Vector*));
    v->elem_size = elem_size;
    v->dtor = dtor;

    return v;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x20
popq %rdi
callq 0x1160
movq %rax, %r15
testq %rax, %rax
je 0x278b
movl $0x80, %esi
movq %r14, %rdi
callq 0x28ba
movq %rax, (%r15)
pushq $0x8
popq %rdi
callq 0x2898
movq %rax, 0x8(%r15)
movq %r14, 0x10(%r15)
movq %rbx, 0x18(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/arena.c
// Function: arena_malloc
void* arena_malloc(Arena *arena) {
    if (vector_len(arena->current) == vector_cap(arena->current)) {
        // Move an ownership of current into chain
        Vector** c = (Vector**)vector_append(arena->chain);
        (*c) = arena->current;

        // Allocate a new space
        arena->current = vector_new_with_cap(arena->elem_size, vector_cap(arena->current) * 2);

        return arena_malloc(arena);
    }

    return vector_append(arena->current);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x29db
movq %rax, %r14
movq (%rbx), %rdi
callq 0x29e0
cmpq %rax, %r14
jne 0x27df
movq 0x8(%rbx), %rdi
callq 0x2982
movq (%rbx), %rdi
movq %rdi, (%rax)
movq 0x10(%rbx), %r14
callq 0x29e0
leaq (%rax,%rax), %rsi
movq %r14, %rdi
callq 0x28ba
movq %rax, %rdi
movq %rax, (%rbx)
jmp 0x279e
movq (%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2982
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/arena.c
// Function: arena_drop
void arena_drop(Arena *arena) {
    if (!arena) {
        return;
    }

    for(size_t i=0; i<vector_len(arena->current); ++i) {
        void* e = vector_at(arena->current, i);
        arena->dtor(e);
    }
    vector_drop(arena->current);

    for(size_t i=0; i<vector_len(arena->chain); ++i) {
        Vector** c = (Vector**)vector_at(arena->chain, i);
        for(size_t j=0; j<vector_len(*c); ++j) {
            void* e = vector_at(*c, j);
            arena->dtor(e);
        }
        vector_drop(*c);
    }
    vector_drop(arena->chain);

    free(arena);
}

// Assembly:
testq %rdi, %rdi
je 0x2895
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x29db
movq (%rbx), %rdi
cmpq %rax, %r14
jae 0x2828
movq %r14, %rsi
callq 0x29c6
movq %rax, %rdi
callq *0x18(%rbx)
incq %r14
jmp 0x2805
callq 0x2966
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
callq 0x29db
movq 0x8(%rbx), %rdi
cmpq %rax, %r14
jae 0x287d
movq %r14, %rsi
callq 0x29c6
movq %rax, %r15
xorl %r12d, %r12d
movq (%r15), %rdi
callq 0x29db
movq (%r15), %rdi
cmpq %rax, %r12
jae 0x2873
movq %r12, %rsi
callq 0x29c6
movq %rax, %rdi
callq *0x18(%rbx)
incq %r12
jmp 0x2850
callq 0x2966
incq %r14
jmp 0x2830
callq 0x2966
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
retq
nop
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/vector.c
// Function: vector_new
Vector* vector_new(size_t elem_size) {
    Vector* v = (Vector*)malloc(sizeof(Vector));
    if (!v) {
        return 0;
    }
    v->elem_size = elem_size;
    v->len = 0;
    v->cap = 0;
    v->buffer = 0;

    return v;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x1160
testq %rax, %rax
je 0x28b8
movq %rbx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
andq $0x0, 0x18(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/vector.c
// Function: vector_new_with_cap
Vector* vector_new_with_cap(size_t elem_size, size_t cap) {
    Vector* v = vector_new(elem_size);
    bool res = extend(v, cap);
    assert(res);

    return v;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
callq 0x2898
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2900
testb %al, %al
je 0x28e3
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3abd(%rip), %rdi      # 0x63a7
leaq 0x3aba(%rip), %rsi      # 0x63ab
leaq 0x3abc(%rip), %rcx      # 0x63b4
pushq $0x20
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/vector.c
// Function: extend
static bool extend(Vector *v, size_t ext_size) {
    size_t new_cap = v->cap + ext_size;
    char* new_buffer = (char*)malloc(v->elem_size * new_cap);
    if (!new_buffer) {
        return false;
    }

    if (v->buffer) {
        memcpy(new_buffer, v->buffer, v->elem_size * v->len);
        free(v->buffer);
    }

    v->cap = new_cap;
    v->buffer = new_buffer;

    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq 0x10(%rdi), %rbx
movq (%rdi), %r12
movq %r12, %rdi
imulq %rbx, %rdi
callq 0x1160
movq %rax, %r15
testq %rax, %rax
je 0x2956
movq 0x18(%r14), %r13
testq %r13, %r13
je 0x294e
imulq 0x8(%r14), %r12
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1150
movq %r13, %rdi
callq 0x1040
movq %rbx, 0x10(%r14)
movq %r15, 0x18(%r14)
testq %r15, %r15
setne %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/vector.c
// Function: vector_drop
void vector_drop(Vector *v) {
    if (!v) {
        return;
    }

    if (v->buffer) {
        free(v->buffer);
    }

    free(v);
}

// Assembly:
testq %rdi, %rdi
je 0x2981
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x1040
movq %rbx, %rdi
popq %rbx
jmp 0x1040
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/vector.c
// Function: vector_append
void* vector_append(Vector *v) {
    if (v->len == v->cap) {
        size_t ext_size = v->cap == 0 ? 24 : v->cap * 2; //
        if (!extend(v, ext_size)) {
            return 0;
        }
    }

    // TODO: Consider alignment
    char* p = &v->buffer[v->elem_size * v->len];
    v->len++;

    return p;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
cmpq 0x10(%rdi), %rcx
jne 0x29ae
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
pushq $0x18
popq %rsi
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x2900
testb %al, %al
je 0x29c2
movq 0x8(%rbx), %rcx
movq (%rbx), %rax
imulq %rcx, %rax
addq 0x18(%rbx), %rax
incq %rcx
movq %rcx, 0x8(%rbx)
jmp 0x29c4
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/node.c
// Function: node_declarator_extract_id_token
Token* node_declarator_extract_id_token(Node* node) {
    switch(node->kind) {
    case NODE_DECLARATOR:
        return node_declarator_extract_id_token(node->value.declarator.node);
    case NODE_DIRECT_DECLARATOR:
        return node_declarator_extract_id_token(node->value.direct_declarator.base);
    case NODE_ID:
        return node->value.id.tok;
    default:
        return NULL;
    }
}

// Assembly:
pushq $0x10
popq %rax
pushq $0x8
popq %rcx
movl (%rdi), %edx
cmpl $0xc, %edx
je 0x2ef5
movq %rax, %rsi
cmpl $0xd, %edx
je 0x2ef8
jmp 0x2efe
movq %rcx, %rsi
movq (%rdi,%rsi), %rdi
jmp 0x2ee4
cmpl $0xa, %edx
jne 0x2f08
movq 0x8(%rdi), %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/ir.c
// Function: ir_function_set_local
void ir_function_set_local(IRFunction* f, IRSymbolID id, size_t size) {
    while(vector_len(f->locals) <= id) {
        void* e = vector_append(f->locals);
        assert(e);
    }

    size_t* s = vector_at(f->locals, id);
    *s = size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x28(%r15), %rdi
callq 0x29db
movq 0x28(%r15), %rdi
cmpq %r14, %rax
ja 0x2f9b
callq 0x2982
testq %rax, %rax
jne 0x2f62
leaq 0x30cb(%rip), %rdi      # 0x6050
leaq 0x3544(%rip), %rsi      # 0x64d0
leaq 0x3542(%rip), %rcx      # 0x64d5
pushq $0x2b
popq %rdx
callq 0x10d0
movq %r14, %rsi
callq 0x29c6
movq %rbx, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/ir.c
// Function: ir_module_new
IRModule* ir_module_new() {
    IRModule* m = (IRModule*)malloc(sizeof(IRModule));
    m->definitions = vector_new(sizeof(IRInst));
    m->functions = vector_new(sizeof(IRFunction));
    m->defs_sym_id = 0;

    return m;
}

// Assembly:
pushq %rbx
pushq $0x18
popq %rdi
callq 0x1160
movq %rax, %rbx
pushq $0x30
popq %rdi
callq 0x2898
movq %rax, (%rbx)
pushq $0x38
popq %rdi
callq 0x2898
movq %rax, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/ir.c
// Function: ir_module_drop
void ir_module_drop(IRModule *m) {
    for(size_t i=0; i<vector_len(m->definitions); ++i) {
        IRInst* inst = vector_at(m->definitions, i);
        ir_inst_destruct(inst);
    }
    vector_drop(m->definitions);

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

    free(m);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x29db
movq (%rbx), %rdi
cmpq %rax, %r14
jae 0x3018
movq %r14, %rsi
callq 0x29c6
movq %rax, %rdi
callq 0x570a
incq %r14
jmp 0x2ff3
callq 0x2966
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
callq 0x29db
movq 0x8(%rbx), %rdi
cmpq %rax, %r14
jae 0x305c
movq %r14, %rsi
callq 0x29c6
movq %rax, %r15
movq (%rax), %rdi
callq 0x1040
movq 0x10(%r15), %rdi
callq 0x56df
movq 0x28(%r15), %rdi
callq 0x2966
incq %r14
jmp 0x3020
callq 0x2966
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/ir.c
// Function: ir_module_fprint
void ir_module_fprint(FILE* fp, IRModule* m) {
    for(size_t i=0; i<vector_len(m->definitions); ++i) {
        IRInst* inst = vector_at(m->definitions, i);
        ir_inst_fprint(fp, inst);
    }

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq (%rbx), %rdi
callq 0x29db
cmpq %rax, %r15
jae 0x32a3
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x29c6
movq %r14, %rdi
movq %rax, %rsi
callq 0x32d6
incq %r15
jmp 0x327b
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
callq 0x29db
cmpq %rax, %r15
jae 0x32d0
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x29c6
movq %r14, %rdi
movq %rax, %rsi
callq 0x34e8
incq %r15
jmp 0x32a6
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
callq 0x3527
movq (%r14), %rdx
leaq 0x2f9e(%rip), %rsi      # 0x6517
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1120
pushq $0x2
popq %rbp
movq 0x10(%r14), %rdi
callq 0x29db
cmpq %rax, %r15
jae 0x35c0
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x29c6
movq %rax, %r12
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3527
movq %rbx, %rdi
movq %r12, %rsi
callq 0x32d6
incq %r15
jmp 0x3589
movq 0x18(%r14), %r15
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x3527
testq %r15, %r15
je 0x35e8
movq 0x18(%r14), %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x32d6
leaq 0x2f2e(%rip), %rdi      # 0x651d
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x11c0
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/ir.c
// Function: ir_builder_build_bb
static IRBB* ir_builder_build_bb(IRBuilder* builder) {
    IRFunction* f = builder->current_func;
    IRBB* bb = ir_bb_arena_malloc(f->bb_arena);
    ir_bb_construct(bb, f->bb_id);
    f->bb_id++;

    return bb;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq 0x10(%r14), %rdi
callq 0x56e4
movq %rax, %rbx
movq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x54d4
incq 0x20(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/ir.c
// Function: ir_bb_terminate
static void ir_bb_terminate(IRBB* bb, IRInst inst) {
    assert(bb->term == NULL);
    // Set terminal
    bb->term = (IRInst*)malloc(sizeof(IRInst));
    *bb->term = inst;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x18(%rdi)
jne 0x3cc2
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
pushq $0x30
popq %rdi
callq 0x1160
movq %rax, 0x18(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
movups %xmm2, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2a39(%rip), %rdi      # 0x6702
leaq 0x2800(%rip), %rsi      # 0x64d0
leaq 0x2a3c(%rip), %rcx      # 0x6713
pushq $0xf
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x28
popq %rdi
callq 0x1160
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
testq %r14, %r14
je 0x3d30
movq %r14, %rdi
callq 0x17f0
jmp 0x3d32
xorl %eax, %eax
movq %rax, 0x10(%rbx)
leaq 0x15(%rip), %rsi        # 0x3d52
pushq $0x8
popq %rdi
callq 0x5878
movq %rax, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x1040
movq 0x20(%rbx), %rdi
callq 0x587d
movq %rbx, %rdi
popq %rbx
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/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 0x3dae
movq 0x20(%rdi), %rdi
leaq 0x4(%rsp), %r14
movq %r14, %rdx
callq 0x5882
cmpl $0x0, (%r14)
jne 0x3dc7
movq %rbx, (%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2a4b(%rip), %rdi      # 0x6800
leaq 0x2a50(%rip), %rsi      # 0x680c
leaq 0x2a54(%rip), %rcx      # 0x6817
pushq $0x36
jmp 0x3dde
leaq 0x2a67(%rip), %rdi      # 0x6835
leaq 0x2a37(%rip), %rsi      # 0x680c
leaq 0x2a3b(%rip), %rcx      # 0x6817
pushq $0x39
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/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 0x17f0
movq %rax, %r12
movq 0x20(%r14), %rdi
movq %rax, %rsi
callq 0x58d2
movq %rax, %r15
movq %r12, %rdi
callq 0x1040
testq %r15, %r15
jne 0x3e21
movq (%r14), %r14
testq %r14, %r14
jne 0x3df2
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x29db
movq (%rbx), %rdi
cmpq %rax, %r14
jae 0x4781
movq %r14, %rsi
callq 0x29c6
cmpl $0x5, (%rax)
jne 0x477c
cmpl $0x0, 0x10(%rax)
je 0x477c
movq 0x8(%rax), %rdi
callq 0x1040
incq %r14
jmp 0x4750
callq 0x2966
movq 0x8(%rbx), %rdi
callq 0x2966
movq 0x10(%rbx), %rdi
callq 0x2966
movq 0x18(%rbx), %rdi
callq 0x2966
movq 0x30(%rbx), %rdi
callq 0x5750
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
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 0x4a70
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 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, 0x10(%rsp)
xorl %r14d, %r14d
testl %ebp, %ebp
cmovlel %r14d, %ebp
leaq 0x1afe(%rip), %r15      # 0x65a9
pushq $0x2
popq %r12
pushq $0x1
popq %r13
cmpl %r14d, %ebp
je 0x4b12
testl %r14d, %r14d
je 0x4ad0
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x11c0
jmp 0x4adb
pushq $0x9
popq %rdi
movq %rbx, %rsi
callq 0x10f0
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x4af4
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x4b02
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x4b2f
incl %r14d
jmp 0x4ab3
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x10f0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
movl (%rsi), %edx
cmpq $0x4, %rdx
ja 0x4c04
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1e70(%rip), %rax      # 0x69bc
movslq (%rax,%rdx,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 0x4bc6
movq %rbx, %rsi
callq 0x10e0
jmp 0x4bdb
movq 0x8(%r14), %rdx
leaq 0x1f73(%rip), %rsi      # 0x6af9
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1120
movl 0x8(%r14), %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4c3b
movl 0x8(%r14), %edx
leaq 0x1f40(%rip), %rsi      # 0x6af5
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1120
movl 0x10(%r14), %edx
leaq 0x1d84(%rip), %rsi      # 0x6955
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1120
pushq $0x28
popq %rdi
movq %rbx, %rsi
callq 0x10f0
movl 0x14(%r14), %esi
movq %rbx, %rdi
callq 0x4c3b
pushq $0x29
popq %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10f0
movq 0x63ed(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x1d32(%rip), %rsi      # 0x6947
xorl %eax, %eax
callq 0x1120
leaq 0x1c1b(%rip), %rdi      # 0x683e
leaq 0x1e91(%rip), %rsi      # 0x6abb
leaq 0x1ed2(%rip), %rcx      # 0x6b03
movl $0x186, %edx            # imm = 0x186
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/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 0x29db
cmpq %rbx, %rax
ja 0x4cea
movq %r14, %rdi
callq 0x2982
testq %rax, %rax
jne 0x4cb1
leaq 0x137e(%rip), %rdi      # 0x6050
leaq 0x1de2(%rip), %rsi      # 0x6abb
leaq 0x1f3d(%rip), %rcx      # 0x6c1d
movl $0xc6, %edx
callq 0x10d0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x29c6
movl $0x1, (%rax)
leaq 0x8(%rax), %r14
movups (%r15), %xmm0
movups %xmm0, 0x8(%rax)
movq 0x10(%r15), %rcx
movq %rcx, 0x18(%rax)
movq 0x62c2(%rip), %r15      # 0xafd8
movq (%r15), %rdi
leaq 0x1f46(%rip), %rsi      # 0x6c66
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1120
movq (%r15), %rdi
movq %r14, %rsi
callq 0x4b2f
movq (%r15), %rsi
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/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 0x5bea(%rip), %rax      # 0xafd8
movq (%rax), %rdi
leaq 0x19c6(%rip), %rsi      # 0x6dbe
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1120
movq %r14, %rdi
callq 0x29db
cmpq %rbx, %rax
jb 0x542b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x29c6
cmpl $0x1, (%rax)
jne 0x544a
addq $0x8, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1997(%rip), %rdi      # 0x6dc9
leaq 0x1682(%rip), %rsi      # 0x6abb
leaq 0x199f(%rip), %rcx      # 0x6ddf
movl $0xd9, %edx
callq 0x10d0
leaq 0x13ed(%rip), %rdi      # 0x683e
leaq 0x1663(%rip), %rsi      # 0x6abb
leaq 0x1980(%rip), %rcx      # 0x6ddf
movl $0xdf, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/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 0x5b5e(%rip), %rax      # 0xafd8
movq (%rax), %rdi
leaq 0x199f(%rip), %rsi      # 0x6e23
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1120
movq 0x18(%r14), %rdi
callq 0x29db
cmpq %rbx, %rax
jb 0x54b3
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x29c6
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x197a(%rip), %rdi      # 0x6e34
leaq 0x15fa(%rip), %rsi      # 0x6abb
leaq 0x1989(%rip), %rcx      # 0x6e51
movl $0xef, %edx
callq 0x10d0
nop
// File: /workspace/github_c_makefile_star2_O2/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)
pushq $0x8
popq %rdi
callq 0x2898
movq %rax, 0x8(%rbx)
pushq $0x30
popq %rdi
callq 0x2898
movq %rax, 0x10(%rbx)
andq $0x0, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2966
xorl %r14d, %r14d
movq 0x10(%rbx), %rdi
callq 0x29db
movq 0x10(%rbx), %rdi
cmpq %rax, %r14
jae 0x5534
movq %r14, %rsi
callq 0x29c6
movq %rax, %rdi
callq 0x570a
incq %r14
jmp 0x550d
callq 0x2966
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x5557
callq 0x570a
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_O2/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 0x55ad
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x55ad
movq %rdx, %rbx
movq %rsi, %rdx
cmpl $0x3, %ecx
je 0x55b3
cmpl $0x2, %ecx
jne 0x55c1
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 0x55ad
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 0x1276(%rip), %rdi      # 0x683e
leaq 0x18d1(%rip), %rsi      # 0x6ea0
leaq 0x18d2(%rip), %rcx      # 0x6ea8
pushq $0x36
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/ir_bb.c
// Function: ir_bb_visit
void ir_bb_visit(IRBB* initial_bb, void(*f)(IRBB* bb, void*), void* args) {
    struct ir_bb_visit_iter_arg_t state = {
        .visited = uint_map_new(1, NULL),
        .bbs = vector_new(sizeof(IRBB*)), // Vector<IRBB*>
        .head = 0,
    };

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

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

        f(*bb, args);

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
xorl %ebp, %ebp
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x571c
movq %rsp, %r15
movq %rax, (%r15)
pushq $0x8
popq %rdi
callq 0x2898
movq %rax, %r13
movq %rax, 0x8(%r15)
andq $0x0, 0x10(%r15)
movq %rax, %rdi
callq 0x2982
movq %r12, (%rax)
leaq 0x65(%rip), %r12        # 0x5692
movq %r13, %rdi
callq 0x29db
movq 0x8(%rsp), %rdi
cmpq %rax, %rbp
jae 0x5675
movq 0x10(%rsp), %rsi
callq 0x29c6
movq %rax, %r13
incq 0x10(%rsp)
movq (%rax), %rdi
movq %rbx, %rsi
callq *%r14
movq (%r13), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x555f
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rbp
jmp 0x562d
callq 0x2966
movq (%rsp), %rdi
callq 0x5750
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x57a9
cmpl $0x0, (%r15)
jne 0x56c6
movq 0x8(%r14), %rdi
callq 0x2982
movq %rbx, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/map.c
// Function: map_new
static Map* map_new(size_t elem_size, void (*dtor)(void*)) {
    Map* m = (Map*)malloc(sizeof(Map));
    m->elem_size = elem_size;
    m->elems = vector_new(sizeof(Elem));
    m->dtor = dtor;

    return m;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x1160
movq %rax, %r15
movq %r14, (%rax)
pushq $0x10
popq %rdi
callq 0x2898
movq %rax, 0x8(%r15)
movq %rbx, 0x10(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
callq 0x29db
movq 0x8(%rbx), %rdi
cmpq %rax, %r14
jae 0x5797
movq %r14, %rsi
callq 0x29c6
movq %rax, %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x5789
movq 0x8(%r15), %rdi
callq *%rax
movq 0x8(%r15), %rdi
callq 0x1040
incq %r14
jmp 0x575d
callq 0x2966
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/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 0x57f9
testq %rax, %rax
je 0x57cf
testq %r15, %r15
je 0x57f3
movl $0x1, (%r15)
jmp 0x57f3
testq %r15, %r15
je 0x57d8
andl $0x0, (%r15)
movq 0x8(%rbx), %rdi
callq 0x2982
movq %rax, %r15
movq %r14, (%rax)
movq (%rbx), %rdi
callq 0x1160
movq %rax, 0x8(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/map.c
// Function: map_find
static void* map_find(UintMap* m, int (*cmp)(Elem*, void*), void* arg) {
    // TODO: improve performance
    for(size_t i=0; i<vector_len(m->elems); ++i) {
        Elem* elem = vector_at(m->elems, i);
        if (cmp(elem, arg)) {
            return (void*)elem->buffer;
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
xorl %r13d, %r13d
movq 0x8(%r12), %rdi
callq 0x29db
cmpq %rax, %r13
jae 0x585a
movq 0x8(%r12), %rdi
movq %r13, %rsi
callq 0x29c6
movq %rax, %rbp
movq %rax, %rdi
movq %r14, %rsi
callq *%r15
incq %r13
testl %eax, %eax
je 0x5827
movq 0x8(%rbp), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x58d2
testq %rax, %rax
je 0x58a8
testq %r15, %r15
je 0x58cc
movl $0x1, (%r15)
jmp 0x58cc
testq %r15, %r15
je 0x58b1
andl $0x0, (%r15)
movq 0x8(%rbx), %rdi
callq 0x2982
movq %rax, %r15
movq %r14, (%rax)
movq (%rbx), %rdi
callq 0x1160
movq %rax, 0x8(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x50
popq %rdi
callq 0x1160
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_O2/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 0x5966
callq 0x2fe8
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x5974
callq 0x3079
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x5990
callq 0x3e41
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x59c3
callq 0x5913
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x59ac
callq 0x194c
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x59dc
callq 0x2f47
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x59ba
callq 0x2966
movq %rbx, %rdi
popq %rbx
jmp 0x1040
leaq 0x1521(%rip), %rdi      # 0x6eeb
leaq 0x1524(%rip), %rsi      # 0x6ef5
leaq 0x1522(%rip), %rcx      # 0x6efa
pushq $0x37
jmp 0x59f3
leaq 0x152a(%rip), %rdi      # 0x6f0d
leaq 0x150b(%rip), %rsi      # 0x6ef5
leaq 0x1509(%rip), %rcx      # 0x6efa
pushq $0x3e
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/yutopp[P]cc/cc.c
// Function: cc_parse
ParserResult cc_parse(CC* cc) {
    cc_lex(cc); // TODO: pass lexer to parser

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

    return parser_parse(cc->parser);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x2898
movq %rax, 0x10(%r14)
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x1494
movq %rax, %r15
leaq 0x8(%rsp), %r12
movq 0x55a4(%rip), %r13      # 0xafd8
pushq $0xa
popq %rbp
movq %r12, %rdi
movq %r15, %rsi
callq 0x14c4
movq (%r13), %rdi
movq %r12, %rsi
callq 0x1838
movl %ebp, %edi
callq 0x1050
movq 0x10(%r14), %rdi
callq 0x2982
testq %rax, %rax
je 0x5abd
movups 0x8(%rsp), %xmm0
movups 0x18(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
cmpl $0x1f, 0x8(%rsp)
jne 0x5a37
movq %r15, %rdi
callq 0x14bf
xorl %eax, %eax
callq 0x2f38
movq %rax, 0x18(%r14)
movq 0x10(%r14), %rdi
movq %rax, %rsi
callq 0x1910
movq %rax, 0x20(%r14)
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1968
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14c4(%rip), %rdi      # 0x6f88
leaq 0x142a(%rip), %rsi      # 0x6ef5
leaq 0x14bb(%rip), %rcx      # 0x6f8d
pushq $0x53
popq %rdx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0x23ce
movq %rax, 0x18(%rbx)
leaq 0x10(%rbx), %r14
movq %rsp, %rdx
andl $0x0, (%rdx)
leaq 0x8(%rsp), %r12
leaq 0x7(%rsp), %rcx
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
callq 0x3b04
movq (%r12), %rax
xorl %ecx, %ecx
testl %ebp, %ebp
movl $0x0, %edx
cmovgl %ebp, %edx
cmpq %rcx, %rdx
je 0x2411
movzbl (%r15,%rcx), %esi
incl (%rax,%rsi,4)
incq %rcx
jmp 0x23ff
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x10(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r12
jae 0x2456
movl (%rax,%r12,4), %ecx
testl %ecx, %ecx
jle 0x2451
imull $0xff, %ecx, %eax
cltd
idivl %ebp
movb %r12b, (%rsp)
movb %al, 0x1(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3f16
movq 0x8(%rsp), %rax
incq %r12
jmp 0x2417
movq 0x10(%rbx), %r14
movq 0x18(%rbx), %rbx
cmpq %rbx, %r14
je 0x24ba
movq %rbx, %r15
subq %r14, %r15
movq %r15, %rax
sarq %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x385b
cmpq $0x21, %r15
jl 0x24af
leaq 0x20(%r14), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a81
cmpq %rbx, %r15
je 0x24ba
movq %r15, %rdi
callq 0x3ae5
addq $0x2, %r15
jmp 0x249c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3a81
leaq 0x8(%rsp), %rdi
callq 0x3e46
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3e46
movq %rbx, %rdi
callq 0x2260
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0x2509
movq %rax, 0x18(%r15)
addq $0x10, %r15
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
xorps %xmm1, %xmm1
leaq 0xe(%rsp), %r12
cmpq %r13, %rbx
je 0x2556
movss (%r14,%r13,4), %xmm0
ucomiss %xmm0, %xmm1
jae 0x2551
mulss 0x2ace(%rip), %xmm0     # 0x5004
cvttss2si %xmm0, %eax
movb %r13b, 0xe(%rsp)
movb %al, 0xf(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3f16
xorps %xmm1, %xmm1
incq %r13
jmp 0x251e
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq