// File: Nallantli[P]Rossa/main/rossa/instruction/instruction.cpp
// Function: ClassI::evaluate(object_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&) const
const symbol_t ClassI::evaluate(const object_t *scope, trace_t &stack_trace) const
{
	ptr_instruction_t nbody = body;
	object_t *ex = NULL;
	std::vector<aug_type_t> extensions;
	if (extends)
	{
		const symbol_t e = extends->evaluate(scope, stack_trace);
		if (e.getValueType() == value_type_enum::TYPE_NAME)
			extensions.push_back(e.getTypeName(&token, stack_trace).getBase());
		else
		{
			ex = e.getObject(&token, stack_trace);
			if (ex->getType() == scope_type_enum::SCOPE_STATIC)
				throw rossa_error_t(_FAILURE_EXTEND_, token, stack_trace);
			const ptr_instruction_t eb = ex->getBody();
			std::vector<ptr_instruction_t> temp;
			temp.push_back(body);
			temp.push_back(eb);
			nbody = std::make_shared<ScopeI>(temp, token);
		}
	}
	object_t o(scope, type, nbody, key, ex, extensions);
	if (type == scope_type_enum::SCOPE_STATIC)
		nbody->evaluate(&o, stack_trace);
	return scope->createVariable(key, symbol_t::Object(o), &token);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x178(%rbp)
movq %rdi, %rax
movq %rax, -0x170(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x168(%rbp)
addq $0xa0, %rsi
leaq -0x30(%rbp), %rdi
callq 0x2f090
movq $0x0, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x57bc0
movq -0x168(%rbp), %rdi
addq $0xb0, %rdi
callq 0x136880
testb $0x1, %al
jne 0x12db24
jmp 0x12de44
movq -0x168(%rbp), %rdi
addq $0xb0, %rdi
callq 0x2d300
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x60(%rbp), %rdi
callq *%rax
jmp 0x12db50
leaq -0x60(%rbp), %rdi
callq 0x883e0
movl %eax, -0x17c(%rbp)
jmp 0x12db61
movl -0x17c(%rbp), %eax
cmpl $-0x9, %eax
jne 0x12dc2e
movq -0x168(%rbp), %rdx
addq $0x8, %rdx
movq -0x20(%rbp), %rcx
leaq -0xd0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x88540
jmp 0x12db91
leaq -0x88(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x80840
jmp 0x12dba6
leaq -0x50(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x7e1f0
jmp 0x12dbb8
leaq -0x88(%rbp), %rdi
callq 0x57de0
leaq -0xd0(%rbp), %rdi
callq 0x57da0
jmp 0x12de2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12dfac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12de36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12dc1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x57de0
leaq -0xd0(%rbp), %rdi
callq 0x57da0
jmp 0x12de36
movq -0x168(%rbp), %rsi
addq $0x8, %rsi
movq -0x20(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x882f0
movq %rax, -0x188(%rbp)
jmp 0x12dc4f
movq -0x188(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x7df00
movl %eax, -0x18c(%rbp)
jmp 0x12dc6b
movl -0x18c(%rbp), %eax
cmpl $0x2, %eax
jne 0x12dd59
movb $0x1, -0xf2(%rbp)
movl $0xa8, %edi
callq 0x112b0
movq %rax, -0x1a0(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x119d0
movq -0x198(%rbp), %rdx
leaq 0x274f0(%rip), %rsi     # 0x1551a3
leaq -0xf0(%rbp), %rdi
callq 0x24740
jmp 0x12dcc1
movq -0x1a0(%rbp), %rdi
movq -0x168(%rbp), %rdx
addq $0x8, %rdx
movq -0x20(%rbp), %rcx
leaq -0xf0(%rbp), %rsi
callq 0x9c360
jmp 0x12dce5
movq -0x1a0(%rbp), %rdi
movb $0x0, -0xf2(%rbp)
leaq 0xb2f86(%rip), %rsi     # 0x1e0c80
leaq -0xd3361(%rip), %rdx    # 0x5a9a0
callq 0x11970
jmp 0x12dfc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12dd31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x11360
leaq -0xf1(%rbp), %rdi
callq 0x11600
testb $0x1, -0xf2(%rbp)
jne 0x12dd48
jmp 0x12dd54
movq -0x1a0(%rbp), %rdi
callq 0x11420
jmp 0x12de36
movq -0x38(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x7df20
jmp 0x12dd6b
leaq -0x120(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0xe52f0
movq -0x168(%rbp), %rsi
movq -0x1a8(%rbp), %rdi
addq $0xa0, %rsi
callq 0x1368a0
jmp 0x12dd9a
leaq -0x120(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x1368a0
jmp 0x12ddaf
movq -0x168(%rbp), %rdx
addq $0x8, %rdx
leaq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xe5450
jmp 0x12ddcf
leaq -0x30(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x136910
leaq -0x130(%rbp), %rdi
callq 0xe5500
leaq -0x120(%rbp), %rdi
callq 0xe55f0
leaq -0x108(%rbp), %rdi
callq 0x2a4e0
jmp 0x12de2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xe55f0
leaq -0x108(%rbp), %rdi
callq 0x2a4e0
jmp 0x12de36
leaq -0x60(%rbp), %rdi
callq 0x86dc0
jmp 0x12de44
leaq -0x60(%rbp), %rdi
callq 0x86dc0
jmp 0x12dfac
movq -0x168(%rbp), %r8
movq -0x18(%rbp), %rsi
movq %r8, %rdx
addq $0x98, %rdx
addq $0x90, %r8
movq -0x38(%rbp), %r9
movq %rsp, %rax
leaq -0x50(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x140(%rbp), %rdi
leaq -0x30(%rbp), %rcx
callq 0x7d5c0
jmp 0x12de80
movq -0x168(%rbp), %rax
cmpl $0x2, 0x98(%rax)
jne 0x12ded7
leaq -0x30(%rbp), %rdi
callq 0x2d300
movq %rax, %rsi
movq -0x20(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rdx
callq *%rax
jmp 0x12deb8
leaq -0x150(%rbp), %rdi
callq 0x86dc0
jmp 0x12ded7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12dfa0
movq -0x168(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, -0x1b8(%rbp)
addq $0x90, %rax
movq %rax, -0x1b0(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x86c80
jmp 0x12df0b
movq -0x1b0(%rbp), %rsi
movq -0x1b8(%rbp), %rdi
movq -0x168(%rbp), %rcx
addq $0x8, %rcx
leaq -0x160(%rbp), %rdx
callq 0x7de40
movq %rax, -0x1c0(%rbp)
jmp 0x12df39
movq -0x1c0(%rbp), %rsi
movq -0x178(%rbp), %rdi
callq 0x86d80
jmp 0x12df4e
leaq -0x160(%rbp), %rdi
callq 0x86dc0
leaq -0x140(%rbp), %rdi
callq 0x7d790
leaq -0x50(%rbp), %rdi
callq 0x57be0
leaq -0x30(%rbp), %rdi
callq 0x2a4e0
movq -0x170(%rbp), %rax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x86dc0
leaq -0x140(%rbp), %rdi
callq 0x7d790
leaq -0x50(%rbp), %rdi
callq 0x57be0
leaq -0x30(%rbp), %rdi
callq 0x2a4e0
movq -0x68(%rbp), %rdi
callq 0x119c0
nopw (%rax,%rax)