// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/node_parser/node_parser.cpp
// Function: node_parser_t::parseForNode(std::vector<node_scope_t, std::allocator<node_scope_t>>*)
ptr_node_t node_parser_t::parseForNode(std::vector<node_scope_t> *scopes)
{
	scopes->push_back({ROSSA_HASH("<FOR@" + std::to_string(scope_i++) + ">")});
	nextToken();
	auto id = ROSSA_HASH(currentToken.valueString);
	nextToken();
	if (currentToken.type != TOK_IN)
		return logErrorN(util::format(_EXPECTED_ERROR_, {KEYWORD_IN}), currentToken);
	nextToken();
	auto fors = parseEquNode(scopes);
	if (currentToken.type != TOK_DO)
		return logErrorN(util::format(_EXPECTED_ERROR_, {KEYWORD_DO}), currentToken);

	auto marker = currentToken;

	nextToken();
	if (currentToken.type != '{')
		return logErrorN(util::format(_EXPECTED_ERROR_, {"{"}), currentToken);
	nextToken();
	std::vector<ptr_node_t> body;
	while (currentToken.type != NULL_TOK)
	{
		if (currentToken.type == '}')
			break;

		if (auto e = parseExprNode(scopes))
			body.push_back(e);
		else
			return logErrorN(_FAILURE_PARSE_CODE_, currentToken);
	}
	if (currentToken.type != '}')
		return logErrorN(util::format(_EXPECTED_ERROR_, {"}"}), currentToken);
	nextToken();

	scopes->pop_back();
	return std::make_shared<ForNode>(*scopes, id, fors, body, marker);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movq (%rsi), %rsi
leaq 0x1(%rsi), %rax
movq %rax, (%rbx)
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x2ecd6
leaq 0x494f7(%rip), %rsi     # 0x76a8b
leaq 0x30(%rsp), %rdi
movq %r14, %rdx
callq 0x1ca9c
leaq 0x48dc6(%rip), %rdx     # 0x7636e
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1ca7d
leaq 0x8934a(%rip), %rdi     # 0xb6908
leaq 0x10(%rsp), %rsi
callq 0x1efb0
leaq 0xd0(%rsp), %r14
movq %rax, -0x8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
leaq 0xc8(%rsp), %rsi
movq %r12, %rdi
callq 0x1fe52
movq %r14, %rdi
callq 0x1f5c4
leaq 0x10(%rsp), %rdi
callq 0x101d0
leaq 0x30(%rsp), %rdi
callq 0x101d0
leaq 0x50(%rsp), %rdi
callq 0x101d0
movq %rbx, %rdi
callq 0x22e24
leaq 0x58(%rbx), %r14
leaq 0xb0(%rbx), %rsi
leaq 0x892d8(%rip), %rdi     # 0xb6908
callq 0x1efb0
movq %rax, 0xc0(%rsp)
movq %rbx, %rdi
callq 0x22e24
cmpl $-0x8, 0xd0(%rbx)
jne 0x2d837
movq %rbx, %rdi
callq 0x22e24
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x25798
cmpl $-0xa, 0xd0(%rbx)
jne 0x2d8aa
leaq 0xc8(%rsp), %rdi
movq %r14, %rsi
callq 0x1f71a
movq %rbx, %rdi
callq 0x22e24
cmpl $0x7b, 0xd0(%rbx)
jne 0x2d91a
movq %rbx, %rdi
callq 0x22e24
movq %r14, 0x90(%rsp)
leaq 0x70(%rsp), %rbp
andq $0x0, 0x10(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbp)
leaq 0x38(%rsp), %r13
leaq 0x30(%rsp), %r14
movl 0xd0(%rbx), %eax
cmpl $0x7d, %eax
je 0x2d70c
testl %eax, %eax
je 0x2d79a
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x23390
cmpq $0x0, 0x30(%rsp)
je 0x2d80c
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2e880
movq %r13, %rdi
callq 0x1d786
jmp 0x2d6ca
movq %rbx, %rdi
callq 0x22e24
movq %r12, %rdi
callq 0x2eb8e
leaq 0x10(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
leaq 0x98(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0xc8(%rsp), %r9
movq %r12, %rsi
callq 0x2f17a
leaq 0x18(%rsp), %rdi
movaps -0x8(%rdi), %xmm0
andq $0x0, (%rdi)
movups %xmm0, (%r15)
andq $0x0, -0x8(%rdi)
callq 0x1d786
leaq 0x70(%rsp), %rdi
callq 0x2e838
leaq 0xc8(%rsp), %rdi
callq 0x1df38
leaq 0xa0(%rsp), %rdi
callq 0x1d786
movq %r15, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x49103(%rip), %rsi     # 0x768a4
leaq 0x30(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x1c814
leaq 0x4d10a(%rip), %rsi     # 0x7a8c1
leaq 0x50(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1c814
leaq 0xa8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x3f724
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x90(%rsp), %rcx
callq 0x25932
leaq 0x49127(%rip), %rsi     # 0x7693a
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x1c814
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x90(%rsp), %rcx
callq 0x25932
leaq 0x49066(%rip), %rsi     # 0x768a4
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x1c814
leaq 0x48ccd(%rip), %rsi     # 0x76521
leaq 0x30(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x1c814
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x98(%rsp), %rcx
callq 0x1f298
leaq 0xc8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x3f724
leaq 0xc8(%rsp), %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x25932
leaq 0x48ff3(%rip), %rsi     # 0x768a4
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x1c814
leaq 0x48c57(%rip), %rsi     # 0x7651e
leaq 0x30(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x1c814
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xd(%rsp), %rcx
callq 0x1f298
leaq 0xc8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x3f724
leaq 0xc8(%rsp), %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x25932
leaq 0x48f83(%rip), %rsi     # 0x768a4
leaq 0x30(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x1c814
leaq 0x4911b(%rip), %rsi     # 0x76a55
leaq 0x50(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x1c814
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xe(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x3f724
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x25932
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2d996
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x1cea0
jmp 0x2d9e7
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x101d0
jmp 0x2d9b7
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x1cea0
jmp 0x2d9f6
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x101d0
jmp 0x2d9d8
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x1cea0
jmp 0x2da05
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x101d0
jmp 0x2da14
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x101d0
jmp 0x2da26
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x101d0
jmp 0x2da38
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x101d0
jmp 0x2db0b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2db18
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x2da90
jmp 0x2dabb
jmp 0x2da55
movq %rax, %rbx
jmp 0x2db25
jmp 0x2dafe
jmp 0x2dafe
movq %rax, %rbx
jmp 0x2db18
movq %rax, %rbx
movq %r14, %rdi
callq 0x1f5c4
jmp 0x2da6d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2da7c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x101d0
jmp 0x2da8b
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x101d0
jmp 0x2db25
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2daac
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x1cea0
jmp 0x2dac3
movq %rax, %rbx
jmp 0x2db0b
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x101d0
jmp 0x2dad2
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x101d0
jmp 0x2db01
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2daf4
jmp 0x2daf1
jmp 0x2dafe
movq %rax, %rbx
movq %r13, %rdi
callq 0x1d786
jmp 0x2db01
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2e838
leaq 0xc8(%rsp), %rdi
callq 0x1df38
leaq 0xa0(%rsp), %rdi
callq 0x1d786
movq %rbx, %rdi
callq 0x106f0
nop