LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x9d72
movq %rdi, %r15
incq %rcx
movl %ecx, 0x14(%rdi)
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %r14
cmpl $0x7b, (%rax,%rcx)
jne 0x9cd1
xorl %ebx, %ebx
jmp 0x9ce5
movq %r15, %rdi
callq 0x8ef4
movq %rax, %rbx
testq %rax, %rax
je 0x9d72
movq %r15, %rdi
callq 0x8e1b
testq %rax, %rax
je 0x9d6a
movq %rax, %r12
movq (%r15), %rax
movslq 0x14(%r15), %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
cmpl $0x121, (%rax,%rdx)     # imm = 0x121
jne 0x9d2a
incq %rcx
movl %ecx, 0x14(%r15)
shlq $0x5, %rcx
cmpl $0x102, (%rax,%rcx)     # imm = 0x102
jne 0x9d2f
movq %r15, %rdi
callq 0x9c92
jmp 0x9d37
xorl %r9d, %r9d
jmp 0x9d3f
movq %r15, %rdi
callq 0x8e1b
movq %rax, %r9
testq %rax, %rax
je 0x9d62
pushq $0x3
popq %rdx
movq %r14, %rdi
movl $0x4101, %esi           # imm = 0x4101
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2458
movq %r12, %rdi
callq 0x25d9
movq %rbx, %rdi
callq 0x25d9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x18
popq %rdi
callq 0x2160
movb $0x1, (%rax)
leaq 0x9061(%rip), %rcx      # 0x12e28
addq 0x10905a(%rip), %rcx    # 0x112e28
movq %rcx, 0x8(%rax)
leaq 0x8ffb(%rip), %rdx      # 0x12dd4
movslq (%rdx), %rsi
xorl %edx, %edx
movq %rcx, %rdi
cmpq %rsi, %rdx
jae 0x9e0b
addq $0x4, %rdx
xorl %r8d, %r8d
cmpq $0x4, %r8
je 0x9e05
movb $0x20, (%rdi,%r8)
addq $0x4, 0x109028(%rip)    # 0x112e28
incq %r8
jmp 0x9ded
addq $0x4, %rdi
jmp 0x9de1
movb $0x0, (%rcx,%rdx)
incq 0x109012(%rip)          # 0x112e28
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/rope.c
// Function: rope_new_tree
struct rope *rope_new_tree(struct rope *left, struct rope *right)
{
    struct rope *rope = malloc(sizeof *rope);
    rope->leaf = false;
    rope->val.childs[0] = left;
    rope->val.childs[1] = right;

    return rope;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x2160
movb $0x0, (%rax)
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x9ee0
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)
pushq $0x18
popq %rdi
callq 0x2160
movq %rax, %rbx
movb $0x1, (%rax)
leaq 0x8f33(%rip), %rdi      # 0x12e28
movq 0x108f2c(%rip), %rax    # 0x112e28
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 0x108efe(%rip), %rax    # 0x112e28
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 0x9f61
addq %rax, 0x108ed7(%rip)    # 0x112e28
movq %rbx, %rax
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2965(%rip), %rsi      # 0xc8cd
xorl %edi, %edi
xorl %eax, %eax
callq 0x4a05
// File: /workspace/github_c_makefile_star2_O2/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
movq %rsi, %rbx
movq %rdi, %r14
testq %r14, %r14
je 0x9f98
movq 0x8(%r14), %rdi
cmpb $0x1, (%r14)
je 0x9fa0
movq %rbx, %rsi
callq 0x9f71
movq 0x10(%r14), %r14
jmp 0x9f7b
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_O2/ryvnf[P]czc/scope.c
// Function: scope_new
struct scope *scope_new(struct scope *parent, size_t n_syms, size_t n_types)
{
    struct scope *scope = malloc(sizeof *scope);
    scope->symtbl = strmap_new(n_syms);
    scope->typetbl = strmap_new(n_types);
    scope->parent = parent;
    return scope;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x18
popq %rdi
callq 0x2160
movq %rax, %r12
movq %r14, %rdi
callq 0xa0d4
movq %rax, (%r12)
movq %rbx, %rdi
callq 0xa0d4
movq %rax, 0x8(%r12)
movq %r15, 0x10(%r12)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xa103
testq %rax, %rax
jne 0xa047
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0xa024
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa282
// File: /workspace/github_c_makefile_star2_O2/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 0xa065
cmpl $0x3, (%rdi)
jne 0xa068
movq 0x10(%rdi), %rax
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x113c(%rip), %rdi      # 0xb1ac
leaq 0x2876(%rip), %rsi      # 0xc8ed
leaq 0x2877(%rip), %rcx      # 0xc8f5
leaq 0x2885(%rip), %r8       # 0xc90a
pushq $0x26
popq %rdx
xorl %eax, %eax
callq 0x4918
// File: /workspace/github_c_makefile_star2_O2/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 0xa103
testq %rax, %rax
jne 0xa0bd
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0xa099
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xa282
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa056
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/strmap.c
// Function: strmap_new
struct strmap *strmap_new(size_t n)
{
    struct strmap *map = malloc(sizeof *map);
    map->n = n;
    map->map = calloc(n, sizeof *map->map);

    return map;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x2160
movq %rax, %r14
movq %rbx, (%rax)
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x20f0
movq %rax, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, %rdi
callq 0xa15d
xorl %ebx, %ebx
xorl %edx, %edx
divq (%r12)
movq %rdx, %r15
shlq $0x3, %r15
addq 0x8(%r12), %r15
movq (%r15), %r15
testq %r15, %r15
je 0xa14e
movq (%r15), %rsi
movq %r14, %rdi
callq 0x2100
testl %eax, %eax
je 0xa14a
addq $0x10, %r15
jmp 0xa12d
movq 0x8(%r15), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/strmap.c
// Function: strhash64
static uint64_t strhash64(const char *s)
{
	uint64_t h = 14695981039346656037ULL;
	for (int i = 0; s[i] != '\0'; ++i) {
		h ^= s[i];
		h *= 1099511628211;
	}
	return h;
}

// Assembly:
movabsq $-0x340d631b7bdddcdb, %rax # imm = 0xCBF29CE484222325
movabsq $0x100000001b3, %rcx    # imm = 0x100000001B3
movsbq (%rdi), %rdx
testq %rdx, %rdx
je 0xa186
xorq %rdx, %rax
imulq %rcx, %rax
incq %rdi
jmp 0xa171
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0xa15d
xorl %edx, %edx
divq (%r15)
movq %rdx, %r12
pushq $0x18
popq %rdi
callq 0x2160
movq %rax, %r13
movq %r14, %rdi
callq 0x2220
movq %rax, (%r13)
movq %rbx, 0x8(%r13)
movq 0x8(%r15), %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_O2/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 0xa21c
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0xa1e1
movq (%rbx), %rdi
callq 0x2030
testq %r14, %r14
je 0xa20d
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_O2/ryvnf[P]czc/sym.c
// Function: sym_new
struct sym *sym_new(struct ast *ast)
{
    struct sym *sym = malloc(sizeof (struct decl_sym));

    sym->loc = ast;
    sym->tag = UNRES_SYM;

    return sym;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x28
popq %rdi
callq 0x2160
movq %rbx, 0x8(%rax)
andl $0x0, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/sym.c
// Function: sym_new_type
struct sym *sym_new_type(struct type *type)
{
    struct type_sym *sym = malloc(sizeof *sym);

    sym->sym.loc = NULL;
    sym->sym.tag = TYPE_SYM;
    sym->type = type;

    return (struct sym *)sym;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x2160
andq $0x0, 0x8(%rax)
movl $0x3, (%rax)
movq %rbx, 0x10(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xa293
cmpl $0x0, (%rbx)
je 0xa29e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rbx), %rdi
movl (%rdi), %eax
cmpl $0x4003, %eax           # imm = 0x4003
je 0xa356
cmpl $0x4002, %eax           # imm = 0x4002
je 0xa309
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xa37a
movl $0x1, (%rbx)
andq $0x0, 0x18(%rbx)
pushq $0x1
popq %rsi
callq 0x26ce
movq %rax, %rdi
callq 0xa849
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x26ce
movq %rax, %rdi
callq 0x25da
movq %rax, %rdi
callq 0x2220
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
callq 0x3cc4
jmp 0xa293
movl $0x3, (%rbx)
movq %rbx, %rdi
callq 0xa651
leaq 0x10(%rbx), %r14
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x26ce
testq %rax, %rax
je 0xa36d
movq %rax, %rdi
callq 0xa849
movq %rax, (%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0xae9d
testb %al, %al
je 0xa399
movq (%r14), %rdi
callq 0x3d41
jmp 0xa293
movl $0x2, (%rbx)
pushq $0x1
popq %rsi
callq 0x26ce
movq %rax, 0x10(%rbx)
jmp 0xa293
callq 0xa756
movq %rax, (%r14)
jmp 0xa293
leaq 0x1b3f(%rip), %rdi      # 0xbec0
leaq 0x25b8(%rip), %rsi      # 0xc940
leaq 0x25b7(%rip), %rcx      # 0xc946
pushq $0x45
popq %rdx
xorl %eax, %eax
callq 0x4918
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdi
leaq 0x256b(%rip), %rsi      # 0xc913
xorl %eax, %eax
callq 0x4a05
// File: /workspace/github_c_makefile_star2_O2/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 0xa3ff
movq %rdi, %rbx
callq 0xa250
movq %rax, %r14
movq %rbx, 0x8(%rax)
movl $0x1, (%rax)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x26ce
movq %rax, %rdi
callq 0xa849
movq %rax, 0x18(%r14)
orb $0x4, 0x1(%rax)
callq 0x2f11
movq %rax, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x2040
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x1a95(%rip), %rax      # 0xbfe4
cmpl $0x1, %ecx
je 0xa641
cmpl $0x2, %ecx
je 0xa60e
cmpl $0x80, %ecx
je 0xa631
cmpl $0x200, %ecx            # imm = 0x200
je 0xa641
cmpl $0x1002, %ecx           # imm = 0x1002
je 0xa60e
cmpl $0x1004, %ecx           # imm = 0x1004
je 0xa63a
cmpl $0x2002, %ecx           # imm = 0x2002
je 0xa60e
cmpl $0x2004, %ecx           # imm = 0x2004
je 0xa628
cmpl $0x3002, %ecx           # imm = 0x3002
je 0xa60e
cmpl $0x4002, %ecx           # imm = 0x4002
je 0xa60e
cmpl $0x5002, %ecx           # imm = 0x5002
je 0xa60e
cmpl $0x6002, %ecx           # imm = 0x6002
je 0xa60e
cmpl $0x7002, %ecx           # imm = 0x7002
je 0xa618
cmpl $0x8002, %ecx           # imm = 0x8002
je 0xa618
cmpl $0x9002, %ecx           # imm = 0x9002
je 0xa618
cmpl $0xa002, %ecx           # imm = 0xA002
je 0xa618
cmpl $0xb002, %ecx           # imm = 0xB002
je 0xa618
cmpl $0xc002, %ecx           # imm = 0xC002
je 0xa618
cmpl $0xd002, %ecx           # imm = 0xD002
je 0xa618
cmpl $0xe002, %ecx           # imm = 0xE002
jne 0xa643
leaq 0x239c(%rip), %rax      # 0xc9a8
jmp 0xa641
callq 0xa404
pushq $0x1
popq %rdi
jmp 0xa61f
callq 0xa404
xorl %edi, %edi
movq %rax, %rsi
popq %rax
jmp 0xa4c5
leaq 0x12cc(%rip), %rax      # 0xb8fb
jmp 0xa641
leaq 0x23a4(%rip), %rax      # 0xc9dc
jmp 0xa641
leaq 0x12b4(%rip), %rax      # 0xb8f5
popq %rcx
retq
leaq 0x2398(%rip), %rdi      # 0xc9e2
xorl %eax, %eax
callq 0x4918
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/type.c
// Function: new_selfref_type
struct type *new_selfref_type(struct type_sym *sym)
{
    struct selfref_type *type = malloc(sizeof *type);
    type->type.tag = SELFREF_TYPE_FLAG;
    type->sym = sym;

    return (struct type *)type;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x2160
movl $0x100, (%rax)          # imm = 0x100
movq %rbx, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/type.c
// Function: new_ptr_type
struct type *new_ptr_type(struct type *to)
{
    struct ptr_type *type = malloc(sizeof *type);
    type->type.tag = PTR_TYPE;
    type->to = to;

    return (struct type *)type;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x2160
movl $0x1008, (%rax)         # imm = 0x1008
movq %rbx, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/type.c
// Function: new_array_type
struct type *new_array_type(struct type *of, size_t len)
{
    struct array_type *type = malloc(sizeof *type);
    type->type.tag = ARRAY_TYPE_FLAG;
    type->of = of;
    type->len = len;

    return (struct type *)type;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x2160
movl $0x10, (%rax)
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x20(,%rsi,8), %rdi
callq 0x2160
movl $0x20, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
movb %bpl, 0x18(%rax)
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0xa6ef
movq (%rbx,%rcx,8), %rdx
movq %rdx, 0x20(%rax,%rcx,8)
incq %rcx
jmp 0xa6dc
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
shlq $0x4, %rdi
addq $0x20, %rdi
callq 0x2160
movl $0x40, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
movb $0x0, 0x18(%rax)
leaq 0x86aa(%rip), %rcx      # 0x12dd8
movl (%rcx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
movl %edx, 0x1c(%rax)
pushq $0x20
popq %rcx
subq $0x1, %r14
jb 0xa750
movups -0x20(%rbx,%rcx), %xmm0
movups %xmm0, (%rax,%rcx)
addq $0x10, %rcx
jmp 0xa73b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x8
popq %rdi
callq 0x2160
movl $0x200, (%rax)          # imm = 0x200
leaq 0x866c(%rip), %rcx      # 0x12dd8
movl (%rcx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
movl %edx, 0x4(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/type.c
// Function: type_from_ast
struct type *type_from_ast(struct ast *ast)
{
    switch (ast->tag) {
        case PTR_EXPR:
            return type_from_ptr_ast(ast);
        case ARRAY_EXPR:
            return type_from_array_ast(ast);
        case FUNC_EXPR:
            return type_from_func_ast(ast);
        case NAME:
            return type_from_name_ast(ast);
        case STRUCT_EXPR:
            return type_from_struct_ast(ast);
    }
    abort();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl (%rdi), %ecx
leal -0x4300(%rcx), %eax
cmpl $0x3, %eax
ja 0xa89f
leaq 0x20e2(%rip), %rcx      # 0xc950
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
xorl %esi, %esi
callq 0x26ce
movq %rax, %rdi
callq 0xa849
movq %rax, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa669
cmpl $0x1000, %ecx           # imm = 0x1000
jne 0xaa7a
movq %rbx, %rdi
callq 0x25da
movq %rax, %r15
leaq 0x8523(%rip), %rax      # 0x12de0
movq (%rax), %rdi
movq %r15, %rsi
callq 0xa08f
testq %rax, %rax
jne 0xaa52
movq 0x8(%rbx), %rdi
leaq 0x2321(%rip), %rsi      # 0xcbfd
jmp 0xaa70
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xaa7f
leaq 0x20(%rsp), %r12
movq %rbx, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x270b
movq %rax, %r15
movq (%r12), %rdi
shlq $0x4, %rdi
addq $0x20, %rdi
callq 0x2160
movq %rax, %rbx
movl $0x40, (%rax)
callq 0x2f11
movq %rax, 0x8(%rbx)
movq (%r12), %r13
movq %r13, 0x10(%rbx)
movb $0x0, 0x18(%rbx)
leaq 0x8494(%rip), %rax      # 0x12dd8
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
movl %ecx, 0x1c(%rbx)
leaq 0x20(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x28(%rbx), %r14
xorl %r12d, %r12d
cmpq %r13, %r12
jae 0xa9b0
movq (%r15,%r12,8), %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0x26ce
movq %rax, %rdi
callq 0x25da
movq %rax, %rdi
callq 0x2220
movq %rax, %rbp
movq %r13, %rdi
pushq $0x1
popq %rsi
callq 0x26ce
movq %rax, %rdi
callq 0xa849
orb $0x4, 0x1(%rax)
movq %rbp, -0x8(%r14)
movq %rax, (%r14)
incq %r12
movq 0x20(%rsp), %r13
addq $0x10, %r14
jmp 0xa95e
movq %rbx, 0x8(%rsp)
movq %rbx, %rbp
addq $0x30, %rbp
xorl %r12d, %r12d
cmpq %r13, %r12
je 0xaa4d
leaq 0x1(%r12), %rax
movq %rax, 0x18(%rsp)
movq %r12, %rbx
shlq $0x4, %rbx
addq 0x10(%rsp), %rbx
movq %rbp, %r14
incq %r12
cmpq %r13, %r12
jae 0xaa01
movq (%rbx), %r15
movq (%r14), %rsi
addq $0x10, %r14
movq %r15, %rdi
callq 0x2100
testl %eax, %eax
jne 0xa9e1
jmp 0xaa61
addq $0x10, %rbp
movq 0x18(%rsp), %r12
jmp 0xa9bf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x26ce
movq %rax, %rdi
callq 0xa849
movq %rax, %r14
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x26ce
movq %rax, %rdi
callq 0x5fbd
movq %r14, %rdi
movq %rax, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa681
movq 0x8(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x21a6(%rip), %rsi      # 0xcc16
movq %r15, %rdx
xorl %eax, %eax
callq 0x4a05
callq 0x2040
// File: /workspace/github_c_makefile_star2_O2/ryvnf[P]czc/type.c
// Function: type_equals
bool type_equals(struct type *a, struct type *b)
{
    if (type_type(a->tag) != type_type(b->tag))
        return false;

    switch (type_type(a->tag)) {
        case PTR_TYPE_FLAG: {
            struct ptr_type *a2 = ptr_type(a);
            struct ptr_type *b2 = ptr_type(b);

            return type_equals(a2->to, b2->to);
        }
        case ARRAY_TYPE_FLAG: {
            struct array_type *a2 = array_type(a);
            struct array_type *b2 = array_type(b);

            if (a2->len != b2->len)
                return false;

            return type_equals(a2->of, b2->of);
        }
        case FUNC_TYPE_FLAG: {
            struct func_type *a2 = func_type(a);
            struct func_type *b2 = func_type(b);

            if (a2->n_params != b2->n_params)
                return false;

            for (size_t i = 0; i < a2->n_params; ++i) {
                if (!type_equals(a2->params[i], b2->params[i]))
                    return false;
            }

            return type_equals(a2->ret, b2->ret);
        }

        case VOID_TYPE_FLAG:
        case BOOL_TYPE_FLAG:
        case INT_TYPE_FLAG:
        case FLOAT_TYPE_FLAG:
            return (a->tag & ~LVAL_TYPE_FLAG) == (b->tag & ~LVAL_TYPE_FLAG);

        case STRUCT_TYPE_FLAG:
            return struct_type(a)->id == struct_type(b)->id;

        case EXTERN_TYPE_FLAG:
            return extern_type(a)->id == extern_type(b)->id;
    }

    unreachable();
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x3ff, %ebp            # imm = 0x3FF
movl (%r14), %eax
movl %eax, %edx
andl %ebp, %edx
movl (%rbx), %ecx
movl %ecx, %esi
andl %ebp, %esi
cmpl %esi, %edx
jne 0xacdf
cmpl $0x8, %edx
je 0xaca6
cmpl $0x10, %edx
je 0xacb8
cmpl $0x20, %edx
jne 0xace3
movq %r14, %rdi
callq 0xa7dc
movq %rbx, %rdi
callq 0xa7dc
movq 0x10(%r14), %rax
cmpq 0x10(%rbx), %rax
jne 0xacdf
xorl %r15d, %r15d
cmpq 0x10(%r14), %r15
jae 0xacd2
movq 0x20(%r14,%r15,8), %rdi
movq 0x20(%rbx,%r15,8), %rsi
callq 0xac35
incq %r15
testb %al, %al
jne 0xac88
jmp 0xacdf
movq %r14, %rdi
callq 0xa778
movq %rbx, %rdi
callq 0xa778
jmp 0xacd2
movq %r14, %rdi
callq 0xa7aa
movq %rbx, %rdi
callq 0xa7aa
movq 0x10(%r14), %rax
cmpq 0x10(%rbx), %rax
jne 0xacdf
movq 0x8(%rbx), %rbx
movq 0x8(%r14), %r14
jmp 0xac47
xorl %eax, %eax
jmp 0xad19
leal -0x1(%rdx), %esi
cmpl $0x2, %esi
jb 0xad0e
cmpl $0x4, %edx
je 0xad0e
cmpl $0x40, %edx
je 0xad24
cmpl $0x80, %edx
je 0xad0e
cmpl $0x200, %edx            # imm = 0x200
jne 0xad2d
movl 0x4(%r14), %eax
cmpl 0x4(%rbx), %eax
jmp 0xad16
xorl %eax, %ecx
testl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x1c(%r14), %eax
cmpl 0x1c(%rbx), %eax
jmp 0xad16
leaq 0x118c(%rip), %rdi      # 0xbec0
leaq 0x1c4f(%rip), %rsi      # 0xc98a
leaq 0x1d38(%rip), %rcx      # 0xca7a
movl $0x1bb, %edx            # imm = 0x1BB
xorl %eax, %eax
callq 0x4918
// File: /workspace/github_c_makefile_star2_O2/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
movl (%rdi), %ebp
movl %ebp, %eax
andl $0x3ff, %eax            # imm = 0x3FF
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0xad91
cmpl $0x80, %eax
je 0xad91
movq %rdi, %r14
cmpl $0x8, %eax
je 0xada0
cmpl $0x10, %eax
je 0xadc2
cmpl $0x20, %eax
je 0xadde
cmpl $0x40, %eax
je 0xadb4
cmpl $0x4, %eax
jne 0xae1c
pushq $0x4
popq %rdi
callq 0x2160
movq %rax, %r15
movl %ebp, (%rax)
jmp 0xae03
pushq $0x10
popq %rdi
callq 0x2160
movq %rax, %r15
movups (%r14), %xmm0
movups %xmm0, (%rax)
jmp 0xae03
movq 0x10(%r14), %r12
shlq $0x4, %r12
addq $0x20, %r12
jmp 0xadea
pushq $0x18
popq %rdi
callq 0x2160
movq %rax, %r15
movups (%r14), %xmm0
movups %xmm0, (%rax)
movq 0x10(%r14), %rax
movq %rax, 0x10(%r15)
jmp 0xae03
movq 0x10(%r14), %rax
leaq 0x20(,%rax,8), %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 0x109d(%rip), %rdi      # 0xbec0
leaq 0x1b60(%rip), %rsi      # 0xc98a
leaq 0x1c55(%rip), %rcx      # 0xca86
movl $0x1e6, %edx            # imm = 0x1E6
xorl %eax, %eax
callq 0x4918
// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rbx
movq 0x10(%rdi), %r15
addq $0x28, %rbx
xorl %r12d, %r12d
pushq $0x1
popq %rbp
cmpq %r12, %r15
je 0xae8e
movq (%rbx), %r14
testb $0x8, (%r14)
jne 0xae6b
movq %rbx, %rdi
xorl %esi, %esi
jmp 0xae7c
movq %r14, %rdi
callq 0xa778
addq $0x8, %r14
movq %r14, %rdi
movl %ebp, %esi
callq 0xae9d
testb %al, %al
je 0xae8e
incq %r12
addq $0x10, %rbx
jmp 0xae56
cmpq %r15, %r12
setae %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x3ff, %ebx            # imm = 0x3FF
pushq $0x20
popq %r13
pushq $-0x1
popq %r12
movl %esi, 0x4(%rsp)
movzbl %sil, %ebp
movq (%r14), %r15
movl (%r15), %eax
andl %ebx, %eax
cmpl $0x8, %eax
je 0xaf14
cmpl $0x10, %eax
je 0xaf1e
cmpl $0x20, %eax
jne 0xaf3e
movq %r12, %rbx
movq (%r14), %r12
movq %r12, %rdi
callq 0xa7dc
movq (%r14), %r15
movq 0x10(%r12), %r12
movq %r15, %rdi
callq 0xa7dc
incq %rbx
cmpq %r12, %rbx
jae 0xaf28
addq %r13, %r15
addq $0x8, %r13
movq %r15, %rdi
movl %ebp, %esi
callq 0xae9d
testb %al, %al
jne 0xaeda
jmp 0xaf68
movq %r15, %rdi
callq 0xa778
jmp 0xaf35
movq %r15, %rdi
callq 0xa7aa
jmp 0xaf35
movl $0x3ff, %ebx            # imm = 0x3FF
pushq $0x20
popq %r13
pushq $-0x1
popq %r12
addq $0x8, %r15
movq %r15, %r14
jmp 0xaec0
cmpl $0x40, %eax
je 0xaf79
cmpl $0x100, %eax            # imm = 0x100
jne 0xaf64
cmpb $0x0, 0x4(%rsp)
je 0xaf68
movq %r15, %rdi
callq 0xa816
movq 0x8(%r15), %rax
movq 0x10(%rax), %rax
movq %rax, (%r14)
movb $0x1, %al
jmp 0xaf6a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xae3d
// File: /workspace/github_c_makefile_star2_O2/wierton[P]socket-based-naive-game/client.c
// Function: strlwr
void strlwr(char *s) {
	while(*s) {
		if('A' <= *s && *s <= 'Z')
			*s = *s - 'A' + 'a';
		s ++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rdi), %al
testb %al, %al
je 0x2337
leal -0x41(%rax), %ecx
cmpb $0x19, %cl
ja 0x2332
orb $0x20, %al
movb %al, (%rdi)
incq %rdi
jmp 0x2320
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x2210
testl %eax, %eax
js 0x2394
movl %eax, %ebx
leaq -0x20(%rbp), %r14
andq $0x0, 0x8(%r14)
movl $0x50c30002, (%r14)     # imm = 0x50C30002
leaq 0x3fd1(%rip), %rdi      # 0x633f
callq 0x2110
movl %eax, 0x4(%r14)
pushq $0x10
popq %rdx
movl %ebx, %edi
movq %r14, %rsi
callq 0x21e0
cmpl $-0x1, %eax
je 0x23b8
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x6c55(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x2c77(%rip), %rsi      # 0x501c
leaq 0x2ca1(%rip), %rdx      # 0x504d
pushq $0x74
popq %rcx
xorl %eax, %eax
callq 0x2130
jmp 0x23e1
movq 0x6c31(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x2c96(%rip), %rsi      # 0x505f
leaq 0x2c7d(%rip), %rdx      # 0x504d
leaq 0x3f68(%rip), %r8       # 0x633f
pushq $0x7f
popq %rcx
xorl %eax, %eax
callq 0x2130
xorl %edi, %edi
callq 0x21d0
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
pushq $0x30
popq %r15
cmpq $0x2f, %r14
ja 0x2421
movl 0x6d50(%rip), %edi      # 0x9158
imulq $0x30, %r14, %rsi
addq %rbx, %rsi
movq %r15, %rdx
subq %r14, %rdx
xorl %ecx, %ecx
callq 0x20a0
addq %rax, %r14
jmp 0x23fc
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wierton[P]socket-based-naive-game/client.c
// Function: wrap_recv
void wrap_recv(server_message_t *psm) {
	size_t total_len = 0;
	while(total_len < sizeof(server_message_t)) {
		size_t len = recv(client_fd, psm + total_len, sizeof(server_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
cmpq $0x1a2, %r14            # imm = 0x1A2
ja 0x2466
movl 0x6d10(%rip), %edi      # 0x9158
imulq $0x1a3, %r14, %rsi      # imm = 0x1A3
addq %rbx, %rsi
movl $0x1a3, %edx            # imm = 0x1A3
subq %r14, %rdx
xorl %ecx, %ecx
callq 0x2030
addq %rax, %r14
jmp 0x2439
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2679
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 0x2e65(%rip), %rdi      # 0x54e5
leaq 0x2e66(%rip), %rsi      # 0x54ed
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_O2/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
callq 0x2d30
xorl %edi, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2702
callq 0x2dbf
cmpb $0x0, (%rax)
je 0x26dc
movq %rax, %r14
callq 0x2d1d
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0xd0, %rsp
movq %rdx, -0xe0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %r8, -0xd0(%rbp)
movq %r9, -0xc8(%rbp)
testb %al, %al
je 0x2760
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
testl %edi, %edi
jg 0x27fb
movq %rsi, %rbx
movl %edi, %r14d
callq 0x2d71
addl $0x11, %r14d
xorl %r12d, %r12d
xorl %edi, %edi
movl %r14d, %esi
callq 0x2d05
pushq $0x20
popq %r15
cmpl 0x6add(%rip), %r12d     # 0x926c
jge 0x279e
movl %r15d, %edi
callq 0x2040
incl %r12d
jmp 0x2788
xorl %edi, %edi
movl %r14d, %esi
callq 0x2d05
leaq -0xf0(%rbp), %rax
leaq -0x40(%rbp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq 0x67f5(%rip), %r14      # 0x8fc8
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x21b0
movq (%r14), %rdi
callq 0x2160
callq 0x2d82
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2caa(%rip), %rdi      # 0x54ac
leaq 0x2c56(%rip), %rsi      # 0x545f
leaq 0x2ca6(%rip), %rcx      # 0x54b6
movl $0x1d8, %edx            # imm = 0x1D8
callq 0x20c0
// File: /workspace/github_c_makefile_star2_O2/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 0x6932(%rip), %rsi      # 0x9160
leaq 0x2863(%rip), %rdi      # 0x5098
leaq 0x297d(%rip), %rcx      # 0x51b9
movl $0xd9, %edx
xorl %eax, %eax
callq 0x261e
movq 0x6911(%rip), %rsi      # 0x9160
leaq 0x286e(%rip), %rdi      # 0x50c4
movl $0xda, %edx
xorl %eax, %eax
callq 0x261e
leaq 0x2874(%rip), %rdi      # 0x50dd
callq 0x26cd
movq %rax, %rbx
movq 0x68e8(%rip), %rsi      # 0x9160
leaq 0x286a(%rip), %rdi      # 0x50e9
movl $0xdc, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x261e
leaq 0x2870(%rip), %rdi      # 0x5105
callq 0x26cd
movq %rax, %r14
movq 0x68bc(%rip), %rsi      # 0x9160
leaq 0x2865(%rip), %rdi      # 0x5110
movl $0xdf, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x261e
leaq 0x2908(%rip), %rsi      # 0x51c9
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2702
xorps %xmm0, %xmm0
leaq -0x47(%rbp), %rdi
movups %xmm0, 0x1f(%rdi)
movups %xmm0, 0x16(%rdi)
movups %xmm0, 0x6(%rdi)
movb $0x1, -0x1(%rdi)
pushq $0x6
popq %r15
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2050
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2050
movq 0x6857(%rip), %rsi      # 0x9160
leaq 0x28de(%rip), %rdi      # 0x51ee
movl $0xe8, %edx
xorl %eax, %eax
callq 0x261e
leaq -0x48(%rbp), %rdi
callq 0x23e8
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x246b
leaq 0x68e4(%rip), %rdi      # 0x9258
callq 0x2c11
pushq $0x12
popq %rsi
xorl %edi, %edi
callq 0x2d05
callq 0x2d30
movl 0x67ca(%rip), %edi      # 0x9158
callq 0x20f0
movq 0x67c6(%rip), %rsi      # 0x9160
leaq 0x2bc1(%rip), %rdi      # 0x5562
movl $0x225, %edx            # imm = 0x225
xorl %eax, %eax
callq 0x261e
movl %ebx, %edi
callq 0x21d0
// File: /workspace/github_c_makefile_star2_O2/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 0x67a1(%rip), %rsi      # 0x9160
leaq 0x26d2(%rip), %rdi      # 0x5098
leaq 0x285e(%rip), %rcx      # 0x522b
movl $0xf5, %edx
xorl %eax, %eax
callq 0x261e
movq 0x6780(%rip), %rsi      # 0x9160
leaq 0x2859(%rip), %rdi      # 0x5240
movl $0xf6, %edx
xorl %eax, %eax
callq 0x261e
orl $-0x1, 0x676e(%rip)     # 0x9168
pushq $0x6
popq %rdi
callq 0x246b
movl 0x6760(%rip), %eax      # 0x9168
leal -0xd(%rax), %ecx
cmpl $0x2, %ecx
jae 0x2a39
movq 0x6749(%rip), %rsi      # 0x9160
leaq 0x60e2(%rip), %rcx      # 0x8b00
movq (%rcx,%rax,8), %rcx
leaq 0x2750(%rip), %rdi      # 0x5179
movl $0xff, %edx
xorl %eax, %eax
callq 0x261e
xorl %eax, %eax
popq %rbp
retq
jmp 0x2a39