// File: /workspace/github_cpp_makefile_star2_O1/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 0x26581
leaq 0x14116(%rip), %rax     # 0x3a558
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movsd (%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x2645f
jnp 0x265fa
cmpeqsd (%rcx), %xmm0
movsd 0x10a34(%rip), %xmm1    # 0x36ea0
andnpd %xmm1, %xmm0
jmp 0x265fa
movsd (%rcx), %xmm0
cmpltsd (%rsi), %xmm0
jmp 0x2656f
movsd (%rsi), %xmm0
addsd (%rcx), %xmm0
jmp 0x265fa
movsd (%rsi), %xmm0
cmpltsd (%rcx), %xmm0
jmp 0x2656f
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x264f1
jp 0x264f1
cmpneqsd (%rcx), %xmm1
jmp 0x265ee
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
jmp 0x265fa
movsd (%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x265dd
jp 0x265dd
movsd (%rcx), %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
jne 0x264f1
jnp 0x265dd
movsd 0x109a7(%rip), %xmm0    # 0x36ea0
jmp 0x265fa
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
movapd 0x10a02(%rip), %xmm1    # 0x36f10
xorpd %xmm0, %xmm1
maxsd %xmm0, %xmm1
cmpltsd 0x10341(%rip), %xmm1    # 0x36860
movsd 0x10979(%rip), %xmm0    # 0x36ea0
andpd %xmm1, %xmm0
movlpd %xmm0, (%rsi)
jmp 0x265fe
movsd (%rsi), %xmm0
subsd (%rcx), %xmm0
movapd 0x109cc(%rip), %xmm1    # 0x36f10
xorpd %xmm0, %xmm1
maxsd %xmm0, %xmm1
movsd 0x1030c(%rip), %xmm0    # 0x36860
cmplesd %xmm1, %xmm0
jmp 0x2656f
movsd (%rcx), %xmm0
cmplesd (%rsi), %xmm0
jmp 0x2656f
movsd (%rsi), %xmm0
cmplesd (%rcx), %xmm0
movsd 0x10929(%rip), %xmm1    # 0x36ea0
andpd %xmm0, %xmm1
movlpd %xmm1, (%rsi)
jmp 0x265fe
leaq 0x14219(%rip), %rdi     # 0x3a7a1
callq 0xa1f0
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xa850
movq 0x1d9bf(%rip), %rbx     # 0x43f60
movl $0x0, 0xd670(%rbx)
leaq 0xc6d0(%rbx), %rdi
leaq 0x140a5(%rip), %rsi     # 0x3a65e
movl $0x50, %edx
callq 0xa8a0
movw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
movl $0x5, %eax
jmp 0x26600
ucomisd %xmm0, %xmm1
jne 0x265e5
jnp 0x265fa
xorpd %xmm1, %xmm1
cmpeqsd (%rcx), %xmm1
movsd 0x108aa(%rip), %xmm0    # 0x36ea0
andpd %xmm1, %xmm0
movsd %xmm0, (%rsi)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop