// File: Nallantli[P]Rossa/main/rossa/symbol/symbol.cpp
// Function: symbol_t::set(symbol_t const*, token_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&) const
void symbol_t::set(const symbol_t *b, const token_t *token, trace_t &stack_trace) const
{
	if (b->d == d)
	{
		return;
	}
	if (d->type == value_type_enum::OBJECT && std::get<object_t>(d->value).hasValue(parser_t::HASH_SET))
	{
		ptr_function_t f = nullptr;
		try
		{
			f = std::get<object_t>(d->value)
					.getVariable(parser_t::HASH_SET, token, stack_trace)
					.getFunction({*b}, token, stack_trace);
		}
		catch (const rossa_error_t &e)
		{
		}
		if (f)
		{
			function_evaluate(f, {*b}, token, stack_trace);
			return;
		}
	}
	switch (b->d->type)
	{
	case value_type_enum::NIL:
		d->clearData();
		break;
	case value_type_enum::ARRAY:
	{
		auto v = &std::get<std::vector<symbol_t>>(b->d->value);
		std::vector<symbol_t> nv(v->size());
		for (size_t i = 0; i < v->size(); i++)
		{
			nv[i].set(&v->at(i), token, stack_trace);
		}
		d->value = nv;
		break;
	}
	case value_type_enum::DICTIONARY:
	{
		d->value = std::map<const std::string, const symbol_t>();
		auto v = &std::get<std::map<const std::string, const symbol_t>>(b->d->value);
		for (auto &e : *v)
		{
			if (e.second.d->type == value_type_enum::NIL)
			{
				continue;
			}
			auto newd = symbol_t();
			newd.set(&e.second, token, stack_trace);
			std::get<std::map<const std::string, const symbol_t>>(d->value).insert({e.first, newd});
		}
		break;
	}
	default:
		d->value = b->d->value;
		break;
	}
	d->type = b->d->type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x1d8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq (%rcx), %rax
jne 0x87117
jmp 0x879ac
movq -0x1d8(%rbp), %rax
movq (%rax), %rax
cmpl $-0x8, (%rax)
jne 0x875d8
movq -0x1d8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x8bd70
movq %rax, %rdi
leaq 0x15ea29(%rip), %rsi    # 0x1e5b70
callq 0x7dd00
testb $0x1, %al
jne 0x87155
jmp 0x875d8
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x8be00
movq -0x1d8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x8bd70
movq %rax, -0x1e0(%rbp)
jmp 0x8717e
movq -0x1e0(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x15e9dc(%rip), %rsi    # 0x1e5b70
callq 0x7ddd0
movq %rax, -0x1e8(%rbp)
jmp 0x871a2
leaq -0x88(%rbp), %rdi
movq %rdi, -0x90(%rbp)
movq -0x10(%rbp), %rsi
callq 0x86d80
jmp 0x871bb
leaq -0x88(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0x1, -0x70(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x2e2f0
movq -0x1f0(%rbp), %rcx
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x8c330
jmp 0x871fb
movq -0x1e8(%rbp), %rsi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq -0x40(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x88920
jmp 0x87219
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x8be20
leaq -0x40(%rbp), %rdi
callq 0x85eb0
leaq -0x68(%rbp), %rdi
callq 0x2cf10
leaq -0x91(%rbp), %rdi
callq 0x304d0
leaq -0x88(%rbp), %rax
movq %rax, -0x200(%rbp)
addq $0x10, %rax
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x208(%rbp)
callq 0x86dc0
movq -0x200(%rbp), %rcx
movq -0x208(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1f8(%rbp)
jne 0x8725d
jmp 0x873a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x87378
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movq -0x90(%rbp), %rax
leaq -0x88(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x210(%rbp)
je 0x872fb
movq -0x210(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x218(%rbp)
callq 0x86dc0
movq -0x218(%rbp), %rax
leaq -0x88(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x210(%rbp)
jne 0x872ca
jmp 0x87378
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x87320
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2cf10
leaq -0x91(%rbp), %rdi
callq 0x304d0
leaq -0x88(%rbp), %rax
movq %rax, -0x228(%rbp)
addq $0x10, %rax
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x230(%rbp)
callq 0x86dc0
movq -0x228(%rbp), %rcx
movq -0x230(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x220(%rbp)
jne 0x87345
jmp 0x87378
movl -0x4c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x875ca
movq -0x48(%rbp), %rdi
callq 0x11220
movq %rax, -0xa0(%rbp)
callq 0x11910
jmp 0x8739f
jmp 0x873a1
leaq -0x30(%rbp), %rdi
callq 0x8c3b0
testb $0x1, %al
jne 0x873b3
jmp 0x875a4
leaq -0xe8(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
movq -0x10(%rbp), %rsi
callq 0x86d80
jmp 0x873cc
leaq -0xe8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq $0x1, -0xd0(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x2e2f0
movq -0x238(%rbp), %rcx
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
callq 0x8c330
jmp 0x8741b
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq -0xb0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0x37a30
jmp 0x8743c
leaq -0xb0(%rbp), %rdi
callq 0x86dc0
leaq -0xc8(%rbp), %rdi
callq 0x2cf10
leaq -0xf1(%rbp), %rdi
callq 0x304d0
leaq -0xe8(%rbp), %rax
movq %rax, -0x248(%rbp)
addq $0x10, %rax
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x250(%rbp)
callq 0x86dc0
movq -0x248(%rbp), %rcx
movq -0x250(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x240(%rbp)
jne 0x87479
movl $0x1, -0xf8(%rbp)
jmp 0x875ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x875ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movq -0xf0(%rbp), %rax
leaq -0xe8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x258(%rbp)
je 0x87521
movq -0x258(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x260(%rbp)
callq 0x86dc0
movq -0x260(%rbp), %rax
leaq -0xe8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x258(%rbp)
jne 0x874f0
jmp 0x875ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x8754c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x2cf10
leaq -0xf1(%rbp), %rdi
callq 0x304d0
leaq -0xe8(%rbp), %rax
movq %rax, -0x270(%rbp)
addq $0x10, %rax
movq %rax, -0x268(%rbp)
movq -0x268(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x278(%rbp)
callq 0x86dc0
movq -0x270(%rbp), %rcx
movq -0x278(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x268(%rbp)
jne 0x87571
jmp 0x875ca
movl $0x0, -0xf8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x85eb0
movl -0xf8(%rbp), %eax
testl %eax, %eax
je 0x875c8
jmp 0x875c3
jmp 0x879ac
jmp 0x875d8
leaq -0x30(%rbp), %rdi
callq 0x85eb0
jmp 0x879b5
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x27c(%rbp)
subl $-0x7, %eax
je 0x8779e
jmp 0x875f2
movl -0x27c(%rbp), %eax
subl $-0x5, %eax
je 0x87624
jmp 0x875ff
movl -0x27c(%rbp), %eax
subl $-0x1, %eax
jne 0x87979
jmp 0x87610
movq -0x1d8(%rbp), %rax
movq (%rax), %rdi
callq 0x99d40
jmp 0x87997
movq -0x10(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x8bcd0
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rdi
callq 0x30a90
movq %rax, -0x290(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x2e2f0
movq -0x290(%rbp), %rsi
movq -0x288(%rbp), %rdx
leaq -0x118(%rbp), %rdi
callq 0x8bb50
jmp 0x8767d
leaq -0x119(%rbp), %rdi
callq 0x304d0
movq $0x0, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x298(%rbp)
movq -0x100(%rbp), %rdi
callq 0x30a90
movq %rax, %rcx
movq -0x298(%rbp), %rax
cmpq %rcx, %rax
jae 0x87767
movq -0x128(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x8c3d0
movq %rax, -0x2a8(%rbp)
movq -0x100(%rbp), %rdi
movq -0x128(%rbp), %rsi
callq 0x8bcf0
movq %rax, -0x2a0(%rbp)
jmp 0x876f7
movq -0x2a0(%rbp), %rsi
movq -0x2a8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x870e0
jmp 0x87714
jmp 0x87716
movq -0x128(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x128(%rbp)
jmp 0x87694
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x119(%rbp), %rdi
callq 0x304d0
jmp 0x879b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x2cf10
jmp 0x879b5
movq -0x1d8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
leaq -0x118(%rbp), %rsi
callq 0x8c3f0
jmp 0x87783
movl $0x2, -0xf8(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x2cf10
jmp 0x87997
leaq -0x158(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x112e0
leaq -0x158(%rbp), %rdi
callq 0x8c490
movq -0x1d8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
leaq -0x158(%rbp), %rsi
callq 0x8c4b0
leaq -0x158(%rbp), %rdi
callq 0x8c530
movq -0x10(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x8bcb0
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rdi
callq 0x8c0f0
movq %rax, -0x170(%rbp)
movq -0x168(%rbp), %rdi
callq 0x8bff0
movq %rax, -0x178(%rbp)
leaq -0x170(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x8bf90
testb $0x1, %al
jne 0x8784a
jmp 0x87977
leaq -0x170(%rbp), %rdi
callq 0x8c120
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rax
movq 0x20(%rax), %rax
cmpl $-0x1, (%rax)
jne 0x87872
jmp 0x87932
leaq -0x190(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x86580
movq -0x2b0(%rbp), %rdi
movq -0x180(%rbp), %rsi
addq $0x20, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x870e0
jmp 0x878a6
movq -0x1d8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x8bcb0
movq %rax, -0x2b8(%rbp)
jmp 0x878c2
movq -0x180(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
leaq -0x190(%rbp), %rdx
callq 0x8c590
jmp 0x878de
movq -0x2b8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x8c550
movb %dl, -0x2c1(%rbp)
movq %rax, -0x2c0(%rbp)
jmp 0x87900
movb -0x2c1(%rbp), %al
movq -0x2c0(%rbp), %rcx
movq %rcx, -0x1d0(%rbp)
movb %al, -0x1c8(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x8c5f0
leaq -0x190(%rbp), %rdi
callq 0x86dc0
leaq -0x170(%rbp), %rdi
callq 0x8c140
jmp 0x8782e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x87969
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x8c5f0
leaq -0x190(%rbp), %rdi
callq 0x86dc0
jmp 0x879b5
jmp 0x87997
movq -0x1d8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rsi
addq $0x8, %rsi
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x8c620
movq -0x1d8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl (%rcx), %ecx
movq (%rax), %rax
movl %ecx, (%rax)
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x119c0
nop