// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rdi, %r14
pushq $0x1
popq %rsi
pushq $0x40
popq %rdx
xorl %edi, %edi
callq 0x9fc0
movq %rax, %r15
leaq 0xe7b1(%rip), %rdi      # 0x12d18
callq 0xa265
leaq 0x8452(%rip), %rsi      # 0xc9c5
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe797(%rip), %rdi      # 0x12d1c
callq 0xa265
leaq 0x734a(%rip), %rsi      # 0xb8db
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe77d(%rip), %rdi      # 0x12d20
callq 0xa265
leaq 0x7332(%rip), %rsi      # 0xb8e1
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe763(%rip), %rdi      # 0x12d24
callq 0xa265
leaq 0x731b(%rip), %rsi      # 0xb8e8
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe749(%rip), %rdi      # 0x12d28
callq 0xa265
leaq 0x7304(%rip), %rsi      # 0xb8ef
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe733(%rip), %rdi      # 0x12d30
callq 0xa265
leaq 0x72c6(%rip), %rsi      # 0xb8cf
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe719(%rip), %rdi      # 0x12d34
callq 0xa265
leaq 0x72ae(%rip), %rsi      # 0xb8d5
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe6ff(%rip), %rdi      # 0x12d38
callq 0xa265
leaq 0x7295(%rip), %rsi      # 0xb8da
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe6e5(%rip), %rdi      # 0x12d3c
callq 0xa265
leaq 0x727d(%rip), %rsi      # 0xb8e0
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe6cb(%rip), %rdi      # 0x12d40
callq 0xa265
leaq 0x7266(%rip), %rsi      # 0xb8e7
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe6b1(%rip), %rdi      # 0x12d44
callq 0xa265
leaq 0x724f(%rip), %rsi      # 0xb8ee
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe69b(%rip), %rdi      # 0x12d4c
callq 0xa265
leaq 0x7213(%rip), %rsi      # 0xb8d0
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe681(%rip), %rdi      # 0x12d50
callq 0xa265
leaq 0x721a(%rip), %rsi      # 0xb8f5
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe667(%rip), %rdi      # 0x12d54
callq 0xa265
leaq 0x7202(%rip), %rsi      # 0xb8fb
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe655(%rip), %rdi      # 0x12d60
callq 0xa265
leaq 0x71eb(%rip), %rsi      # 0xb902
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe63b(%rip), %rdi      # 0x12d64
callq 0xa265
leaq 0x8273(%rip), %rsi      # 0xc9a8
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
leaq 0xe621(%rip), %rdi      # 0x12d68
callq 0xa265
leaq 0x7891(%rip), %rsi      # 0xbfe4
movq %r15, %rdi
movq %rax, %rdx
callq 0xa011
movl $0x10000, %esi          # imm = 0x10000
movl $0x2000, %edx           # imm = 0x2000
movq %r15, %rdi
callq 0x9fc0
leaq 0xe671(%rip), %rcx      # 0x12de8
movq %rax, (%rcx)
leaq 0xe65f(%rip), %rcx      # 0x12de0
movq %rax, (%rcx)
leaq 0xe66d(%rip), %r15      # 0x12df8
andq $0x0, (%r15)
leaq 0xe66a(%rip), %r12      # 0x12e00
andq $0x0, (%r12)
leaq 0xe666(%rip), %r13      # 0x12e08
andq $0x0, (%r13)
leaq 0xe662(%rip), %rbp      # 0x12e10
andq $0x0, (%rbp)
movq %r14, %rdi
callq 0x4278
movq %r14, %rdi
callq 0x44ae
movq %r14, %rdi
callq 0x25d9
movq (%r15), %rdi
movq (%r12), %rsi
callq 0x9e47
movq (%r13), %rsi
movq %rax, %rdi
callq 0x9e47
movq (%rbp), %rsi
movq %rax, %rdi
callq 0x9e47
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9f71