// File: sundale[P]gcode/rs274ngc/interp_execute.cc
// Function: Interp::execute_binary1(double*, int, double*)
int Interp::execute_binary1(double *left,        //!< pointer to the left operand    
                           int operation,       //!< integer code for the operation 
                           double *right)       //!< pointer to the right operand   
{
  switch (operation) {
  case DIVIDED_BY:
    CHKS((*right == 0.0), NCE_ATTEMPT_TO_DIVIDE_BY_ZERO);
    *left = (*left / *right);
    break;
  case MODULO:                 /* always calculates a positive answer */
    *left = fmod(*left, *right);
    if (*left < 0.0) {
      *left = (*left + fabs(*right));
    }
    break;
  case POWER:
    CHKS(((*left < 0.0) && (floor(*right) != *right)),
        NCE_ATTEMPT_TO_RAISE_NEGATIVE_TO_NON_INTEGER_POWER);
    *left = pow(*left, *right);
    break;
  case TIMES:
    *left = (*left * *right);
    break;
  default:
    ERS(NCE_BUG_UNKNOWN_OPERATION);
  }
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x3, %eax
ja 0x55425
movq -0x30(%rbp), %rax
leaq 0x276aa(%rip), %rcx     # 0x7c818
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x55179
movq -0x28(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x55269
jp 0x55269
jmp 0x55196
leaq 0x27733(%rip), %rdi     # 0x7c8d0
callq 0x10380
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x31da9(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x31d98(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x31d8a(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x276ff(%rip), %rsi     # 0x7c8ea
movl $0x50, %edx
callq 0x10840
movq 0x31d64(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x31d56(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x31d3e(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x31d2e(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x31d21(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x31d13(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x554fe
jmp 0x5526b
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movq -0x28(%rbp), %rax
divsd (%rax), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x554f7
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movq -0x28(%rbp), %rax
movsd (%rax), %xmm1
callq 0x116b0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd (%rax), %xmm0
jbe 0x552d9
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movq -0x28(%rbp), %rax
movsd (%rax), %xmm1
movaps 0x21d57(%rip), %xmm2    # 0x77020
pand %xmm2, %xmm1
addsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x554f7
jmp 0x552e0
movq -0x18(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd (%rax), %xmm0
jbe 0x553e4
movq -0x28(%rbp), %rax
movsd (%rax), %xmm0
callq 0x11e50
movq -0x28(%rbp), %rax
ucomisd (%rax), %xmm0
jne 0x5530f
jp 0x5530f
jmp 0x553e4
jmp 0x55311
leaq 0x27607(%rip), %rdi     # 0x7c91f
callq 0x10380
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x31c2e(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x31c1d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x31c0f(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x27584(%rip), %rsi     # 0x7c8ea
movl $0x50, %edx
callq 0x10840
movq 0x31be9(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x31bdb(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x31bc3(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x31bb3(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x31ba6(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x31b98(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x554fe
jmp 0x553e6
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movq -0x28(%rbp), %rax
movsd (%rax), %xmm1
callq 0x11ef0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x554f7
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movq -0x28(%rbp), %rax
mulsd (%rax), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x554f7
jmp 0x55427
leaq 0x27520(%rip), %rdi     # 0x7c94e
callq 0x10380
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x31b18(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x31b07(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x31af9(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x2746e(%rip), %rsi     # 0x7c8ea
movl $0x50, %edx
callq 0x10840
movq 0x31ad3(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x31ac5(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x31aad(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x31a9d(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x31a90(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x31a82(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x554fe
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)