// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a3d0
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
callq 0x1aca0
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xdfde
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x25b1a(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xde69
cmpb $0x2a, (%rdi)
je 0xdfe3
callq 0x6310
testl %eax, %eax
jne 0xdfe3
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xdfde
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x25c74(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xdea7
cmpb $0x2a, (%rdi)
je 0xe03a
callq 0x6310
testl %eax, %eax
jne 0xe03a
movl 0x8(%r14), %esi
leaq -0x50(%rbp), %rdi
callq 0x1aca0
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 0xdf14
movq %r14, %rdi
callq 0x1a5cc
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 0xdf3d
movq %r14, %rdi
callq 0x1a5cc
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 0x1a3d0
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq %r14, (%rcx,%rax,8)
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x16689(%rip), %rsi     # 0x2460a
leaq 0x16685(%rip), %rdx     # 0x2460d
leaq -0x40(%rbp), %rdi
callq 0x746c
addq $0x78, %rbx
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x1ce78
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xdfb6
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
leaq -0x50(%rbp), %rdi
callq 0x1acc4
leaq -0x60(%rbp), %rdi
callq 0x1acc4
leaq -0x70(%rbp), %rdi
callq 0x1a3f4
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), %r12
movq %r12, -0x10(%r12)
leaq 0x16578(%rip), %rsi     # 0x24578
leaq 0x165ba(%rip), %rdx     # 0x245c1
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x24a5f(%rip), %rsi     # 0x32a88
leaq 0xd406(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xe08f
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1656b(%rip), %rsi     # 0x245c2
leaq 0x165ab(%rip), %rdx     # 0x24609
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x24a08(%rip), %rsi     # 0x32a88
leaq 0xd3af(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xe093
jmp 0xe0ad
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xe0b3
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xe0b3
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xe103
movq %r14, %rdi
callq 0x6170
jmp 0xe103
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xe0fa
movq -0x30(%rbp), %rsi
incq %rsi
jmp 0xe0e4
jmp 0xe0f7
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0x6210
jmp 0xe0fa
jmp 0xe0f2
movq %rax, %rbx
jmp 0xe10c
movq %rax, %rbx
jmp 0xe103
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1acc4
leaq -0x60(%rbp), %rdi
callq 0x1acc4
leaq -0x70(%rbp), %rdi
callq 0x1a3f4
movq %rbx, %rdi
callq 0x6410
nop