// File: /workspace/github_cpp_makefile_star2_O2/zerolfx[P]P-Machine/neg.cpp
// Function: Neg::execute(StackMachine*)
void Neg::execute(StackMachine *stack) 
{
	// check if the stack contains at least one entry
	if(stack->fSP < 0)
		throw ExecutionError("instruction neg: 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 add: 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 add: SP does not point to element of type real.");
				
			break;
		}
	}
	
	// actual operation
	stack->fStore[stack->fSP]->neg();
	
	// adding cost of this instruction
	stack->fTime.count("neg");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
cmpl $0x0, 0xb4(%rsi)
js 0x11ba1
movq %rsi, %rbx
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x11b0c
cmpl $0x1, %eax
jne 0x11b54
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x175ac
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x11bed
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x1d004(%rip), %rdi     # 0x2eaf8
callq 0x76ba
testb %al, %al
jne 0x11bf7
leaq -0x30(%rbp), %rdi
callq 0x175d0
jmp 0x11b54
leaq -0x30(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x177d4
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x11bf2
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x1d08a(%rip), %rdi     # 0x2ebc8
callq 0x76ba
testb %al, %al
jne 0x11c40
leaq -0x30(%rbp), %rdi
callq 0x17802
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
leaq 0xe675(%rip), %rsi      # 0x201e5
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x72a6
addq $0x78, %rbx
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x1925e
leaq -0x50(%rbp), %rdi
callq 0x60d0
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0xe5fa(%rip), %rsi      # 0x201ad
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x1beaf(%rip), %rsi     # 0x2da88
leaq 0x613a(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0x11c87
callq 0x6220
callq 0x6220
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0xc5e9(%rip), %rsi      # 0x1e1f2
leaq -0x50(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x1be59(%rip), %rsi     # 0x2da88
leaq 0x60e4(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0x11c87
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0xc622(%rip), %rsi      # 0x1e274
leaq -0x50(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x1be10(%rip), %rsi     # 0x2da88
leaq 0x609b(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0x11c9d
jmp 0x11cca
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0x11cca
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0x11cbd
jmp 0x11cd8
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0x11cd8
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x17802
jmp 0x11d14
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x175d0
jmp 0x11d14
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0x11cf9
jmp 0x11d14
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0x11d14
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x60d0
jmp 0x11d14
movq %rax, %rbx
movq %rbx, %rdi
callq 0x63f0