// File: /workspace/github_cpp_makefile_star2_O1/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 0x417d(%rip), %rsi      # 0x19c78
xorl %eax, %eax
callq 0x162e4
movq 0x8(%rbx), %rdx
leaq 0x4176(%rip), %rsi      # 0x19c83
movq %r12, %rdi
xorl %eax, %eax
callq 0x162e4
leaq 0x416a(%rip), %rsi      # 0x19c88
movq %r12, %rdi
xorl %eax, %eax
callq 0x162e4
leaq 0x416c(%rip), %rsi      # 0x19c9b
movq %r12, %rdi
xorl %eax, %eax
callq 0x162e4
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 0x17a38
leaq 0x88(%rsp), %r15
leaq 0x28(%rbx), %rsi
movq %r15, %rdi
movq %rsi, 0x50(%rsp)
callq 0x105d8
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rbx), %rsi
callq 0xb122
movups 0x58(%rbx), %xmm0
leaq 0x60(%rsp), %rsi
movups %xmm0, 0x58(%rsi)
movq %r12, %rdi
movq %r13, %rdx
callq 0x1636c
leaq 0x410e(%rip), %rsi      # 0x19cb5
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x162e4
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x15bd1
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %r15, %rdi
callq 0x9812
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x15bf0
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x40d7(%rip), %rsi      # 0x19cce
movq %r12, 0x8(%rsp)
movq %r12, %rdi
xorl %eax, %eax
callq 0x162e4
xorps %xmm0, %xmm0
leaq 0xd0(%rsp), %rcx
movups %xmm0, 0x9(%rcx)
movups %xmm0, (%rcx)
movups %xmm0, 0x20(%rcx)
movq $0x0, 0x30(%rcx)
movq %r13, -0x8(%rcx)
movb 0x20(%r13), %al
movb %al, 0x18(%rcx)
movq 0x28(%r13), %rax
movq %rax, 0x20(%rcx)
movq 0x30(%r13), %rax
movq %rax, 0x28(%rcx)
movq 0x38(%r13), %rax
movq %rax, 0x30(%rcx)
movq 0x30(%rbx), %rax
movq %rbx, (%rsp)
movq 0x28(%rbx), %rcx
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
subq %rcx, %rax
je 0x15d8d
movl $0x2, %r14d
leaq 0xa10d(%rip), %rcx      # 0x1fd80
movq $-0x8, %rbp
leaq 0x30(%rsp), %rbx
leaq 0x158(%rsp), %r13
xorl %r15d, %r15d
movq %rcx, 0x58(%rsp)
movq (%rcx), %rdx
movq 0x8(%rsp), %rdi
leaq 0x4065(%rip), %rsi      # 0x19d03
movl %ebp, %ecx
xorl %eax, %eax
callq 0x162e4
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 0x17a38
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x16476
leaq 0xd0(%rsp), %rdi
movq %r13, %rsi
callq 0x10b8e
leaq 0x180(%rsp), %rdi
callq 0x9812
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x15d25
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x15d41
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
addq $-0x8, 0xf0(%rsp)
movq (%rsp), %rcx
movq 0x30(%rcx), %rax
subq 0x28(%rcx), %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rdx, %rax
cmpq $0x4, %r15
ja 0x15d95
incq %r15
addq $0x5, %r14
movq 0x58(%rsp), %rcx
addq $0x8, %rcx
addq $-0x8, %rbp
cmpq %r15, %rax
ja 0x15c8a
jmp 0x15d95
sarq $0x3, %rax
imulq %rdx, %rax
cmpq $0x7, %rax
jb 0x15eac
movq (%rsp), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
imulq %rdx, %rcx
cmpq $0x7, %rcx
jb 0x15eac
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 0x17a38
movslq %r12d, %rcx
leaq 0x108(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rbp
movq %r13, %rdx
callq 0x16476
leaq 0xd0(%rsp), %rdi
movq %rbx, %rsi
callq 0x10b8e
leaq 0x130(%rsp), %rdi
callq 0x9812
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x15e58
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x15e74
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 0x15dd7
movq (%rsp), %rbx
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
movq 0x8(%rsp), %r12
je 0x15ef0
xorl %r14d, %r14d
leaq 0xc8(%rsp), %r15
movq (%rax,%r14,8), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x164f0
incq %r14
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
ja 0x15eca
leaq 0xd0(%rsp), %rdi
callq 0x15538
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 0x986e
jmp 0x15fc0
movq %rax, %rbx
movq %r15, %rdi
callq 0x9812
jmp 0x15f31
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x15fc0
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x15fc0
jmp 0x15f7d
movq %rax, %rbx
jmp 0x15f65
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x103f6
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x15fb3
movq 0x20(%rsp), %rsi
jmp 0x15fab
jmp 0x15f7d
movq %rax, %rbx
jmp 0x15fb3
movq %rax, %rbx
jmp 0x15f97
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x103f6
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x15fb3
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0xd0(%rsp), %rdi
callq 0x15538
movq %rbx, %rdi
callq 0x33b0