// File: zerolfx[P]P-Machine/ixj.cpp
// Function: Ixj::execute(StackMachine*)
void Ixj::execute(StackMachine *stack)
{
	StackInteger p1;
			
	if(typeid(p1) != typeid(*stack->fStore[stack->fSP]))
		throw ExecutionError("instruction ixj: STORE[SP] does not contain an element of type integer.");
		
	stack->fPC = stack->fStore[stack->fSP]->getValue() + stack->fLabelCenter.getAddress(fQ);
	
	delete stack->fStore[stack->fSP];
	stack->fStore.pop_back();
	
	--stack->fSP;
	
	// adding cost of this instruction
	stack->fTime.count("ixj");

}

// 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 0x27340
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 0x13ba8
callq 0x7300
jmp 0x13ba8
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x36f33(%rip), %rdi     # 0x4aaf0
callq 0x9370
testb $0x1, %al
jne 0x13bcb
jmp 0x13c94
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 0x24a1a(%rip), %rsi     # 0x38618
leaq -0x50(%rbp), %rdi
callq 0x8940
jmp 0x13c09
movq -0xa0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x283d0
jmp 0x13c1b
movq -0xa0(%rbp), %rdi
movb $0x0, -0x52(%rbp)
leaq 0x35e53(%rip), %rsi     # 0x49a80
leaq 0x147cc(%rip), %rdx     # 0x28400
callq 0x74a0
jmp 0x13e07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13df5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13c72
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 0x13c83
jmp 0x13c8f
movq -0xa0(%rbp), %rdi
callq 0x71c0
jmp 0x13df5
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movslq 0xb4(%rax), %rsi
callq 0x8e70
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movl %eax, -0xa4(%rbp)
jmp 0x13cbf
movq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
addq $0x8, %rsi
callq 0x28510
movl %eax, -0xa8(%rbp)
jmp 0x13cdf
movl -0xa8(%rbp), %eax
movl -0xa4(%rbp), %ecx
addl %eax, %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 0x13d3c
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 0x248d8(%rip), %rsi     # 0x38660
leaq -0x78(%rbp), %rdi
callq 0x8940
jmp 0x13d93
movq -0xc0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2c4d0
jmp 0x13da5
leaq -0x78(%rbp), %rdi
callq 0x7170
leaq -0x79(%rbp), %rdi
callq 0x72e0
leaq -0x20(%rbp), %rdi
callq 0x27380
addq $0xc0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13dec
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 0x27380
movq -0x28(%rbp), %rdi
callq 0x74e0
nopw (%rax,%rax)