// File: /workspace/github_c_makefile_star2_O3/almk277[P]ROSE/rasm/module.cpp
// Function: code::finish()
void code::finish()
{

	for (const auto &ur: unres) {
		auto it = lbl.find(ur.label);
		if (it == lbl.end())
			throw error("unresolved: " + ur.label
					+ " at " + std::to_string(ur.lineno));
		auto o = offset(ur.offset_base, it->second,
				ur.label, ur.lineno);
		patch(ur.patch_addr, o);
	}

	cur_proc->size = address() - cur_proc->addr;
	cur_proc->type = sym.add(cur_type);
	cur_proc->varc = var.count();

	var.clear();
	lbl.clear();
	unres.clear();
	cur_type.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movq 0xb0(%rdi), %r14
movq 0xb8(%rdi), %r12
cmpq %r12, %r14
je 0x7ffe
leaq 0x78(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x9ff8
testq %rax, %rax
je 0x807d
movl 0x28(%rax), %esi
movl 0x20(%r14), %edi
movl 0x28(%r14), %ecx
movq %r14, %rdx
callq 0x7cc2
movl 0x24(%r14), %ecx
movq (%rbx), %rdx
movw %ax, (%rdx,%rcx)
addq $0x30, %r14
cmpq %r12, %r14
jne 0x7fc3
movl 0x8(%rbx), %eax
subl (%rbx), %eax
movq 0xc8(%rbx), %rcx
subl (%rcx), %eax
leaq 0xb0(%rbx), %r14
movl %eax, 0x4(%rcx)
movq 0x18(%rbx), %rdi
leaq 0xd0(%rbx), %rsi
callq 0x7884
movq 0xc8(%rbx), %rcx
movw %ax, 0x8(%rcx)
movb 0x58(%rbx), %al
movb %al, 0xb(%rcx)
leaq 0x40(%rbx), %rdi
callq 0x4c66
leaq 0x78(%rbx), %rdi
callq 0x4d04
movq 0xb0(%rbx), %rsi
movq %r14, %rdi
callq 0xa34a
movq $0x0, 0xd8(%rbx)
movq 0xd0(%rbx), %rax
movb $0x0, (%rax)
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3150
movq %rax, %rbx
leaq 0x6327(%rip), %rsi      # 0xe3b8
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
callq 0x670f
leaq 0x630e(%rip), %rsi      # 0xe3b3
leaq 0x20(%rsp), %rdi
callq 0x3500
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x80d0
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x80dc
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x28(%r14), %esi
leaq 0x40(%rsp), %rdi
callq 0x6bde
leaq 0x60(%rsp), %rdi
movq %rsp, %rsi
leaq 0x40(%rsp), %rdx
callq 0x6b36
movb $0x1, %bpl
leaq 0x60(%rsp), %rsi
movq %rbx, %rdi
callq 0x3440
xorl %ebp, %ebp
movq 0xbec3(%rip), %rsi      # 0x13ff0
movq 0xbe7c(%rip), %rdx      # 0x13fb0
movq %rbx, %rdi
callq 0x3480
movq %rax, %r14
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8162
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x8162
movq %rax, %r14
movb $0x1, %bpl
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8185
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x8185
movq %rax, %r14
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x819b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x81b6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3260
testb %bpl, %bpl
jne 0x81e0
jmp 0x81e8
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x81e0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x81e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x31f0
movq %r14, %rdi
callq 0x34a0