// File: Nallantli[P]Rossa/main/rossa/node/node.cpp
// Function: VectorNode::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 VectorNode::fold(const std::vector<std::pair<std::vector<hash_ull>, symbol_t>> &consts) const
{
	if (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);
	}

	std::vector<ptr_node_t> nargs;
	for (auto &c : args)
		if (c != nullptr)
			nargs.push_back(c->fold(consts));
	return std::make_shared<VectorNode>(path, nargs, scoped, token);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0xf8(%rbp)
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
movq (%rdi), %rax
callq *0x8(%rax)
testb $0x1, %al
jne 0xd3482
jmp 0xd359e
movq -0xe8(%rbp), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x28(%rbp), %rdi
callq *%rax
movq $0x0, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x7d410
jmp 0xd34ac
leaq -0x68(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x24b80
leaq -0x28(%rbp), %rdi
callq 0x2d300
movq -0x100(%rbp), %rcx
movq %rax, %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq *%rax
jmp 0xd34e1
movq -0xe8(%rbp), %rcx
movq %rcx, %rsi
addq $0x8, %rsi
addq $0x28, %rcx
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0xe5670
jmp 0xd3505
movq -0xf8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x571a0
leaq -0x88(%rbp), %rdi
callq 0x571d0
leaq -0x78(%rbp), %rdi
callq 0x86dc0
leaq -0x68(%rbp), %rdi
callq 0x24e60
leaq -0x38(%rbp), %rdi
callq 0x7d790
leaq -0x28(%rbp), %rdi
callq 0x2a4e0
jmp 0xd371b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd3590
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd357e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x86dc0
leaq -0x68(%rbp), %rdi
callq 0x24e60
leaq -0x38(%rbp), %rdi
callq 0x7d790
leaq -0x28(%rbp), %rdi
callq 0x2a4e0
jmp 0xd372b
leaq -0xa0(%rbp), %rdi
callq 0x57390
movq -0xe8(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0xe5310
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
callq 0xe5340
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xe5370
testb $0x1, %al
jne 0xd3600
jmp 0xd36af
leaq -0xb0(%rbp), %rdi
callq 0xe53b0
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe53d0
testb $0x1, %al
jne 0xd3629
jmp 0xd369c
movq -0xc0(%rbp), %rdi
callq 0x2d030
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0xd0(%rbp), %rdi
callq *%rax
jmp 0xd364e
leaq -0xa0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x57650
jmp 0xd3663
leaq -0xd0(%rbp), %rdi
callq 0x24b20
jmp 0xd369c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd370d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x24b20
jmp 0xd370d
jmp 0xd369e
leaq -0xb0(%rbp), %rdi
callq 0xe5430
jmp 0xd35e4
movq -0xe8(%rbp), %r8
movq %r8, %rsi
addq $0x8, %rsi
movq %r8, %rcx
addq $0xc0, %rcx
addq $0x28, %r8
leaq -0xe0(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0xe56f0
jmp 0xd36e0
movq -0xf8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x57470
leaq -0xe0(%rbp), %rdi
callq 0x574a0
leaq -0xa0(%rbp), %rdi
callq 0x574c0
jmp 0xd371b
leaq -0xa0(%rbp), %rdi
callq 0x574c0
jmp 0xd372b
movq -0xf0(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x119c0
nopw %cs:(%rax,%rax)