// File: /workspace/github_cpp_makefile_star2_O3/zerolfx[P]P-Machine/or.cpp
// Function: Or::execute(StackMachine*)
void Or::execute(StackMachine *stack) 
{
	// check if the stack contains at least two entries
	if(stack->fSP < 1)
		throw ExecutionError("instruction or: requires 2 stackelements to be present.");
		
	StackBoolean p1;
	
	if(typeid(p1) != typeid(*(stack->fStore[stack->fSP])))
		throw ExecutionError("instruction or: SP does not point to element of type boolean.");
	if(typeid(p1) != typeid(*(stack->fStore[stack->fSP - 1])))
		throw ExecutionError("instruction or: SP - 1 does not point to element of type boolean.");

	
	// actual or-operation
	stack->fStore[stack->fSP - 1]->ori(stack->fStore[stack->fSP]);
	
	// SP := SP - 1
	delete stack->fStore[stack->fSP];
	stack->fStore[stack->fSP] = 0;
	stack->fStore.pop_back();
	--stack->fSP;
	
	// adding cost of this instruction
	stack->fTime.count("or");

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpl $0x0, 0xb4(%rsi)
jle 0x153ce
movq %rsi, %rbx
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x1ae40
movslq 0xb4(%rbx), %r12
movq 0x18(%rbx), %r13
movq (%r13,%r12,8), %r14
testq %r14, %r14
je 0x1531a
movq (%r14), %rax
movq -0x8(%rax), %rax
leaq 0x1ea8d(%rip), %rcx     # 0x33c98
movq 0x8(%rcx), %r15
movq 0x8(%rax), %rsi
cmpq %rsi, %r15
je 0x15232
cmpb $0x2a, (%r15)
je 0x1531f
movq %r15, %rdi
callq 0x6310
testl %eax, %eax
jne 0x1531f
movq -0x8(%r13,%r12,8), %r12
testq %r12, %r12
je 0x1531a
movq (%r12), %r13
movq -0x8(%r13), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r15
je 0x1526b
cmpb $0x2a, (%r15)
je 0x15378
movq %r15, %rdi
callq 0x6310
testl %eax, %eax
jne 0x15378
movq %r12, %rdi
movq %r14, %rsi
callq *0x38(%r13)
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %r14
testq %r14, %r14
je 0x15291
movq %r14, %rdi
callq 0x1a300
movl $0x8, %esi
movq %r14, %rdi
callq 0x6210
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
addq $-0x8, 0x20(%rbx)
decl %eax
movl %eax, 0xb4(%rbx)
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11799(%rip), %rsi     # 0x26a66
leaq 0x11794(%rip), %rdx     # 0x26a68
leaq -0x48(%rbp), %rdi
callq 0x746c
addq $0x78, %rbx
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x1cbc8
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x15302
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
leaq -0x58(%rbp), %rdi
callq 0x1ae64
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6250
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1036a(%rip), %rsi     # 0x256a5
leaq 0x103a0(%rip), %rdx     # 0x256e2
leaq -0x48(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1d724(%rip), %rsi     # 0x32a88
leaq 0x5dff(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x15422
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1034f(%rip), %rsi     # 0x256e3
leaq 0x10389(%rip), %rdx     # 0x25724
leaq -0x48(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1d6cb(%rip), %rsi     # 0x32a88
leaq 0x5da6(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
jmp 0x15422
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x10283(%rip), %rsi     # 0x2566d
leaq 0x102b3(%rip), %rdx     # 0x256a4
leaq -0x48(%rbp), %rdi
callq 0x746c
movb $0x1, %r12b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x1b14c
xorl %r12d, %r12d
leaq 0x1d675(%rip), %rsi     # 0x32a88
leaq 0x5d50(%rip), %rdx      # 0x1b16a
movq %r14, %rdi
callq 0x63e0
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x1543a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x15444
jmp 0x154a6
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x154a6
jmp 0x15452
jmp 0x15471
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x1546a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
testb %r12b, %r12b
jne 0x15474
jmp 0x1549d
movq %rax, %rbx
movq %r14, %rdi
callq 0x6170
jmp 0x1549d
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x1549d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x1549d
jmp 0x1549a
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x1ae64
movq %rbx, %rdi
callq 0x6410