// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x1b74e(%rip), %rdi     # 0x21438
callq 0x1367e
movq %rax, %r14
testq %rax, %rax
jne 0x5d09
movq (%r13), %rsi
leaq 0x10895(%rip), %rdi     # 0x16597
xorl %eax, %eax
callq 0xf410
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10893(%rip), %rsi     # 0x165b3
movq %r13, %rdi
callq 0xf4c8
testb %al, %al
movq %rbx, -0x30(%rbp)
je 0x5d78
movq (%r12), %rsi
cmpq 0x8(%r12), %rsi
jne 0x5d4d
leaq 0x10878(%rip), %rdi     # 0x165ba
xorl %eax, %eax
callq 0xf410
movq (%r12), %rsi
leaq 0x111d6(%rip), %rdx     # 0x16f2a
leaq -0xb8(%rbp), %rdi
callq 0xf35b
leaq -0x58(%rbp), %rdi
leaq -0xb8(%rbp), %rbx
movq %rbx, %rsi
callq 0x3230
movq %rbx, %rdi
jmp 0x5dca
leaq 0x1048d(%rip), %rsi     # 0x1620c
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0xf1f8
leaq -0xb8(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
movq %r12, %rsi
callq 0x5530
leaq -0x58(%rbp), %rdi
leaq -0xb8(%rbp), %rbx
movq %rbx, %rsi
callq 0x3230
movq %rbx, %rdi
callq 0x3368
leaq -0xf8(%rbp), %rdi
callq 0x3368
addq $0x38, %r14
movq (%r14), %r14
movq %r14, -0x38(%rbp)
testq %r14, %r14
je 0x5ef3
leaq -0x118(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x10bd0(%rip), %rdx     # 0x169c7
callq 0xf35b
leaq -0xd8(%rbp), %r15
leaq -0xb8(%rbp), %r14
movq %r15, %rdi
movq %rbx, %rsi
leaq -0x58(%rbp), %rdx
callq 0xf332
movq %r14, %rdi
movq %r15, %rsi
leaq 0x10d62(%rip), %rdx     # 0x16b88
callq 0xf309
movq %r14, %r15
movq -0x38(%rbp), %r14
leaq 0x8(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xf53d
movl %eax, %ebx
movq %r15, %rdi
callq 0x3368
leaq -0xd8(%rbp), %rdi
callq 0x3368
leaq -0x118(%rbp), %rdi
callq 0x3368
testb %bl, %bl
je 0x5dd3
leaq 0x1b51e(%rip), %rdi     # 0x21390
movq %r12, %rsi
callq 0x136c0
movq %rax, %rbx
testq %rax, %rax
jne 0x5e90
leaq 0x10751(%rip), %rdi     # 0x165da
xorl %eax, %eax
callq 0xf410
addq $0x28, %rbx
leaq -0xb8(%rbp), %rdi
movq %rbx, %rsi
callq 0x104b4
leaq -0x60(%rbp), %rcx
leaq -0x68(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq -0x58(%rbp), %r8
leaq -0xb8(%rbp), %r9
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x10566
leaq -0xb8(%rbp), %rdi
callq 0xf1d4
leaq -0x58(%rbp), %rdi
callq 0x3368
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r13), %rsi
leaq 0x106f7(%rip), %rdi     # 0x165f5
xorl %eax, %eax
callq 0xf410
pushq $0x1
popq %rdi
callq 0x3220
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
jmp 0x5f54
jmp 0x5f34
jmp 0x5f34
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0xf1d4
jmp 0x5f59
jmp 0x5f34
jmp 0x5f34
jmp 0x5f34
movq %rax, %rbx
jmp 0x5f59
movq %rax, %rbx
jmp 0x5f4d
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x3368
leaq -0x118(%rbp), %rdi
callq 0x3368
leaq -0x58(%rbp), %rdi
callq 0x3368
movq %rbx, %rdi
callq 0x3310