// File: /workspace/github_cpp_makefile_star2_O2/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 $0x40, %rsp
cmpl $0x0, 0xb4(%rsi)
jle 0xac53
movq %rsi, %rbx
movl 0x8(%rdi), %eax
cmpq $0x4, %rax
ja 0xab4c
leaq 0x1437f(%rip), %rcx     # 0x1ec48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x58(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x177d4
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xacae
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x242c4(%rip), %rdi     # 0x2ebc8
callq 0x76ba
testb %al, %al
jne 0xad9c
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rax
testq %rax, %rax
je 0xacae
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x24290(%rip), %rdi     # 0x2ebc8
callq 0x76ba
testb %al, %al
jne 0xaecc
leaq -0x58(%rbp), %rdi
callq 0x17802
jmp 0xab4c
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x1704c
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xac9f
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x23fdc(%rip), %rdi     # 0x2e960
callq 0x76ba
testb %al, %al
jne 0xacb8
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rax
testq %rax, %rax
je 0xac9f
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x23fa8(%rip), %rdi     # 0x2e960
callq 0x76ba
testb %al, %al
jne 0xae34
leaq -0x58(%rbp), %rdi
callq 0x17070
jmp 0xab4c
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x17a18
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xaca4
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x24294(%rip), %rdi     # 0x2ec98
callq 0x76ba
testb %al, %al
jne 0xad04
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rax
testq %rax, %rax
je 0xaca4
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x24260(%rip), %rdi     # 0x2ec98
callq 0x76ba
testb %al, %al
jne 0xae80
leaq -0x58(%rbp), %rdi
callq 0x17a3c
jmp 0xab4c
leaq -0x58(%rbp), %rdi
pushq $0x61
popq %rsi
callq 0x17c08
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xaca9
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x242e3(%rip), %rdi     # 0x2ed68
callq 0x76ba
testb %al, %al
jne 0xad50
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rax
testq %rax, %rax
je 0xaca9
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x242af(%rip), %rdi     # 0x2ed68
callq 0x76ba
testb %al, %al
jne 0xaf18
leaq -0x58(%rbp), %rdi
callq 0x17c2c
jmp 0xab4c
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x175ac
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xacb3
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x23ff6(%rip), %rdi     # 0x2eaf8
callq 0x76ba
testb %al, %al
jne 0xade8
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rax
testq %rax, %rax
je 0xacb3
movq (%rax), %rax
movq -0x8(%rax), %rsi
leaq 0x23fc2(%rip), %rdi     # 0x2eaf8
callq 0x76ba
testb %al, %al
jne 0xaf61
leaq -0x58(%rbp), %rdi
callq 0x175d0
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movq (%rcx,%rax,8), %rsi
callq 0x17503
movl %eax, %r15d
pushq $0x10
popq %rdi
callq 0x61d0
movq %rax, %r14
testb %r15b, %r15b
je 0xab85
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x17a18
jmp 0xab8f
movq %r14, %rdi
xorl %esi, %esi
callq 0x17a18
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %r12
testq %r12, %r12
je 0xabab
movq %r12, %rdi
callq 0x17248
leaq 0x18(%rbx), %r15
pushq $0x8
popq %rsi
movq %r12, %rdi
callq 0x61e0
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
andq $0x0, (%rcx,%rax,8)
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %r12
testq %r12, %r12
je 0xabe0
movq %r12, %rdi
callq 0x17248
pushq $0x8
popq %rsi
movq %r12, %rdi
callq 0x61e0
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
andq $0x0, -0x8(%rcx,%rax,8)
addq $-0x10, 0x20(%rbx)
decq %rax
movl %eax, 0xb4(%rbx)
leaq -0x48(%rbp), %rsi
movq %r14, (%rsi)
movq %r15, %rdi
callq 0x99a0
leaq 0x14302(%rip), %rsi     # 0x1ef22
leaq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x72a6
addq $0x78, %rbx
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x1925e
leaq -0x48(%rbp), %rdi
callq 0x60d0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x13ffc(%rip), %rsi     # 0x1ec61
leaq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22dfd(%rip), %rsi     # 0x2da88
leaq 0xd088(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
callq 0x6220
callq 0x6220
callq 0x6220
callq 0x6220
callq 0x6220
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x141d6(%rip), %rsi     # 0x1eea0
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22d98(%rip), %rsi     # 0x2da88
leaq 0xd023(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x14082(%rip), %rsi     # 0x1ed98
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22d4c(%rip), %rsi     # 0x2da88
leaq 0xcfd7(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x140b8(%rip), %rsi     # 0x1ee1a
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22d00(%rip), %rsi     # 0x2da88
leaq 0xcf8b(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x13f6e(%rip), %rsi     # 0x1ed1c
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22cb4(%rip), %rsi     # 0x2da88
leaq 0xcf3f(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x13ea0(%rip), %rsi     # 0x1ec9a
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22c68(%rip), %rsi     # 0x2da88
leaq 0xcef3(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x14099(%rip), %rsi     # 0x1eedf
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22c1c(%rip), %rsi     # 0x2da88
leaq 0xcea7(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x13f45(%rip), %rsi     # 0x1edd7
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22bd0(%rip), %rsi     # 0x2da88
leaq 0xce5b(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x13e7a(%rip), %rsi     # 0x1ed58
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22b84(%rip), %rsi     # 0x2da88
leaq 0xce0f(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x13f31(%rip), %rsi     # 0x1ee5b
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22b38(%rip), %rsi     # 0x2da88
leaq 0xcdc3(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafa8
pushq $0x20
popq %rdi
callq 0x60f0
movq %rax, %r14
leaq 0x13d66(%rip), %rsi     # 0x1ecd9
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x72a6
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x17d10
xorl %r15d, %r15d
leaq 0x22aef(%rip), %rsi     # 0x2da88
leaq 0xcd7a(%rip), %rdx      # 0x17d1a
movq %r14, %rdi
callq 0x63c0
jmp 0xafc5
jmp 0xaff1
jmp 0xb00b
jmp 0xb01e
jmp 0xafdb
jmp 0xaffe
jmp 0xb02b
jmp 0xb03e
jmp 0xb04b
jmp 0xb05e
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0xaff4
jmp 0xb06e
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0xb001
jmp 0xb07c
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0xb06e
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0xb07c
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0xb021
jmp 0xb08a
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0xb08a
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0xb041
jmp 0xb098
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0xb098
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0xb061
jmp 0xb0a6
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0xb0a6
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x175d0
jmp 0xb0f4
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x17802
jmp 0xb0f4
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x17c2c
jmp 0xb0f4
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x17a3c
jmp 0xb0f4
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x17070
jmp 0xb0f4
jmp 0xb0b3
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x61e0
jmp 0xb0f4
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x60d0
testb %r15b, %r15b
jne 0xb0d9
jmp 0xb0f4
movq %rax, %rbx
movq %r14, %rdi
callq 0x6150
jmp 0xb0f4
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x60d0
jmp 0xb0f4
movq %rax, %rbx
movq %rbx, %rdi
callq 0x63f0