// File: /workspace/github_c_makefile_star2_O1/ryvnf[P]czc/codegen.c
// Function: codegen_to_file
void codegen_to_file(struct ast *ast, FILE *fp)
{
    struct scope *predecl_symtbl = scope_new(NULL, 1, 64);

    scope_add_typesym(predecl_symtbl, "int", sym_new_type(int_type));
    scope_add_typesym(predecl_symtbl, "int8", sym_new_type(int8_type));
    scope_add_typesym(predecl_symtbl, "int16", sym_new_type(int16_type));
    scope_add_typesym(predecl_symtbl, "int32", sym_new_type(int32_type));
    scope_add_typesym(predecl_symtbl, "int64", sym_new_type(int64_type));
    scope_add_typesym(predecl_symtbl, "ssize", sym_new_type(ssize_type));
    scope_add_typesym(predecl_symtbl, "uint", sym_new_type(uint_type));
    scope_add_typesym(predecl_symtbl, "uint8", sym_new_type(uint8_type));
    scope_add_typesym(predecl_symtbl, "uint16", sym_new_type(uint16_type));
    scope_add_typesym(predecl_symtbl, "uint32", sym_new_type(uint32_type));
    scope_add_typesym(predecl_symtbl, "uint64", sym_new_type(uint64_type));
    scope_add_typesym(predecl_symtbl, "size", sym_new_type(size_type));
    scope_add_typesym(predecl_symtbl, "float", sym_new_type(float_type));
    scope_add_typesym(predecl_symtbl, "double", sym_new_type(double_type));
    scope_add_typesym(predecl_symtbl, "bool", sym_new_type(bool_type));
    scope_add_typesym(predecl_symtbl, "char", sym_new_type(char_type));
    scope_add_typesym(predecl_symtbl, "void", sym_new_type(void_type));

    current_scope = global_scope = scope_new(predecl_symtbl, 65536, 8192);

    zc_type_decls_rope = NULL;
    zc_type_defs_rope = NULL;
    zc_prog_decls_rope = NULL;
    zc_prog_defs_rope = NULL;

    decl_pass(ast);
    codegen_pass(ast);

    ast_unref(ast);

    struct rope *zc_file_rope = zc_type_decls_rope;
    zc_file_rope = rope_new_tree(zc_file_rope, zc_type_defs_rope);
    zc_file_rope = rope_new_tree(zc_file_rope, zc_prog_decls_rope);
    zc_file_rope = rope_new_tree(zc_file_rope, zc_prog_defs_rope);
    rope_print_to_file(zc_file_rope, fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r14
xorl %r12d, %r12d
movl $0x1, %esi
movl $0x40, %edx
xorl %edi, %edi
callq 0xb2b4
movq %rax, %r15
leaq 0xf19f(%rip), %rdi      # 0x13d18
callq 0xb5a6
leaq 0x9e50(%rip), %rsi      # 0xe9d5
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf185(%rip), %rdi      # 0x13d1c
callq 0xb5a6
leaq 0x8d38(%rip), %rsi      # 0xd8db
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf16b(%rip), %rdi      # 0x13d20
callq 0xb5a6
leaq 0x8d20(%rip), %rsi      # 0xd8e1
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf151(%rip), %rdi      # 0x13d24
callq 0xb5a6
leaq 0x8d09(%rip), %rsi      # 0xd8e8
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf137(%rip), %rdi      # 0x13d28
callq 0xb5a6
leaq 0x8cf2(%rip), %rsi      # 0xd8ef
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf121(%rip), %rdi      # 0x13d30
callq 0xb5a6
leaq 0x8cb4(%rip), %rsi      # 0xd8cf
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf107(%rip), %rdi      # 0x13d34
callq 0xb5a6
leaq 0x8c9c(%rip), %rsi      # 0xd8d5
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf0ed(%rip), %rdi      # 0x13d38
callq 0xb5a6
leaq 0x8c83(%rip), %rsi      # 0xd8da
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf0d3(%rip), %rdi      # 0x13d3c
callq 0xb5a6
leaq 0x8c6b(%rip), %rsi      # 0xd8e0
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf0b9(%rip), %rdi      # 0x13d40
callq 0xb5a6
leaq 0x8c54(%rip), %rsi      # 0xd8e7
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf09f(%rip), %rdi      # 0x13d44
callq 0xb5a6
leaq 0x8c3d(%rip), %rsi      # 0xd8ee
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf089(%rip), %rdi      # 0x13d4c
callq 0xb5a6
leaq 0x8c01(%rip), %rsi      # 0xd8d0
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf06f(%rip), %rdi      # 0x13d50
callq 0xb5a6
leaq 0x8c08(%rip), %rsi      # 0xd8f5
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf055(%rip), %rdi      # 0x13d54
callq 0xb5a6
leaq 0x8bf0(%rip), %rsi      # 0xd8fb
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf043(%rip), %rdi      # 0x13d60
callq 0xb5a6
leaq 0x8bd9(%rip), %rsi      # 0xd902
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf029(%rip), %rdi      # 0x13d64
callq 0xb5a6
leaq 0x9c71(%rip), %rsi      # 0xe9b8
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
leaq 0xf00f(%rip), %rdi      # 0x13d68
callq 0xb5a6
leaq 0x927f(%rip), %rsi      # 0xdfe4
movq %r15, %rdi
movq %rax, %rdx
callq 0xb307
movl $0x10000, %esi          # imm = 0x10000
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rdi
callq 0xb2b4
leaq 0xf05f(%rip), %rcx      # 0x13de8
movq %rax, (%rcx)
leaq 0xf04d(%rip), %rcx      # 0x13de0
movq %rax, (%rcx)
leaq 0xf05b(%rip), %r15      # 0x13df8
movq %r12, (%r15)
leaq 0xf059(%rip), %r13      # 0x13e00
movq %r12, (%r13)
leaq 0xf056(%rip), %rbp      # 0x13e08
movq %r12, (%rbp)
leaq 0xf053(%rip), %rbx      # 0x13e10
movq %r12, (%rbx)
movq %r14, %rdi
callq 0x4835
movq %r14, %rdi
callq 0x4a8d
movq %r14, %rdi
callq 0x26cf
movq (%r15), %rdi
movq (%r13), %rsi
callq 0xb136
movq (%rbp), %rsi
movq %rax, %rdi
callq 0xb136
movq (%rbx), %rsi
movq %rax, %rdi
callq 0xb136
movq %rax, %rdi
movq (%rsp), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb264
nopl (%rax)