// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movl %esi, %r15d
movl %edi, %r12d
movl %esi, -0x24(%rbp)
leaq 0x1e756(%rip), %rdi     # 0x234b8
leaq 0x1e527(%rip), %rsi     # 0x23290
callq 0x18834
testq %rax, %rax
je 0x4d8e
movq 0x1e59e(%rip), %rsi     # 0x23318
movq %rsi, %rbx
subq 0x1e58c(%rip), %rbx     # 0x23310
sarq $0x2, %rbx
movq %rbx, 0x18(%rax)
jmp 0x4dd7
movq 0x1e583(%rip), %rax     # 0x23318
subq 0x1e574(%rip), %rax     # 0x23310
sarq $0x2, %rax
movq 0x1e4e9(%rip), %rcx     # 0x23290
leaq -0x50(%rbp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq %rax, 0x10(%rsi)
leaq 0x1e6fb(%rip), %rdi     # 0x234b8
callq 0x18896
movq 0x1e54f(%rip), %rsi     # 0x23318
movq %rsi, %rbx
subq 0x1e53d(%rip), %rbx     # 0x23310
sarq $0x2, %rbx
movl %r12d, -0x50(%rbp)
cmpq 0x1e53e(%rip), %rsi     # 0x23320
je 0x4df4
movl %r12d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x1e526(%rip)     # 0x23318
jmp 0x4e04
leaq 0x1e515(%rip), %rdi     # 0x23310
leaq -0x50(%rbp), %rdx
callq 0x18b46
cmpl $0x29, %r12d
ja 0x4e7a
movl %r12d, %eax
movabsq $0x48000007f8, %rcx     # imm = 0x48000007F8
btq %rax, %rcx
jb 0x4e4a
movabsq $0x3a000000000, %rcx    # imm = 0x3A000000000
btq %rax, %rcx
jae 0x4e7a
movq 0x1e4e4(%rip), %rax     # 0x23318
subq 0x1e4d5(%rip), %rax     # 0x23310
shrq $0x2, %rax
notl %eax
addl %r15d, %eax
movl %eax, -0x24(%rbp)
movl %eax, %r15d
movq 0x1e4c7(%rip), %rsi     # 0x23318
cmpq 0x1e4c8(%rip), %rsi     # 0x23320
je 0x4e6a
movl %r15d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x1e4b0(%rip)     # 0x23318
jmp 0x4e7a
leaq 0x1e49f(%rip), %rdi     # 0x23310
leaq -0x24(%rbp), %rdx
callq 0x18c22
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0x4ec3
leaq -0x48(%rbp), %rdi
movq %rbx, -0x8(%rdi)
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
addq %rsi, %rdx
callq 0x16942
leaq 0x1e4c3(%rip), %rdi     # 0x23368
leaq -0x50(%rbp), %rsi
callq 0x174f4
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x4ec3
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
cmpl $0x3, 0x1e716(%rip)     # 0x235e0
jl 0x4f57
movq 0x1e441(%rip), %rax     # 0x23318
subq 0x1e432(%rip), %rax     # 0x23310
sarq $0x2, %rax
cmpq %rax, 0x1e67f(%rip)     # 0x23568
jae 0x4f57
leaq 0x164d5(%rip), %rdi     # 0x1b3c7
xorl %eax, %eax
callq 0x15114
movq 0x1e668(%rip), %rax     # 0x23568
movq 0x1e411(%rip), %rcx     # 0x23318
subq 0x1e402(%rip), %rcx     # 0x23310
sarq $0x2, %rcx
cmpq %rcx, %rax
jae 0x4f49
leaq 0x1e3f2(%rip), %r14     # 0x23310
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x4bf7
movq %rax, 0x1e636(%rip)     # 0x23568
movq 0x1e3df(%rip), %rcx     # 0x23318
subq 0x1e3d0(%rip), %rcx     # 0x23310
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x4f1e
leaq 0x17572(%rip), %rdi     # 0x1c4c2
xorl %eax, %eax
callq 0x15114
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x4f7f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rdi
callq 0x3320