// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/node/node.cpp
// Function: IfElseNode::fold(std::vector<std::pair<std::vector<unsigned long long, std::allocator<unsigned long long>>, symbol_t>, std::allocator<std::pair<std::vector<unsigned long long, std::allocator<unsigned long long>>, symbol_t>>> const&) const
const ptr_node_t IfElseNode::fold(const std::vector<std::pair<std::vector<hash_ull>, symbol_t>> &consts) const
{
	auto nifs = ifs->fold(consts);
	auto nbody = body->fold(consts);
	ptr_node_t nelses = nullptr;
	if (elses)
		nelses = elses->fold(consts);

	if (nifs->isConst() && nbody->isConst() && (!nelses || nelses->isConst()))
	{
		auto i = genParser();
		object_t newScope(static_cast<hash_ull>(0));
		trace_t stack_trace;
		auto r = i->evaluate(&newScope, stack_trace);
		return std::make_shared<ContainerNode>(path, r, token);
	}

	auto ret = std::make_shared<IfElseNode>(path, nifs, nbody, token);
	if (nelses)
		ret->setElse(nelses);
	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0xa8(%rsi), %rsi
movq (%rsi), %rax
leaq 0x40(%rsp), %rdi
callq *0x18(%rax)
movq 0xb8(%r14), %rsi
movq (%rsi), %rax
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq *0x18(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0xc8(%r14), %rsi
testq %rsi, %rsi
je 0x55b62
movq (%rsi), %rax
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq *0x18(%rax)
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2fc8e
leaq 0x18(%rsp), %rdi
callq 0x1d786
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
testb %al, %al
je 0x55c42
movq 0x30(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
testb %al, %al
je 0x55c42
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x55b9f
movq (%rdi), %rax
callq *0x8(%rax)
testb %al, %al
je 0x55c42
movq (%r14), %rax
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq *(%rax)
leaq 0x10(%rsp), %rsi
andq $0x0, (%rsi)
leaq 0x60(%rsp), %rdi
callq 0x361aa
leaq 0x10(%rsp), %rcx
andq $0x0, 0x10(%rcx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rcx)
movq 0x70(%rsp), %rsi
movq (%rsi), %rax
leaq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq *(%rax)
leaq 0x8(%r14), %rsi
addq $0x28, %r14
leaq 0x80(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %r14, %rcx
callq 0x58a65
leaq 0x88(%rsp), %rdi
movaps -0x8(%rdi), %xmm0
andq $0x0, (%rdi)
movups %xmm0, (%rbx)
andq $0x0, -0x8(%rdi)
callq 0x1d786
leaq 0x50(%rsp), %rdi
callq 0x39102
leaq 0x10(%rsp), %rdi
callq 0x1cb1a
leaq 0x60(%rsp), %rdi
callq 0x363f2
leaq 0x78(%rsp), %rdi
jmp 0x55c8f
leaq 0x8(%r14), %rsi
addq $0x28, %r14
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movq %r14, %r8
callq 0x5967a
cmpq $0x0, (%rsp)
je 0x55c7a
movl $0xc8, %edi
addq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x2fc8e
leaq 0x18(%rsp), %rdi
movaps -0x8(%rdi), %xmm0
andq $0x0, (%rdi)
movups %xmm0, (%rbx)
andq $0x0, -0x8(%rdi)
callq 0x1d786
leaq 0x8(%rsp), %rdi
callq 0x1d786
leaq 0x38(%rsp), %rdi
callq 0x1d786
leaq 0x48(%rsp), %rdi
callq 0x1d786
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x39102
jmp 0x55cd4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1cb1a
leaq 0x60(%rsp), %rdi
callq 0x363f2
jmp 0x55ced
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x1d786
jmp 0x55d07
jmp 0x55d04
jmp 0x55d04
jmp 0x55d04
movq %rax, %rbx
jmp 0x55d1b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1d786
leaq 0x38(%rsp), %rdi
callq 0x1d786
leaq 0x48(%rsp), %rdi
callq 0x1d786
movq %rbx, %rdi
callq 0x106f0
nop