// File: /workspace/github_cpp_makefile_star2_O1/Nallantli[P]Rossa/main/rossa/global/global.cpp
// Function: global::convertToSymbol(mediator_t const&)
const symbol_t global::convertToSymbol(const mediator_t &m)
{
	switch (m.getType())
	{
	case MEDIATOR_NIL:
		return symbol_t();
	case MEDIATOR_BOOLEAN_D:
		return symbol_t::Boolean(COERCE_BOOLEAN(m));
	case MEDIATOR_NUMBER:
		return symbol_t::Number(COERCE_NUMBER(m));
	case MEDIATOR_STRING:
		return symbol_t::String(COERCE_STRING(m));
	case MEDIATOR_POINTER:
		return symbol_t::Pointer(COERCE_POINTER(m, void));
	case MEDIATOR_ARRAY:
	{
		std::vector<symbol_t> sv;
		for (auto &e : COERCE_ARRAY(m))
		{
			sv.push_back(convertToSymbol(e));
		}
		return symbol_t::Array(sv);
	}
	case DICTIONARY:
	{
		std::map<const std::string, const symbol_t> sd;
		for (auto &e : COERCE_DICTIONARY(m))
		{
			sd.insert({e.first, convertToSymbol(e.second)});
		}
		return symbol_t::Dictionary(sd);
	}
	default:
		return symbol_t();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %r13
movq %rsi, %rdi
callq 0x6eaa0
addl $0xa, %eax
cmpl $0x9, %eax
ja 0x57d05
leaq 0x2eaec(%rip), %rcx     # 0x867e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r13, %rdi
callq 0x400a4
jmp 0x57f3b
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6eaa4
movq (%r15), %rsi
movq %r13, %rdi
callq 0x40466
jmp 0x57f07
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6eaa4
movq (%r15), %rcx
movq 0x8(%r15), %rax
movq %rcx, (%rsp)
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x57f12
movq 0x5f230(%rip), %rcx     # 0xb6f90
cmpb $0x0, (%rcx)
je 0x57f0e
incl 0x8(%rax)
jmp 0x57f12
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6eaa4
movq (%r15), %rsi
movq %r13, %rdi
callq 0x40458
jmp 0x57f07
leaq 0x8(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x6eaa4
movq %r13, 0x60(%rsp)
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x57dd2
callq 0x1e6ee
movq 0x18(%rbx), %r14
addq $0x8, %rbx
cmpq %rbx, %r14
je 0x57e50
leaq 0x40(%rsp), %r15
leaq 0x68(%rsp), %r12
leaq 0x30(%rsp), %r13
movq %rsp, %rbp
leaq 0x40(%r14), %rsi
movq %r12, %rdi
callq 0x57cd1
leaq 0x20(%r14), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x582b2
movq %rbp, %rdi
movq %r13, %rsi
callq 0x465c6
leaq 0x50(%rsp), %rdi
callq 0x404da
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x57e38
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
movq %r12, %rdi
callq 0x404da
movq %r14, %rdi
callq 0x102a0
movq %rax, %r14
cmpq %rbx, %rax
jne 0x57df1
movq %rsp, %rsi
movq 0x60(%rsp), %r13
movq %r13, %rdi
callq 0x404ba
movq %rsp, %rdi
callq 0x443fa
jmp 0x57f3b
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x6eaa4
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x57e9e
callq 0x1e6ee
movq (%rbx), %r14
movq 0x8(%rbx), %rbx
cmpq %rbx, %r14
je 0x57ed9
leaq 0x30(%rsp), %r15
movq %rsp, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x57cd1
movq %r12, %rdi
movq %r15, %rsi
callq 0x209ac
movq %r15, %rdi
callq 0x404da
addq $0x18, %r14
cmpq %rbx, %r14
jne 0x57eb2
movq %rsp, %rsi
movq %r13, %rdi
callq 0x40474
movq %rsp, %rdi
callq 0x20a84
jmp 0x57f3b
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6eaa4
movq (%r15), %rsi
movq %r13, %rdi
callq 0x404ac
movq 0x8(%rsp), %rdi
jmp 0x57f31
lock
incl 0x8(%rax)
movq %rsp, %rsi
movq %r13, %rdi
callq 0x4043c
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x57f2c
callq 0x1e6ee
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x57f3b
callq 0x1e6ee
movq %r13, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x57f86
jmp 0x57fb1
jmp 0x57f72
jmp 0x57fb1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x57f67
callq 0x1e6ee
movq 0x38(%rsp), %rdi
jmp 0x57f7a
jmp 0x57f86
jmp 0x57f72
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x57fcb
callq 0x1e6ee
jmp 0x57fcb
movq %rax, %rbx
jmp 0x57fa7
movq %rax, %rbx
jmp 0x57f9d
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x58306
leaq 0x68(%rsp), %rdi
callq 0x404da
movq %rsp, %rdi
callq 0x443fa
jmp 0x57fcb
movq %rax, %rbx
jmp 0x57fc3
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x404da
movq %rsp, %rdi
callq 0x20a84
movq %rbx, %rdi
callq 0x106f0
nop