// File: /workspace/github_cpp_makefile_star2_O3/zerolfx[P]P-Machine/dec.cpp
// Function: Dec::execute(StackMachine*)
void Dec::execute(StackMachine *stack)
{
	// check if the stack contains at least one entry
	if(stack->fSP < 0)
		throw ExecutionError("instruction dec: requires 1 stackelement to be present.");
		
	switch(fType)
	{
		case integer:
		{
			StackInteger p1;

			// check if the  uppermost stackentry is of type integer
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction dec: SP does not point to element of type integer.");

			break;
		}	
		case real:
		{
			StackReal p1;
			// check if the  uppermost stackentry is of type real
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction dec: SP does not point to element of type real.");

			break;
		}
		case boolean:
		{
			StackBoolean p1;
			// check if the  uppermost stackentry is of type boolean
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction dec: SP does not point to element of type boolean.");

			break;
		}
		case character:
		{
			StackCharacter p1;
			// check if the  uppermost stackentriy is of type character
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction dec: SP does not point to element of type character.");

			break;
		}
		case address:
		{
			StackAddress p1;
			// check if the uppermost stackentry is of type address
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction dec: SP does not point to element of type address.");

			break;
		}
	}
	
	// actual decrement
	stack->fStore[stack->fSP]->inc(fP);
	
	// adding cost of this instruction
	stack->fTime.count("dec");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpl $0x0, 0xb4(%rsi)
js 0x9084
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rdi), %eax
cmpq $0x4, %rax
ja 0x9017
leaq 0x1a69c(%rip), %rcx     # 0x234c4
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 0x929c
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2ad65(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x8e86
cmpb $0x2a, (%rdi)
je 0x918f
callq 0x6310
testl %eax, %eax
jne 0x918f
leaq -0x50(%rbp), %rdi
callq 0x1ac2a
jmp 0x9017
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 0x9292
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2aa9b(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x8ee8
cmpb $0x2a, (%rdi)
je 0x90dd
callq 0x6310
testl %eax, %eax
jne 0x90dd
leaq -0x50(%rbp), %rdi
callq 0x1a128
jmp 0x9017
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 0x9297
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2ad71(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x8f4a
cmpb $0x2a, (%rdi)
je 0x9136
callq 0x6310
testl %eax, %eax
jne 0x9136
leaq -0x50(%rbp), %rdi
callq 0x1ae64
jmp 0x9017
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 0x92a1
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2addc(%rip), %rcx     # 0x33d68
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x8faf
cmpb $0x2a, (%rdi)
je 0x91e8
callq 0x6310
testl %eax, %eax
jne 0x91e8
leaq -0x50(%rbp), %rdi
callq 0x1b060
jmp 0x9017
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 0x92a6
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2ab0d(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x900e
cmpb $0x2a, (%rdi)
je 0x923e
callq 0x6310
testl %eax, %eax
jne 0x923e
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
movl 0x8(%r14), %esi
movq (%rdi), %rax
callq *0x80(%rax)
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1a60d(%rip), %rsi     # 0x2364f
leaq 0x1a609(%rip), %rdx     # 0x23652
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 0x9077
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 0x1a43d(%rip), %rsi     # 0x234dd
leaq 0x1a46d(%rip), %rdx     # 0x23514
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x299bf(%rip), %rsi     # 0x32a88
leaq 0x1209a(%rip), %rdx     # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x9292
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a517(%rip), %rsi     # 0x23610
leaq 0x1a54e(%rip), %rdx     # 0x2364e
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x29966(%rip), %rsi     # 0x32a88
leaq 0x12041(%rip), %rdx     # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x9292
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a43e(%rip), %rsi     # 0x23590
leaq 0x1a475(%rip), %rdx     # 0x235ce
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x2990d(%rip), %rsi     # 0x32a88
leaq 0x11fe8(%rip), %rdx     # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x9292
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a3a9(%rip), %rsi     # 0x23554
leaq 0x1a3dd(%rip), %rdx     # 0x2358f
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x298b4(%rip), %rsi     # 0x32a88
leaq 0x11f8f(%rip), %rdx     # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x9292
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a3cb(%rip), %rsi     # 0x235cf
leaq 0x1a404(%rip), %rdx     # 0x2360f
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x2985b(%rip), %rsi     # 0x32a88
leaq 0x11f36(%rip), %rdx     # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x9292
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a2bb(%rip), %rsi     # 0x23515
leaq 0x1a2f2(%rip), %rdx     # 0x23553
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x29805(%rip), %rsi     # 0x32a88
leaq 0x11ee0(%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 0x92c3
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x92d0
jmp 0x9396
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x9396
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x92f5
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x9302
jmp 0x93b5
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x93b5
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x9327
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x9331
jmp 0x93a7
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x93a7
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x9353
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x935d
jmp 0x93c3
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x93c3
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x937f
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x9389
jmp 0x93d1
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x93d1
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
jmp 0x9425
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1ac2a
jmp 0x9425
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b060
jmp 0x9425
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1ae64
jmp 0x9425
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a128
jmp 0x9425
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x93f4
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x93fe
jmp 0x9425
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x9425
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x9425
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x9425
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410
nop