// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %rdi
movl (%rdi), %ecx
movq (%rsi), %rax
cmpl $-0x8, %ecx
je 0x433ea
cmpl (%rax), %ecx
je 0x433ea
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 0x433d7
movb $0x1, %bpl
leaq 0x42254(%rip), %rdx     # 0x85650
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addq $0x8, %rdi
callq 0x44323
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x44323
movq %rbx, %rdi
movq %rax, %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3e440
addq $0x8, %rdi
callq 0x4438e
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x4438e
movq 0x28(%rbx), %rcx
cmpq 0x28(%rax), %rcx
jne 0x433d7
movq 0x18(%rbx), %rdi
addq $0x8, %rbx
movq 0x18(%rax), %rdx
movq %rbx, %rsi
callq 0x46724
testb %al, %al
je 0x433d7
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x4438e
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x4438e
movq 0x30(%rbx), %rcx
cmpq 0x30(%rax), %rcx
jmp 0x4371c
addq $0x8, %rdi
callq 0x442b8
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x3d150
leaq 0x744ff(%rip), %rsi     # 0xb79c0
movq %r12, %rdi
callq 0x3d498
testb %al, %al
je 0x43756
leaq 0x744e8(%rip), %rsi     # 0xb79c0
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3d502
movq %rax, %r12
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x404c8
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x1, %edx
callq 0x43e3c
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
movq %r14, %rcx
movq %r13, %r8
callq 0x42736
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x410e2
movl %eax, %ebp
leaq 0x58(%rsp), %rdi
callq 0x404da
leaq 0x8(%rsp), %rdi
callq 0x20a84
leaq 0x48(%rsp), %rdi
callq 0x404da
jmp 0x43771
addq $0x8, %rdi
callq 0x4410c
movq 0x18(%rax), %rbx
addq $0x8, %rax
movq %rax, 0x40(%rsp)
cmpq %rax, %rbx
sete %bpl
je 0x433d9
leaq 0x20(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x40(%rbx), %r12
movq %r15, 0x38(%rsp)
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x4410c
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0x43cc8
movq %r12, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x433ac
testb %al, %al
je 0x433d9
movq %rbx, %rdi
callq 0x102a0
cmpq 0x40(%rsp), %rax
sete %bpl
je 0x433d9
movq %rax, %rbx
leaq 0x20(%rax), %r12
movq %r14, %r15
movq %r13, %r14
movq %rax, %r13
addq $0x40, %r13
movq 0x38(%rsp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x4410c
movq %rax, %rdi
movq %r12, %rsi
callq 0x43cc8
movq %r13, %rdi
movq %r14, %r13
movq %r15, %r14
movq %rax, %rsi
movq %r15, %rdx
jmp 0x435b5
addq $0x8, %rdi
callq 0x4424d
movb (%rax), %bl
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x4424d
cmpb (%rax), %bl
jmp 0x4371c
addq $0x8, %rax
movq %rax, %rdi
callq 0x44177
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x43f8e
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x44177
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
cmpq %rax, %rcx
jne 0x43780
movq $-0x1, %rbx
xorl %r15d, %r15d
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x44177
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x4, %rcx
incq %rbx
cmpq %rcx, %rbx
setae %bpl
jae 0x43782
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x44177
movq (%rax), %rdi
addq %r15, %rdi
movq 0x8(%rsp), %rsi
addq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x433ac
addq $0x10, %r15
testb %al, %al
jne 0x43685
jmp 0x43782
addq $0x8, %rdi
callq 0x441e2
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x441e2
movq 0x8(%rbx), %rdx
cmpq 0x8(%rax), %rdx
jne 0x433d7
testq %rdx, %rdx
je 0x433d9
movq (%rax), %rsi
movq (%rbx), %rdi
callq 0x10400
testl %eax, %eax
sete %bpl
jmp 0x433d9
addq $0x8, %rdi
callq 0x44018
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x44018
movq %rbx, %rdi
movq %rax, %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x47efe
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x442b8
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x3d4e8
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
callq 0x3d168
jmp 0x433d9
xorl %ebp, %ebp
leaq 0x8(%rsp), %rdi
callq 0x20a84
jmp 0x433d9
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x404da
jmp 0x437a3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20a84
jmp 0x437b2
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x404da
jmp 0x437c7
jmp 0x437c4
jmp 0x437c4
jmp 0x437d3
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3d168
jmp 0x437e0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20a84
movq %rbx, %rdi
callq 0x106f0