// File: Nallantli[P]Rossa/main/rossa/node/node.cpp
// Function: SwitchNode::genParser() const
ptr_instruction_t SwitchNode::genParser() const
{
	std::map<symbol_t, size_t> cases_solved;
	std::map<ptr_instruction_t, size_t> cases_unsolved;
	std::vector<ptr_instruction_t> goto_cases;
	trace_t stack_trace;
	for (auto &e : this->cases)
	{
		if (e.first->isConst())
		{
			object_t newScope(static_cast<hash_ull>(0));
			trace_t stack_trace;
			auto key = e.first->genParser()->evaluate(&newScope, stack_trace);
			cases_solved[key] = e.second;
		}
		else
		{
			cases_unsolved[e.first->genParser()] = e.second;
		}
	}
	for (auto &e : this->gotos)
	{
		goto_cases.push_back(e->genParser());
	}
	if (elses)
		return std::make_shared<SwitchI>(switchs->genParser(), cases_solved, cases_unsolved, goto_cases, elses->genParser(), token);
	return std::make_shared<SwitchI>(switchs->genParser(), cases_solved, cases_unsolved, goto_cases, nullptr, token);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x1d8(%rbp)
movq %rdi, %rax
movq %rax, -0x1d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xea2b0
leaq -0x70(%rbp), %rdi
callq 0xea2d0
leaq -0x88(%rbp), %rdi
callq 0xe52f0
leaq -0xa0(%rbp), %rdi
callq 0x24b80
movq -0x1c8(%rbp), %rax
addq $0xb8, %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0xea2f0
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
callq 0xea320
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xea350
testb $0x1, %al
jne 0xe277f
jmp 0xe29cb
leaq -0xb0(%rbp), %rdi
callq 0xea380
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
callq 0x2d030
movq %rax, %rdi
movq (%rdi), %rax
movq 0x8(%rax), %rax
callq *%rax
movb %al, -0x1d9(%rbp)
jmp 0xe27b2
movb -0x1d9(%rbp), %al
testb $0x1, %al
jne 0xe27c1
jmp 0xe2932
movq $0x0, -0xe8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x7d410
jmp 0xe27e1
leaq -0x100(%rbp), %rdi
callq 0x24b80
movq -0xc0(%rbp), %rdi
callq 0x2d030
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x120(%rbp), %rdi
callq *%rax
jmp 0xe280d
leaq -0x120(%rbp), %rdi
callq 0x2d300
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x110(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
leaq -0x100(%rbp), %rcx
callq *%rax
jmp 0xe283b
leaq -0x120(%rbp), %rdi
callq 0x2a4e0
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0xea3b0
movq %rax, -0x1e8(%rbp)
jmp 0xe2872
movq -0x1e8(%rbp), %rax
movq -0x1f0(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x110(%rbp), %rdi
callq 0x86dc0
leaq -0x100(%rbp), %rdi
callq 0x24e60
leaq -0xe0(%rbp), %rdi
callq 0x7d790
jmp 0xe29b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xe2cd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xe2915
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x2a4e0
jmp 0xe2915
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x86dc0
leaq -0x100(%rbp), %rdi
callq 0x24e60
leaq -0xe0(%rbp), %rdi
callq 0x7d790
jmp 0xe2cd4
movq -0xc0(%rbp), %rdi
movq 0x10(%rdi), %rax
movq %rax, -0x1f8(%rbp)
callq 0x2d030
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x130(%rbp), %rdi
callq *%rax
jmp 0xe295d
leaq -0x70(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xea490
movq %rax, -0x200(%rbp)
jmp 0xe2976
movq -0x200(%rbp), %rax
movq -0x1f8(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x130(%rbp), %rdi
callq 0x2a4e0
jmp 0xe29b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x2a4e0
jmp 0xe2cd4
jmp 0xe29ba
leaq -0xb0(%rbp), %rdi
callq 0xea570
jmp 0xe2763
movq -0x1c8(%rbp), %rax
addq $0xe8, %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
callq 0xe5310
movq %rax, -0x140(%rbp)
movq -0x138(%rbp), %rdi
callq 0xe5340
movq %rax, -0x148(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0xe5370
testb $0x1, %al
jne 0xe2a21
jmp 0xe2aa6
leaq -0x140(%rbp), %rdi
callq 0xe53b0
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rdi
callq 0x2d030
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x160(%rbp), %rdi
callq *%rax
jmp 0xe2a54
leaq -0x88(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xe5400
jmp 0xe2a69
leaq -0x160(%rbp), %rdi
callq 0x2a4e0
leaq -0x140(%rbp), %rdi
callq 0xe5430
jmp 0xe2a05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x2a4e0
jmp 0xe2cd4
movq -0x1c8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x57630
testb $0x1, %al
jne 0xe2ac2
jmp 0xe2bd5
movq -0x1c8(%rbp), %rdi
addq $0xa8, %rdi
callq 0x2d030
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x180(%rbp), %rdi
callq *%rax
jmp 0xe2ae9
movq -0x1c8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x2d030
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x190(%rbp), %rdi
callq *%rax
jmp 0xe2b10
movq -0x1c8(%rbp), %rcx
addq $0x28, %rcx
movq %rsp, %rax
movq %rcx, (%rax)
leaq -0x170(%rbp), %rdi
leaq -0x180(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x70(%rbp), %rcx
leaq -0x88(%rbp), %r8
leaq -0x190(%rbp), %r9
callq 0xea5a0
jmp 0xe2b4c
movq -0x1d8(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0xea640
leaq -0x170(%rbp), %rdi
callq 0xea670
leaq -0x190(%rbp), %rdi
callq 0x2a4e0
leaq -0x180(%rbp), %rdi
callq 0x2a4e0
movl $0x1, -0x194(%rbp)
jmp 0xe2c9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xe2bc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x2a4e0
leaq -0x180(%rbp), %rdi
callq 0x2a4e0
jmp 0xe2cd4
movq -0x1c8(%rbp), %rdi
addq $0xa8, %rdi
callq 0x2d030
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x1b8(%rbp), %rdi
callq *%rax
jmp 0xe2bfc
movq -0x1c8(%rbp), %rcx
movq $0x0, -0x1c0(%rbp)
addq $0x28, %rcx
movq %rsp, %rax
movq %rcx, (%rax)
leaq -0x1a8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x70(%rbp), %rcx
leaq -0x88(%rbp), %r8
leaq -0x1c0(%rbp), %r9
callq 0xea690
jmp 0xe2c43
movq -0x1d8(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0xea640
leaq -0x1a8(%rbp), %rdi
callq 0xea670
leaq -0x1b8(%rbp), %rdi
callq 0x2a4e0
movl $0x1, -0x194(%rbp)
jmp 0xe2c9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x2a4e0
jmp 0xe2cd4
leaq -0xa0(%rbp), %rdi
callq 0x24e60
leaq -0x88(%rbp), %rdi
callq 0xe55f0
leaq -0x70(%rbp), %rdi
callq 0xea730
leaq -0x40(%rbp), %rdi
callq 0xea750
movq -0x1d0(%rbp), %rax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
leaq -0xa0(%rbp), %rdi
callq 0x24e60
leaq -0x88(%rbp), %rdi
callq 0xe55f0
leaq -0x70(%rbp), %rdi
callq 0xea730
leaq -0x40(%rbp), %rdi
callq 0xea750
movq -0xc8(%rbp), %rdi
callq 0x119c0
nopw (%rax,%rax)