// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
addq $0xb0, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11640
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11670
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x116a0
testb $0x1, %al
jne 0x101c4
jmp 0x103c8
leaq -0x18(%rbp), %rdi
callq 0x116e0
movq -0xd8(%rbp), %rdi
movq %rax, -0x28(%rbp)
addq $0x78, %rdi
movq -0x28(%rbp), %rsi
callq 0x114b0
movq -0xd8(%rbp), %rdi
movq %rax, -0x30(%rbp)
addq $0x78, %rdi
callq 0x11510
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x11380
testb $0x1, %al
jne 0x10213
jmp 0x10368
movb $0x1, -0xc9(%rbp)
movl $0x10, %edi
callq 0x41e0
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rdx
leaq 0x1316b(%rip), %rsi     # 0x233a1
leaq -0x98(%rbp), %rdi
callq 0xb520
jmp 0x10244
leaq 0x13151(%rip), %rdx     # 0x2339c
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x6250
jmp 0x1025d
movq -0x28(%rbp), %rax
movl 0x28(%rax), %esi
leaq -0xc8(%rbp), %rdi
callq 0xbcc0
jmp 0x10272
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0xbbf0
jmp 0x10288
movq -0xe0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x45f0
jmp 0x1029a
movq -0xe0(%rbp), %rdi
movb $0x0, -0xc9(%rbp)
movq 0x24d39(%rip), %rsi     # 0x34fe8
movq 0x24cea(%rip), %rdx     # 0x34fa0
callq 0x4640
jmp 0x10485
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x1034c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x10340
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x10337
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x1032b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4748
leaq -0xc8(%rbp), %rdi
callq 0x4748
leaq -0x78(%rbp), %rdi
callq 0x4748
leaq -0x98(%rbp), %rdi
callq 0x4748
testb $0x1, -0xc9(%rbp)
jne 0x10357
jmp 0x10363
movq -0xe0(%rbp), %rdi
callq 0x42c0
jmp 0x10479
movq -0x28(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0xe4(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x11590
movl -0xe4(%rbp), %edi
movl 0x20(%rax), %esi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rax
movl 0x28(%rax), %ecx
callq 0xfe00
movq -0xd8(%rbp), %rdi
movw %ax, -0xcc(%rbp)
movq -0x28(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, %esi
movswl -0xcc(%rbp), %edx
callq 0x11700
leaq -0x18(%rbp), %rdi
callq 0x11760
jmp 0x101ae
movq -0xd8(%rbp), %rdi
callq 0x11450
movq -0xd8(%rbp), %rsi
movl %eax, %ecx
movq 0xc8(%rsi), %rax
subl (%rax), %ecx
movq 0xc8(%rsi), %rax
movl %ecx, 0x4(%rax)
movq 0x18(%rsi), %rdi
addq $0xd0, %rsi
callq 0xf760
movq -0xd8(%rbp), %rdi
movw %ax, %cx
movq 0xc8(%rdi), %rax
movw %cx, 0x8(%rax)
addq $0x20, %rdi
callq 0x11780
movq -0xd8(%rbp), %rdi
movb %al, %cl
movq 0xc8(%rdi), %rax
movb %cl, 0xb(%rax)
addq $0x20, %rdi
callq 0x117a0
movq -0xd8(%rbp), %rdi
addq $0x78, %rdi
callq 0x117c0
movq -0xd8(%rbp), %rdi
addq $0xb0, %rdi
callq 0x117e0
movq -0xd8(%rbp), %rdi
addq $0xd0, %rdi
callq 0x44a0
addq $0xf0, %rsp
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x4670
nopw %cs:(%rax,%rax)