// File: /workspace/github_cpp_makefile_star2_O3/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 0xb8fd
movq %rsi, %rbx
movl 0x8(%rdi), %eax
cmpq $0x4, %rax
ja 0xb7d1
leaq 0x18795(%rip), %rcx     # 0x23c48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x50(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x1abfc
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb965
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x286da(%rip), %rcx     # 0x33bc8
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb515
cmpb $0x2a, (%r14)
je 0xba21
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xba21
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb965
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb54d
cmpb $0x2a, (%r14)
je 0xbbde
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbbde
leaq -0x50(%rbp), %rdi
callq 0x1ac2a
jmp 0xb7d1
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1a104
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb956
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x283d4(%rip), %rcx     # 0x33960
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb5b3
cmpb $0x2a, (%r14)
je 0xb96f
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xb96f
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb956
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb5eb
cmpb $0x2a, (%r14)
je 0xbb2c
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbb2c
leaq -0x50(%rbp), %rdi
callq 0x1a128
jmp 0xb7d1
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1ae40
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb95b
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2866e(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb651
cmpb $0x2a, (%r14)
je 0xb9c8
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xb9c8
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb95b
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb689
cmpb $0x2a, (%r14)
je 0xbb85
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbb85
leaq -0x50(%rbp), %rdi
callq 0x1ae64
jmp 0xb7d1
leaq -0x50(%rbp), %rdi
movl $0x61, %esi
callq 0x1b03c
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb960
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2869d(%rip), %rcx     # 0x33d68
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb6f2
cmpb $0x2a, (%r14)
je 0xba7a
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xba7a
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb960
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb72a
cmpb $0x2a, (%r14)
je 0xbc37
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbc37
leaq -0x50(%rbp), %rdi
callq 0x1b060
jmp 0xb7d1
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1a9d4
movslq 0xb4(%rbx), %r15
movq 0x18(%rbx), %r12
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xb96a
movq (%rax), %rax
movq -0x8(%rax), %rax
leaq 0x2838f(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %r14
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb790
cmpb $0x2a, (%r14)
je 0xbad3
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbad3
movq -0x8(%r12,%r15,8), %rax
testq %rax, %rax
je 0xb96a
movq (%rax), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r14
je 0xb7c8
cmpb $0x2a, (%r14)
je 0xbc8d
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
jne 0xbc8d
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movq (%rcx,%rax,8), %rsi
callq 0x1a925
movl %eax, %r15d
movl $0x10, %edi
callq 0x6200
movq %rax, %r14
testb %r15b, %r15b
je 0xb80e
movq %r14, %rdi
movl $0x1, %esi
callq 0x1ae40
jmp 0xb818
movq %r14, %rdi
xorl %esi, %esi
callq 0x1ae40
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %r12
testq %r12, %r12
je 0xb834
movq %r12, %rdi
callq 0x1a300
leaq 0x18(%rbx), %r15
movl $0x8, %esi
movq %r12, %rdi
callq 0x6210
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 0xb86e
movq %r12, %rdi
callq 0x1a300
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 0xa334
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x18667(%rip), %rsi     # 0x23f22
leaq 0x18663(%rip), %rdx     # 0x23f25
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 0xb8f0
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 0x18348(%rip), %rsi     # 0x23c61
leaq 0x18379(%rip), %rdx     # 0x23c99
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x27146(%rip), %rsi     # 0x32a88
leaq 0xf821(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
callq 0x6250
callq 0x6250
callq 0x6250
callq 0x6250
callq 0x6250
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x18515(%rip), %rsi     # 0x23ea0
leaq 0x1854c(%rip), %rdx     # 0x23ede
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x270d4(%rip), %rsi     # 0x32a88
leaq 0xf7af(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x183b4(%rip), %rsi     # 0x23d98
leaq 0x183eb(%rip), %rdx     # 0x23dd6
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x2707b(%rip), %rsi     # 0x32a88
leaq 0xf756(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x182df(%rip), %rsi     # 0x23d1c
leaq 0x18313(%rip), %rdx     # 0x23d57
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x27022(%rip), %rsi     # 0x32a88
leaq 0xf6fd(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x18384(%rip), %rsi     # 0x23e1a
leaq 0x183bd(%rip), %rdx     # 0x23e5a
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x26fc9(%rip), %rsi     # 0x32a88
leaq 0xf6a4(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x181ab(%rip), %rsi     # 0x23c9a
leaq 0x181e2(%rip), %rdx     # 0x23cd8
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x26f70(%rip), %rsi     # 0x32a88
leaq 0xf64b(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x18397(%rip), %rsi     # 0x23edf
leaq 0x183d2(%rip), %rdx     # 0x23f21
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x26f17(%rip), %rsi     # 0x32a88
leaq 0xf5f2(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x18236(%rip), %rsi     # 0x23dd7
leaq 0x18271(%rip), %rdx     # 0x23e19
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x26ebe(%rip), %rsi     # 0x32a88
leaq 0xf599(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1815e(%rip), %rsi     # 0x23d58
leaq 0x18196(%rip), %rdx     # 0x23d97
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x26e65(%rip), %rsi     # 0x32a88
leaq 0xf540(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x18208(%rip), %rsi     # 0x23e5b
leaq 0x18245(%rip), %rdx     # 0x23e9f
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x26e0c(%rip), %rsi     # 0x32a88
leaq 0xf4e7(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbce1
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x18030(%rip), %rsi     # 0x23cd9
leaq 0x1806b(%rip), %rdx     # 0x23d1b
leaq -0x40(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x26db6(%rip), %rsi     # 0x32a88
leaq 0xf491(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0xbd04
jmp 0xbd26
jmp 0xbd36
jmp 0xbd58
jmp 0xbd68
jmp 0xbd87
jmp 0xbd94
jmp 0xbdb3
jmp 0xbdc0
jmp 0xbddf
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xbd1c
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xbd29
jmp 0xbdef
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xbdef
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xbd4e
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xbd5b
jmp 0xbe11
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xbe11
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xbd80
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xbd8a
jmp 0xbe00
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xbe00
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xbdac
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xbdb6
jmp 0xbe1f
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xbe1f
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xbdd8
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xbde2
jmp 0xbe2d
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xbe2d
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a9f8
jmp 0xbe90
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1ac2a
jmp 0xbe90
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1b060
jmp 0xbe90
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1ae64
jmp 0xbe90
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a128
jmp 0xbe90
jmp 0xbe3a
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
jmp 0xbe86
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xbe5f
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0xbe69
jmp 0xbe90
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0xbe90
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0xbe90
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0xbe90
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410