// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/symbol/symbol.cpp
// Function: symbol_t::equals(symbol_t const*, token_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&) const
const bool symbol_t::equals(const symbol_t *b, const token_t *token, trace_t &stack_trace) const
{
	if (d->type != b->d->type && d->type != value_type_enum::OBJECT)
	{
		return false;
	}
	switch (d->type)
	{
	case value_type_enum::NIL:
		return true;
	case value_type_enum::NUMBER:
		return std::get<number_t>(d->value) == std::get<number_t>(b->d->value);
	case value_type_enum::BOOLEAN_D:
		return std::get<bool>(d->value) == std::get<bool>(b->d->value);
	case value_type_enum::STRING:
		return std::get<std::string>(d->value) == std::get<std::string>(b->d->value);
	case value_type_enum::OBJECT:
	{
		auto o = std::get<object_t>(d->value);
		if (o.hasValue(parser_t::HASH_EQUALS))
		{
			return o.getVariable(parser_t::HASH_EQUALS, token, stack_trace).call({*b}, token, stack_trace).getBool(token, stack_trace);
		}
		return o == std::get<object_t>(b->d->value);
	}
	case value_type_enum::ARRAY:
	{
		auto bv = std::get<std::vector<symbol_t>>(b->d->value);
		if (std::get<std::vector<symbol_t>>(d->value).size() != bv.size())
		{
			return false;
		}
		for (unsigned long i = 0; i < std::get<std::vector<symbol_t>>(d->value).size(); i++)
		{
			if (!std::get<std::vector<symbol_t>>(d->value)[i].equals(&bv[i], token, stack_trace))
			{
				return false;
			}
		}
		return true;
	}
	case value_type_enum::DICTIONARY:
		for (auto &e : std::get<std::map<const std::string, const symbol_t>>(d->value))
		{
			if (!e.second.equals(&std::get<std::map<const std::string, const symbol_t>>(b->d->value)[e.first], token, stack_trace))
			{
				return false;
			}
		}
		return true;
	case value_type_enum::FUNCTION:
		return std::get<wrapper_t>(d->value).map == std::get<wrapper_t>(b->d->value).map && std::get<wrapper_t>(d->value).varg == std::get<wrapper_t>(b->d->value).varg;
	case value_type_enum::TYPE_NAME:
		return std::get<parameter_t>(d->value) == std::get<parameter_t>(b->d->value);
	default:
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rdi
movl (%rdi), %ecx
movq (%rsi), %rax
cmpl $-0x8, %ecx
je 0x3b240
cmpl (%rax), %ecx
je 0x3b240
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl $0x9, %ecx
cmpl $0x8, %ecx
ja 0x3b22d
leaq 0x3c44d(%rip), %rdx     # 0x7769c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addq $0x8, %rdi
callq 0x3bd5c
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x3bd5c
movq %rbx, %rdi
movq %rax, %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x373e2
addq $0x8, %rax
movq %rax, %rdi
callq 0x3bce8
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x3bbc0
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x3bce8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
cmpq %rax, %rcx
jne 0x3b53f
movq %rbx, %r15
pushq $-0x1
popq %rbx
xorl %r14d, %r14d
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x3bce8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x4, %rcx
incq %rbx
cmpq %rcx, %rbx
setae %bpl
jae 0x3b541
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x3bce8
movq (%rax), %rdi
addq %r14, %rdi
movq 0x10(%rsp), %rsi
addq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x3b202
addq $0x10, %r14
testb %al, %al
jne 0x3b2d2
jmp 0x3b541
movq %r13, 0x38(%rsp)
addq $0x8, %rdi
callq 0x3bccb
movq 0x18(%rax), %r13
addq $0x8, %rax
movq %rax, 0x40(%rsp)
cmpq 0x40(%rsp), %r13
sete %bpl
je 0x3b22f
movq %rbx, %r12
leaq 0x20(%r13), %rbx
leaq 0x40(%r13), %r14
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x3bccb
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rbx
callq 0x3b968
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
movq 0x38(%rsp), %rcx
callq 0x3b202
testb %al, %al
je 0x3b22f
movq %r13, %rdi
callq 0x102b0
movq %rax, %r13
jmp 0x3b348
addq $0x8, %rdi
callq 0x3bd79
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x3bd79
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3e11c
testb %al, %al
je 0x3b22d
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x3bd79
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x3bd79
movq 0x30(%rbx), %rcx
cmpq 0x30(%rax), %rcx
jmp 0x3b52e
addq $0x8, %rdi
callq 0x3bc13
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x3bc13
movq %rbx, %rdi
movq %rax, %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3f20e
addq $0x8, %rdi
callq 0x3bd3f
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x363da
leaq 0x7b587(%rip), %rsi     # 0xb69d0
movq %r12, %rdi
callq 0x366b2
testb %al, %al
je 0x3b550
leaq 0x7b570(%rip), %rsi     # 0xb69d0
leaq 0x28(%rsp), %rdi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x366ec
movq %rax, %r12
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x390f0
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x3ba84
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %r12, %rsi
movq %rbx, %rcx
movq %r13, %r8
callq 0x3aa8c
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x39b5c
movl %eax, %ebp
leaq 0x58(%rsp), %rdi
callq 0x39102
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
leaq 0x48(%rsp), %rdi
callq 0x39102
jmp 0x3b56b
addq $0x8, %rdi
callq 0x3bd05
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x3bd05
movq %rbx, %rdi
movq %rax, %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f438
addq $0x8, %rdi
callq 0x3bd22
movb (%rax), %bl
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x3bd22
cmpb (%rax), %bl
sete %bpl
jmp 0x3b22f
movb $0x1, %bpl
jmp 0x3b22f
xorl %ebp, %ebp
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
jmp 0x3b22f
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x3bd3f
leaq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x366d2
movl %eax, %ebp
leaq 0x28(%rsp), %rdi
callq 0x363f2
jmp 0x3b22f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x39102
jmp 0x3b58c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
jmp 0x3b59b
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x39102
jmp 0x3b5b0
jmp 0x3b5ad
jmp 0x3b5ad
jmp 0x3b5bc
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x363f2
jmp 0x3b5c9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1f0b8
movq %rbx, %rdi
callq 0x106f0
nop