// File: Nallantli[P]Rossa/main/rossa/instruction/instruction.cpp
// Function: ForI::evaluate(object_t const*, std::vector<std::pair<token_t, function_t>, std::allocator<std::pair<token_t, function_t>>>&) const
const symbol_t ForI::evaluate(const object_t *scope, trace_t &stack_trace) const
{
	const std::vector<symbol_t> evalFor = fors->evaluate(scope, stack_trace).getVector(&token, stack_trace);
	for (auto &&e : evalFor)
	{
		const object_t newScope(scope, OBJECT_WEAK);
		newScope.createVariable(id, e, &token);
		bool cflag = false;
		for (auto &&i : body)
		{
			const symbol_t temp = i->evaluate(&newScope, stack_trace);
			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 $0x110, %rsp            # imm = 0x110
movq %rdi, -0xf8(%rbp)
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
addq $0x98, %rdi
callq 0x2d300
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x48(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq *%rax
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdi
addq $0x8, %rsi
movq -0x20(%rbp), %rdx
callq 0x87fe0
movq %rax, -0xd8(%rbp)
jmp 0x1295f5
movq -0xd8(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x8c650
jmp 0x129607
leaq -0x48(%rbp), %rdi
callq 0x86dc0
leaq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x24ba0
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
callq 0x24bd0
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x24c00
testb $0x1, %al
jne 0x129648
jmp 0x1298ba
leaq -0x68(%rbp), %rdi
callq 0x24c40
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rsi
movq $0x0, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x7d4e0
jmp 0x129679
movq -0xe8(%rbp), %rcx
movq %rcx, %rsi
addq $0x90, %rsi
movq -0x78(%rbp), %rdx
addq $0x8, %rcx
leaq -0x88(%rbp), %rdi
callq 0x7de40
jmp 0x1296a0
movq -0xe8(%rbp), %rax
movb $0x0, -0x91(%rbp)
addq $0xa8, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x1367a0
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x1367d0
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x136800
testb $0x1, %al
jne 0x1296fd
jmp 0x12987a
leaq -0xa8(%rbp), %rdi
callq 0x136840
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x2d300
movq %rax, %rsi
movq -0x20(%rbp), %rcx
movq (%rsi), %rax
movq (%rax), %rax
leaq -0xc8(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq *%rax
jmp 0x12973b
leaq -0xc8(%rbp), %rdi
callq 0x879c0
movl %eax, -0xfc(%rbp)
jmp 0x12974f
movl -0xfc(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x108(%rbp)
subl $0x4, %eax
ja 0x12981b
movq -0x108(%rbp), %rax
leaq 0x2b64f(%rip), %rcx     # 0x154dc4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x86dc0
jmp 0x1298f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1298eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1298ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x86dc0
jmp 0x1298ac
movq -0xf8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x86d80
jmp 0x1297ec
movl $0x1, -0xcc(%rbp)
jmp 0x12983c
movq -0xf8(%rbp), %rdi
callq 0x86580
jmp 0x129806
movl $0x1, -0xcc(%rbp)
jmp 0x12983c
movb $0x1, -0x91(%rbp)
jmp 0x12981d
jmp 0x12981d
testb $0x1, -0x91(%rbp)
je 0x129832
movl $0x4, -0xcc(%rbp)
jmp 0x12983c
movl $0x0, -0xcc(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x86dc0
movl -0xcc(%rbp), %eax
movl %eax, -0x10c(%rbp)
testl %eax, %eax
je 0x129867
jmp 0x12985a
movl -0x10c(%rbp), %eax
subl $0x4, %eax
je 0x12987a
jmp 0x129884
jmp 0x129869
leaq -0xa8(%rbp), %rdi
callq 0x136860
jmp 0x1296e1
movl $0x0, -0xcc(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x7d790
movl -0xcc(%rbp), %eax
testl %eax, %eax
jne 0x1298d2
jmp 0x12989c
jmp 0x12989e
leaq -0x68(%rbp), %rdi
callq 0x24e20
jmp 0x129632
leaq -0x88(%rbp), %rdi
callq 0x7d790
jmp 0x1298eb
movq -0xf8(%rbp), %rdi
callq 0x86580
jmp 0x1298c8
movl $0x1, -0xcc(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2cf10
movq -0xf0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x2cf10
movq -0x50(%rbp), %rdi
callq 0x119c0
nopl (%rax)