// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/node_parser/node_parser.cpp
// Function: node_parser_t::parseWhileNode(std::vector<node_scope_t, std::allocator<node_scope_t>>*)
ptr_node_t node_parser_t::parseWhileNode(std::vector<node_scope_t> *scopes)
{
	scopes->push_back({ROSSA_HASH("<WHI@" + std::to_string(scope_i++) + ">")});
	nextToken();
	auto ifs = parseEquNode(scopes);
	if (!ifs)
		return nullptr;
	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<WhileNode>(*scopes, ifs, 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 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x2ecd6
leaq 0x499f3(%rip), %rsi     # 0x76a85
leaq 0x38(%rsp), %rdi
movq %r14, %rdx
callq 0x1ca9c
leaq 0x492c8(%rip), %rdx     # 0x7636e
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1ca7d
leaq 0x8984c(%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 0x38(%rsp), %rdi
callq 0x101d0
leaq 0x58(%rsp), %rdi
callq 0x101d0
movq %rbx, %rdi
callq 0x22e24
leaq 0xa0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x25798
cmpq $0x0, (%r14)
je 0x2d24b
leaq 0x58(%rbx), %r14
cmpl $-0xa, 0xd0(%rbx)
jne 0x2d30b
leaq 0xc8(%rsp), %rdi
movq %r14, %rsi
callq 0x1f71a
movq %rbx, %rdi
callq 0x22e24
cmpl $0x7b, 0xd0(%rbx)
jne 0x2d37e
movq %rbx, %rdi
callq 0x22e24
movq %r14, 0x78(%rsp)
leaq 0x80(%rsp), %rbp
andq $0x0, 0x10(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbp)
leaq 0x40(%rsp), %r13
leaq 0x38(%rsp), %r14
movl 0xd0(%rbx), %eax
cmpl $0x7d, %eax
je 0x2d1df
testl %eax, %eax
je 0x2d274
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x23390
cmpq $0x0, 0x38(%rsp)
je 0x2d2e3
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2e880
movq %r13, %rdi
callq 0x1d786
jmp 0x2d19d
movq %rbx, %rdi
callq 0x22e24
movq %r12, %rdi
callq 0x2eb8e
leaq 0x10(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
leaq 0x80(%rsp), %rcx
leaq 0xc8(%rsp), %r8
movq %r12, %rsi
callq 0x2f153
leaq 0x18(%rsp), %rdi
movaps -0x8(%rdi), %xmm0
andq $0x0, (%rdi)
movups %xmm0, (%r15)
andq $0x0, -0x8(%rdi)
callq 0x1d786
leaq 0x80(%rsp), %rdi
callq 0x2e838
leaq 0xc8(%rsp), %rdi
callq 0x1df38
jmp 0x2d252
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
leaq 0xa8(%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 0x49629(%rip), %rsi     # 0x768a4
leaq 0x38(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x1c814
leaq 0x4d630(%rip), %rsi     # 0x7a8c1
leaq 0x58(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1c814
leaq 0xb0(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x3f724
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x78(%rsp), %rcx
callq 0x25932
leaq 0x49650(%rip), %rsi     # 0x7693a
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x1c814
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
movq 0x78(%rsp), %rcx
callq 0x25932
leaq 0x49592(%rip), %rsi     # 0x768a4
leaq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x1c814
leaq 0x491f3(%rip), %rsi     # 0x7651e
leaq 0x38(%rsp), %rdi
leaq 0xb0(%rsp), %rdx
callq 0x1c814
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xd(%rsp), %rcx
callq 0x1f298
leaq 0xc8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x3f724
leaq 0xc8(%rsp), %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x25932
leaq 0x4951f(%rip), %rsi     # 0x768a4
leaq 0x38(%rsp), %rdi
leaq 0xb0(%rsp), %rdx
callq 0x1c814
leaq 0x496b7(%rip), %rsi     # 0x76a55
leaq 0x58(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x1c814
leaq 0x80(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xe(%rsp), %rcx
callq 0x1f298
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x80(%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 0x2d400
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x1cea0
jmp 0x2d433
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x101d0
jmp 0x2d424
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1cea0
jmp 0x2d442
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x101d0
jmp 0x2d451
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x101d0
jmp 0x2d463
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x101d0
jmp 0x2d539
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2d546
jmp 0x2d4e6
jmp 0x2d480
jmp 0x2d529
jmp 0x2d529
movq %rax, %rbx
jmp 0x2d546
movq %rax, %rbx
movq %r14, %rdi
callq 0x1f5c4
jmp 0x2d498
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2d4a7
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x101d0
jmp 0x2d4b6
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x101d0
jmp 0x2d553
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2d4d7
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x1cea0
jmp 0x2d4ee
movq %rax, %rbx
jmp 0x2d539
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x101d0
jmp 0x2d4fd
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x101d0
jmp 0x2d52c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x101d0
jmp 0x2d51f
jmp 0x2d51c
jmp 0x2d529
movq %rax, %rbx
movq %r13, %rdi
callq 0x1d786
jmp 0x2d52c
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x2e838
leaq 0xc8(%rsp), %rdi
callq 0x1df38
leaq 0xa8(%rsp), %rdi
callq 0x1d786
movq %rbx, %rdi
callq 0x106f0
nop