// File: /workspace/github_cpp_makefile_star2_O3/CobaltXII[P]cxcc/./compiler/compiler.hpp
// Function: compiler_t::compile_function(function_t, symbol_table_t&)
void compile_function(function_t function, symbol_table_t& symbols) {
		#ifdef __APPLE__
		emit(".globl _%s\n", function.identifier.c_str());
		emit("_%s:\n", function.identifier.c_str());
		#else
		emit(".globl %s\n", function.identifier.c_str());
		emit("%s:\n", function.identifier.c_str());
		#endif

		emit("    pushq   %%rbp\n");
		emit("    movq    %%rsp, %%rbp\n");
		emit("    subq    $%ld, %%rsp\n", aligned_offset(function, symbols));
		emit("    andq    $-16, %%rsp\n");

		symbol_table_t new_symbols(&symbols);
		const char* registers[6] = {"%rdi", "%rsi", "%rdx", "%rcx", "%r8", "%r9"};
		for (int i = 0; i < function.parameters.size() && i < 6; i++) {
			emit("    movq    %s, %d(%%rbp)\n", registers[i], i * -8 - 8);
			new_symbols.add_symbol(symbol_t(
				function.parameters[i].type,
				function.parameters[i].identifier,
				i * -8 - 8
			));
			new_symbols.offset -= 8;
		}
		if (function.parameters.size() > 6) {
			for (int i = 6; i < function.parameters.size(); i++) {
				new_symbols.add_symbol(symbol_t(
					function.parameters[i].type,
					function.parameters[i].identifier,
					(i - 6) * 8 + 16
				));
			}
		}
		for (int i = 0; i < function.body.size(); i++) {
			compile_statement(function.body[i], new_symbols);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r12
movq 0x8(%rsi), %rdx
leaq 0x41a7(%rip), %rsi      # 0x19ca8
xorl %eax, %eax
callq 0x162e6
movq 0x8(%rbx), %rdx
leaq 0x41a0(%rip), %rsi      # 0x19cb3
movq %r12, %rdi
xorl %eax, %eax
callq 0x162e6
leaq 0x4194(%rip), %rsi      # 0x19cb8
movq %r12, %rdi
xorl %eax, %eax
callq 0x162e6
leaq 0x4196(%rip), %rsi      # 0x19ccb
movq %r12, %rdi
xorl %eax, %eax
callq 0x162e6
movq (%rbx), %rax
leaq 0x68(%rsp), %rdi
movq %rax, -0x8(%rdi)
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
callq 0x179ce
leaq 0x88(%rsp), %r15
leaq 0x28(%rbx), %rsi
movq %r15, %rdi
movq %rsi, 0x50(%rsp)
callq 0x10074
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rbx), %rsi
callq 0xb076
movups 0x58(%rbx), %xmm0
leaq 0x60(%rsp), %rsi
movups %xmm0, 0x58(%rsi)
movq %r12, %rdi
movq %r13, %rdx
callq 0x1636e
leaq 0x4138(%rip), %rsi      # 0x19ce5
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x162e6
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x15bd7
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %r15, %rdi
callq 0x9730
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x15bf6
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x4101(%rip), %rsi      # 0x19cfe
movq %r12, 0x8(%rsp)
movq %r12, %rdi
xorl %eax, %eax
callq 0x162e6
xorps %xmm0, %xmm0
leaq 0xd0(%rsp), %rcx
movups %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
movq %r13, -0x8(%rcx)
movb 0x20(%r13), %al
movb %al, 0x18(%rcx)
movups 0x28(%r13), %xmm0
movups %xmm0, 0x20(%rcx)
movq 0x38(%r13), %rax
movq %rax, 0x30(%rcx)
movq 0x28(%rbx), %rax
movq %rbx, (%rsp)
movq 0x30(%rbx), %rcx
movq %rcx, %rdx
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
subq %rax, %rdx
je 0x15d8d
movl $0x2, %r14d
leaq 0xa113(%rip), %rdi      # 0x1fd80
movq $-0x8, %rbp
leaq 0x30(%rsp), %rbx
leaq 0x158(%rsp), %r13
xorl %r15d, %r15d
movq %rdi, 0x58(%rsp)
movq (%rdi), %rdx
movq 0x8(%rsp), %rdi
leaq 0x409b(%rip), %rsi      # 0x19d33
movl %ebp, %ecx
xorl %eax, %eax
callq 0x162e6
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq -0x10(%rax,%r14,8), %r12
leaq 0x40(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq -0x8(%rax,%r14,8), %rsi
movq (%rax,%r14,8), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x179ce
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x1646c
leaq 0xd0(%rsp), %rdi
movq %r13, %rsi
callq 0x105f4
leaq 0x180(%rsp), %rdi
callq 0x9730
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x15d1f
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x15d3b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
addq $-0x8, 0xf0(%rsp)
movq (%rsp), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rsi, %rdx
cmpq $0x4, %r15
ja 0x15d95
incq %r15
addq $0x5, %r14
movq 0x58(%rsp), %rdi
addq $0x8, %rdi
addq $-0x8, %rbp
cmpq %r15, %rdx
ja 0x15c84
jmp 0x15d95
sarq $0x3, %rdx
imulq %rsi, %rdx
cmpq $0x7, %rdx
jb 0x15ea0
subq %rax, %rcx
sarq $0x3, %rcx
imulq %rsi, %rcx
cmpq $0x7, %rcx
jb 0x15ea0
movl $0x6, %r15d
movl $0x20, %r14d
movl $0x10, %r12d
leaq 0x10(%rsp), %r13
movq -0x10(%rax,%r14,8), %rbp
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq -0x8(%rax,%r14,8), %rsi
movq (%rax,%r14,8), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x179ce
movslq %r12d, %rcx
leaq 0x108(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rbp
movq %r13, %rdx
callq 0x1646c
leaq 0xd0(%rsp), %rdi
movq %rbx, %rsi
callq 0x105f4
leaq 0x130(%rsp), %rdi
callq 0x9730
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x15e4c
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x15e68
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3280
incq %r15
movq (%rsp), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rdx, %rcx
addq $0x5, %r14
addl $0x8, %r12d
cmpq %r15, %rcx
movq %rbp, %r13
ja 0x15dcb
movq (%rsp), %rbx
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
movq 0x8(%rsp), %r12
je 0x15ee4
xorl %r14d, %r14d
leaq 0xc8(%rsp), %r15
movq (%rax,%r14,8), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x164e6
incq %r14
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
ja 0x15ebe
leaq 0xd0(%rsp), %rdi
callq 0x1553e
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x978e
jmp 0x15fb4
movq %rax, %rbx
movq %r15, %rdi
callq 0x9730
jmp 0x15f25
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x15fb4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x15fb4
jmp 0x15f71
movq %rax, %rbx
jmp 0x15f59
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0xfecc
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x15fa7
movq 0x20(%rsp), %rsi
jmp 0x15f9f
jmp 0x15f71
movq %rax, %rbx
jmp 0x15fa7
movq %rax, %rbx
jmp 0x15f8b
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xfecc
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x15fa7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0xd0(%rsp), %rdi
callq 0x1553e
movq %rbx, %rdi
callq 0x33b0