// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/operation/operation.cpp
// Function: operation::neg(object_t const*, 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::neg(const object_t *scope, const symbol_t &evalA, const token_t *token, trace_t &stack_trace)
{
	switch (evalA.getValueType())
	{
	case value_type_enum::NUMBER:
		return symbol_t::Number(-evalA.getNumber(token, stack_trace));
	case value_type_enum::ARRAY:
	{
		auto av = evalA.getVector(token, stack_trace);
		std::vector<symbol_t> v(av.size());
		for (size_t i = 0; i < v.size(); i++)
			v[i] = neg(scope, av[i], token, stack_trace);
		return symbol_t::Array(v);
	}
	case value_type_enum::OBJECT:
	{
		const auto &o = evalA.getObject(token, stack_trace);
		if (o->hasValue(parser_t::HASH_SUB))
			return o->getVariable(parser_t::HASH_SUB, token, stack_trace).call({}, token, stack_trace);
	}
	default:
		break;
	}

	if (scope != NULL)
		return scope->getVariable(parser_t::HASH_SUB, token, stack_trace).call({evalA}, token, stack_trace);

	throw rossa_error_t(util::format(_UNDECLARED_OPERATOR_ERROR_, {"-"}), *token, stack_trace);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
movq %rdx, %rdi
callq 0x39ca6
cmpl $-0x8, %eax
je 0x7496a
cmpl $-0x5, %eax
je 0x748d1
cmpl $-0x2, %eax
jne 0x749c9
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3968c
movq %rax, %rdi
callq 0x3ee48
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl %edx, 0x8(%rsi)
movq %r14, %rdi
callq 0x39080
jmp 0x74a60
movq %r14, 0x58(%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x39a02
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x3bbc0
movq 0x8(%r13), %rsi
subq (%r13), %rsi
sarq $0x4, %rsi
leaq 0x38(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x3b8f4
xorl %ebp, %ebp
leaq 0x60(%rsp), %r13
xorl %r14d, %r14d
movq 0x40(%rsp), %rax
subq 0x38(%rsp), %rax
sarq $0x4, %rax
cmpq %rax, %r14
jae 0x74a3a
movq 0x10(%rsp), %rdx
addq %rbp, %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rcx
movq %rbx, %r8
callq 0x74864
movq 0x38(%rsp), %rdi
addq %rbp, %rdi
movq %r13, %rsi
callq 0x39122
movq %r13, %rdi
callq 0x39102
incq %r14
addq $0x10, %rbp
jmp 0x74919
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x39c02
movq %rax, %rbp
leaq 0x41fc6(%rip), %rsi     # 0xb6948
movq %rax, %rdi
callq 0x366b2
testb %al, %al
je 0x749c9
leaq 0x41fb3(%rip), %rsi     # 0xb6948
movq %rbp, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x366ec
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rcx
movq %rbx, %r8
callq 0x3aa8c
jmp 0x74a56
testq %r12, %r12
je 0x74a75
leaq 0x41f6f(%rip), %rsi     # 0xb6948
movq %r12, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x366ec
movq %rax, %r12
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0x390f0
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x60(%rsp), %rcx
callq 0x3ba84
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rcx
movq %rbx, %r8
callq 0x3aa8c
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
leaq 0x38(%rsp), %rdi
callq 0x39102
jmp 0x74a60
leaq 0x38(%rsp), %rsi
movq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x3909c
leaq 0x38(%rsp), %rdi
callq 0x1f0b8
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xa8, %edi
callq 0x101f0
movq %rax, %r14
leaq 0x5e3a(%rip), %rsi      # 0x7a8c3
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1c814
leaq 0x1592(%rip), %rsi      # 0x76031
leaq 0x60(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1c814
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xd(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x3f724
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3ebb8
xorl %ebp, %ebp
leaq 0x3d1a2(%rip), %rsi     # 0xb1ca0
leaq -0x45693(%rip), %rdx    # 0x2f472
movq %r14, %rdi
callq 0x106c0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x74b22
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x80(%rsp), %rdi
callq 0x1cea0
jmp 0x74b37
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x60(%rsp), %rdi
callq 0x101d0
jmp 0x74b49
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x38(%rsp), %rdi
callq 0x101d0
testb %bpl, %bpl
jne 0x74b5f
jmp 0x74bb9
jmp 0x74b6b
movq %rax, %rbx
movq %r14, %rdi
callq 0x102e0
jmp 0x74bb9
jmp 0x74ba2
movq %rax, %rbx
jmp 0x74baf
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
jmp 0x74b82
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x39102
jmp 0x74bb9
movq %rax, %rbx
jmp 0x74bb9
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x39102
jmp 0x74ba5
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x1f0b8
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
movq %rbx, %rdi
callq 0x106f0