// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x30, %rsp
cmpl $0x0, 0xb4(%rsi)
js 0x13e1a
movq %rsi, %rbx
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x13d56
cmpl $0x1, %eax
jne 0x13db4
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 0x13f20
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1fdd0(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x13d4b
cmpb $0x2a, (%rdi)
je 0x13e74
callq 0x6310
testl %eax, %eax
jne 0x13e74
leaq -0x50(%rbp), %rdi
callq 0x1acc4
jmp 0x13db4
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 0x13f25
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x1fe40(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
cmpq %rsi, %rdi
je 0x13dab
cmpb $0x2a, (%rdi)
je 0x13ecb
callq 0x6310
testl %eax, %eax
jne 0x13ecb
leaq -0x50(%rbp), %rdi
callq 0x1aef6
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1140d(%rip), %rsi     # 0x251e5
leaq 0x11409(%rip), %rdx     # 0x251e8
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 0x13e0d
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 0x11376(%rip), %rsi     # 0x251ad
leaq 0x113a6(%rip), %rdx     # 0x251e4
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1ec28(%rip), %rsi     # 0x32a88
leaq 0x75cf(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x13f20
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xf361(%rip), %rsi      # 0x231f2
leaq 0xf398(%rip), %rdx      # 0x23230
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1ebce(%rip), %rsi     # 0x32a88
leaq 0x7575(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x13f20
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xf38c(%rip), %rsi      # 0x23274
leaq 0xf3c0(%rip), %rdx      # 0x232af
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x1eb77(%rip), %rsi     # 0x32a88
leaq 0x751e(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
callq 0x6250
callq 0x6250
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x13f4a
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x13f4a
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x13f8b
movq %r14, %rdi
callq 0x6170
jmp 0x13f8b
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x13f79
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x13f79
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x13f99
movq %r14, %rdi
callq 0x6170
jmp 0x13f99
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0x13ff0
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1acc4
jmp 0x13ff0
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x13fc4
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x13fc4
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x13ff0
movq %r14, %rdi
callq 0x6170
jmp 0x13ff0
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x13ff0
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x13ff0
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410