// File: /workspace/github_cpp_makefile_star2_O1/Nallantli[P]Rossa/main/rossa/instruction/instruction.cpp
// Function: VargDefineI::evaluate(object_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&) const
const symbol_t VargDefineI::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(), body, capturedVars);
	if (key > 0)
	{
		return scope->createVariable(key, symbol_t::FunctionVARG(static_cast<ptr_function_t>(f)), &token);
	}
	return symbol_t::FunctionVARG(static_cast<ptr_function_t>(f));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r12
movq %rdx, 0x18(%rsp)
movq %rdi, 0x30(%rsp)
leaq 0x50(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq 0xa8(%rsi), %r13
movq %rsi, 0x10(%rsp)
movq 0xb0(%rsi), %r15
cmpq %r15, %r13
je 0x6f18d
movq 0x10(%rsp), %rax
leaq 0x8(%rax), %rbp
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3ee3a
movq %rax, %r14
movq 0x18(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x3d502
movq %r14, %rdi
movq %rax, %rsi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x40674
addq $0x8, %r13
cmpq %r15, %r13
jne 0x6f152
movq 0x18(%rsp), %rdi
callq 0x3d574
movq 0x10(%rsp), %rdx
leaq 0x90(%rdx), %r12
movq %rsp, %rcx
movq %rax, (%rcx)
leaq 0x98(%rdx), %r8
leaq 0x20(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x48(%rsp), %r9
movq %r12, %rdx
callq 0x7994c
cmpq $0x0, (%r12)
je 0x6f1f8
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x6f22a
movq 0x47da2(%rip), %rcx     # 0xb6f90
cmpb $0x0, (%rcx)
je 0x6f226
incl 0x8(%rax)
jmp 0x6f22a
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rsp)
movq %rax, 0x8(%rsp)
testq %rax, %rax
movq 0x30(%rsp), %rbx
je 0x6f273
movq 0x47d74(%rip), %rcx     # 0xb6f90
cmpb $0x0, (%rcx)
je 0x6f26f
incl 0x8(%rax)
jmp 0x6f273
lock
incl 0x8(%rax)
movq %rsp, %rdi
leaq 0x38(%rsp), %rsi
callq 0x4049e
movq 0x10(%rsp), %rcx
addq $0x8, %rcx
movq %rsp, %rdx
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x3d512
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x404c8
movq %rsp, %rdi
callq 0x404da
movq 0x40(%rsp), %rdi
jmp 0x6f283
lock
incl 0x8(%rax)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x4049e
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x6f28d
callq 0x1e6ee
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x6f29c
callq 0x1e6ee
leaq 0x48(%rsp), %rdi
callq 0x1ed86
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0x6f2d7
movq %rax, %rbx
jmp 0x6f2d2
movq %rax, %rbx
movq %rsp, %rdi
callq 0x404da
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x6f2e1
callq 0x1e6ee
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x6f2f7
callq 0x1e6ee
jmp 0x6f2f7
jmp 0x6f2f4
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x1ed86
movq %rbx, %rdi
callq 0x106f0
nop