// File: /workspace/github_cpp_makefile_star2_O1/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 0x90a8
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rdi), %eax
cmpq $0x4, %rax
ja 0x903b
leaq 0x1a678(%rip), %rcx     # 0x234c4
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 0x92c6
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2ad41(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x8eaa
cmpb $0x2a, (%rdi)
je 0x91b6
callq 0x6310
testl %eax, %eax
jne 0x91b6
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0x903b
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 0x92bc
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2aa77(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x8f0c
cmpb $0x2a, (%rdi)
je 0x9102
callq 0x6310
testl %eax, %eax
jne 0x9102
leaq -0x50(%rbp), %rdi
callq 0x1a3f4
jmp 0x903b
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 0x92c1
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2ad4d(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x8f6e
cmpb $0x2a, (%rdi)
je 0x915c
callq 0x6310
testl %eax, %eax
jne 0x915c
leaq -0x50(%rbp), %rdi
callq 0x1b130
jmp 0x903b
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 0x92cb
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2adb8(%rip), %rcx     # 0x33d68
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x8fd3
cmpb $0x2a, (%rdi)
je 0x9210
callq 0x6310
testl %eax, %eax
jne 0x9210
leaq -0x50(%rbp), %rdi
callq 0x1b32c
jmp 0x903b
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 0x92d0
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2aae9(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x9032
cmpb $0x2a, (%rdi)
je 0x9267
callq 0x6310
testl %eax, %eax
jne 0x9267
leaq -0x50(%rbp), %rdi
callq 0x1acc4
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 0x1a5e9(%rip), %rsi     # 0x2364f
leaq 0x1a5e5(%rip), %rdx     # 0x23652
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 0x909b
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 0x1a418(%rip), %rsi     # 0x234dd
leaq 0x1a448(%rip), %rdx     # 0x23514
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x2999a(%rip), %rsi     # 0x32a88
leaq 0x12341(%rip), %rdx     # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x92bc
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1a4f1(%rip), %rsi     # 0x23610
leaq 0x1a528(%rip), %rdx     # 0x2364e
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x29940(%rip), %rsi     # 0x32a88
leaq 0x122e7(%rip), %rdx     # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x92bc
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1a417(%rip), %rsi     # 0x23590
leaq 0x1a44e(%rip), %rdx     # 0x235ce
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x298e6(%rip), %rsi     # 0x32a88
leaq 0x1228d(%rip), %rdx     # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x92bc
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1a381(%rip), %rsi     # 0x23554
leaq 0x1a3b5(%rip), %rdx     # 0x2358f
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x2988c(%rip), %rsi     # 0x32a88
leaq 0x12233(%rip), %rdx     # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x92bc
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1a3a2(%rip), %rsi     # 0x235cf
leaq 0x1a3db(%rip), %rdx     # 0x2360f
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x29832(%rip), %rsi     # 0x32a88
leaq 0x121d9(%rip), %rdx     # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x92bc
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1a291(%rip), %rsi     # 0x23515
leaq 0x1a2c8(%rip), %rdx     # 0x23553
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x297db(%rip), %rsi     # 0x32a88
leaq 0x12182(%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 0x92f5
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x92f5
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x93d1
movq %r14, %rdi
callq 0x6170
jmp 0x93d1
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x932b
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x932b
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x93f0
movq %r14, %rdi
callq 0x6170
jmp 0x93f0
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x9361
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x9361
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x93e2
movq %r14, %rdi
callq 0x6170
jmp 0x93e2
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x9390
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x9390
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x93fe
movq %r14, %rdi
callq 0x6170
jmp 0x93fe
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x93bf
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x93bf
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x940c
movq %r14, %rdi
callq 0x6170
jmp 0x940c
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1acc4
jmp 0x9463
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0x9463
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b32c
jmp 0x9463
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b130
jmp 0x9463
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a3f4
jmp 0x9463
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x9437
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x9437
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x9463
movq %r14, %rdi
callq 0x6170
jmp 0x9463
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x9463
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x9463
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410
nop