// File: sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_unary(char*, int*, double*, double*)
int Interp::read_unary(char *line,       //!< string: line of RS274/NGC code being processed
                      int *counter,     //!< pointer to a counter for position on the line 
                      double *double_ptr,       //!< pointer to double to be read                  
                      double *parameters)       //!< array of system parameters                    
{
  int operation;

  CHP(read_operation_unary(line, counter, &operation));
  CHKS((line[*counter] != '['),
      NCE_LEFT_BRACKET_MISSING_AFTER_UNARY_OPERATION_NAME);
  CHP(read_real_expression(line, counter, double_ptr, parameters));

  if (operation == ATAN)
    CHP(read_atan(line, counter, double_ptr, parameters));
  else
    CHP(execute_unary(double_ptr, operation));
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x34(%rbp), %rcx
callq 0x11330
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x67b93
jmp 0x67ad8
movq 0x1f481(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x67b88
movq 0x1f46d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1f45f(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16e79(%rip), %rsi     # 0x7e98f
movl $0x50, %edx
callq 0x10840
movq 0x1f439(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f42b(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1f413(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1f403(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1f3f6(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f3e8(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x67f47
jmp 0x67b95
jmp 0x67b97
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq (%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5b, %eax
je 0x67c84
jmp 0x67bb1
leaq 0x16e11(%rip), %rdi     # 0x7e9c9
callq 0x10380
movq -0x50(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1f38e(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1f37d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1f36f(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16d89(%rip), %rsi     # 0x7e98f
movl $0x50, %edx
callq 0x10840
movq 0x1f349(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f33b(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1f323(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1f313(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1f306(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f2f8(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x67f47
jmp 0x67c86
jmp 0x67c88
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x119e0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x67d6b
jmp 0x67cb0
movq 0x1f2a9(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x67d60
movq 0x1f295(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1f287(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16ca1(%rip), %rsi     # 0x7e98f
movl $0x50, %edx
callq 0x10840
movq 0x1f261(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f253(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1f23b(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1f22b(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1f21e(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f210(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x67f47
jmp 0x67d6d
cmpl $0x4, -0x34(%rbp)
jne 0x67e63
jmp 0x67d79
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x10910
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x67e5c
jmp 0x67da1
movq 0x1f1b8(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x67e51
movq 0x1f1a4(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1f196(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16bb0(%rip), %rsi     # 0x7e98f
movl $0x50, %edx
callq 0x10840
movq 0x1f170(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f162(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1f14a(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1f13a(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1f12d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f11f(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x67f47
jmp 0x67e5e
jmp 0x67f40
jmp 0x67e65
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x34(%rbp), %edx
callq 0x11280
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x67f3c
jmp 0x67e84
movq 0x1f0d5(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x67f34
movq 0x1f0c1(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1f0b3(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16acd(%rip), %rsi     # 0x7e98f
movl $0x50, %edx
callq 0x10840
movq 0x1f08d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f07f(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1f067(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1f057(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1f04a(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1f03c(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x67f47
jmp 0x67f3e
jmp 0x67f40
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq