// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/operation/operation.cpp
// Function: operation::band(object_t const*, symbol_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::band(const object_t *scope, const symbol_t &evalA, const symbol_t &evalB, const token_t *token, trace_t &stack_trace)
{
	switch (COMP(evalA.getValueType(), evalB.getValueType()))
	{
	case COMP(value_type_enum::NUMBER, value_type_enum::NUMBER):
		return symbol_t::Number(evalA.getNumber(token, stack_trace) & evalB.getNumber(token, stack_trace));
	case COMP(value_type_enum::BOOLEAN_D, value_type_enum::BOOLEAN_D):
		return symbol_t::Boolean(evalA.getBool(token, stack_trace) & evalB.getBool(token, stack_trace));
	case COMP(value_type_enum::STRING, value_type_enum::ARRAY):
	{
		std::vector<std::string> elems;
		for (const symbol_t &e : evalB.getVector(token, stack_trace))
			elems.push_back(e.toString(token, stack_trace));
		return symbol_t::String(util::format(evalA.getString(token, stack_trace), elems));
	}
	case COMP(value_type_enum::ARRAY, value_type_enum::ARRAY):
	{
		auto av = evalA.getVector(token, stack_trace);
		auto bv = evalB.getVector(token, stack_trace);
		if (av.size() != bv.size())
			throw rossa_error_t(_INCOMPATIBLE_VECTOR_SIZES_, *token, stack_trace);
		std::vector<symbol_t> v(av.size());
		for (size_t i = 0; i < v.size(); i++)
			v[i] = band(scope, av[i], bv[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_AND))
			return o->getVariable(parser_t::HASH_B_AND, token, stack_trace).call({evalB}, token, stack_trace);
	}
	default:
		if (scope != NULL)
			return scope->getVariable(parser_t::HASH_B_AND, token, stack_trace).call({evalA, evalB}, 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 %r9, %r14
movq %r8, %r15
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, (%rsp)
movq %rdx, %rdi
callq 0x39ca6
cmpl $-0x8, %eax
jne 0x73324
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39c02
movq %rax, %rbx
leaq 0x436d0(%rip), %rsi     # 0xb6978
movq %rax, %rdi
callq 0x366b2
testb %al, %al
je 0x733b1
leaq 0x436b9(%rip), %rsi     # 0xb6978
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x366ec
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x390f0
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x50(%rsp), %rcx
callq 0x3ba84
leaq 0x10(%rsp), %rdx
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rcx
movq %r14, %r8
callq 0x3aa8c
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
leaq 0x30(%rsp), %rdi
callq 0x39102
jmp 0x7343e
movq %rbp, %rdi
callq 0x39ca6
movl %eax, %ebx
shll $0x18, %ebx
negl %ebx
sarl $0x14, %ebx
movq %r13, %rdi
callq 0x39ca6
negb %al
movsbl %al, %eax
orl %ebx, %eax
cmpl $-0x8, %eax
je 0x73290
cmpl $0x55, %eax
je 0x73454
cmpl $0x33, %eax
je 0x73586
cmpl $0x45, %eax
je 0x7351c
cmpl $0x22, %eax
jne 0x733b1
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3968c
movq %rax, %rbx
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3968c
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3f304
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl %edx, 0x8(%rsi)
movq (%rsp), %rdi
callq 0x39080
jmp 0x7343e
testq %r12, %r12
je 0x73649
leaq 0x435b7(%rip), %rsi     # 0xb6978
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x366ec
movq %rax, %r12
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x390f0
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x390f0
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x2
popq %rdx
leaq 0x50(%rsp), %rcx
callq 0x3ba84
leaq 0x30(%rsp), %rdx
movq (%rsp), %rdi
movq %r12, %rsi
movq %r15, %rcx
movq %r14, %r8
callq 0x3aa8c
leaq 0x30(%rsp), %rdi
callq 0x1f0b8
pushq $0x10
popq %rbx
leaq (%rsp,%rbx), %rdi
addq $0x10, %rdi
callq 0x39102
addq $-0x10, %rbx
cmpq $-0x10, %rbx
jne 0x73427
movq (%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39a02
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x3bbc0
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39a02
leaq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x3bbc0
movq 0x38(%rsp), %rsi
subq 0x30(%rsp), %rsi
movq 0x58(%rsp), %rax
subq 0x50(%rsp), %rax
cmpq %rax, %rsi
jne 0x736dd
sarq $0x4, %rsi
leaq 0x10(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x3b8f4
xorl %ebx, %ebx
leaq 0x78(%rsp), %r13
xorl %ebp, %ebp
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x4, %rax
cmpq %rax, %rbp
jae 0x73618
movq 0x30(%rsp), %rdx
addq %rbx, %rdx
movq 0x50(%rsp), %rcx
addq %rbx, %rcx
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %r8
movq %r14, %r9
callq 0x7325b
movq 0x10(%rsp), %rdi
addq %rbx, %rdi
movq %r13, %rsi
callq 0x39122
movq %r13, %rdi
callq 0x39102
incq %rbp
addq $0x10, %rbx
jmp 0x734c3
movq %rbp, 0x90(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq %r13, %rdi
movq %r15, %rbp
movq %r15, %rsi
movq %r14, %r15
movq %r14, %rdx
callq 0x39a02
movq (%rax), %r12
movq 0x8(%rax), %r14
leaq 0x10(%rsp), %r13
leaq 0x50(%rsp), %rbx
cmpq %r14, %r12
je 0x735bb
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x3a326
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1f322
movq %r13, %rdi
callq 0x101d0
addq $0x10, %r12
jmp 0x73557
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39b5c
movl %eax, %ebx
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39b5c
andb %bl, %al
leaq 0x10(%rsp), %rsi
movb %al, (%rsi)
movq (%rsp), %rdi
callq 0x3908e
jmp 0x7343e
leaq 0x30(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x39aa6
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x3f724
leaq 0x10(%rsp), %rsi
movq (%rsp), %rdi
callq 0x390d4
leaq 0x10(%rsp), %rdi
callq 0x101d0
leaq 0x30(%rsp), %rdi
callq 0x101d0
leaq 0x50(%rsp), %rdi
callq 0x1cea0
jmp 0x7343e
leaq 0x10(%rsp), %rsi
movq (%rsp), %rdi
callq 0x3909c
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
leaq 0x50(%rsp), %rdi
callq 0x1f0b8
leaq 0x30(%rsp), %rdi
callq 0x1f0b8
jmp 0x7343e
movl $0xa8, %edi
callq 0x101f0
movq %rax, %r12
leaq 0x7266(%rip), %rsi      # 0x7a8c3
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1c814
leaq 0x29d9(%rip), %rsi      # 0x7604c
leaq 0x50(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1c814
leaq 0x78(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xd(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x3f724
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x3ebb8
xorl %ebp, %ebp
leaq 0x3e5d4(%rip), %rsi     # 0xb1ca0
leaq -0x44261(%rip), %rdx    # 0x2f472
movq %r12, %rdi
callq 0x106c0
jmp 0x7372e
movl $0xa8, %edi
callq 0x101f0
movq %rax, %r12
leaq 0x7111(%rip), %rsi      # 0x7a802
leaq 0x10(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x1c814
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x3ebb8
xorl %ebp, %ebp
leaq 0x3e581(%rip), %rsi     # 0xb1ca0
leaq -0x442b4(%rip), %rdx    # 0x2f472
movq %r12, %rdi
callq 0x106c0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x73743
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x78(%rsp), %rdi
callq 0x1cea0
jmp 0x7377c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
testb %bpl, %bpl
jne 0x73769
jmp 0x73867
movq %rax, %rbx
movq %r12, %rdi
callq 0x102e0
jmp 0x73867
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x50(%rsp), %rdi
callq 0x101d0
jmp 0x737c1
jmp 0x7385a
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x7379f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x7388a
jmp 0x7387d
movq %rax, %rbx
jmp 0x73867
jmp 0x7387d
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x30(%rsp), %rdi
callq 0x101d0
testb %bpl, %bpl
jne 0x737e0
jmp 0x73899
movq %rax, %rbx
jmp 0x73871
movq %rax, %rbx
movq %r12, %rdi
callq 0x102e0
jmp 0x73899
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
jmp 0x737ff
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x7383f
jmp 0x73846
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1f0b8
jmp 0x7381a
movq %rax, %rbx
pushq $0x10
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x10, %rdi
callq 0x39102
addq $-0x10, %r14
cmpq $-0x10, %r14
jne 0x7381e
jmp 0x73899
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x39102
jmp 0x73899
movq %rax, %rbx
jmp 0x73899
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x39102
jmp 0x7385d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
leaq 0x50(%rsp), %rdi
callq 0x1f0b8
leaq 0x30(%rsp), %rdi
callq 0x1f0b8
jmp 0x73899
movq %rax, %rbx
jmp 0x7388f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
leaq 0x50(%rsp), %rdi
callq 0x1cea0
movq %rbx, %rdi
callq 0x106f0