// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/interp_execute.cc
// Function: Interp::execute_binary2(double*, int, double*)
int Interp::execute_binary2(double *left,        //!< pointer to the left operand    
                           int operation,       //!< integer code for the operation 
                           double *right)       //!< pointer to the right operand   
{
  double diff;
  switch (operation) {
  case AND2:
    *left = ((*left == 0.0) || (*right == 0.0)) ? 0.0 : 1.0;
    break;
  case EXCLUSIVE_OR:
    *left = (((*left == 0.0) && (*right != 0.0))
             || ((*left != 0.0) && (*right == 0.0))) ? 1.0 : 0.0;
    break;
  case MINUS:
    *left = (*left - *right);
    break;
  case NON_EXCLUSIVE_OR:
    *left = ((*left != 0.0) || (*right != 0.0)) ? 1.0 : 0.0;
    break;
  case PLUS:
    *left = (*left + *right);
    break;

  case LT:
      *left = (*left < *right) ? 1.0 : 0.0;
      break;
  case EQ:
      diff = *left - *right;
      diff = (diff < 0) ? -diff : diff;
      *left = (diff < TOLERANCE_EQUAL) ? 1.0 : 0.0;
      break;
  case NE:
      diff = *left - *right;
      diff = (diff < 0) ? -diff : diff;
      *left = (diff >= TOLERANCE_EQUAL) ? 1.0 : 0.0;
      break;
  case LE:
      *left = (*left <= *right) ? 1.0 : 0.0;
      break;
  case GE:
      *left = (*left >= *right) ? 1.0 : 0.0;
      break;
  case GT:
      *left = (*left > *right) ? 1.0 : 0.0;
      break;

  default:
    ERS(NCE_BUG_UNKNOWN_OPERATION);
  }
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addl $-0x5, %edx
cmpl $0xb, %edx
ja 0x215c3
leaq 0x120cc(%rip), %rax     # 0x33550
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movsd (%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x214a1
jnp 0x2162d
cmpeqsd (%rcx), %xmm0
movsd 0xe9f2(%rip), %xmm1     # 0x2fea0
andnpd %xmm1, %xmm0
jmp 0x2162d
movsd (%rcx), %xmm0
cmpltsd (%rsi), %xmm0
jmp 0x215b1
movsd (%rsi), %xmm0
addsd (%rcx), %xmm0
jmp 0x2162d
movsd (%rsi), %xmm0
cmpltsd (%rcx), %xmm0
jmp 0x215b1
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x21533
jp 0x21533
cmpneqsd (%rcx), %xmm1
jmp 0x21621
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
jmp 0x2162d
movsd (%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x21610
jp 0x21610
movsd (%rcx), %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
jne 0x21533
jnp 0x21610
movsd 0xe965(%rip), %xmm0     # 0x2fea0
jmp 0x2162d
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
movapd 0xe9c0(%rip), %xmm1     # 0x2ff10
xorpd %xmm0, %xmm1
maxsd %xmm0, %xmm1
cmpltsd 0xe2ff(%rip), %xmm1     # 0x2f860
movsd 0xe937(%rip), %xmm0     # 0x2fea0
andpd %xmm1, %xmm0
movlpd %xmm0, (%rsi)
jmp 0x21631
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
movapd 0xe98a(%rip), %xmm1     # 0x2ff10
xorpd %xmm0, %xmm1
maxsd %xmm0, %xmm1
movsd 0xe2ca(%rip), %xmm0     # 0x2f860
cmplesd %xmm1, %xmm0
jmp 0x215b1
movsd (%rcx), %xmm0
cmplesd (%rsi), %xmm0
jmp 0x215b1
movsd (%rsi), %xmm0
cmplesd (%rcx), %xmm0
movsd 0xe8e7(%rip), %xmm1     # 0x2fea0
andpd %xmm0, %xmm1
movlpd %xmm1, (%rsi)
jmp 0x21631
leaq 0x121cf(%rip), %rdi     # 0x33799
callq 0xb220
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xb8e0
movq 0x1b97d(%rip), %rbx     # 0x3cf60
leaq 0xc6d0(%rbx), %rdi
leaq 0x12065(%rip), %rsi     # 0x33656
pushq $0x50
popq %rdx
callq 0xb940
andw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
pushq $0x5
popq %rax
jmp 0x21633
ucomisd %xmm0, %xmm1
jne 0x21618
jnp 0x2162d
xorpd %xmm1, %xmm1
cmpeqsd (%rcx), %xmm1
movsd 0xe877(%rip), %xmm0     # 0x2fea0
andpd %xmm1, %xmm0
movsd %xmm0, (%rsi)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq