// File: /workspace/github_cpp_makefile_star2_O1/zerolfx[P]P-Machine/geq.cpp
// Function: Geq::execute(StackMachine*)
void Geq::execute(StackMachine *stack) 
{
	// check if the stack contains at least two entries
	if(stack->fSP < 1)
		throw ExecutionError("instruction geq: requires 2 stackelements to be present.");

	switch(fType)
	{
		case integer:
		{
			StackInteger p1;

			// check if the two uppermost stackentries are of type integer
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction geq: SP does not point to element of type integer.");
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP - 1])))
				throw ExecutionError("instruction geq: SP - 1 does not point to element of type integer.");

			break;
		}	
		case real:
		{
			StackReal p1;
			// check if the two uppermost stackentries are of type real
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction geq: SP does not point to element of type real.");
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP - 1])))
				throw ExecutionError("instruction geq: SP - 1 does not point to element of type real.");
			break;
		}
		case boolean:
		{
			StackBoolean p1;
			// check if the two uppermost stackentries are of type real
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction geq: SP does not point to element of type boolean.");
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP - 1])))
				throw ExecutionError("instruction geq: SP - 1 does not point to element of type boolean.");
			break;
		}

		case character:
		{
			StackCharacter p1;
			// check if the two uppermost stackentries are of type real
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction geq: SP does not point to element of type character.");
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP - 1])))
				throw ExecutionError("instruction geq: SP - 1 does not point to element of type character.");
			break;
		}
		case address:
		{
			StackAddress p1;
			// check if the two uppermost stackentries are of type real
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
				throw ExecutionError("instruction geq: SP does not point to element of type address.");
			if(typeid(p1) != typeid(*(stack->fStore[stack->fSP - 1])))
				throw ExecutionError("instruction geq: SP - 1 does not point to element of type address.");
			break;
		}

	}
		
	// compare
	StackBoolean *result;
	if(*(stack->fStore[stack->fSP - 1]) >= *(stack->fStore[stack->fSP]))
		result = new StackBoolean(true);
	else
		result = new StackBoolean(false);
		
	// remove operands
	delete stack->fStore[stack->fSP];
	stack->fStore[stack->fSP] = 0;
	delete stack->fStore[stack->fSP - 1];
	stack->fStore[stack->fSP - 1] = 0;
	stack->fStore.pop_back();
	stack->fStore.pop_back();
	--stack->fSP;

	// put result on top of stack
	stack->fStore.push_back(result);
	
	// adding cost of this instruction
	stack->fTime.count("geq");

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpl $0x0, 0xb4(%rsi)
jle 0xb991
movq %rsi, %rbx
movl 0x8(%rdi), %eax
cmpq $0x4, %rax
ja 0xb865
leaq 0x18701(%rip), %rcx     # 0x23c48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x50(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x1aec8
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9fa
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x28646(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb5a9
cmpb $0x2a, (%r14)
je 0xbab8
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbab8
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9fa
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb5e1
cmpb $0x2a, (%r14)
je 0xbc7a
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbc7a
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0xb865
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1a3d0
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9eb
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x28340(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb647
cmpb $0x2a, (%r14)
je 0xba04
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xba04
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9eb
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb67f
cmpb $0x2a, (%r14)
je 0xbbc6
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbbc6
leaq -0x50(%rbp), %rdi
callq 0x1a3f4
jmp 0xb865
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1b10c
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9f0
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x285da(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb6e5
cmpb $0x2a, (%r14)
je 0xba5e
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xba5e
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9f0
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb71d
cmpb $0x2a, (%r14)
je 0xbc20
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbc20
leaq -0x50(%rbp), %rdi
callq 0x1b130
jmp 0xb865
leaq -0x50(%rbp), %rdi
movl $0x61, %esi
callq 0x1b308
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9f5
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x28609(%rip), %rcx     # 0x33d68
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb786
cmpb $0x2a, (%r14)
je 0xbb12
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbb12
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9f5
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb7be
cmpb $0x2a, (%r14)
je 0xbcd4
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbcd4
leaq -0x50(%rbp), %rdi
callq 0x1b32c
jmp 0xb865
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1aca0
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9ff
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x282fb(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb824
cmpb $0x2a, (%r14)
je 0xbb6c
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbb6c
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb9ff
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb85c
cmpb $0x2a, (%r14)
je 0xbd2b
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbd2b
leaq -0x50(%rbp), %rdi
callq 0x1acc4
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movq (%rcx,%rax,8), %rsi
callq 0x1abf1
movl %eax, %r15d
movl $0x10, %edi
callq 0x6200
movq %rax, %r14
testb %r15b, %r15b
je 0xb8a2
movq %r14, %rdi
movl $0x1, %esi
callq 0x1b10c
jmp 0xb8ac
movq %r14, %rdi
xorl %esi, %esi
callq 0x1b10c
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %r15
testq %r15, %r15
je 0xb8d5
movq %r15, %rdi
callq 0x1a5cc
movl $0x8, %esi
movq %r15, %rdi
callq 0x6210
leaq 0x18(%rbx), %r15
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %r12
testq %r12, %r12
je 0xb90f
movq %r12, %rdi
callq 0x1a5cc
movl $0x8, %esi
movq %r12, %rdi
callq 0x6210
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq $0x0, -0x8(%rcx,%rax,8)
addq $-0x10, 0x20(%rbx)
decq %rax
movl %eax, 0xb4(%rbx)
leaq -0x40(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, %rdi
callq 0xa3ae
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x185d3(%rip), %rsi     # 0x23f22
leaq 0x185cf(%rip), %rdx     # 0x23f25
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 0xb984
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 0x182b3(%rip), %rsi     # 0x23c61
leaq 0x182e4(%rip), %rdx     # 0x23c99
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x270b1(%rip), %rsi     # 0x32a88
leaq 0xfa58(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
callq 0x6250
callq 0x6250
callq 0x6250
callq 0x6250
callq 0x6250
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1847f(%rip), %rsi     # 0x23ea0
leaq 0x184b6(%rip), %rdx     # 0x23ede
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x2703e(%rip), %rsi     # 0x32a88
leaq 0xf9e5(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1831d(%rip), %rsi     # 0x23d98
leaq 0x18354(%rip), %rdx     # 0x23dd6
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26fe4(%rip), %rsi     # 0x32a88
leaq 0xf98b(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x18247(%rip), %rsi     # 0x23d1c
leaq 0x1827b(%rip), %rdx     # 0x23d57
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26f8a(%rip), %rsi     # 0x32a88
leaq 0xf931(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x182eb(%rip), %rsi     # 0x23e1a
leaq 0x18324(%rip), %rdx     # 0x23e5a
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26f30(%rip), %rsi     # 0x32a88
leaq 0xf8d7(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x18111(%rip), %rsi     # 0x23c9a
leaq 0x18148(%rip), %rdx     # 0x23cd8
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26ed6(%rip), %rsi     # 0x32a88
leaq 0xf87d(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x182fc(%rip), %rsi     # 0x23edf
leaq 0x18337(%rip), %rdx     # 0x23f21
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26e7c(%rip), %rsi     # 0x32a88
leaq 0xf823(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1819a(%rip), %rsi     # 0x23dd7
leaq 0x181d5(%rip), %rdx     # 0x23e19
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26e22(%rip), %rsi     # 0x32a88
leaq 0xf7c9(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x180c1(%rip), %rsi     # 0x23d58
leaq 0x180f9(%rip), %rdx     # 0x23d97
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26dc8(%rip), %rsi     # 0x32a88
leaq 0xf76f(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1816a(%rip), %rsi     # 0x23e5b
leaq 0x181a7(%rip), %rdx     # 0x23e9f
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26d6e(%rip), %rsi     # 0x32a88
leaq 0xf715(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbd80
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x17f91(%rip), %rsi     # 0x23cd9
leaq 0x17fcc(%rip), %rdx     # 0x23d1b
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x26d17(%rip), %rsi     # 0x32a88
leaq 0xf6be(%rip), %rdx      # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0xbda6
jmp 0xbdc0
jmp 0xbddc
jmp 0xbdf6
jmp 0xbe12
jmp 0xbe2c
jmp 0xbe41
jmp 0xbe5b
jmp 0xbe70
jmp 0xbe8a
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xbdc6
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xbdc6
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xbea2
movq %r14, %rdi
callq 0x6170
jmp 0xbea2
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xbdfc
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xbdfc
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xbec4
movq %r14, %rdi
callq 0x6170
jmp 0xbec4
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xbe32
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xbe32
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xbeb3
movq %r14, %rdi
callq 0x6170
jmp 0xbeb3
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xbe61
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xbe61
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xbed2
movq %r14, %rdi
callq 0x6170
jmp 0xbed2
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xbe90
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xbe90
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xbee0
movq %r14, %rdi
callq 0x6170
jmp 0xbee0
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1acc4
jmp 0xbf46
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1aef6
jmp 0xbf46
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b32c
jmp 0xbf46
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b130
jmp 0xbf46
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a3f4
jmp 0xbf46
jmp 0xbeed
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
jmp 0xbf3c
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xbf1a
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xbf1a
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0xbf46
movq %r14, %rdi
callq 0x6170
jmp 0xbf46
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xbf46
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xbf46
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410