// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
movq %rdx, %rdi
callq 0x40b5a
cmpl $-0x8, %eax
je 0x80b58
cmpl $-0x5, %eax
je 0x80a9b
cmpl $-0x2, %eax
jne 0x80bc1
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x40416
movq %rax, %rdi
callq 0x471e2
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movl %edx, 0x8(%rsi)
movq %r15, %rdi
callq 0x3fd84
jmp 0x80c2e
movq %r15, 0x78(%rsp)
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x40848
leaq 0x30(%rsp), %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x437fe
movq 0x8(%r13), %rsi
subq (%r13), %rsi
sarq $0x4, %rsi
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x43418
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x80b3a
xorl %ebp, %ebp
leaq 0x58(%rsp), %r13
xorl %r15d, %r15d
movq 0x30(%rsp), %rdx
addq %rbp, %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x80a2e
movq 0x10(%rsp), %rdi
addq %rbp, %rdi
movq %r13, %rsi
callq 0x3fe28
movq %r13, %rdi
callq 0x3fe06
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
incq %r15
sarq $0x4, %rax
addq $0x10, %rbp
cmpq %rax, %r15
jb 0x80aef
leaq 0x10(%rsp), %rsi
movq 0x78(%rsp), %r15
movq %r15, %rdi
callq 0x3fda0
leaq 0x10(%rsp), %rdi
callq 0x20952
jmp 0x80bb5
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x40a9e
movq %rax, %rbp
leaq 0x34dc8(%rip), %rsi     # 0xb5938
movq %rax, %rdi
callq 0x3ce6c
testb %al, %al
je 0x80bc1
leaq 0x34db5(%rip), %rsi     # 0xb5938
movq %rbp, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x3ced2
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x41ffe
leaq 0x30(%rsp), %rdi
callq 0x20952
jmp 0x80c2e
testq %r12, %r12
je 0x80c43
leaq 0x34d6b(%rip), %rsi     # 0xb5938
movq %r12, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x3ced2
movq %rax, %r12
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x3fdf4
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rcx
movl $0x1, %edx
callq 0x436ac
leaq 0x30(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x41ffe
leaq 0x30(%rsp), %rdi
callq 0x20952
leaq 0x10(%rsp), %rdi
callq 0x3fe06
movq %r15, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xa8, %edi
callq 0x101e0
movq %rax, %r15
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x6c6a(%rip), %rsi      # 0x878cb
leaq 0x6c95(%rip), %rdx      # 0x878fd
leaq 0x10(%rsp), %rdi
callq 0x1e698
leaq 0x68(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4f27(%rip), %rsi      # 0x85ba9
leaq 0x4f21(%rip), %rdx      # 0x85baa
leaq 0x58(%rsp), %rdi
callq 0x1e698
leaq 0x80(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x20b38
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x47db4
movb $0x1, %bpl
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x46e88
xorl %ebp, %ebp
leaq 0x3003b(%rip), %rsi     # 0xb0d20
leaq -0x49a48(%rip), %rdx    # 0x372a4
movq %r15, %rdi
callq 0x106d0
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x80d1a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x80d1a
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x80(%rsp), %rdi
callq 0x1db60
jmp 0x80d2f
movq %rax, %rbx
movb $0x1, %bpl
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x80d46
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x80d5d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
testb %bpl, %bpl
jne 0x80d85
jmp 0x80ddf
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x80d85
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x80d85
jmp 0x80d91
movq %rax, %rbx
movq %r15, %rdi
callq 0x102d0
jmp 0x80ddf
jmp 0x80db9
movq %rax, %rbx
jmp 0x80dd5
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x20952
jmp 0x80da8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3fe06
jmp 0x80ddf
movq %rax, %rbx
jmp 0x80ddf
movq %rax, %rbx
jmp 0x80dcb
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3fe06
leaq 0x10(%rsp), %rdi
callq 0x20952
leaq 0x30(%rsp), %rdi
callq 0x20952
movq %rbx, %rdi
callq 0x106f0