// File: /workspace/github_cpp_makefile_star2_O3/zerolfx[P]P-Machine/sro.cpp
// Function: Sro::execute(StackMachine*)
void Sro::execute(StackMachine *stack)
{
	if(stack->fSP < 1)
		throw ExecutionError("instruction sro: at least 1 stackelement is required for this operation");

				
	switch(fType)
	{
		case integer:
		{
			StackInteger p1;

			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sro: type pointed to by SP is not of type integer.");
			}
				
			break;
		}	
		case real:
		{
			StackReal p1;

			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sro: type pointed to by SP is not of type real.");
			}

			break;
		}
		case boolean:
		{
			StackBoolean p1;
			
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sro: type pointed to by SP is not of type boolean.");
			}

			break;
		}
		case character:
		{
			StackCharacter p1;
			
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sro: type pointed to by SP is not of type character.");
			}


			break;
		}
		case address:
		{
			StackAddress p1;

			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
			{
				throw ExecutionError("instruction sro: type pointed to by SP is not of type address.");
			}
				
			break;
		}
	}
	
	if(fQ < 0)
	{
		// address on the heap
		if(fQ < stack->fNP)
			throw ExecutionError("instruction ind: invalid heap address.");
		else
		{
			stack->fHeap[fQ] = stack->fStore[stack->fSP];
		}
	}
	else
	{
		// address on the stack
		if(fQ > stack->fSP)
			throw ExecutionError("instruction ind: invalid stack address.");
		else
		{
			stack->fStore[fQ] = stack->fStore[stack->fSP];
		}
	}
	
	stack->fStore.pop_back();

	--stack->fSP;
	
	// adding cost of this instruction
	stack->fTime.count("sro");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpl $0x0, 0xb4(%rsi)
jle 0x1678b
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rdi), %eax
cmpq $0x4, %rax
ja 0x166e5
leaq 0xf462(%rip), %rcx      # 0x25958
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x50(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x1abfc
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16a55
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d697(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x16554
cmpb $0x2a, (%rdi)
je 0x16948
callq 0x6310
testl %eax, %eax
jne 0x16948
leaq -0x50(%rbp), %rdi
callq 0x1ac2a
jmp 0x166e5
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1a104
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16a4b
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d3cd(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x165b6
cmpb $0x2a, (%rdi)
je 0x16896
callq 0x6310
testl %eax, %eax
jne 0x16896
leaq -0x50(%rbp), %rdi
callq 0x1a128
jmp 0x166e5
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1ae40
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16a50
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d6a3(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x16618
cmpb $0x2a, (%rdi)
je 0x168ef
callq 0x6310
testl %eax, %eax
jne 0x168ef
leaq -0x50(%rbp), %rdi
callq 0x1ae64
jmp 0x166e5
leaq -0x50(%rbp), %rdi
movl $0x61, %esi
callq 0x1b03c
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16a5a
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d70e(%rip), %rcx     # 0x33d68
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x1667d
cmpb $0x2a, (%rdi)
je 0x169a1
callq 0x6310
testl %eax, %eax
jne 0x169a1
leaq -0x50(%rbp), %rdi
callq 0x1b060
jmp 0x166e5
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1a9d4
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16a5f
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d43f(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x166dc
cmpb $0x2a, (%rdi)
je 0x169f7
callq 0x6310
testl %eax, %eax
jne 0x169f7
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
movslq 0xc(%r14), %rax
testq %rax, %rax
js 0x1670a
movl 0xb4(%rbx), %ecx
cmpl %ecx, %eax
jg 0x167e4
movq 0x18(%rbx), %rdx
movq (%rdx,%rcx,8), %rsi
movq %rsi, (%rdx,%rax,8)
jmp 0x1672d
cmpl 0xb8(%rbx), %eax
jl 0x1683d
movslq 0xb4(%rbx), %rcx
movq 0x18(%rbx), %rdx
movq 0x30(%rbx), %rsi
movq (%rdx,%rcx,8), %rdx
movq %rdx, (%rsi,%rax,8)
addq $-0x8, 0x20(%rbx)
decl %ecx
movl %ecx, 0xb4(%rbx)
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xf3aa(%rip), %rsi      # 0x25af3
leaq 0xf3a6(%rip), %rdx      # 0x25af6
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 0x1677e
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xf1ca(%rip), %rsi      # 0x25971
leaq 0xf20a(%rip), %rdx      # 0x259b8
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1c2b8(%rip), %rsi     # 0x32a88
leaq 0x4993(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x16a4b
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xdc2b(%rip), %rsi      # 0x2442b
leaq 0xdc4b(%rip), %rdx      # 0x24452
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1c25f(%rip), %rsi     # 0x32a88
leaq 0x493a(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x16a4b
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xdbab(%rip), %rsi      # 0x24404
leaq 0xdbca(%rip), %rdx      # 0x2442a
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1c206(%rip), %rsi     # 0x32a88
leaq 0x48e1(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x16a4b
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xf202(%rip), %rsi      # 0x25ab4
leaq 0xf239(%rip), %rdx      # 0x25af2
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1c1ad(%rip), %rsi     # 0x32a88
leaq 0x4888(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x16a4b
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xf129(%rip), %rsi      # 0x25a34
leaq 0xf160(%rip), %rdx      # 0x25a72
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1c154(%rip), %rsi     # 0x32a88
leaq 0x482f(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x16a4b
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xf094(%rip), %rsi      # 0x259f8
leaq 0xf0c8(%rip), %rdx      # 0x25a33
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1c0fb(%rip), %rsi     # 0x32a88
leaq 0x47d6(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x16a4b
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xf0b6(%rip), %rsi      # 0x25a73
leaq 0xf0ef(%rip), %rdx      # 0x25ab3
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1c0a2(%rip), %rsi     # 0x32a88
leaq 0x477d(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x16a4b
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xefa6(%rip), %rsi      # 0x259b9
leaq 0xefdd(%rip), %rdx      # 0x259f7
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1c04c(%rip), %rsi     # 0x32a88
leaq 0x4727(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
callq 0x6250
callq 0x6250
callq 0x6250
callq 0x6250
callq 0x6250
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x16a7c
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x16a89
jmp 0x16b4f
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x16b4f
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x16aae
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x16abb
jmp 0x16b6e
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x16b6e
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x16ae0
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x16aea
jmp 0x16b60
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x16b60
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x16b0c
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x16b16
jmp 0x16b7c
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x16b7c
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x16b38
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x16b42
jmp 0x16b8a
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x16b8a
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
jmp 0x16be6
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1ac2a
jmp 0x16be6
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b060
jmp 0x16be6
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1ae64
jmp 0x16be6
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a128
jmp 0x16be6
jmp 0x16b9d
jmp 0x16bbc
jmp 0x16b9d
jmp 0x16bbc
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x16bb5
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x16bbf
jmp 0x16be6
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x16be6
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x16be6
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x16be6
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410