// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa0, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0xa8(%rsi), %rsi
movq (%rsi), %rax
leaq 0x60(%rsp), %rdi
callq *0x18(%rax)
movq 0xb8(%r14), %rsi
movq (%rsi), %rax
leaq 0x50(%rsp), %rdi
movq %r15, %rdx
callq *0x18(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0xc8(%r14), %rsi
testq %rsi, %rsi
je 0x62d07
movq (%rsi), %rax
leaq 0x20(%rsp), %rdi
movq %r15, %rdx
callq *0x18(%rax)
leaq 0x28(%rsp), %r15
movq -0x8(%r15), %rax
leaq 0x18(%rsp), %rdi
movq %rax, -0x8(%rdi)
movq %r15, %rsi
callq 0x3775e
movq (%r15), %rdi
testq %rdi, %rdi
je 0x62d07
callq 0x1e5bc
movq 0x60(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
testb %al, %al
je 0x62e04
movq 0x50(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
testb %al, %al
je 0x62e04
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x62d45
movq (%rdi), %rax
callq *0x8(%rax)
testb %al, %al
je 0x62e04
movq (%r14), %rax
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq *(%rax)
leaq 0x20(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x80(%rsp), %rdi
callq 0x3c8de
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
movaps %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
movq 0x40(%rsp), %rsi
movq (%rsi), %rax
leaq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq *(%rax)
leaq 0x8(%r14), %rcx
addq $0x28, %r14
leaq 0x98(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x90(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x70(%rsp), %r8
movq %r14, %r9
callq 0x676e2
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rbx)
leaq 0x70(%rsp), %rdi
callq 0x3fe06
leaq 0x20(%rsp), %rdi
callq 0x1d632
leaq 0x80(%rsp), %rdi
callq 0x3cb40
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x62e65
callq 0x1e5bc
jmp 0x62e65
leaq 0x8(%r14), %rcx
addq $0x28, %r14
leaq 0x28(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %r14, (%rsp)
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
leaq 0x60(%rsp), %r8
leaq 0x50(%rsp), %r9
callq 0x6bdd6
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x62e5d
movq 0x20(%rsp), %rdi
movq %rax, 0xc8(%rdi)
addq $0xd0, %rdi
leaq 0x18(%rsp), %rsi
callq 0x3775e
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x62e74
callq 0x1e5bc
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x62e83
callq 0x1e5bc
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x62e92
callq 0x1e5bc
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x3fe06
jmp 0x62eb4
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1d632
leaq 0x80(%rsp), %rdi
callq 0x3cb40
jmp 0x62ed0
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x62eef
callq 0x1e5bc
jmp 0x62eef
jmp 0x62eec
jmp 0x62eec
jmp 0x62eec
movq %rax, %rbx
jmp 0x62f0d
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x62efe
callq 0x1e5bc
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x62f0d
callq 0x1e5bc
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x62f1c
callq 0x1e5bc
movq %rbx, %rdi
callq 0x106f0