// File: smallsimple[P]CoreInterpreter-CSE5341/Comp.cpp
// Function: Comp::EvalComp()
bool Comp::EvalComp(){
  switch(alterId) {
  case 1:
    if (op1->EvalOp() != op2->EvalOp())
      return true;
    else 
      return false;
  case 2:
    if (op1->EvalOp() == op2->EvalOp())
      return true;
    else 
      return false;
  case 3:
    if (op1->EvalOp() < op2->EvalOp())
      return true;
    else 
      return false;
  case 4:
    if (op1->EvalOp() > op2->EvalOp())
      return true;
    else
      return false;
  case 5:
    if (op1->EvalOp() <= op2->EvalOp())
      return true;
    else 
      return false;
  case 6:
    if (op1->EvalOp() >= op2->EvalOp())
      return true;
    else
      return false;
  default:
    cout << "Error: EvalComp: wrong alterId." << endl;
    cout << "program stopped." << endl;
    exit(0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl 0x10(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x5, %eax
ja 0xaf99
movq -0x18(%rbp), %rax
leaq 0x1b95(%rip), %rcx      # 0xc9d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, -0x24(%rbp)
movq 0x8(%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movl -0x24(%rbp), %eax
cmpl %ecx, %eax
je 0xae7c
movb $0x1, -0x1(%rbp)
jmp 0xafe4
movb $0x0, -0x1(%rbp)
jmp 0xafe4
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, -0x28(%rbp)
movq 0x8(%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movl -0x28(%rbp), %eax
cmpl %ecx, %eax
jne 0xaeb5
movb $0x1, -0x1(%rbp)
jmp 0xafe4
movb $0x0, -0x1(%rbp)
jmp 0xafe4
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, -0x2c(%rbp)
movq 0x8(%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movl -0x2c(%rbp), %eax
cmpl %ecx, %eax
jge 0xaeee
movb $0x1, -0x1(%rbp)
jmp 0xafe4
movb $0x0, -0x1(%rbp)
jmp 0xafe4
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, -0x30(%rbp)
movq 0x8(%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movl -0x30(%rbp), %eax
cmpl %ecx, %eax
jle 0xaf27
movb $0x1, -0x1(%rbp)
jmp 0xafe4
movb $0x0, -0x1(%rbp)
jmp 0xafe4
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, -0x34(%rbp)
movq 0x8(%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movl -0x34(%rbp), %eax
cmpl %ecx, %eax
jg 0xaf60
movb $0x1, -0x1(%rbp)
jmp 0xafe4
movb $0x0, -0x1(%rbp)
jmp 0xafe4
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, -0x38(%rbp)
movq 0x8(%rax), %rdi
callq 0x8e50
movl %eax, %ecx
movl -0x38(%rbp), %eax
cmpl %ecx, %eax
jl 0xaf93
movb $0x1, -0x1(%rbp)
jmp 0xafe4
movb $0x0, -0x1(%rbp)
jmp 0xafe4
movq 0x6038(%rip), %rdi      # 0x10fd8
leaq 0x1a8d(%rip), %rsi      # 0xca34
callq 0x21d0
movq %rax, %rdi
movq 0x6012(%rip), %rsi      # 0x10fc8
callq 0x2210
movq 0x6016(%rip), %rdi      # 0x10fd8
leaq 0x117d(%rip), %rsi      # 0xc146
callq 0x21d0
movq %rax, %rdi
movq 0x5ff0(%rip), %rsi      # 0x10fc8
callq 0x2210
xorl %edi, %edi
callq 0x2280
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop