// File: /workspace/github_cpp_makefile_star2_O1/yanlinlin82[P]icpp/icpp.cpp
// Function: add_assembly_code(instruction, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
size_t add_assembly_code(instruction code, int param = 0, string comment = "")
{
	auto it = offset.find(line_no);
	if (it == offset.end()) {
		offset.insert(make_pair(line_no, make_pair(code_sec.size(), code_sec.size())));
	} else {
		it->second.second = code_sec.size();
	}
	size_t code_offset = code_sec.size();
	code_sec.push_back(code);
	if (instruction_has_parameter(code)) {
		if (code == CALL || code == JMP || code == JZ || code == JNZ) {
			param -= code_sec.size() + 1; // use relative address
		}
		code_sec.push_back(param);
	}
	if (!comment.empty()) {
		comments.insert(make_pair(code_offset, comment));
	}
	if (verbose >= 3) {
		if (next_display_instruction < code_sec.size()) {
			log(COLOR_BLUE);
			while (next_display_instruction < code_sec.size()) {
				next_display_instruction = print_code(code_sec, next_display_instruction);
			}
			log(COLOR_NORMAL);
		}
	}
	return code_offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movl %edi, %r15d
movl %esi, -0x1c(%rbp)
leaq 0x1f4e8(%rip), %rcx     # 0x24290
movq 0x1f4e1(%rip), %r8      # 0x24290
leaq 0x1f702(%rip), %rdi     # 0x244b8
xorl %ebx, %ebx
movq %r8, %rax
xorl %edx, %edx
divq 0x1f6fc(%rip)           # 0x244c0
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0x18c3a
testq %rax, %rax
je 0x4dda
movq (%rax), %rbx
testq %rbx, %rbx
je 0x4df7
movq 0x1f532(%rip), %rax     # 0x24318
subq 0x1f523(%rip), %rax     # 0x24310
sarq $0x2, %rax
movq %rax, 0x18(%rbx)
jmp 0x4e2b
movq 0x1f51a(%rip), %rax     # 0x24318
subq 0x1f50b(%rip), %rax     # 0x24310
sarq $0x2, %rax
movq 0x1f480(%rip), %rcx     # 0x24290
leaq -0x48(%rbp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq %rax, 0x10(%rsi)
leaq 0x1f692(%rip), %rdi     # 0x244b8
callq 0x18c88
movq 0x1f4e6(%rip), %rsi     # 0x24318
movq %rsi, %rbx
subq 0x1f4d4(%rip), %rbx     # 0x24310
movl %r15d, -0x48(%rbp)
cmpq 0x1f4d9(%rip), %rsi     # 0x24320
je 0x4e59
movl %r15d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x1f4c1(%rip)     # 0x24318
jmp 0x4e69
leaq 0x1f4b0(%rip), %rdi     # 0x24310
leaq -0x48(%rbp), %rdx
callq 0x18f44
cmpl $0x29, %r15d
ja 0x4edb
movl %r15d, %eax
movabsq $0x48000007f8, %rcx     # imm = 0x48000007F8
btq %rax, %rcx
jb 0x4ea9
movabsq $0x3a000000000, %rcx    # imm = 0x3A000000000
btq %rax, %rcx
jae 0x4edb
movq 0x1f47f(%rip), %rax     # 0x24318
subq 0x1f470(%rip), %rax     # 0x24310
shrq $0x2, %rax
notl %eax
addl %eax, -0x1c(%rbp)
movq 0x1f468(%rip), %rsi     # 0x24318
cmpq 0x1f469(%rip), %rsi     # 0x24320
je 0x4ecb
movl -0x1c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x1f44f(%rip)     # 0x24318
jmp 0x4edb
leaq 0x1f43e(%rip), %rdi     # 0x24310
leaq -0x1c(%rbp), %rdx
callq 0x19020
sarq $0x2, %rbx
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0x4f28
leaq -0x40(%rbp), %rdi
movq %rbx, -0x8(%rdi)
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
addq %rsi, %rdx
callq 0x16d2e
leaq 0x1f45e(%rip), %rdi     # 0x24368
leaq -0x48(%rbp), %rsi
callq 0x178e4
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x4f28
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x31d0
cmpl $0x3, 0x1f6b1(%rip)     # 0x245e0
jl 0x4fbc
movq 0x1f3dc(%rip), %rax     # 0x24318
subq 0x1f3cd(%rip), %rax     # 0x24310
sarq $0x2, %rax
cmpq %rax, 0x1f61a(%rip)     # 0x24568
jae 0x4fbc
leaq 0x17470(%rip), %rdi     # 0x1c3c7
xorl %eax, %eax
callq 0x15504
movq 0x1f603(%rip), %rax     # 0x24568
movq 0x1f3ac(%rip), %rcx     # 0x24318
subq 0x1f39d(%rip), %rcx     # 0x24310
sarq $0x2, %rcx
cmpq %rcx, %rax
jae 0x4fae
leaq 0x1f38d(%rip), %r14     # 0x24310
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x4bf4
movq %rax, 0x1f5d1(%rip)     # 0x24568
movq 0x1f37a(%rip), %rcx     # 0x24318
subq 0x1f36b(%rip), %rcx     # 0x24310
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x4f83
leaq 0x1850d(%rip), %rdi     # 0x1d4c2
xorl %eax, %eax
callq 0x15504
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x4fe2
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rdi
callq 0x3320