// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/operation/operation.cpp
// Function: operation::bnot(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::bnot(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] = bnot(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_B_NOT))
			return o->getVariable(parser_t::HASH_B_NOT, token, stack_trace).call({}, token, stack_trace);
	}
	default:
		break;
	}

	if (scope != NULL)
		return scope->getVariable(parser_t::HASH_B_NOT, 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 0x743b3
cmpl $-0x5, %eax
je 0x7431a
cmpl $-0x2, %eax
jne 0x74412
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3968c
movq %rax, %rdi
callq 0x3f3ee
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl %edx, 0x8(%rsi)
movq %r14, %rdi
callq 0x39080
jmp 0x744a9
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 0x74483
movq 0x10(%rsp), %rdx
addq %rbp, %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rcx
movq %rbx, %r8
callq 0x742ad
movq 0x38(%rsp), %rdi
addq %rbp, %rdi
movq %r13, %rsi
callq 0x39122
movq %r13, %rdi
callq 0x39102
incq %r14
addq $0x10, %rbp
jmp 0x74362
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x39c02
movq %rax, %rbp
leaq 0x425d5(%rip), %rsi     # 0xb69a0
movq %rax, %rdi
callq 0x366b2
testb %al, %al
je 0x74412
leaq 0x425c2(%rip), %rsi     # 0xb69a0
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 0x7449f
testq %r12, %r12
je 0x744be
leaq 0x4257e(%rip), %rsi     # 0xb69a0
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 0x744a9
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 0x63f1(%rip), %rsi      # 0x7a8c3
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1c814
leaq 0x1ba1(%rip), %rsi      # 0x76089
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 0x3d759(%rip), %rsi     # 0xb1ca0
leaq -0x450dc(%rip), %rdx    # 0x2f472
movq %r14, %rdi
callq 0x106c0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x7456b
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x80(%rsp), %rdi
callq 0x1cea0
jmp 0x74580
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x60(%rsp), %rdi
callq 0x101d0
jmp 0x74592
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x38(%rsp), %rdi
callq 0x101d0
testb %bpl, %bpl
jne 0x745a8
jmp 0x74602
jmp 0x745b4
movq %rax, %rbx
movq %r14, %rdi
callq 0x102e0
jmp 0x74602
jmp 0x745eb
movq %rax, %rbx
jmp 0x745f8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
jmp 0x745cb
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x39102
jmp 0x74602
movq %rax, %rbx
jmp 0x74602
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x39102
jmp 0x745ee
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x1f0b8
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
movq %rbx, %rdi
callq 0x106f0