// File: /workspace/github_cpp_makefile_star2_O3/zerolfx[P]P-Machine/ixa.cpp
// Function: Ixa::execute(StackMachine*)
void Ixa::execute(StackMachine *stack)
{
	StackAddress p1;
	StackInteger p2;
	
	if(typeid(p1) != typeid(*(stack->fStore[stack->fSP - 1])))
		throw ExecutionError("instruction ixa: STORE[SP-1] does not contain an element of type address.");
		
	if(typeid(p2) != typeid(*(stack->fStore[stack->fSP])))
		throw ExecutionError("instruction ixa: STORE[SP] does not contain an element of type integer.");
		
	StackInteger temp(fQ);
	
	int newaddress = stack->fStore[stack->fSP - 1]->getValue() + stack->fStore[stack->fSP]->getValue() * fQ;
	
	delete stack->fStore[stack->fSP - 1];
	delete stack->fStore[stack->fSP];
	stack->fStore.pop_back();
	
	--stack->fSP;
	
	stack->fStore[stack->fSP] = new StackAddress(newaddress);
	
	// adding cost of this instruction
	stack->fTime.count("ixa");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0x1a104
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
callq 0x1a9d4
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xdece
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x25c2a(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xdd59
cmpb $0x2a, (%rdi)
je 0xded3
callq 0x6310
testl %eax, %eax
jne 0xded3
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xdece
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x25d84(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xdd97
cmpb $0x2a, (%rdi)
je 0xdf29
callq 0x6310
testl %eax, %eax
jne 0xdf29
movl 0x8(%r14), %esi
leaq -0x50(%rbp), %rdi
callq 0x1a9d4
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movl %eax, %r15d
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
movl %eax, %r12d
imull 0x8(%r14), %r12d
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %r14
testq %r14, %r14
je 0xddf7
movq %r14, %rdi
callq 0x1a300
movl $0x8, %esi
movq %r14, %rdi
callq 0x6210
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %r14
testq %r14, %r14
je 0xde20
movq %r14, %rdi
callq 0x1a300
movl $0x8, %esi
movq %r14, %rdi
callq 0x6210
addq $-0x8, 0x20(%rbx)
decl 0xb4(%rbx)
movl $0x10, %edi
callq 0x6200
movq %rax, %r14
addl %r15d, %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x1a104
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq %r14, (%rcx,%rax,8)
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x16799(%rip), %rsi     # 0x2460a
leaq 0x16795(%rip), %rdx     # 0x2460d
leaq -0x40(%rbp), %rdi
callq 0x746c
addq $0x78, %rbx
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x1cbc8
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xdea6
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
leaq -0x60(%rbp), %rdi
callq 0x1a9f8
leaq -0x70(%rbp), %rdi
callq 0x1a128
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x6250
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x16689(%rip), %rsi     # 0x24578
leaq 0x166cb(%rip), %rdx     # 0x245c1
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x24b70(%rip), %rsi     # 0x32a88
leaq 0xd24b(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xdf7d
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1667d(%rip), %rsi     # 0x245c2
leaq 0x166bd(%rip), %rdx     # 0x24609
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x24b1a(%rip), %rsi     # 0x32a88
leaq 0xd1f5(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xdf81
jmp 0xdfa0
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xdf99
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xdfa3
jmp 0xdfee
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xdfee
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xdfe5
movq -0x30(%rbp), %rsi
incq %rsi
jmp 0xdfcf
jmp 0xdfe2
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0x6210
jmp 0xdfe5
jmp 0xdfdd
movq %rax, %rbx
jmp 0xdff7
movq %rax, %rbx
jmp 0xdfee
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
leaq -0x60(%rbp), %rdi
callq 0x1a9f8
leaq -0x70(%rbp), %rdi
callq 0x1a128
movq %rbx, %rdi
callq 0x6410