// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %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 0x42cb0
cmpl (%rax), %ecx
je 0x42cb0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl $0x9, %ecx
cmpl $0x8, %ecx
ja 0x42c9d
movb $0x1, %bpl
leaq 0x419ae(%rip), %rdx     # 0x84670
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addq $0x8, %rdi
callq 0x43b93
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x43b93
movq %rbx, %rdi
movq %rax, %rsi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ddb2
addq $0x8, %rdi
callq 0x43bfe
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x43bfe
movq 0x28(%rbx), %rcx
cmpq 0x28(%rax), %rcx
jne 0x42c9d
movq 0x18(%rbx), %rdi
addq $0x8, %rbx
movq 0x18(%rax), %rdx
movq %rbx, %rsi
callq 0x45ef0
testb %al, %al
je 0x42c9d
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x43bfe
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x43bfe
movq 0x30(%rbx), %rcx
cmpq 0x30(%rax), %rcx
jmp 0x42f99
addq $0x8, %rdi
callq 0x43b28
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x3cb28
leaq 0x72c39(%rip), %rsi     # 0xb59c0
movq %r12, %rdi
callq 0x3ce6c
testb %al, %al
je 0x42fd3
leaq 0x72c22(%rip), %rsi     # 0xb59c0
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
movq %r13, %rcx
callq 0x3ced2
movq %rax, %r12
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x3fdf4
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x1, %edx
callq 0x436ac
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
movq %r14, %rcx
movq %r13, %r8
callq 0x41ffe
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x409e0
movl %eax, %ebp
leaq 0x48(%rsp), %rdi
callq 0x3fe06
leaq 0x8(%rsp), %rdi
callq 0x20952
leaq 0x38(%rsp), %rdi
callq 0x3fe06
jmp 0x42fee
movq %r14, 0x30(%rsp)
movq %r13, %r14
addq $0x8, %rdi
callq 0x4397c
movq %rax, %r12
movq 0x18(%rax), %r13
addq $0x8, %r12
cmpq %r12, %r13
je 0x42c9f
leaq 0x20(%r13), %rbp
leaq 0x40(%r13), %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x4397c
movq %rax, %rdi
movq %rbp, %rsi
callq 0x43536
movq %rbx, %rdi
movq %rax, %rsi
movq 0x30(%rsp), %rdx
movq %r14, %rcx
callq 0x42c72
movl %eax, %ebp
testb %al, %al
je 0x42c9f
movq %r13, %rdi
callq 0x102a0
movq %rax, %r13
cmpq %r12, %rax
jne 0x42e49
jmp 0x42c9f
addq $0x8, %rdi
callq 0x43abd
movb (%rax), %bl
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x43abd
cmpb (%rax), %bl
jmp 0x42f99
addq $0x8, %rax
movq %rax, %rdi
callq 0x439e7
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x437fe
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x439e7
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
cmpq %rax, %rcx
jne 0x42ffd
movq $-0x1, %rbx
xorl %r15d, %r15d
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x439e7
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x4, %rcx
incq %rbx
cmpq %rcx, %rbx
setae %bpl
jae 0x42fff
movq (%r12), %rdi
addq $0x8, %rdi
callq 0x439e7
movq (%rax), %rdi
addq %r15, %rdi
movq 0x8(%rsp), %rsi
addq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x42c72
addq $0x10, %r15
testb %al, %al
jne 0x42f02
jmp 0x42fff
addq $0x8, %rdi
callq 0x43a52
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x43a52
movq 0x8(%rbx), %rdx
cmpq 0x8(%rax), %rdx
jne 0x42c9d
testq %rdx, %rdx
je 0x42c9f
movq (%rax), %rsi
movq (%rbx), %rdi
callq 0x10400
testl %eax, %eax
sete %bpl
jmp 0x42c9f
addq $0x8, %rdi
callq 0x43888
movq %rax, %rbx
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x43888
movq %rbx, %rdi
movq %rax, %rsi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x47620
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x43b28
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x3ceb8
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
callq 0x3cb40
jmp 0x42c9f
xorl %ebp, %ebp
leaq 0x8(%rsp), %rdi
callq 0x20952
jmp 0x42c9f
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3fe06
jmp 0x43020
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20952
jmp 0x4302f
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3fe06
jmp 0x43044
jmp 0x43041
jmp 0x43041
jmp 0x43050
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3cb40
jmp 0x4305d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20952
movq %rbx, %rdi
callq 0x106f0
nop