// File: Nallantli[P]Rossa/main/rossa/instruction/instruction.cpp
// Function: DefineI::evaluate(object_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&) const
const symbol_t DefineI::evaluate(const object_t *scope, trace_t &stack_trace) const
{
	std::map<const hash_ull, const symbol_t> capturedVars;
	for (const hash_ull &e : captures)
	{
		capturedVars[e].set(&scope->getVariable(e, &token, stack_trace), &token, stack_trace);
	}
	ptr_function_t f = std::make_shared<function_t>(key, scope->getPtr(), params, body, capturedVars);
	if (key > 0)
	{
		return scope->createVariable(key, symbol_t::FunctionSIG(ftype, f), &token);
	}
	return symbol_t::FunctionSIG(ftype, f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0xc8(%rbp)
movq %rdi, %rax
movq %rax, -0xc0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x824e0
movq -0xb8(%rbp), %rax
addq $0xd8, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2e5d0
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2e600
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xe4f20
testb $0x1, %al
jne 0x128481
jmp 0x12850e
leaq -0x60(%rbp), %rdi
callq 0xe4f60
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x82550
movq %rax, -0xd0(%rbp)
jmp 0x1284a4
movq -0xb8(%rbp), %rdx
movq -0x18(%rbp), %rdi
movq -0x70(%rbp), %rsi
addq $0x8, %rdx
movq -0x20(%rbp), %rcx
callq 0x7ddd0
movq %rax, -0xd8(%rbp)
jmp 0x1284c9
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdi
movq -0xb8(%rbp), %rdx
addq $0x8, %rdx
movq -0x20(%rbp), %rcx
callq 0x870e0
jmp 0x1284ed
jmp 0x1284ef
leaq -0x60(%rbp), %rdi
callq 0xe4f80
jmp 0x12846b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x1286ae
movq -0xb8(%rbp), %rax
addq $0x90, %rax
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7df60
movq %rax, -0xe0(%rbp)
jmp 0x128534
movq -0xe8(%rbp), %rsi
movq -0xb8(%rbp), %r8
movq -0xe0(%rbp), %rax
movq %rax, -0x98(%rbp)
movq %r8, %rcx
addq $0xb0, %rcx
addq $0xc8, %r8
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rdx
leaq -0x50(%rbp), %r9
callq 0x136580
jmp 0x12857a
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x90(%rax)
jbe 0x128650
movq -0xb8(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq %rsi, %rax
addq $0x90, %rax
movq %rax, -0xf0(%rbp)
addq $0x98, %rsi
leaq -0xa8(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x86cb0
jmp 0x1285cd
movq -0xf0(%rbp), %rsi
movq -0xf8(%rbp), %rdi
movq -0xb8(%rbp), %rcx
addq $0x8, %rcx
leaq -0xa8(%rbp), %rdx
callq 0x7de40
movq %rax, -0x100(%rbp)
jmp 0x1285fb
movq -0x100(%rbp), %rsi
movq -0xc8(%rbp), %rdi
callq 0x86d80
jmp 0x128610
leaq -0xa8(%rbp), %rdi
callq 0x86dc0
movl $0x1, -0xac(%rbp)
jmp 0x12867d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x1286a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x86dc0
jmp 0x1286a2
movq -0xc8(%rbp), %rdi
movq -0xb8(%rbp), %rsi
addq $0x98, %rsi
leaq -0x90(%rbp), %rdx
callq 0x86cb0
jmp 0x128673
movl $0x1, -0xac(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x85eb0
leaq -0x50(%rbp), %rdi
callq 0x2a4c0
movq -0xc0(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0x85eb0
leaq -0x50(%rbp), %rdi
callq 0x2a4c0
movq -0x78(%rbp), %rdi
callq 0x119c0