// File: zerolfx[P]P-Machine/fjp.cpp
// Function: Fjp::execute(StackMachine*)
void Fjp::execute(StackMachine *stack)
{
	StackBoolean p;
	
	if(typeid(p) != typeid(*(stack->fStore[stack->fSP])))
		throw ExecutionError("instruction fjp: requires a boolean te be on top of the stack.");

	if(stack->fStore[stack->fSP]->getBoolean() == false)
	{
		stack->fPC = stack->fLabelCenter.getAddress(fQ);
	}
	
	delete stack->fStore[stack->fSP];
	stack->fStore.pop_back();
	--stack->fSP;
	
	// adding cost of this instruction
	stack->fTime.count("fjp");

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x27d20
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
jne 0xf2c8
callq 0x7300
jmp 0xf2c8
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x3b9b3(%rip), %rdi     # 0x4ac90
callq 0x9370
testb $0x1, %al
jne 0xf2eb
jmp 0xf3b4
movb $0x1, -0x52(%rbp)
movl $0x20, %edi
callq 0x7110
movq %rax, -0xa0(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x74f0
movq -0x98(%rbp), %rdx
leaq 0x288dd(%rip), %rsi     # 0x37bfb
leaq -0x50(%rbp), %rdi
callq 0x8940
jmp 0xf329
movq -0xa0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x283d0
jmp 0xf33b
movq -0xa0(%rbp), %rdi
movb $0x0, -0x52(%rbp)
leaq 0x3a733(%rip), %rsi     # 0x49a80
leaq 0x190ac(%rip), %rdx     # 0x28400
callq 0x74a0
jmp 0xf52f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xf51d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xf392
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x7170
leaq -0x51(%rbp), %rdi
callq 0x72e0
testb $0x1, -0x52(%rbp)
jne 0xf3a3
jmp 0xf3af
movq -0xa0(%rbp), %rdi
callq 0x71c0
jmp 0xf51d
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x70(%rax), %rax
callq *%rax
movb %al, -0xa1(%rbp)
jmp 0xf3df
movb -0xa1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xf41f
movq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
addq $0x8, %rsi
callq 0x28510
movl %eax, -0xa8(%rbp)
jmp 0xf40f
movl -0xa8(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xb0(%rax)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0xf464
movq -0xb0(%rbp), %rdi
callq 0x26ca0
movq -0xb0(%rbp), %rdi
movl $0x8, %esi
callq 0x7280
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x8e90
movq -0x10(%rbp), %rax
movl 0xb4(%rax), %ecx
decl %ecx
movl %ecx, 0xb4(%rax)
movq -0x10(%rbp), %rax
addq $0x78, %rax
movq %rax, -0xc0(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x74f0
movq -0xb8(%rbp), %rdx
leaq 0x2878a(%rip), %rsi     # 0x37c3a
leaq -0x78(%rbp), %rdi
callq 0x8940
jmp 0xf4bb
movq -0xc0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2c4d0
jmp 0xf4cd
leaq -0x78(%rbp), %rdi
callq 0x7170
leaq -0x79(%rbp), %rdi
callq 0x72e0
leaq -0x20(%rbp), %rdi
callq 0x27d70
addq $0xc0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xf514
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x7170
leaq -0x79(%rbp), %rdi
callq 0x72e0
leaq -0x20(%rbp), %rdi
callq 0x27d70
movq -0x28(%rbp), %rdi
callq 0x74e0
nop