// File: /workspace/github_cpp_makefile_star2_O1/Nallantli[P]Rossa/main/rossa/operation/operation.cpp
// Function: operation::fdiv(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::fdiv(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(number_t::Long((evalA.getNumber(token, stack_trace) / evalB.getNumber(token, stack_trace)).getLong()));
	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] = div(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_FDIV))
			return o->getVariable(parser_t::HASH_FDIV, token, stack_trace).call({evalB}, token, stack_trace);
	}
	default:
		if (scope != NULL)
			return scope->getVariable(parser_t::HASH_FDIV, 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, %rbx
movq %r8, %r14
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, 0x30(%rsp)
movq %rdx, %rdi
callq 0x41262
movl $0xfffffff8, %ecx       # imm = 0xFFFFFFF8
cmpl $-0x8, %eax
je 0x7ceb8
movq %rbp, %rdi
callq 0x41262
movl %eax, %r15d
shll $0x18, %r15d
negl %r15d
sarl $0x14, %r15d
movq %r13, %rdi
callq 0x41262
negb %al
movsbl %al, %ecx
orl %r15d, %ecx
cmpl $-0x8, %ecx
je 0x7d03e
cmpl $0x55, %ecx
je 0x7cf37
movq %r13, 0x38(%rsp)
cmpl $0x22, %ecx
jne 0x7d0df
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x40b0c
movq %rax, %r15
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x40b0c
movq %r15, %rdi
movq %rax, %rsi
callq 0x47cac
leaq 0x40(%rsp), %rdi
movq %rax, (%rdi)
movl %edx, 0x8(%rdi)
callq 0x479d4
leaq 0x60(%rsp), %rdi
movq %rax, (%rdi)
callq 0x47868
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl %edx, 0x8(%rsi)
movq 0x30(%rsp), %rdi
callq 0x40458
jmp 0x7d17c
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x40f46
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x43f8e
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x40f46
leaq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x43f8e
movq 0x48(%rsp), %rsi
subq 0x40(%rsp), %rsi
movq 0x68(%rsp), %rax
subq 0x60(%rsp), %rax
cmpq %rax, %rsi
jne 0x7d246
sarq $0x4, %rsi
leaq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x43baa
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x7d00c
xorl %r13d, %r13d
leaq 0x80(%rsp), %r15
xorl %ebp, %ebp
movq 0x40(%rsp), %rdx
addq %r13, %rdx
movq 0x60(%rsp), %rcx
addq %r13, %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %r8
movq %rbx, %r9
callq 0x7c8a1
movq 0x10(%rsp), %rdi
addq %r13, %rdi
movq %r15, %rsi
callq 0x40508
movq %r15, %rdi
callq 0x404da
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
incq %rbp
sarq $0x4, %rax
addq $0x10, %r13
cmpq %rax, %rbp
jb 0x7cfb9
leaq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rdi
callq 0x40474
leaq 0x10(%rsp), %rdi
callq 0x20a84
leaq 0x60(%rsp), %rdi
callq 0x20a84
leaq 0x40(%rsp), %rdi
callq 0x20a84
jmp 0x7d17c
movq %r13, 0x38(%rsp)
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x411a4
movq %rax, %r13
leaq 0x3a8f5(%rip), %rsi     # 0xb7950
movq %rax, %rdi
callq 0x3d498
testb %al, %al
je 0x7d0df
movl %eax, %r15d
leaq 0x3a8df(%rip), %rsi     # 0xb7950
movq %r13, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x3d502
movq %rax, %r13
leaq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x404c8
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x60(%rsp), %rcx
movl $0x1, %edx
callq 0x43e3c
leaq 0x10(%rsp), %rdx
movq 0x30(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x42736
leaq 0x10(%rsp), %rdi
callq 0x20a84
leaq 0x40(%rsp), %rdi
callq 0x404da
testb %r15b, %r15b
jne 0x7d17c
testq %r12, %r12
je 0x7d193
leaq 0x3a861(%rip), %rsi     # 0xb7950
movq %r12, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x3d502
movq %rax, %r15
leaq 0x10(%rsp), %r13
movq %r13, %r12
movq %r13, %rdi
movq %rbp, %rsi
callq 0x404c8
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq 0x38(%rsp), %rsi
callq 0x404c8
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x60(%rsp), %rcx
movl $0x2, %edx
callq 0x43e3c
leaq 0x40(%rsp), %rdx
movq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x42736
leaq 0x40(%rsp), %rdi
callq 0x20a84
movl $0x10, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x10, %rdi
callq 0x404da
addq $-0x10, %rbx
cmpq $-0x10, %rbx
jne 0x7d165
movq 0x30(%rsp), %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 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xb6fa(%rip), %rsi      # 0x888ab
leaq 0xb725(%rip), %rdx      # 0x888dd
leaq 0x40(%rsp), %rdi
callq 0x1e7ca
leaq 0x70(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x99af(%rip), %rsi      # 0x86b81
leaq 0x99aa(%rip), %rdx      # 0x86b83
leaq 0x60(%rsp), %rdi
callq 0x1e7ca
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x20c5e
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x48694
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x476dc
xorl %ebp, %ebp
leaq 0x35aab(%rip), %rsi     # 0xb2ce0
leaq -0x45a88(%rip), %rdx    # 0x377b4
movq %r15, %rdi
callq 0x106d0
jmp 0x7d2a3
movl $0xa8, %edi
callq 0x101e0
movq %rax, %r15
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xb586(%rip), %rsi      # 0x887ea
leaq 0xb5a6(%rip), %rdx      # 0x88811
leaq 0x10(%rsp), %rdi
callq 0x1e7ca
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x476dc
xorl %ebp, %ebp
leaq 0x35a4c(%rip), %rsi     # 0xb2ce0
leaq -0x45ae7(%rip), %rdx    # 0x377b4
movq %r15, %rdi
callq 0x106d0
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d2c9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7d2c9
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x80(%rsp), %rdi
callq 0x1dca2
jmp 0x7d2de
movq %rax, %rbx
movb $0x1, %bpl
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x7d2fd
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7d2fd
movq %rax, %rbx
movb $0x1, %bpl
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x7d37d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7d37d
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x7d338
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x7d338
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7d40f
movq %r15, %rdi
callq 0x102d0
jmp 0x7d40f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20a84
jmp 0x7d360
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x404da
jmp 0x7d423
movq %rax, %rbx
jmp 0x7d423
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7d423
movq %r15, %rdi
callq 0x102d0
jmp 0x7d423
jmp 0x7d3f0
movq %rax, %rbx
jmp 0x7d40f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x20a84
jmp 0x7d3ac
movq %rax, %rbx
movl $0x10, %r14d
leaq (%rsp,%r14), %rdi
addq $0x10, %rdi
callq 0x404da
addq $-0x10, %r14
cmpq $-0x10, %r14
jne 0x7d3b2
jmp 0x7d423
movq %rax, %rbx
jmp 0x7d419
movq %rax, %rbx
cmpq %r12, %r13
je 0x7d423
leaq 0x10(%rsp), %r14
addq $-0x10, %r12
movq %r12, %rdi
callq 0x404da
cmpq %r14, %r12
jne 0x7d3dd
jmp 0x7d423
movq %rax, %rbx
jmp 0x7d405
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x404da
leaq 0x10(%rsp), %rdi
callq 0x20a84
leaq 0x60(%rsp), %rdi
callq 0x20a84
leaq 0x40(%rsp), %rdi
callq 0x20a84
movq %rbx, %rdi
callq 0x106f0