// File: /workspace/github_cpp_makefile_star2_O1/zerolfx[P]P-Machine/inc.cpp
// Function: Inc::execute(StackMachine*)
void Inc::execute(StackMachine *stack)
{
	// check if the stack contains at least one entry
	
	if(stack->fSP < 0)
		throw ExecutionError("instruction inc: 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 inc: 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 inc: 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 inc: 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 inc: 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 inc: SP does not point to element of type address.");

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

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpl $0x0, 0xb4(%rsi)
js 0xcee2
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rdi), %eax
cmpq $0x4, %rax
ja 0xce75
leaq 0x17592(%rip), %rcx     # 0x24218
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 0xd100
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26f07(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xcce4
cmpb $0x2a, (%rdi)
je 0xcff0
callq 0x6310
testl %eax, %eax
jne 0xcff0
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0xce75
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 0xd0f6
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26c3d(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xcd46
cmpb $0x2a, (%rdi)
je 0xcf3c
callq 0x6310
testl %eax, %eax
jne 0xcf3c
leaq -0x50(%rbp), %rdi
callq 0x1a3f4
jmp 0xce75
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 0xd0fb
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26f13(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xcda8
cmpb $0x2a, (%rdi)
je 0xcf96
callq 0x6310
testl %eax, %eax
jne 0xcf96
leaq -0x50(%rbp), %rdi
callq 0x1b130
jmp 0xce75
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 0xd105
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26f7e(%rip), %rcx     # 0x33d68
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xce0d
cmpb $0x2a, (%rdi)
je 0xd04a
callq 0x6310
testl %eax, %eax
jne 0xd04a
leaq -0x50(%rbp), %rdi
callq 0x1b32c
jmp 0xce75
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 0xd10a
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26caf(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xce6c
cmpb $0x2a, (%rdi)
je 0xd0a1
callq 0x6310
testl %eax, %eax
jne 0xd0a1
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 0x17503(%rip), %rsi     # 0x243a3
leaq 0x174ff(%rip), %rdx     # 0x243a6
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 0xced5
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 0x17332(%rip), %rsi     # 0x24231
leaq 0x17362(%rip), %rdx     # 0x24268
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x25b60(%rip), %rsi     # 0x32a88
leaq 0xe507(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xd0f6
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1740b(%rip), %rsi     # 0x24364
leaq 0x17442(%rip), %rdx     # 0x243a2
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x25b06(%rip), %rsi     # 0x32a88
leaq 0xe4ad(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xd0f6
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x17331(%rip), %rsi     # 0x242e4
leaq 0x17368(%rip), %rdx     # 0x24322
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x25aac(%rip), %rsi     # 0x32a88
leaq 0xe453(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xd0f6
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1729b(%rip), %rsi     # 0x242a8
leaq 0x172cf(%rip), %rdx     # 0x242e3
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x25a52(%rip), %rsi     # 0x32a88
leaq 0xe3f9(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xd0f6
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x172bc(%rip), %rsi     # 0x24323
leaq 0x172f5(%rip), %rdx     # 0x24363
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x259f8(%rip), %rsi     # 0x32a88
leaq 0xe39f(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xd0f6
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x171ab(%rip), %rsi     # 0x24269
leaq 0x171e2(%rip), %rdx     # 0x242a7
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x259a1(%rip), %rsi     # 0x32a88
leaq 0xe348(%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 0xd12f
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xd12f
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xd20b
movq %r14, %rdi
callq 0x6170
jmp 0xd20b
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xd165
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xd165
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xd22a
movq %r14, %rdi
callq 0x6170
jmp 0xd22a
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xd19b
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xd19b
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xd21c
movq %r14, %rdi
callq 0x6170
jmp 0xd21c
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xd1ca
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xd1ca
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xd238
movq %r14, %rdi
callq 0x6170
jmp 0xd238
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xd1f9
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xd1f9
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xd246
movq %r14, %rdi
callq 0x6170
jmp 0xd246
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1acc4
jmp 0xd29d
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0xd29d
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b32c
jmp 0xd29d
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b130
jmp 0xd29d
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a3f4
jmp 0xd29d
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xd271
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xd271
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xd29d
movq %r14, %rdi
callq 0x6170
jmp 0xd29d
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xd29d
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xd29d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410
nop