// File: /workspace/github_cpp_makefile_star2_O3/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 0x23cd5
leaq 0x139ba(%rip), %rax     # 0x37550
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movsd (%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x23bb3
jnp 0x23d44
cmpeqsd (%rcx), %xmm0
movsd 0x102e0(%rip), %xmm1    # 0x33ea0
andnpd %xmm1, %xmm0
jmp 0x23d44
movsd (%rcx), %xmm0
cmpltsd (%rsi), %xmm0
jmp 0x23cc3
movsd (%rsi), %xmm0
addsd (%rcx), %xmm0
jmp 0x23d44
movsd (%rsi), %xmm0
cmpltsd (%rcx), %xmm0
jmp 0x23cc3
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x23c45
jp 0x23c45
cmpneqsd (%rcx), %xmm1
jmp 0x23d38
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
jmp 0x23d44
movsd (%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x23d27
jp 0x23d27
movsd (%rcx), %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
jne 0x23c45
jnp 0x23d27
movsd 0x10253(%rip), %xmm0    # 0x33ea0
jmp 0x23d44
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
movapd 0x102ae(%rip), %xmm1    # 0x33f10
xorpd %xmm0, %xmm1
maxsd %xmm0, %xmm1
cmpltsd 0xfbed(%rip), %xmm1     # 0x33860
movsd 0x10225(%rip), %xmm0    # 0x33ea0
andpd %xmm1, %xmm0
movlpd %xmm0, (%rsi)
jmp 0x23d48
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
movapd 0x10278(%rip), %xmm1    # 0x33f10
xorpd %xmm0, %xmm1
maxsd %xmm0, %xmm1
movsd 0xfbb8(%rip), %xmm0     # 0x33860
cmplesd %xmm1, %xmm0
jmp 0x23cc3
movsd (%rcx), %xmm0
cmplesd (%rsi), %xmm0
jmp 0x23cc3
movsd (%rsi), %xmm0
cmplesd (%rcx), %xmm0
movsd 0x101d5(%rip), %xmm1    # 0x33ea0
andpd %xmm0, %xmm1
movlpd %xmm1, (%rsi)
jmp 0x23d48
leaq 0x13abd(%rip), %rdi     # 0x37799
callq 0xa1f0
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xa850
movq 0x1d26b(%rip), %rbx     # 0x40f60
leaq 0xc6d0(%rbx), %rdi
leaq 0x13953(%rip), %rsi     # 0x37656
movl $0x50, %edx
callq 0xa8a0
movw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
movl $0x5, %eax
jmp 0x23d4a
ucomisd %xmm0, %xmm1
jne 0x23d2f
jnp 0x23d44
xorpd %xmm1, %xmm1
cmpeqsd (%rcx), %xmm1
movsd 0x10160(%rip), %xmm0    # 0x33ea0
andpd %xmm1, %xmm0
movsd %xmm0, (%rsi)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop