// File: Nallantli[P]Rossa/main/rossa/instruction/instruction.cpp
// Function: WhileI::evaluate(object_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&) const
const symbol_t WhileI::evaluate(const object_t *scope, trace_t &stack_trace) const
{
	while (whiles->evaluate(scope, stack_trace).getBool(&token, stack_trace))
	{
		const object_t newScope(scope, OBJECT_WEAK);
		for (const ptr_instruction_t &i : body)
		{
			const symbol_t temp = i->evaluate(&newScope, stack_trace);
			bool cflag = false;
			switch (temp.getSymbolType())
			{
			case symbol_t::type_t::ID_REFER:
			case symbol_t::type_t::ID_RETURN:
				return temp;
			case symbol_t::type_t::ID_BREAK:
				return symbol_t();
			case symbol_t::type_t::ID_CONTINUE:
				cflag = true;
				break;
			default:
				break;
			}
			if (cflag)
				break;
		}
	}
	return symbol_t();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
addq $0x90, %rdi
callq 0x2d300
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x30(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq *%rax
movq -0x98(%rbp), %rsi
movq -0xb8(%rbp), %rdi
addq $0x8, %rsi
movq -0x20(%rbp), %rdx
callq 0x881f0
movb %al, -0xa9(%rbp)
jmp 0x12928b
leaq -0x30(%rbp), %rdi
callq 0x86dc0
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x1292a3
jmp 0x129492
movq -0x18(%rbp), %rsi
movq $0x0, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x7d4e0
movq -0x98(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x1367a0
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
callq 0x1367d0
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x136800
testb $0x1, %al
jne 0x1292fd
jmp 0x129461
leaq -0x68(%rbp), %rdi
callq 0x136840
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x2d300
movq %rax, %rsi
movq -0x20(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x88(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq *%rax
jmp 0x12932f
movb $0x0, -0x89(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x879c0
movl %eax, -0xbc(%rbp)
jmp 0x12934a
movl -0xbc(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0xc8(%rbp)
subl $0x4, %eax
ja 0x129405
movq -0xc8(%rbp), %rax
leaq 0x2ba40(%rip), %rcx     # 0x154db0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x86dc0
jmp 0x1294ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x129487
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x86dc0
jmp 0x129487
movq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x86d80
jmp 0x1293d6
movl $0x1, -0x90(%rbp)
jmp 0x129426
movq -0xa8(%rbp), %rdi
callq 0x86580
jmp 0x1293f0
movl $0x1, -0x90(%rbp)
jmp 0x129426
movb $0x1, -0x89(%rbp)
jmp 0x129407
jmp 0x129407
testb $0x1, -0x89(%rbp)
je 0x12941c
movl $0x4, -0x90(%rbp)
jmp 0x129426
movl $0x0, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x86dc0
movl -0x90(%rbp), %eax
movl %eax, -0xcc(%rbp)
testl %eax, %eax
je 0x129451
jmp 0x129444
movl -0xcc(%rbp), %eax
subl $0x4, %eax
je 0x129461
jmp 0x12946b
jmp 0x129453
leaq -0x68(%rbp), %rdi
callq 0x136860
jmp 0x1292e7
movl $0x0, -0x90(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x7d790
movl -0x90(%rbp), %eax
testl %eax, %eax
je 0x129482
jmp 0x129480
jmp 0x12949e
jmp 0x129237
leaq -0x50(%rbp), %rdi
callq 0x7d790
jmp 0x1294ae
movq -0xa8(%rbp), %rdi
callq 0x86580
movq -0xa0(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x119c0
nopw (%rax,%rax)