// File: /workspace/github_cpp_makefile_star2_O3/Nallantli[P]Rossa/main/rossa/global/global.cpp
// Function: global::convertToMediator(symbol_t const&, token_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&)
const mediator_t global::convertToMediator(const symbol_t &s, const token_t *token, trace_t &stack_trace)
{
	switch (s.getValueType())
	{
	case NIL:
		return mediator_t();
	case BOOLEAN_D:
		return mediator_t(
			MEDIATOR_BOOLEAN_D,
			std::make_shared<bool>(s.getBool(token, stack_trace)));
	case NUMBER:
		return mediator_t(
			MEDIATOR_NUMBER,
			std::make_shared<number_t>(s.getNumber(token, stack_trace)));
	case STRING:
		return mediator_t(
			MEDIATOR_STRING,
			std::make_shared<std::string>(s.getString(token, stack_trace)));
	case POINTER:
		return mediator_t(
			MEDIATOR_POINTER,
			s.getPointer(token, stack_trace));
	case FUNCTION:
		return MAKE_POINTER(s.getFunction({}, token, stack_trace));
	case ARRAY:
	{
		std::vector<mediator_t> mv;
		for (auto &e : s.getVector(token, stack_trace))
		{
			mv.push_back(convertToMediator(e, token, stack_trace));
		}
		return mediator_t(
			MEDIATOR_ARRAY,
			std::make_shared<std::vector<mediator_t>>(mv));
	}
	case DICTIONARY:
	{
		std::map<const std::string, const mediator_t> md;
		for (auto &e : s.getDictionary(token, stack_trace))
		{
			md.insert({e.first, convertToMediator(e.second, token, stack_trace)});
		}
		return MAKE_DICTIONARY(md);
	}
	default:
		throw rossa_error_t("[this shouldn't happen] Improper symbol_t to mediator_t conversion: " + s.toCodeString(), *token, stack_trace);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
movq %rsi, %rdi
callq 0x40b5a
addl $0xa, %eax
cmpl $0x9, %eax
ja 0x57220
leaq 0x2eaaf(%rip), %rcx     # 0x857e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x40(%rsp), %r12
movl $0xfffffff6, (%r12)     # imm = 0xFFFFFFF6
leaq 0xd8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x404d2
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x6dafe
movq 0xe0(%rsp), %rdi
jmp 0x571b7
movl $0xfffffffc, 0x78(%rsp) # imm = 0xFFFFFFFC
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x40904
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x7(%rsp), %rdx
movq %r12, %rcx
callq 0x5877e
movaps 0x10(%rsp), %xmm0
leaq 0xc0(%rsp), %rdx
movaps %xmm0, (%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x78(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x6dafe
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x56df3
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x56e02
callq 0x1e5bc
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x57209
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x57209
leaq 0x40(%rsp), %r12
movl $0xfffffffd, (%r12)     # imm = 0xFFFFFFFD
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x409e0
movl %eax, %ebx
movl $0x18, %edi
callq 0x103c0
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x5abee(%rip), %rcx     # 0xb1a50
addq $0x10, %rcx
movq %rcx, (%rax)
leaq 0x10(%rax), %rcx
movb %bl, 0x10(%rax)
leaq 0xf8(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x6dafe
movq 0x100(%rsp), %rdi
jmp 0x571b7
movl $0xfffffff6, 0x78(%rsp) # imm = 0xFFFFFFF6
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rcx
movq %r14, %r8
callq 0x40f14
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x90(%rsp)
movq %rax, 0x98(%rsp)
testq %rax, %rax
je 0x571c7
movq 0x5e09f(%rip), %rcx     # 0xb4f90
cmpb $0x0, (%rcx)
je 0x571c3
incl 0x8(%rax)
jmp 0x571c7
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x6daf0
movq %rbx, %rax
jmp 0x5720e
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x40848
movq (%rax), %rbx
movq 0x8(%rax), %rbp
cmpq %rbp, %rbx
je 0x56f80
leaq 0x10(%rsp), %r12
leaq 0x40(%rsp), %r13
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x56cf7
movq %r13, %rdi
movq %r12, %rsi
callq 0x5791e
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x56f77
callq 0x1e5bc
addq $0x10, %rbx
cmpq %rbp, %rbx
jne 0x56f4c
movl $0xfffffffb, 0x78(%rsp) # imm = 0xFFFFFFFB
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0x58a38
movaps 0x10(%rsp), %xmm0
leaq 0xb0(%rsp), %rdx
movaps %xmm0, (%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x78(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x6dafe
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x56fe2
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x56ff1
callq 0x1e5bc
leaq 0x40(%rsp), %rdi
callq 0x5796a
jmp 0x57209
leaq 0x18(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x405bc
movq %rax, %r12
movq 0x18(%rax), %r13
addq $0x8, %r12
cmpq %r12, %r13
je 0x570c4
leaq 0x78(%rsp), %rbp
leaq 0x40(%rsp), %rbx
leaq 0x40(%r13), %rsi
movq %rbp, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x56cf7
leaq 0x20(%r13), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x579b8
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x58be6
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x57086
callq 0x1e5bc
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x570a2
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x103d0
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x570b4
callq 0x1e5bc
movq %r13, %rdi
callq 0x102a0
movq %rax, %r13
cmpq %r12, %rax
jne 0x57049
movl $0xfffffff9, 0x78(%rsp) # imm = 0xFFFFFFF9
leaq 0x48(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x40(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x58dd8
movaps 0x40(%rsp), %xmm0
leaq 0xa0(%rsp), %rdx
movaps %xmm0, (%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
leaq 0x78(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x6dafe
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x57126
callq 0x1e5bc
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x57135
callq 0x1e5bc
leaq 0x10(%rsp), %rdi
callq 0x57ee8
jmp 0x57209
leaq 0x40(%rsp), %r12
movl $0xfffffffe, (%r12)     # imm = 0xFFFFFFFE
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x40416
movq %rax, %rbx
movl $0x20, %edi
callq 0x103c0
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x5a91f(%rip), %rcx     # 0xb1aa0
addq $0x10, %rcx
movq %rcx, (%rax)
leaq 0x10(%rax), %rcx
movups (%rbx), %xmm0
movups %xmm0, 0x10(%rax)
leaq 0xe8(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x6dafe
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x57209
callq 0x1e5bc
jmp 0x57209
lock
incl 0x8(%rax)
leaq 0x78(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq 0x8(%rsp), %rdi
callq 0x6dafe
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x571f0
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x571ff
callq 0x1e5bc
leaq 0x40(%rsp), %rdi
callq 0x20952
movq 0x8(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xa8, %edi
callq 0x101e0
movq %rax, %r12
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x42070
leaq 0x2e708(%rip), %rsi     # 0x85949
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x1d67c
movb $0x1, %bpl
leaq 0x40(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x46e88
xorl %ebp, %ebp
leaq 0x59ab1(%rip), %rsi     # 0xb0d20
leaq -0x1ffd2(%rip), %rdx    # 0x372a4
movq %r12, %rdi
callq 0x106d0
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5729c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x103d0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x572b7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
testb %bpl, %bpl
jne 0x572e4
jmp 0x57445
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x572e4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x572e4
movq %rax, %rbx
movq %r12, %rdi
callq 0x102d0
jmp 0x57445
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x57306
callq 0x1e5bc
movq 0x48(%rsp), %rdi
jmp 0x5740e
jmp 0x573ef
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x5732a
callq 0x1e5bc
movq 0x18(%rsp), %rdi
jmp 0x57431
jmp 0x57424
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x5734e
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5739c
callq 0x1e5bc
jmp 0x5739c
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x57374
callq 0x1e5bc
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x573d2
callq 0x1e5bc
jmp 0x573d2
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
jmp 0x573c3
jmp 0x573ef
jmp 0x57424
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x20952
jmp 0x57445
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
jmp 0x573c3
movq %rax, %rbx
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x57445
callq 0x1e5bc
jmp 0x57445
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x57445
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x57445
movq %rax, %rbx
jmp 0x57418
movq %rax, %rbx
jmp 0x57406
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x57a14
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x57418
callq 0x1e5bc
leaq 0x10(%rsp), %rdi
callq 0x57ee8
jmp 0x57445
movq %rax, %rbx
jmp 0x5743b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x5743b
callq 0x1e5bc
leaq 0x40(%rsp), %rdi
callq 0x5796a
movq %rbx, %rdi
callq 0x106f0