// File: Nallantli[P]Rossa/main/rossa/operation/operation.cpp
// Function: operation::callWithInner(object_t const*, std::shared_ptr<Instruction const> const&, std::vector<symbol_t, std::allocator<symbol_t>> const&, token_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&)
const symbol_t operation::callWithInner(const object_t *scope, const ptr_instruction_t &a, const std::vector<symbol_t> &args, const token_t *token, trace_t &stack_trace)
{
	const symbol_t evalA = reinterpret_cast<const InnerI *>(a.get())->getA()->evaluate(scope, stack_trace);
	if (evalA.getValueType() == value_type_enum::OBJECT)
	{
		const symbol_t evalB = reinterpret_cast<const InnerI *>(a.get())->getB()->evaluate(evalA.getObject(token, stack_trace), stack_trace);
		return evalB.call(args, token, stack_trace);
	}
	else
	{
		const symbol_t evalB = reinterpret_cast<const InnerI *>(a.get())->getB()->evaluate(scope, stack_trace);
		std::vector<symbol_t> params;
		params.push_back(evalA);
		params.insert(params.end(), std::make_move_iterator(args.begin()), std::make_move_iterator(args.end()));

		if (evalB.getValueType() == value_type_enum::OBJECT)
		{
			const auto &o = evalB.getObject(token, stack_trace);
			if (o->hasValue(parser_t::HASH_CALL))
				return o->getVariable(parser_t::HASH_CALL, token, stack_trace).call(args, token, stack_trace);
		}

		return evalB.call(params, token, stack_trace);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x120(%rbp)
movq %rdi, %rax
movq %rax, -0x118(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x32830
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x1280c0
movq -0x110(%rbp), %rdi
callq 0x2d300
movq %rax, %rsi
movq -0x10(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x40(%rbp), %rdi
callq *%rax
jmp 0x13c505
leaq -0x50(%rbp), %rdi
callq 0x2a4e0
leaq -0x40(%rbp), %rdi
callq 0x883e0
movl %eax, -0x124(%rbp)
jmp 0x13c51f
movl -0x124(%rbp), %eax
cmpl $-0x8, %eax
jne 0x13c62d
movq -0x18(%rbp), %rdi
callq 0x32830
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x1281e0
jmp 0x13c545
leaq -0x80(%rbp), %rdi
callq 0x2d300
movq %rax, -0x138(%rbp)
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x882f0
movq %rax, -0x130(%rbp)
jmp 0x13c56f
movq -0x130(%rbp), %rdx
movq -0x138(%rbp), %rsi
movq -0x30(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x70(%rbp), %rdi
callq *%rax
jmp 0x13c58f
leaq -0x80(%rbp), %rdi
callq 0x2a4e0
movq -0x120(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
leaq -0x70(%rbp), %rsi
callq 0x89e20
jmp 0x13c5b6
movl $0x1, -0x84(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x86dc0
jmp 0x13c8cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2a4e0
jmp 0x13c8ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x13c8e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2a4e0
jmp 0x13c8e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x86dc0
jmp 0x13c8e5
movq -0x18(%rbp), %rdi
callq 0x32830
movq %rax, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x1281e0
jmp 0x13c647
leaq -0xa8(%rbp), %rdi
callq 0x2d300
movq %rax, %rsi
movq -0x10(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x98(%rbp), %rdi
callq *%rax
jmp 0x13c66f
leaq -0xa8(%rbp), %rdi
callq 0x2a4e0
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x2cc30
movq -0x140(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x2cc50
jmp 0x13c6a0
leaq -0xc0(%rbp), %rdi
callq 0x307d0
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x14e300
movq -0x20(%rbp), %rdi
callq 0x24ba0
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rdi
callq 0x14e340
movq %rax, -0x148(%rbp)
jmp 0x13c6eb
movq -0x148(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x24bd0
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rdi
callq 0x14e340
movq %rax, -0x150(%rbp)
jmp 0x13c71e
movq -0x150(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xc8(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq -0xe8(%rbp), %rcx
leaq -0xc0(%rbp), %rdi
callq 0x14e250
movq %rax, -0x158(%rbp)
jmp 0x13c756
movq -0x158(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x883e0
movl %eax, -0x15c(%rbp)
jmp 0x13c778
movl -0x15c(%rbp), %eax
cmpl $-0x8, %eax
jne 0x13c886
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0x882f0
movq %rax, -0x168(%rbp)
jmp 0x13c7a4
movq -0x168(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq (%rax), %rdi
leaq 0xa93a7(%rip), %rsi     # 0x1e5b78
callq 0x7dd00
movb %al, -0x169(%rbp)
jmp 0x13c7de
movb -0x169(%rbp), %al
testb $0x1, %al
jne 0x13c7ed
jmp 0x13c884
movq -0x100(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0xa9372(%rip), %rsi     # 0x1e5b78
callq 0x7ddd0
movq %rax, -0x178(%rbp)
jmp 0x13c814
movq -0x178(%rbp), %rsi
movq -0x120(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x89e20
jmp 0x13c835
movl $0x1, -0x84(%rbp)
jmp 0x13c8b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x2a4e0
jmp 0x13c8e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x2cf10
leaq -0x98(%rbp), %rdi
callq 0x86dc0
jmp 0x13c8e5
jmp 0x13c886
movq -0x120(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
leaq -0x98(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0x89e20
jmp 0x13c8aa
movl $0x1, -0x84(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x2cf10
leaq -0x98(%rbp), %rdi
callq 0x86dc0
leaq -0x40(%rbp), %rdi
callq 0x86dc0
movq -0x118(%rbp), %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x86dc0
movq -0x58(%rbp), %rdi
callq 0x119c0
nopw (%rax,%rax)