// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
leaq -0x34(%rbp), %rcx
callq 0xabd0
movl %eax, %ecx
testl %eax, %eax
je 0x2db24
movq 0x164a4(%rip), %r14     # 0x43f60
movslq 0xd670(%r14), %rax
cmpq $0x30, %rax
jg 0x2dc4b
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r14,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0xe05e(%rip), %rsi      # 0x3bb45
movl $0x50, %edx
movl %ecx, %ebx
callq 0xa8a0
movslq 0xd670(%r14), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r14,%rcx)
incl %eax
movl %eax, 0xd670(%r14)
movb %dl, 0xc720(%r14,%rcx)
movl %ebx, %ecx
jmp 0x2dc4b
movq %rbx, -0x30(%rbp)
movq %r15, -0x40(%rbp)
movslq (%r13), %rax
cmpb $0x5b, (%r12,%rax)
jne 0x2dbf0
movq -0x30(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %r15
movl %ecx, %ebx
movq %r14, %rcx
movq -0x40(%rbp), %r8
callq 0xafc0
movl %ebx, %ecx
movl %eax, %r14d
testl %eax, %eax
je 0x2dbc1
movq 0x163fa(%rip), %rbx     # 0x43f60
movslq 0xd670(%rbx), %rax
cmpq $0x30, %rax
jg 0x2dbbe
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%rbx,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0xdfb8(%rip), %rsi      # 0x3bb45
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%rbx), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%rbx,%rcx)
incl %eax
movl %eax, 0xd670(%rbx)
movb %dl, 0xc720(%rbx,%rcx)
movl %r14d, %ecx
testl %r14d, %r14d
jne 0x2dc4b
movl %ecx, %ebx
movl -0x34(%rbp), %edx
cmpl $0x4, %edx
jne 0x2dc5c
movq -0x30(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq -0x40(%rbp), %r8
callq 0xa590
jmp 0x2dc68
leaq 0xf0cb(%rip), %rdi      # 0x3ccc2
callq 0xa1f0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xa850
movq 0x1634f(%rip), %rbx     # 0x43f60
movl $0x0, 0xd670(%rbx)
leaq 0xc6d0(%rbx), %rdi
leaq 0xdf1c(%rip), %rsi      # 0x3bb45
movl $0x50, %edx
callq 0xa8a0
movw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
movl $0x5, %ecx
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0xab60
movl %eax, %r14d
testl %eax, %eax
movl %ebx, %ecx
je 0x2dcd3
movq 0x162e8(%rip), %rbx     # 0x43f60
movslq 0xd670(%rbx), %rax
cmpq $0x30, %rax
jg 0x2dcd0
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%rbx,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0xdea6(%rip), %rsi      # 0x3bb45
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%rbx), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%rbx,%rcx)
incl %eax
movl %eax, 0xd670(%rbx)
movb %dl, 0xc720(%rbx,%rcx)
movl %r14d, %ecx
testl %r14d, %r14d
jne 0x2dc4b
xorl %ecx, %ecx
jmp 0x2dc4b
nop