// File: /workspace/github_cpp_makefile_star2_O3/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 0xce0e
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rdi), %eax
cmpq $0x4, %rax
ja 0xcda1
leaq 0x17666(%rip), %rcx     # 0x24218
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 0xd026
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26fdb(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xcc10
cmpb $0x2a, (%rdi)
je 0xcf19
callq 0x6310
testl %eax, %eax
jne 0xcf19
leaq -0x50(%rbp), %rdi
callq 0x1ac2a
jmp 0xcda1
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 0xd01c
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26d11(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xcc72
cmpb $0x2a, (%rdi)
je 0xce67
callq 0x6310
testl %eax, %eax
jne 0xce67
leaq -0x50(%rbp), %rdi
callq 0x1a128
jmp 0xcda1
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 0xd021
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26fe7(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xccd4
cmpb $0x2a, (%rdi)
je 0xcec0
callq 0x6310
testl %eax, %eax
jne 0xcec0
leaq -0x50(%rbp), %rdi
callq 0x1ae64
jmp 0xcda1
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 0xd02b
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x27052(%rip), %rcx     # 0x33d68
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xcd39
cmpb $0x2a, (%rdi)
je 0xcf72
callq 0x6310
testl %eax, %eax
jne 0xcf72
leaq -0x50(%rbp), %rdi
callq 0x1b060
jmp 0xcda1
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 0xd030
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x26d83(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0xcd98
cmpb $0x2a, (%rdi)
je 0xcfc8
callq 0x6310
testl %eax, %eax
jne 0xcfc8
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 0x175d7(%rip), %rsi     # 0x243a3
leaq 0x175d3(%rip), %rdx     # 0x243a6
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 0xce01
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 0x17407(%rip), %rsi     # 0x24231
leaq 0x17437(%rip), %rdx     # 0x24268
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x25c35(%rip), %rsi     # 0x32a88
leaq 0xe310(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xd01c
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x174e1(%rip), %rsi     # 0x24364
leaq 0x17518(%rip), %rdx     # 0x243a2
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x25bdc(%rip), %rsi     # 0x32a88
leaq 0xe2b7(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xd01c
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x17408(%rip), %rsi     # 0x242e4
leaq 0x1743f(%rip), %rdx     # 0x24322
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x25b83(%rip), %rsi     # 0x32a88
leaq 0xe25e(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xd01c
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x17373(%rip), %rsi     # 0x242a8
leaq 0x173a7(%rip), %rdx     # 0x242e3
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x25b2a(%rip), %rsi     # 0x32a88
leaq 0xe205(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xd01c
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x17395(%rip), %rsi     # 0x24323
leaq 0x173ce(%rip), %rdx     # 0x24363
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x25ad1(%rip), %rsi     # 0x32a88
leaq 0xe1ac(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xd01c
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x17285(%rip), %rsi     # 0x24269
leaq 0x172bc(%rip), %rdx     # 0x242a7
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x25a7b(%rip), %rsi     # 0x32a88
leaq 0xe156(%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 0xd04d
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xd05a
jmp 0xd120
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xd120
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xd07f
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xd08c
jmp 0xd13f
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xd13f
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xd0b1
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xd0bb
jmp 0xd131
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xd131
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xd0dd
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xd0e7
jmp 0xd14d
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xd14d
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xd109
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xd113
jmp 0xd15b
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xd15b
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
jmp 0xd1af
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1ac2a
jmp 0xd1af
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b060
jmp 0xd1af
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1ae64
jmp 0xd1af
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a128
jmp 0xd1af
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xd17e
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xd188
jmp 0xd1af
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xd1af
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xd1af
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xd1af
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410
nop