// File: yanlinlin82[P]icpp/icpp.cpp
// Function: query_function(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
auto query_function(string name, vector<string>& arg_types) -> tuple<size_t, string, bool, string, int> // offset, arg_types, is_code, type_name, arg_count
{
	auto it = override_functions.find(name);
	if (it == override_functions.end()) {
		err("function '%s' not defined!\n", name.c_str());
	}
	string type_name;
	if (name == "printf") {
		if (arg_types.empty()) err("missing parameter in printf()!\n");
		type_name = arg_types[0] + ",...";
	} else {
		type_name = vector_to_string(arg_types);
	}
	for (auto it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
		if (*it2 == name + "(" + type_name + ")") {
			auto it3 = symbols.find(*it2);
			if (it3 == symbols.end()) {
				err("unexpected runtime error!\n");
			}
			auto [ is_code, offset, size, symbol_type_name, ret_type, arg_count ] = it3->second;
			return make_tuple(offset, ret_type, is_code, type_name, arg_count);
		}
	}
	err("function '%s' not matched!\n", name.c_str());
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rsi, -0x1e8(%rbp)
movq %rdi, -0x1e0(%rbp)
movq %rdi, %rax
movq %rax, -0x1d8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x48e9a(%rip), %rdi     # 0x50690
callq 0x1ace0
movq %rax, -0x20(%rbp)
leaq 0x48e8a(%rip), %rdi     # 0x50690
callq 0x1ad40
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1ad10
testb $0x1, %al
jne 0x7822
jmp 0x783f
movq -0x1e8(%rbp), %rdi
callq 0x3110
movq %rax, %rsi
leaq 0x2fc9f(%rip), %rdi     # 0x374d7
movb $0x0, %al
callq 0x1a780
leaq -0x48(%rbp), %rdi
callq 0x3380
movq -0x1e8(%rbp), %rdi
leaq 0x2fc9d(%rip), %rsi     # 0x374f3
callq 0x1a9c0
movb %al, -0x1e9(%rbp)
jmp 0x7863
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x786f
jmp 0x78de
movq -0x18(%rbp), %rdi
callq 0x1ad70
testb $0x1, %al
jne 0x787e
jmp 0x78a1
leaq 0x2fc75(%rip), %rdi     # 0x374fa
xorl %eax, %eax
callq 0x1a780
jmp 0x788e
jmp 0x78a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7c8f
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19740
movq %rax, %rsi
leaq 0x305b2(%rip), %rdx     # 0x37e6a
leaq -0x78(%rbp), %rdi
callq 0x1a540
jmp 0x78c3
leaq -0x48(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3300
leaq -0x78(%rbp), %rdi
callq 0x34d8
jmp 0x79a1
movq -0x18(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x3470
movq -0x1f8(%rbp), %rdx
leaq 0x2f842(%rip), %rsi     # 0x3714c
leaq -0xb8(%rbp), %rdi
callq 0x199b0
jmp 0x7918
movq -0x200(%rbp), %rsi
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x6980
jmp 0x7934
leaq -0x48(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3300
leaq -0x98(%rbp), %rdi
callq 0x34d8
leaq -0xb8(%rbp), %rdi
callq 0x34d8
leaq -0xb9(%rbp), %rdi
callq 0x32b0
jmp 0x79a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7990
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x34d8
leaq -0xb9(%rbp), %rdi
callq 0x32b0
jmp 0x7c8f
leaq -0x20(%rbp), %rdi
callq 0x1adb0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x1ade0
movq %rax, -0xc8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x1adb0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x1ae40
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x1ae10
testb $0x1, %al
jne 0x79f5
jmp 0x7c66
leaq -0xc8(%rbp), %rdi
callq 0x1af00
movq -0x1e8(%rbp), %rsi
movq %rax, -0x208(%rbp)
leaq 0x2fef1(%rip), %rdx     # 0x37907
leaq -0x130(%rbp), %rdi
callq 0x1a540
jmp 0x7a24
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x1a4f0
jmp 0x7a3d
leaq 0x30084(%rip), %rdx     # 0x37ac8
leaq -0xf0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1a4a0
jmp 0x7a59
movq -0x208(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x1ae70
movb %al, -0x209(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x34d8
leaq -0x110(%rbp), %rdi
callq 0x34d8
leaq -0x130(%rbp), %rdi
callq 0x34d8
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x7aa5
jmp 0x7c53
leaq -0xc8(%rbp), %rdi
callq 0x1af00
movq %rax, %rsi
leaq 0x48b2d(%rip), %rdi     # 0x505e8
callq 0x1af30
movq %rax, -0x218(%rbp)
jmp 0x7ac9
movq -0x218(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq 0x48b0a(%rip), %rdi     # 0x505e8
callq 0x1af90
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x1af60
testb $0x1, %al
jne 0x7b03
jmp 0x7b4c
leaq 0x2fa10(%rip), %rdi     # 0x3751a
xorl %eax, %eax
callq 0x1a780
jmp 0x7b13
jmp 0x7b4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7b3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x34d8
leaq -0x130(%rbp), %rdi
callq 0x34d8
jmp 0x7c8f
leaq -0x138(%rbp), %rdi
callq 0x1afc0
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x1aff0
jmp 0x7b6d
leaq -0x1a0(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x1b020
movq -0x220(%rbp), %rdi
movq %rax, -0x1a8(%rbp)
callq 0x1b040
movq -0x220(%rbp), %rdi
movq %rax, -0x1b0(%rbp)
callq 0x1b060
movq -0x220(%rbp), %rdi
movq %rax, -0x1b8(%rbp)
callq 0x1b080
movq -0x220(%rbp), %rdi
movq %rax, -0x1c0(%rbp)
callq 0x1b0a0
movq -0x220(%rbp), %rdi
movq %rax, -0x1c8(%rbp)
callq 0x1b0c0
movq -0x1e0(%rbp), %rdi
movq %rax, -0x1d0(%rbp)
movq -0x1b0(%rbp), %rsi
movq -0x1c8(%rbp), %rdx
movq -0x1a8(%rbp), %rcx
movq -0x1d0(%rbp), %r9
leaq -0x48(%rbp), %r8
callq 0x1b0e0
jmp 0x7c14
leaq -0x1a0(%rbp), %rdi
callq 0x198d0
leaq -0x48(%rbp), %rdi
callq 0x34d8
movq -0x1d8(%rbp), %rax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x198d0
jmp 0x7c8f
jmp 0x7c55
leaq -0xc8(%rbp), %rdi
callq 0x1b130
jmp 0x79bd
movq -0x1e8(%rbp), %rdi
callq 0x3110
movq %rax, %rsi
leaq 0x2f8b9(%rip), %rdi     # 0x37535
xorl %eax, %eax
callq 0x1a780
jmp 0x7c85
movl $0x1, %edi
callq 0x32f0
leaq -0x48(%rbp), %rdi
callq 0x34d8
movq -0x50(%rbp), %rdi
callq 0x3460
nopw %cs:(%rax,%rax)