// File: /workspace/github_cpp_makefile_star2_O1/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 0x169ad
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rdi), %eax
cmpq $0x4, %rax
ja 0x16909
leaq 0xf23e(%rip), %rcx      # 0x25958
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x50(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x1aec8
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16c7f
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d473(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x16778
cmpb $0x2a, (%rdi)
je 0x16b6f
callq 0x6310
testl %eax, %eax
jne 0x16b6f
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0x16909
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1a3d0
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16c75
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d1a9(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x167da
cmpb $0x2a, (%rdi)
je 0x16abb
callq 0x6310
testl %eax, %eax
jne 0x16abb
leaq -0x50(%rbp), %rdi
callq 0x1a3f4
jmp 0x16909
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1b10c
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16c7a
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d47f(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x1683c
cmpb $0x2a, (%rdi)
je 0x16b15
callq 0x6310
testl %eax, %eax
jne 0x16b15
leaq -0x50(%rbp), %rdi
callq 0x1b130
jmp 0x16909
leaq -0x50(%rbp), %rdi
movl $0x61, %esi
callq 0x1b308
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16c84
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d4ea(%rip), %rcx     # 0x33d68
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x168a1
cmpb $0x2a, (%rdi)
je 0x16bc9
callq 0x6310
testl %eax, %eax
jne 0x16bc9
leaq -0x50(%rbp), %rdi
callq 0x1b32c
jmp 0x16909
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1aca0
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x16c89
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1d21b(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x16900
cmpb $0x2a, (%rdi)
je 0x16c20
callq 0x6310
testl %eax, %eax
jne 0x16c20
leaq -0x50(%rbp), %rdi
callq 0x1acc4
movslq 0xc(%r14), %rax
testq %rax, %rax
js 0x1692e
movl 0xb4(%rbx), %ecx
cmpl %ecx, %eax
jg 0x16a07
movq 0x18(%rbx), %rdx
movq (%rdx,%rcx,8), %rcx
movq %rcx, (%rdx,%rax,8)
jmp 0x16951
cmpl 0xb8(%rbx), %eax
jl 0x16a61
movslq 0xb4(%rbx), %rcx
movq 0x18(%rbx), %rdx
movq 0x30(%rbx), %rsi
movq (%rdx,%rcx,8), %rcx
movq %rcx, (%rsi,%rax,8)
addq $-0x8, 0x20(%rbx)
decl 0xb4(%rbx)
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xf188(%rip), %rsi      # 0x25af3
leaq 0xf184(%rip), %rdx      # 0x25af6
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 0x169a0
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), %r12
movq %r12, -0x10(%r12)
leaq 0xefa7(%rip), %rsi      # 0x25971
leaq 0xefe7(%rip), %rdx      # 0x259b8
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1c095(%rip), %rsi     # 0x32a88
leaq 0x4a3c(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x16c75
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xda07(%rip), %rsi      # 0x2442b
leaq 0xda27(%rip), %rdx      # 0x24452
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1c03b(%rip), %rsi     # 0x32a88
leaq 0x49e2(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x16c75
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xd986(%rip), %rsi      # 0x24404
leaq 0xd9a5(%rip), %rdx      # 0x2442a
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1bfe1(%rip), %rsi     # 0x32a88
leaq 0x4988(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x16c75
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xefdc(%rip), %rsi      # 0x25ab4
leaq 0xf013(%rip), %rdx      # 0x25af2
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1bf87(%rip), %rsi     # 0x32a88
leaq 0x492e(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x16c75
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xef02(%rip), %rsi      # 0x25a34
leaq 0xef39(%rip), %rdx      # 0x25a72
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1bf2d(%rip), %rsi     # 0x32a88
leaq 0x48d4(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x16c75
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xee6c(%rip), %rsi      # 0x259f8
leaq 0xeea0(%rip), %rdx      # 0x25a33
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1bed3(%rip), %rsi     # 0x32a88
leaq 0x487a(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x16c75
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xee8d(%rip), %rsi      # 0x25a73
leaq 0xeec6(%rip), %rdx      # 0x25ab3
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1be79(%rip), %rsi     # 0x32a88
leaq 0x4820(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x16c75
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xed7c(%rip), %rsi      # 0x259b9
leaq 0xedb3(%rip), %rdx      # 0x259f7
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1be22(%rip), %rsi     # 0x32a88
leaq 0x47c9(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
callq 0x6250
callq 0x6250
callq 0x6250
callq 0x6250
callq 0x6250
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x16cae
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x16cae
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x16d8a
movq %r14, %rdi
callq 0x6170
jmp 0x16d8a
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x16ce4
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x16ce4
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x16da9
movq %r14, %rdi
callq 0x6170
jmp 0x16da9
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x16d1a
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x16d1a
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x16d9b
movq %r14, %rdi
callq 0x6170
jmp 0x16d9b
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x16d49
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x16d49
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x16db7
movq %r14, %rdi
callq 0x6170
jmp 0x16db7
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x16d78
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x16d78
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x16dc5
movq %r14, %rdi
callq 0x6170
jmp 0x16dc5
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1acc4
jmp 0x16e24
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0x16e24
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b32c
jmp 0x16e24
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b130
jmp 0x16e24
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a3f4
jmp 0x16e24
jmp 0x16dd8
jmp 0x16df2
jmp 0x16dd8
jmp 0x16df2
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x16df8
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x16df8
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x16e24
movq %r14, %rdi
callq 0x6170
jmp 0x16e24
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x16e24
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x16e24
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410