LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/parse.c
// Function: parse_type_def
static struct ast *parse_type_def(struct parse *parse)
{
    struct loc *line = get_linenr(parse);
    expect(parse, TYPE_TOK);

    struct ast *name = parse_name(parse);
    if (name == NULL)
	return NULL;

    struct ast *type = parse_type(parse);
    // If we cannot parse the type (and type becomes NULL), then it is a type
    // declaration to an incomplete type.

    return term_semicolon(parse, ast_new_ast(line, TYPE_DEF, 2, name, type));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rcx
movslq 0x14(%rdi), %rax
movq %rax, %rdx
shlq $0x5, %rdx
movq 0x8(%rcx,%rdx), %r14
cmpl $0x123, (%rcx,%rdx)     # imm = 0x123
jne 0x9a19
incl %eax
movl %eax, 0x14(%rbx)
movq %rbx, %rdi
callq 0xa6b9
testq %rax, %rax
je 0x9a73
movq %rax, %r15
movq %rbx, %rdi
callq 0x9b22
movl $0x2, %edx
movq %r14, %rdi
movl $0x4002, %esi           # imm = 0x4002
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2552
testq %rax, %rax
je 0x9a73
movq (%rbx), %rdx
movslq 0x14(%rbx), %rcx
movq %rcx, %rsi
shlq $0x5, %rsi
cmpl $0x3b, (%rdx,%rsi)
jne 0x9a6b
incl %ecx
movl %ecx, 0x14(%rbx)
jmp 0x9a75
movq %rax, %rdi
callq 0x26ef
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/parse.c
// Function: parse_alias_def
static bool expect(struct parse *parse, enum tok tok)
{
    if (peek_tok(parse)->type == tok) {
        parse->pos++;
        return true;
    }
    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rax
movslq 0x14(%rdi), %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
cmpl $0x127, (%rax,%rdx)     # imm = 0x127
jne 0x9b10
movq %rdi, %rbx
incq %rcx
movl %ecx, 0x14(%rdi)
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %r15
callq 0xa6b9
testq %rax, %rax
je 0x9b10
movq %rax, %r12
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9ef1
testq %rax, %rax
je 0x9b13
movl $0x2, %edx
movq %r15, %rdi
movl $0x4003, %esi           # imm = 0x4003
movq %r12, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2552
testq %rax, %rax
je 0x9b10
movq %rax, %r14
movq (%rbx), %rcx
movslq 0x14(%rbx), %rax
movq %rax, %rdx
shlq $0x5, %rdx
cmpl $0x3b, (%rcx,%rdx)
jne 0x9b08
incl %eax
movl %eax, 0x14(%rbx)
jmp 0x9b13
movq %r14, %rdi
callq 0x26ef
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/parse.c
// Function: parse_init
static struct ast *parse_init(struct parse *parse)
{
    struct ast *expr;
    if (peek_tok(parse)->type == '{') 
        return parse_enclosed(parse, '{', parse_init_list, '}', true);
    else
        return parse_asgn_expr(parse);
}

// Assembly:
movq (%rdi), %rax
movslq 0x14(%rdi), %rcx
shlq $0x5, %rcx
cmpl $0x7b, (%rax,%rcx)
jne 0x9ccb
leaq 0x1108(%rip), %rdx      # 0xadc1
movl $0x7b, %esi
movl $0x7d, %ecx
movl $0x1, %r8d
jmp 0x9cd5
movl $0x1, %esi
jmp 0x9ef1
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/parse.c
// Function: parse_enclosed
static struct ast *parse_enclosed(struct parse *parse, enum tok open_delim, 
        struct ast *(*parse_syntax)(struct parse *), char close_delim,
        bool report_err)
{
    if (!expect(parse, open_delim))
        goto err;

    struct ast *ast = parse_syntax(parse);
    if (ast == NULL)
        goto err;

    if (!expect(parse, close_delim)) {
        ast_unref(ast);
        goto err;
    }

    return ast;

err:
    if (report_err)
        syntax_error(parse);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdi, %rbx
movq (%rdi), %rcx
movslq 0x14(%rdi), %rax
movq %rax, %rdi
shlq $0x5, %rdi
cmpl %esi, (%rcx,%rdi)
jne 0x9d2a
incl %eax
movl %eax, 0x14(%rbx)
movq %rbx, %rdi
callq *%rdx
testq %rax, %rax
je 0x9d2a
movzbl %r14b, %edx
movq (%rbx), %rsi
movslq 0x14(%rbx), %rcx
movq %rcx, %rdi
shlq $0x5, %rdi
cmpl %edx, (%rsi,%rdi)
jne 0x9d22
incl %ecx
movl %ecx, 0x14(%rbx)
jmp 0x9d31
movq %rax, %rdi
callq 0x26ef
testb %bpl, %bpl
jne 0x9d36
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq (%rbx), %rax
movslq 0x14(%rbx), %rcx
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %rdi
callq 0x8c83
leaq 0x4a1d(%rip), %rsi      # 0xe76f
movq %rax, %rdi
xorl %eax, %eax
callq 0x4fa1
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/parse.c
// Function: parse_param_list
static struct ast *parse_param_list(struct parse *parse)
{
    struct ast_list *head = NULL, **tailp = &head;

    for (;;) {
        int pos = parse->pos;
        struct ast *ast = parse_param(parse);
        if (ast == NULL) {
            parse->pos = pos;
            break;
        }

        *tailp = ast_list_new(ast);
        (*tailp)->ast = ast;

        tailp = &(*tailp)->next;

        if (peek_tok(parse)->type != ',')
            break;

        parse->pos++;
    }

    struct loc *line = get_linenr(parse);

    if (peek_tok(parse)->type == ELLIPSIS_TOK) {
        *tailp = ast_list_new(ast_new(get_linenr(parse), VARARG_TYPE));
        (*tailp)->ast = ast_new(line, VARARG_TYPE);
        parse->pos++;
    }

    return ast_new_list(line, PARAM_LIST, head);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r12
movq $0x0, (%r12)
movl 0x14(%rdi), %r13d
movq (%rdi), %rax
movslq %r13d, %r15
movq %r15, %rbp
shlq $0x5, %rbp
cmpl $0x120, (%rax,%rbp)     # imm = 0x120
jne 0x9df7
movq %r15, 0x8(%rsp)
movq 0x8(%rax,%rbp), %r15
addq %rbp, %rax
leal 0x1(%r13), %ecx
movl %ecx, 0x14(%rbx)
movq 0x10(%rax), %rdi
callq 0x2220
movq %r15, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdx
callq 0x247d
movq %rax, %r14
movl 0x14(%rbx), %eax
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
callq 0x9b22
testq %rax, %rax
je 0x9e04
movl $0x2, %edx
movq %r15, %rdi
movl $0x4000, %esi           # imm = 0x4000
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2552
movq %rax, %r14
jmp 0x9e0b
movq %rbx, %rdi
callq 0x9b22
movq %rax, %r14
jmp 0x9e10
movl 0x4(%rsp), %eax
movl %eax, 0x14(%rbx)
movq 0x8(%rsp), %r15
testq %r14, %r14
je 0x9e4e
movq %r14, %rdi
callq 0x26d4
movq %rax, (%r12)
movq %r14, (%rax)
movq (%r12), %r12
addq $0x8, %r12
movq (%rbx), %rax
movslq 0x14(%rbx), %r13
movq %r13, %rcx
shlq $0x5, %rcx
movl (%rax,%rcx), %ecx
cmpl $0x2c, %ecx
jne 0x9e5a
incl %r13d
movl %r13d, 0x14(%rbx)
jmp 0x9d81
movl %r13d, 0x14(%rbx)
movq (%rbx), %rax
movl (%rax,%rbp), %ecx
jmp 0x9e5d
movq %r13, %r15
shlq $0x5, %r15
movq 0x8(%rax,%r15), %r14
cmpl $0x122, %ecx            # imm = 0x122
jne 0x9e9e
movq %r14, %rdi
movl $0x6, %esi
callq 0x245c
movq %rax, %rdi
callq 0x26d4
movq %rax, (%r12)
movq %r14, %rdi
movl $0x6, %esi
callq 0x245c
movq (%r12), %rcx
movq %rax, (%rcx)
incl 0x14(%rbx)
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movl $0x4400, %esi           # imm = 0x4400
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x263d
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/parse.c
// Function: parse_name
static struct ast *parse_name(struct parse *parse)
{
    if (peek_tok(parse)->type != IDENT_TOK)
	return NULL;

    struct loc *line = get_linenr(parse);
    return ast_new_s(line, NAME, strdup(get_tok(parse)->val.u.s));
}

// Assembly:
movq (%rdi), %rcx
movslq 0x14(%rdi), %rax
movq %rax, %rdx
shlq $0x5, %rdx
cmpl $0x120, (%rcx,%rdx)     # imm = 0x120
jne 0xa6f9
pushq %rbx
leaq (%rcx,%rdx), %rsi
movq 0x8(%rcx,%rdx), %rbx
incl %eax
movl %eax, 0x14(%rdi)
movq 0x10(%rsi), %rdi
callq 0x2220
movq %rbx, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdx
popq %rbx
jmp 0x247d
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/parse.c
// Function: parse_decl
static struct ast *parse_decl(struct parse *parse)
{
    struct ast *name = parse_name(parse);
    if (name == NULL)
        return NULL;

    struct ast *type = parse_type(parse);
    if (type == NULL)
        return NULL;

    return ast_new_ast(name->loc, DECL, 2, name, type);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xa6b9
testq %rax, %rax
je 0xa73f
movq %rax, %rbx
movq %r14, %rdi
callq 0x9b22
testq %rax, %rax
je 0xa73f
movq 0x8(%rbx), %rdi
movl $0x2, %edx
movl $0x4000, %esi           # imm = 0x4000
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2552
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/parse.c
// Function: parse_if_stmt
static struct ast *parse_if_stmt(struct parse *parse)
{
    if (!expect(parse, IF_TOK))
        goto err0;

    struct loc *line = get_linenr(parse);

    struct ast *expr = NULL;
    if (peek_tok(parse)->type != '{') {
        expr = parse_expr(parse);
        if (expr == NULL)
            goto err0;
    }

    struct ast *then_block = parse_block(parse);
    if (then_block == NULL)
        goto err1;

    struct ast *else_block = NULL;
    if (peek_tok(parse)->type == ELSE_TOK) {
	parse->pos++;

        else_block = peek_tok(parse)->type == IF_TOK ?
                parse_if_stmt(parse) : parse_block(parse);

        if (else_block == NULL)
            goto err2;
    }

    return ast_new_ast(line, IF_STMT, 3, expr, then_block, else_block);

err2:
    ast_unref(then_block);
err1:
    ast_unref(expr);
err0:
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rax
movslq 0x14(%rdi), %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
cmpl $0x102, (%rax,%rdx)     # imm = 0x102
jne 0xadb3
movq %rdi, %r15
incq %rcx
movl %ecx, 0x14(%rdi)
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %rbx
cmpl $0x7b, (%rax,%rcx)
jne 0xacdc
xorl %r14d, %r14d
jmp 0xacf2
movq %r15, %rdi
xorl %esi, %esi
callq 0x9ef1
movq %rax, %r14
testq %rax, %rax
je 0xadb3
leaq -0x5b0(%rip), %rdx      # 0xa749
movq %r15, %rdi
movl $0x7b, %esi
movl $0x7d, %ecx
movl $0x1, %r8d
callq 0x9cd5
testq %rax, %rax
je 0xadab
movq %rax, %r12
movq (%r15), %rax
movslq 0x14(%r15), %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
cmpl $0x121, (%rax,%rdx)     # imm = 0x121
jne 0xad52
incq %rcx
movl %ecx, 0x14(%r15)
shlq $0x5, %rcx
cmpl $0x102, (%rax,%rcx)     # imm = 0x102
jne 0xad57
movq %r15, %rdi
callq 0xac9c
jmp 0xad76
xorl %r9d, %r9d
jmp 0xad7e
leaq -0x615(%rip), %rdx      # 0xa749
movq %r15, %rdi
movl $0x7b, %esi
movl $0x7d, %ecx
movl $0x1, %r8d
callq 0x9cd5
movq %rax, %r9
testq %rax, %rax
je 0xada3
movl $0x3, %edx
movq %rbx, %rdi
movl $0x4101, %esi           # imm = 0x4101
movq %r14, %rcx
movq %r12, %r8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2552
movq %r12, %rdi
callq 0x26ef
movq %r14, %rdi
callq 0x26ef
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/rope.c
// Function: rope_indent
struct rope *rope_indent(void)
{
    struct rope *rope = malloc(sizeof *rope);
    rope->leaf = true;
    rope->val.s = rope_buf.data + rope_buf.n;
    
    size_t i = 0;
    while (i < zc_indent_level) {
        for (size_t j = 0; j < 4; ++j) {
            rope->val.s[i++] = ' ';
            rope_buf.n += 4;
        }
    }
    rope->val.s[i] = '\0';
    rope_buf.n++;

    return rope;
}

// Assembly:
pushq %rax
movl $0x18, %edi
callq 0x2160
movb $0x1, (%rax)
leaq 0x901f(%rip), %rcx      # 0x13e28
addq 0x109018(%rip), %rcx    # 0x113e28
movq %rcx, 0x8(%rax)
leaq 0x8fb9(%rip), %rdx      # 0x13dd4
movslq (%rdx), %rsi
xorl %edx, %edx
testq %rsi, %rsi
je 0xae4e
movq %rcx, %rdi
addq $0x4, %rdx
xorl %r8d, %r8d
movb $0x20, (%rdi,%r8)
addq $0x4, 0x108fec(%rip)    # 0x113e28
incq %r8
cmpq $0x4, %r8
jne 0xae2f
addq $0x4, %rdi
cmpq %rsi, %rdx
jb 0xae28
movb $0x0, (%rcx,%rdx)
incq 0x108fcf(%rip)          # 0x113e28
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/rope.c
// Function: rope_new_fmt
struct rope *rope_new_fmt(const char *fmt, ...)
{
    struct rope *rope = malloc(sizeof *rope);
    rope->leaf = true;
    rope->val.s = rope_buf.data + rope_buf.n;

    va_list va;
    va_start(va, fmt);

    char *data = rope_buf.data + rope_buf.n;
    size_t n_left = sizeof rope_buf.data - rope_buf.n;

    size_t n_written = vsnprintf(data, n_left, fmt, va) + 1;
    if (n_written > n_left)
        fatal(NULL, "not enough space in rope buffer");

    rope_buf.n += n_written;

    va_end(va);

    return rope;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %r14
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0xaf5a
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)
movl $0x18, %edi
callq 0x2160
movq %rax, %rbx
movb $0x1, (%rax)
leaq 0x8eb7(%rip), %rdi      # 0x13e28
movq 0x108eb0(%rip), %rax    # 0x113e28
addq %rdi, %rax
movq %rax, 0x8(%rbx)
movq %rsp, %rcx
movq %r15, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
movq 0x108e82(%rip), %rax    # 0x113e28
addq %rax, %rdi
movl $0x100000, %r15d        # imm = 0x100000
subq %rax, %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x2080
incl %eax
cltq
cmpq %rax, %r15
jb 0xafdd
addq %rax, 0x108e5b(%rip)    # 0x113e28
movq %rbx, %rax
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x38e9(%rip), %rsi      # 0xe8cd
xorl %edi, %edi
xorl %eax, %eax
callq 0x4fa1
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/rope.c
// Function: rope_print_to_file
void rope_print_to_file(struct rope *rope, FILE *fp)
{
    if (!rope)
        return;

    if (rope->leaf) {
        fputs(rope->val.s, fp);
        return;
    }

    rope_print_to_file(rope->val.childs[0], fp);
    rope_print_to_file(rope->val.childs[1], fp);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xb017
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%r14), %rdi
cmpb $0x1, (%r14)
je 0xb01f
movq %rbx, %rsi
callq 0xafed
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0xaffc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20e0
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/scope.c
// Function: scope_get_sym
struct sym *scope_get_sym(struct scope *scope, const char *name)
{
    struct sym *sym = strmap_get(scope->symtbl, name);
    if (sym == NULL) {
        if (scope->parent == NULL)
            return NULL;
        return scope_get_sym(scope->parent, name);
    }
    return sym_res(sym);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%r14), %rdi
movq %rbx, %rsi
callq 0xb18b
testq %rax, %rax
jne 0xb0c9
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0xb0a6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb354
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/scope.c
// Function: sym_type
struct type *sym_type(struct sym * sym)
{
    if (sym == NULL)
        return NULL;

    assert(sym->tag == TYPE_SYM);
    return ((struct type_sym *)sym)->type;
}

// Assembly:
testq %rdi, %rdi
je 0xb0e7
cmpl $0x3, (%rdi)
jne 0xb0ea
movq 0x10(%rdi), %rax
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x20ba(%rip), %rdi      # 0xd1ac
leaq 0x37f4(%rip), %rsi      # 0xe8ed
leaq 0x37f5(%rip), %rcx      # 0xe8f5
leaq 0x3803(%rip), %r8       # 0xe90a
movl $0x26, %edx
xorl %eax, %eax
callq 0x4eac
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/scope.c
// Function: scope_get_type
struct type *scope_get_type(struct scope *scope, const char *name)
{
    struct sym *sym = strmap_get(scope->typetbl, name);
    if (sym == NULL) {
        if (scope->parent == NULL)
            return NULL;
        return scope_get_type(scope->parent, name);
    }
    return sym_type(sym_res(sym));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq 0xb18b
testq %rax, %rax
jne 0xb141
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0xb11d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xb354
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb0d8
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/strmap.c
// Function: strmap_get
void *strmap_get(struct strmap *map, const char *key)
{
    size_t h = strhash64(key) % map->n;
    for (struct strmap_e *e = map->map[h]; e != NULL; e = e->next) {
        if (strcmp(key, e->key) == 0)
            return e->val;
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movabsq $-0x340d631b7bdddcdb, %r8 # imm = 0xCBF29CE484222325
movb (%rsi), %sil
testb %sil, %sil
je 0xb1ce
leaq 0x1(%rbx), %rcx
movabsq $0x100000001b3, %rdx    # imm = 0x100000001B3
movsbq %sil, %rax
xorq %r8, %rax
imulq %rdx, %rax
movb (%rcx), %sil
incq %rcx
movq %rax, %r8
testb %sil, %sil
jne 0xb1b3
jmp 0xb1d1
movq %r8, %rax
xorl %r14d, %r14d
xorl %edx, %edx
divq (%rdi)
movq 0x8(%rdi), %rax
movq (%rax,%rdx,8), %r15
testq %r15, %r15
je 0xb207
xorl %r14d, %r14d
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x2100
testl %eax, %eax
je 0xb203
movq 0x10(%r15), %r15
testq %r15, %r15
jne 0xb1e9
jmp 0xb207
movq 0x8(%r15), %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/strmap.c
// Function: strmap_add
void strmap_add(struct strmap *map, const char *key, void *val)
{
    int n = strhash64(key) % map->n;
    struct strmap_e *e = malloc(sizeof *e);

    e->key = strdup(key);
    e->val = val;
    e->next = map->map[n];

    map->map[n] = e;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movabsq $-0x340d631b7bdddcdb, %rdi # imm = 0xCBF29CE484222325
movb (%rsi), %sil
testb %sil, %sil
je 0xb25d
leaq 0x1(%r15), %rcx
movabsq $0x100000001b3, %rdx    # imm = 0x100000001B3
movsbq %sil, %rax
xorq %rdi, %rax
imulq %rdx, %rax
movb (%rcx), %sil
incq %rcx
movq %rax, %rdi
testb %sil, %sil
jne 0xb242
jmp 0xb260
movq %rdi, %rax
xorl %edx, %edx
divq (%r14)
movq %rdx, %r12
movl $0x18, %edi
callq 0x2160
movq %rax, %r13
movq %r15, %rdi
callq 0x2220
movq %rax, (%r13)
movq %rbx, 0x8(%r13)
movq 0x8(%r14), %rax
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rdx
movq %rdx, 0x10(%r13)
movq %r13, (%rax,%rcx,8)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/strmap.c
// Function: del_strmap_e
void del_strmap_e(struct strmap_e *e, void (*val_free)(void *))
{
    if (e == NULL)
        return;

    del_strmap_e(e->next, val_free);
    free(e->key);

    if (val_free != NULL)
        val_free(e->val);

    free(e);
}

// Assembly:
testq %rdi, %rdi
je 0xb2dd
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0xb2a2
movq (%rbx), %rdi
callq 0x2030
testq %r14, %r14
je 0xb2ce
movq 0x8(%rbx), %rdi
callq *%r14
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2030
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/sym.c
// Function: sym_res
struct sym *sym_res(struct sym *sym)
{
    if (sym == NULL)
        return NULL;

    if (sym->tag != UNRES_SYM)
        return sym;

    switch (sym->loc->tag) {
        case DECL: {
            sym->tag = DECL_SYM;
            struct decl_sym *decl_sym = (struct decl_sym *)sym;
            decl_sym->type = NULL;
            decl_sym->type = type_from_ast(ast_ast(sym->loc, 1));
            decl_sym->c_name = strdup(ast_s(ast_ast(sym->loc, 0)));

            add_global_decl(decl_sym);
            return sym;
        }
        case TYPE_DEF: {
            sym->tag = TYPE_SYM;
            struct type_sym *type_sym = (struct type_sym *)sym;
            type_sym->type = new_selfref_type(type_sym);

            struct ast *ast = ast_ast(sym->loc, 1);

            if (ast == NULL) {
                type_sym->type = new_extern_type();
            } else {
                type_sym->type = type_from_ast(ast);
                if (!resolve_selfref(&type_sym->type, false))
                    fatal(sym->loc->loc, "type cannot reference itself in "
                            "this context");
                add_type_decl(type_sym->type);
            }

            return sym;
        }
        case ALIAS_DEF: {
            sym->tag = ALIAS_SYM;
            struct alias_sym *alias_sym = (struct alias_sym *)sym;
            alias_sym->ast = ast_ast(sym->loc, 1);
            return sym;
        }
        default:
            unreachable();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0xb365
cmpl $0x0, (%rbx)
je 0xb370
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rbx), %rdi
movl (%rdi), %eax
cmpl $0x4003, %eax           # imm = 0x4003
je 0xb42f
cmpl $0x4002, %eax           # imm = 0x4002
je 0xb3e0
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xb455
movl $0x1, (%rbx)
movq $0x0, 0x18(%rbx)
movl $0x1, %esi
callq 0x27e8
movq %rax, %rdi
callq 0xba08
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x27e8
movq %rax, %rdi
callq 0x26f0
movq %rax, %rdi
callq 0x2220
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
callq 0x4191
jmp 0xb365
movl $0x3, (%rbx)
movq %rbx, %rdi
callq 0xb7ec
leaq 0x10(%rbx), %r14
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rdi
movl $0x1, %esi
callq 0x27e8
testq %rax, %rax
je 0xb448
movq %rax, %rdi
callq 0xba08
movq %rax, (%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0xc193
testb %al, %al
je 0xb476
movq (%r14), %rdi
callq 0x421b
jmp 0xb365
movl $0x2, (%rbx)
movl $0x1, %esi
callq 0x27e8
movq %rax, 0x10(%rbx)
jmp 0xb365
callq 0xb913
movq %rax, (%r14)
jmp 0xb365
leaq 0x2a64(%rip), %rdi      # 0xdec0
leaq 0x34dd(%rip), %rsi      # 0xe940
leaq 0x34dc(%rip), %rcx      # 0xe946
movl $0x45, %edx
xorl %eax, %eax
callq 0x4eac
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x348e(%rip), %rsi      # 0xe913
xorl %eax, %eax
callq 0x4fa1
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/sym.c
// Function: sym_from_ast
struct sym *sym_from_ast(struct ast *ast)
{
    if (ast->tag == DECL) {
        struct decl_sym *decl_sym = (struct decl_sym *)sym_new(ast);
        decl_sym->sym.loc = ast;
        decl_sym->sym.tag = DECL_SYM;
        decl_sym->type = type_from_ast(ast_ast(decl_sym->sym.loc, 1));
	decl_sym->type->tag |= LVAL_TYPE_FLAG;
        decl_sym->c_name = gen_c_ident();

        return (struct sym *)decl_sym;
    }
    abort();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x4000, (%rdi)         # imm = 0x4000
jne 0xb4e3
movq %rdi, %rbx
movl $0x28, %edi
callq 0x2160
movq %rax, %r14
movq %rbx, 0x8(%rax)
movl $0x1, (%rax)
movl $0x1, %esi
movq %rbx, %rdi
callq 0x27e8
movq %rax, %rdi
callq 0xba08
movq %rax, 0x18(%r14)
orb $0x4, 0x1(%rax)
callq 0x31ff
movq %rax, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x2040
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/type.c
// Function: sizeof_basic_type
size_t sizeof_basic_type(struct type *type)
{
    switch (type->tag & ~LVAL_TYPE_FLAG) {
        case INT8_TYPE:
        case UINT8_TYPE:
        case CHAR_TYPE:
        case BOOL_TYPE:
            return 1;

        case INT16_TYPE:
        case UINT16_TYPE:
            return 2;

        case UINT_TYPE:
        case INT_TYPE:
            return sizeof (int);

        case UINT32_TYPE:
        case INT32_TYPE:
            return 4;

        case SSIZE_TYPE:
        case SIZE_TYPE:
            return sizeof (size_t);

        case INT64_TYPE:
        case UINT64_TYPE:
            return 8;

        case INTPTR_TYPE:
        case UINTPTR_TYPE:
            return sizeof (intptr_t);

        case FLOAT_TYPE:
            return sizeof (float);

        case DOUBLE_TYPE:
            return sizeof (double);

        default:
            bug("Invalid argument to sizeof_basic_type: %x", type->tag);
    }
}

// Assembly:
movl (%rdi), %esi
movl %esi, %ecx
andl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
movl $0x1, %eax
cmpl $0x6001, %ecx           # imm = 0x6001
jg 0xb53c
cmpl $0x2001, %ecx           # imm = 0x2001
jle 0xb572
cmpl $0x3001, %ecx           # imm = 0x3001
jle 0xb5c8
cmpl $0x3002, %ecx           # imm = 0x3002
je 0xb5fd
cmpl $0x4002, %ecx           # imm = 0x4002
je 0xb5f7
cmpl $0x5002, %ecx           # imm = 0x5002
je 0xb5f7
jmp 0xb5d8
cmpl $0xa001, %ecx           # imm = 0xA001
jle 0xb589
cmpl $0xc001, %ecx           # imm = 0xC001
jle 0xb5e7
cmpl $0xc002, %ecx           # imm = 0xC002
je 0xb5f7
cmpl $0xd002, %ecx           # imm = 0xD002
je 0xb5f7
cmpl $0xe002, %ecx           # imm = 0xE002
je 0xb5c7
jmp 0xb5d8
cmpl $0x1001, %ecx           # imm = 0x1001
jg 0xb5a3
cmpl $0x2, %ecx
je 0xb5fd
cmpl $0x80, %ecx
je 0xb5c7
jmp 0xb5d8
cmpl $0x8001, %ecx           # imm = 0x8001
jg 0xb5b5
cmpl $0x6002, %ecx           # imm = 0x6002
je 0xb5f7
cmpl $0x7002, %ecx           # imm = 0x7002
je 0xb5fd
jmp 0xb5d8
cmpl $0x1002, %ecx           # imm = 0x1002
je 0xb5c7
cmpl $0x1004, %ecx           # imm = 0x1004
je 0xb5fd
jmp 0xb5d8
cmpl $0x8002, %ecx           # imm = 0x8002
je 0xb5c7
cmpl $0x9002, %ecx           # imm = 0x9002
je 0xb603
jmp 0xb5d8
retq
cmpl $0x2002, %ecx           # imm = 0x2002
je 0xb603
cmpl $0x2004, %ecx           # imm = 0x2004
je 0xb5f7
pushq %rax
leaq 0x3380(%rip), %rdi      # 0xe960
xorl %eax, %eax
callq 0x4eac
cmpl $0xa002, %ecx           # imm = 0xA002
je 0xb5fd
cmpl $0xb002, %ecx           # imm = 0xB002
jne 0xb5d8
movl $0x8, %eax
retq
movl $0x4, %eax
retq
movl $0x2, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/type.c
// Function: basic_type_c_name
const char *basic_type_c_name(struct type *type)
{
    switch (type->tag & ~LVAL_TYPE_FLAG) {
        case EXTERN_TYPE:
        case VOID_TYPE:
            return "void";

        case CHAR_TYPE:
            return "char";

        case BOOL_TYPE:
            return "_Bool";

        case UINT_TYPE:
        case UINT8_TYPE:
        case UINT16_TYPE:
        case UINT32_TYPE:
        case UINT64_TYPE:
        case SIZE_TYPE:
        case UINTPTR_TYPE:
            return int_to_c_type(false, sizeof_basic_type(type));

        case INT_TYPE:
        case INT8_TYPE:
        case INT16_TYPE:
        case INT32_TYPE:
        case INT64_TYPE:
        case SSIZE_TYPE:
        case INTPTR_TYPE:
            return int_to_c_type(true, sizeof_basic_type(type));

        case FLOAT_TYPE:
            return "float";

        case DOUBLE_TYPE:
            return "double";

        default:
            bug("Invalid argument to basic_type_c_name: %x", type->tag);
    }
}

// Assembly:
pushq %rax
movl (%rdi), %esi
movl %esi, %ecx
andl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
cmpl $0x5001, %ecx           # imm = 0x5001
jg 0xb6da
cmpl $0x1003, %ecx           # imm = 0x1003
jg 0xb717
leaq 0x293c(%rip), %rax      # 0xdfe4
cmpl $0x7f, %ecx
jle 0xb769
cmpl $0x80, %ecx
je 0xb7cc
cmpl $0x200, %ecx            # imm = 0x200
je 0xb7dc
cmpl $0x1002, %ecx           # imm = 0x1002
je 0xb797
jmp 0xb7de
cmpl $0xa001, %ecx           # imm = 0xA001
jg 0xb740
cmpl $0x7001, %ecx           # imm = 0x7001
jle 0xb775
cmpl $0x7002, %ecx           # imm = 0x7002
je 0xb7b3
cmpl $0x8002, %ecx           # imm = 0x8002
je 0xb7b3
cmpl $0x9002, %ecx           # imm = 0x9002
je 0xb7b3
jmp 0xb7de
cmpl $0x2003, %ecx           # imm = 0x2003
jle 0xb787
cmpl $0x2004, %ecx           # imm = 0x2004
je 0xb7d5
cmpl $0x3002, %ecx           # imm = 0x3002
je 0xb797
cmpl $0x4002, %ecx           # imm = 0x4002
je 0xb797
jmp 0xb7de
cmpl $0xc001, %ecx           # imm = 0xC001
jle 0xb7a3
cmpl $0xc002, %ecx           # imm = 0xC002
je 0xb7b3
cmpl $0xd002, %ecx           # imm = 0xD002
je 0xb7b3
cmpl $0xe002, %ecx           # imm = 0xE002
jne 0xb7de
leaq 0x3241(%rip), %rax      # 0xe9a8
jmp 0xb7dc
cmpl $0x1, %ecx
je 0xb7dc
cmpl $0x2, %ecx
je 0xb797
jmp 0xb7de
cmpl $0x5002, %ecx           # imm = 0x5002
je 0xb797
cmpl $0x6002, %ecx           # imm = 0x6002
je 0xb797
jmp 0xb7de
cmpl $0x1004, %ecx           # imm = 0x1004
je 0xb7c3
cmpl $0x2002, %ecx           # imm = 0x2002
jne 0xb7de
callq 0xb4e8
movl $0x1, %edi
jmp 0xb7ba
cmpl $0xa002, %ecx           # imm = 0xA002
je 0xb7b3
cmpl $0xb002, %ecx           # imm = 0xB002
jne 0xb7de
callq 0xb4e8
xorl %edi, %edi
movq %rax, %rsi
popq %rax
jmp 0xb609
leaq 0x212b(%rip), %rax      # 0xd8f5
jmp 0xb7dc
leaq 0x3209(%rip), %rax      # 0xe9dc
jmp 0xb7dc
leaq 0x211f(%rip), %rax      # 0xd8fb
popq %rcx
retq
leaq 0x31fd(%rip), %rdi      # 0xe9e2
xorl %eax, %eax
callq 0x4eac
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/type.c
// Function: new_func_type
struct type *new_func_type(struct type *ret, size_t n_params,
        struct type *params[], bool has_vararg)
{
    struct func_type *type = malloc(sizeof *type +
            n_params * sizeof *type->params);
    type->type.tag = FUNC_TYPE_FLAG;
    type->ret = ret;
    type->n_params = n_params;
    type->has_vararg = has_vararg;
    
    for (size_t i = 0; i < n_params; i++) {
        type->params[i] = params[i];
    }

    return (struct type *)type;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x20(,%rsi,8), %rdi
callq 0x2160
movq %rax, %r15
movl $0x20, (%rax)
movq %r12, 0x8(%rax)
movq %rbx, 0x10(%rax)
movb %bpl, 0x18(%rax)
testq %rbx, %rbx
je 0xb89a
shlq $0x3, %rbx
movq %r15, %rdi
addq $0x20, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2150
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/type.c
// Function: new_struct_type
struct type *new_struct_type(size_t n_fields, struct field fields[],
        char *cname)
{
    struct struct_type *type = malloc(sizeof *type +
            n_fields * sizeof *type->fields);

    type->type.tag = STRUCT_TYPE_FLAG;
    type->cname = cname;
    type->n_fields = n_fields;
    type->is_defined = false;
    type->id = zc_n_struct_types++;
    for (size_t i = 0; i < n_fields; i++)
        type->fields[i] = fields[i];

    return (struct type *)type;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
movq %rdi, %r14
shlq $0x4, %r14
leaq 0x20(%r14), %rdi
callq 0x2160
movq %rax, %r15
movl $0x40, (%rax)
movq %r12, 0x8(%rax)
movq %r13, 0x10(%rax)
movb $0x0, 0x18(%rax)
leaq 0x84f4(%rip), %rax      # 0x13dd8
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
movl %ecx, 0x1c(%r15)
testq %r13, %r13
je 0xb906
movq %r15, %rdi
addq $0x20, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2150
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/type.c
// Function: new_extern_type
struct type *new_extern_type(void)
{
    struct extern_type *type = malloc(sizeof *type);
    type->type.tag = EXTERN_TYPE_FLAG;
    type->id = zc_n_struct_types++;
    return (struct type *)type;
}

// Assembly:
pushq %rax
movl $0x8, %edi
callq 0x2160
movl $0x200, (%rax)          # imm = 0x200
leaq 0x84ad(%rip), %rcx      # 0x13dd8
movl (%rcx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
movl %edx, 0x4(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/type.c
// Function: type_dup
struct type *type_dup(struct type *t, enum type_tag flags)
{
    struct type *t2;
    switch (type_type(t->tag)) {
        case VOID_TYPE_FLAG:
        case BOOL_TYPE_FLAG:
        case INT_TYPE_FLAG:
        case FLOAT_TYPE_FLAG:
            t2 = malloc(sizeof *t2);
            memcpy(t2, t, sizeof *t2);
            break;
        case PTR_TYPE_FLAG:
            t2 = malloc(sizeof (struct ptr_type));
            memcpy(t2, t, sizeof (struct ptr_type));
            break;
        case ARRAY_TYPE_FLAG:
            t2 = malloc(sizeof (struct array_type));
            memcpy(t2, t, sizeof (struct array_type));
            break;
        case FUNC_TYPE_FLAG: {
            struct func_type *t_ = (struct func_type *)t;
            size_t n = sizeof *t_ + t_->n_params * sizeof *t_->params;
            struct func_type *t2_ = malloc(n);
            t2 = (struct type *)memcpy(t2_, t, n);
            break;
        }
        case STRUCT_TYPE_FLAG: {
            struct struct_type *t_ = (struct struct_type *)t;
            size_t n = sizeof *t_ + t_->n_fields * sizeof *t_->fields;
            struct struct_type *t2_ = malloc(n);
            t2 = (struct type *)memcpy(t2_, t, n);
            break;
        }
        default:
            unreachable();
    }
    t2->tag = (t2->tag & ~LVAL_TYPE_FLAG) | flags;
    return t2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl (%rdi), %ebp
movl %ebp, %eax
andl $0x3ff, %eax            # imm = 0x3FF
cmpl $0xf, %eax
jg 0xc062
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0xc08f
cmpl $0x4, %eax
je 0xc08f
cmpl $0x8, %eax
jne 0xc0fc
movl $0x10, %edi
callq 0x2160
movq %rax, %r15
movups (%r14), %xmm0
movups %xmm0, (%rax)
jmp 0xc0e3
cmpl $0x3f, %eax
jg 0xc083
cmpl $0x10, %eax
je 0xc0a0
cmpl $0x20, %eax
jne 0xc0fc
movq 0x10(%r14), %rax
leaq 0x20(,%rax,8), %r12
jmp 0xc0ca
cmpl $0x40, %eax
je 0xc0be
cmpl $0x80, %eax
jne 0xc0fc
movl $0x4, %edi
callq 0x2160
movq %rax, %r15
movl %ebp, (%rax)
jmp 0xc0e3
movl $0x18, %edi
callq 0x2160
movq %rax, %r15
movups (%r14), %xmm0
movups %xmm0, (%rax)
movq 0x10(%r14), %rax
movq %rax, 0x10(%r15)
jmp 0xc0e3
movq 0x10(%r14), %r12
shlq $0x4, %r12
addq $0x20, %r12
movq %r12, %rdi
callq 0x2160
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2150
movl $0xfffffbff, %eax       # imm = 0xFFFFFBFF
andl (%r15), %eax
orl %ebx, %eax
movl %eax, (%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1dbd(%rip), %rdi      # 0xdec0
leaq 0x2880(%rip), %rsi      # 0xe98a
leaq 0x2975(%rip), %rcx      # 0xea86
movl $0x1e6, %edx            # imm = 0x1E6
xorl %eax, %eax
callq 0x4eac
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/type.c
// Function: resolve_selfref_struct
bool resolve_selfref_struct(struct struct_type *type, bool selfref_ok)
{
    size_t n_fields = type->n_fields;
    struct field *fields = type->fields;

    for (size_t i = 0; i < n_fields; i++) {
        struct field *field = &fields[i];

        if (is_ptr_type(field->type)) {
            if (!resolve_selfref(&ptr_type(field->type)->to, true))
                return false;
        } else {
            if (!resolve_selfref(&field->type, false))
                return false;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0xc181
movq %rdi, %rbx
movq %r14, %r15
negq %r15
addq $0x28, %rbx
movl $0x1, %r12d
xorl %ebp, %ebp
movq (%rbx), %rdi
testb $0x8, (%rdi)
jne 0xc152
movq %rbx, %rdi
xorl %esi, %esi
jmp 0xc15b
addq $0x8, %rdi
movl $0x1, %esi
callq 0xc193
testb %al, %al
je 0xc184
cmpq %r14, %r12
setae %bpl
leaq (%r15,%r12), %rax
incq %rax
incq %r12
addq $0x10, %rbx
cmpq $0x1, %rax
jne 0xc143
jmp 0xc184
movb $0x1, %bpl
andb $0x1, %bpl
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/type.c
// Function: resolve_selfref
bool resolve_selfref(struct type **type, bool selfref_ok)
{
    switch (type_type((*type)->tag)) {
        case SELFREF_TYPE_FLAG:
            if (selfref_ok) {
                *type = selfref_type(*type)->sym->type;
            }
            return selfref_ok;
        case PTR_TYPE_FLAG:
            return resolve_selfref(&ptr_type(*type)->to, selfref_ok);
        case ARRAY_TYPE_FLAG:
            return resolve_selfref(&array_type(*type)->of, selfref_ok);
        case FUNC_TYPE_FLAG:
            for (size_t i = 0; i < func_type(*type)->n_params; i++)
                if (!resolve_selfref(&func_type(*type)->params[i], selfref_ok))
                    return false;
            return resolve_selfref(&func_type(*type)->ret, selfref_ok);
        case STRUCT_TYPE_FLAG:
            return resolve_selfref_struct(struct_type(*type), selfref_ok);
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movzbl %bl, %ebp
movq (%r14), %rdi
movl (%rdi), %eax
movl %eax, %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
cmpl $0x1f, %ecx
jg 0xc1cc
cmpl $0x8, %ecx
je 0xc20e
cmpl $0x10, %ecx
jne 0xc245
testb $0x10, %al
jne 0xc216
jmp 0xc28b
cmpl $0x20, %ecx
jne 0xc21f
testb $0x20, %al
je 0xc263
cmpq $0x0, 0x10(%rdi)
je 0xc216
movl $0x20, %r15d
xorl %r12d, %r12d
addq %r15, %rdi
movl %ebp, %esi
callq 0xc193
testb %al, %al
je 0xc249
movq (%r14), %rdi
testb $0x20, (%rdi)
je 0xc263
incq %r12
addq $0x8, %r15
cmpq 0x10(%rdi), %r12
jb 0xc1e9
jmp 0xc216
testb $0x8, %al
je 0xc2ae
addq $0x8, %rdi
movq %rdi, %r14
jmp 0xc1a3
cmpl $0x40, %ecx
je 0xc254
cmpl $0x100, %ecx            # imm = 0x100
jne 0xc245
testb %bl, %bl
je 0xc249
btl $0x8, %eax
jae 0xc2d1
movq 0x8(%rdi), %rax
movq 0x10(%rax), %rax
movq %rax, (%r14)
movb $0x1, %al
jmp 0xc24b
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %esi, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xc11d
leaq 0xf42(%rip), %rdi       # 0xd1ac
leaq 0x2719(%rip), %rsi      # 0xe98a
leaq 0x27c8(%rip), %rcx      # 0xea40
leaq 0x27d1(%rip), %r8       # 0xea50
movl $0xec, %edx
xorl %eax, %eax
callq 0x4eac
leaq 0xf1a(%rip), %rdi       # 0xd1ac
leaq 0x26f1(%rip), %rsi      # 0xe98a
leaq 0x2784(%rip), %rcx      # 0xea24
leaq 0x278e(%rip), %r8       # 0xea35
movl $0xe6, %edx
jmp 0xc284
leaq 0xef7(%rip), %rdi       # 0xd1ac
leaq 0x26ce(%rip), %rsi      # 0xe98a
leaq 0x2749(%rip), %rcx      # 0xea0c
leaq 0x2751(%rip), %r8       # 0xea1b
movl $0xe0, %edx
jmp 0xc284
leaq 0xed4(%rip), %rdi       # 0xd1ac
leaq 0x26ab(%rip), %rsi      # 0xe98a
leaq 0x2774(%rip), %rcx      # 0xea5a
leaq 0x2780(%rip), %r8       # 0xea6d
movl $0xfc, %edx
jmp 0xc284
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: connect_to_server
int connect_to_server() {
	int sockfd = socket(AF_INET, SOCK_STREAM, 0);

	if(sockfd < 0) {
		eprintf("Create Socket Failed!\n");
	}

	struct sockaddr_in servaddr;
	memset(&servaddr, 0, sizeof(servaddr));

	servaddr.sin_family = AF_INET;
	servaddr.sin_port = htons(PORT);
	servaddr.sin_addr.s_addr = inet_addr(server_addr);

	if(connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) == -1) {
		eprintf("Can Not Connect To Server %s!\n", server_addr);
	}

	return sockfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2210
testl %eax, %eax
js 0x2525
movl %eax, %ebx
leaq -0x20(%rbp), %r14
movq $0x0, 0x8(%r14)
movl $0x50c30002, (%r14)     # imm = 0x50C30002
leaq 0x4e42(%rip), %rdi      # 0x733f
callq 0x2110
movl %eax, 0x4(%r14)
movl %ebx, %edi
movq %r14, %rsi
movl $0x10, %edx
callq 0x21e0
cmpl $-0x1, %eax
je 0x252a
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x2264
callq 0x2230
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: wrap_send
void wrap_send(client_message_t *pcm) {
	size_t total_len = 0;
	while(total_len < sizeof(client_message_t)) {
		size_t len = send(client_fd, pcm + total_len, sizeof(client_message_t) - total_len, 0);
		if(len < 0) {
			loge("broken pipe\n");
		}

		total_len += len;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movl 0x7c16(%rip), %edi      # 0xa158
leaq (%r14,%r14,2), %rsi
shlq $0x4, %rsi
addq %rbx, %rsi
movl $0x30, %edx
subq %r14, %rdx
xorl %ecx, %ecx
callq 0x20a0
addq %rax, %r14
cmpq $0x30, %r14
jb 0x253c
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: write_log
void write_log(const char *format, ...) {
	FILE *fp = fopen("log.txt", "a+");

	va_list ap;
	va_start(ap, format);
	vfprintf(fp, format, ap);
	va_end(ap);

	fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xe0(%rbp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x2814
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq 0x3cca(%rip), %rdi      # 0x64e5
leaq 0x3ccb(%rip), %rsi      # 0x64ed
callq 0x2190
movq %rax, %r14
leaq -0x30(%rbp), %rdx
movq %r15, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x2070
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: accept_input
char *accept_input(const char *prompt) {
	char *line;
	show_cursor();
	do
	{
		bottom_bar_output(0, prompt);
		line = readline();
	}while(strncmp(line,"",1)==0);
	hide_cursor();
	return line;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x3bc1(%rip), %rdi      # 0x643a
xorl %eax, %eax
callq 0x20b0
xorl %edi, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x28af
callq 0x2faa
cmpb $0x0, (%rax)
je 0x2880
movq %rax, %r14
leaq 0x3b93(%rip), %rdi      # 0x6433
xorl %eax, %eax
callq 0x20b0
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: bottom_bar_output
void bottom_bar_output(int line, const char *format, ...) {
	assert(line <= 0);
	lock_cursor();
	set_cursor(0, SCR_H - 1 + line);
	for(int i = 0; i < scr_actual_w; i++)
		printf(" ");
	set_cursor(0, SCR_H - 1 + line);

	va_list ap;
	va_start(ap, format);
	vfprintf(stdout, format, ap);
	va_end(ap);

	fflush(stdout);

	unlock_cursor();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdx, -0xd0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %r8, -0xc0(%rbp)
movq %r9, -0xb8(%rbp)
testb %al, %al
je 0x2908
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
testl %edi, %edi
jg 0x29cc
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x7913(%rip), %rdi      # 0xa230
callq 0x2200
addl $0x12, %r14d
leaq 0x3afd(%rip), %rdi      # 0x642a
xorl %r15d, %r15d
movl %r14d, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x20b0
cmpl $0x0, 0x7926(%rip)      # 0xa26c
jle 0x295e
movl $0x20, %edi
callq 0x2040
incl %r15d
cmpl 0x7910(%rip), %r15d     # 0xa26c
jl 0x2948
leaq 0x3ac5(%rip), %rdi      # 0x642a
movl %r14d, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x20b0
leaq -0xe0(%rbp), %rax
leaq -0x30(%rbp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq 0x7629(%rip), %r14      # 0x9fc8
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x21b0
movq (%r14), %rdi
callq 0x2160
leaq 0x7877(%rip), %rdi      # 0xa230
callq 0x2150
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ad9(%rip), %rdi      # 0x64ac
leaq 0x3a85(%rip), %rsi      # 0x645f
leaq 0x3ad5(%rip), %rcx      # 0x64b6
movl $0x1d8, %edx            # imm = 0x1D8
callq 0x20c0
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: button_register
int button_register() {
	wlog("call button handler %s\n", __func__);
	wlogi("require name\n");
	char *name = accept_input("your name: ");
	wlogi("input name '%s'\n", name);

	char *password = accept_input("password: ");
	wlogi("input password '%s'\n", password);

	bottom_bar_output(0, "register your name '%s' to server...", name);

	client_message_t cm;
	memset(&cm, 0, sizeof(client_message_t));
	cm.command = CLIENT_COMMAND_USER_REGISTER;
	strncpy(cm.user_name, name, USERNAME_SIZE - 1);
	strncpy(cm.password, password, PASSWORD_SIZE - 1);
	wlogi("send register message to server\n");
	wrap_send(&cm);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq 0x7761(%rip), %rsi      # 0xa160
leaq 0x3692(%rip), %rdi      # 0x6098
leaq 0x37ac(%rip), %rcx      # 0x61b9
xorl %r15d, %r15d
movl $0xd9, %edx
xorl %eax, %eax
callq 0x27b9
movq 0x773d(%rip), %rsi      # 0xa160
leaq 0x369a(%rip), %rdi      # 0x60c4
movl $0xda, %edx
xorl %eax, %eax
callq 0x27b9
leaq 0x36a0(%rip), %rdi      # 0x60dd
callq 0x2868
movq %rax, %rbx
movq 0x7714(%rip), %rsi      # 0xa160
leaq 0x3696(%rip), %rdi      # 0x60e9
movl $0xdc, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x27b9
leaq 0x369c(%rip), %rdi      # 0x6105
callq 0x2868
movq %rax, %r14
movq 0x76e8(%rip), %rsi      # 0xa160
leaq 0x3691(%rip), %rdi      # 0x6110
movl $0xdf, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x27b9
leaq 0x3734(%rip), %rsi      # 0x61c9
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x28af
xorps %xmm0, %xmm0
leaq -0x47(%rbp), %rdi
movups %xmm0, 0x1f(%rdi)
movups %xmm0, 0x16(%rdi)
movups %xmm0, 0x6(%rdi)
movb $0x1, -0x1(%rdi)
movl $0x6, %edx
movq %rbx, %rsi
callq 0x2050
leaq -0x40(%rbp), %rdi
movl $0x6, %edx
movq %r14, %rsi
callq 0x2050
movq 0x7683(%rip), %rsi      # 0xa160
leaq 0x370a(%rip), %rdi      # 0x61ee
movl $0xe8, %edx
xorl %eax, %eax
callq 0x27b9
movl 0x7662(%rip), %edi      # 0xa158
leaq (%r15,%r15,2), %rax
shlq $0x4, %rax
leaq (%rax,%rbp), %rsi
addq $-0x48, %rsi
movl $0x30, %edx
subq %r15, %rdx
xorl %ecx, %ecx
callq 0x20a0
addq %rax, %r15
cmpq $0x30, %r15
jb 0x2af0
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: resume_and_exit
void resume_and_exit(int status) {
	send_command(CLIENT_COMMAND_USER_QUIT);
	wrap_set_term_attr(&raw_termio);
	set_cursor(0, SCR_H);
	show_cursor();
	close(client_fd);
	wlog("====================EXIT====================\n\n\n");
	exit(status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %edi, %edi
callq 0x25b2
leaq 0x76eb(%rip), %rdi      # 0xa258
callq 0x2e22
xorl %edi, %edi
movl $0x12, %esi
callq 0x2ef0
callq 0x2f1b
movl 0x75cf(%rip), %edi      # 0xa158
callq 0x20f0
movq 0x75cb(%rip), %rsi      # 0xa160
leaq 0x39c6(%rip), %rdi      # 0x6562
movl $0x225, %edx            # imm = 0x225
xorl %eax, %eax
callq 0x27b9
movl %ebx, %edi
callq 0x21d0
// File: /workspace/github_c_makefile_star2_O3/wierton[P]socket-based-naive-game/client.c
// Function: button_launch_battle
int button_launch_battle() {
	wlog("call button handler %s\n", __func__);
	wlogi("send `launch battle` message to server\n");
	global_serv_message=-1;
	send_command(CLIENT_COMMAND_LAUNCH_BATTLE);
	/* wait for server reply */
	do {
		if(global_serv_message == SERVER_RESPONSE_LAUNCH_BATTLE_SUCCESS
		|| global_serv_message == SERVER_RESPONSE_LAUNCH_BATTLE_FAIL)
			break;
	} while(1);
	wlog("wait until message=%s\n", server_message_s[global_serv_message]);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x75a6(%rip), %rsi      # 0xa160
leaq 0x34d7(%rip), %rdi      # 0x6098
leaq 0x3663(%rip), %rcx      # 0x622b
movl $0xf5, %edx
xorl %eax, %eax
callq 0x27b9
movq 0x7585(%rip), %rsi      # 0xa160
leaq 0x365e(%rip), %rdi      # 0x6240
movl $0xf6, %edx
xorl %eax, %eax
callq 0x27b9
movl $0xffffffff, 0x7570(%rip) # imm = 0xFFFFFFFF
movl $0x6, %edi
callq 0x25b2
movl 0x7560(%rip), %eax      # 0xa168
leal -0xd(%rax), %ecx
cmpl $0x2, %ecx
jae 0x2c39
movq 0x7549(%rip), %rsi      # 0xa160
leaq 0x6ee2(%rip), %rcx      # 0x9b00
movq (%rcx,%rax,8), %rcx
leaq 0x3550(%rip), %rdi      # 0x6179
movl $0xff, %edx
xorl %eax, %eax
callq 0x27b9
xorl %eax, %eax
popq %rbp
retq
jmp 0x2c39