// File: sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_p(char*, int*, block_struct*, double*)
int Interp::read_p(char *line,   //!< string: line of RS274/NGC code being processed
                  int *counter, //!< pointer to a counter for position on the line 
                  block_pointer block,  //!< pointer to a block being filled from the line 
                  double *parameters)   //!< array of system parameters                    
{
  double value;

  CHKS((line[*counter] != 'p'), NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED);
  *counter = (*counter + 1);
  CHKS((block->p_number > -1.0), NCE_MULTIPLE_P_WORDS_ON_ONE_LINE);
  CHP(read_real_value(line, counter, &value, parameters));
  // FMP removed check for negatives, since we may want them for
  // user-defined codes
  // CHKS((value < 0.0), NCE_NEGATIVE_P_WORD_USED);
  block->p_number = value;
  block->p_flag = ON;
  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, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq (%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x70, %eax
je 0x64ec1
jmp 0x64dee
leaq 0x175f0(%rip), %rdi     # 0x7c3e5
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x22151(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x22140(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x22132(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x191f5(%rip), %rsi     # 0x7e038
movl $0x50, %edx
callq 0x10840
movq 0x2210c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x220fe(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x220e6(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x220d6(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x220c9(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x220bb(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x650ce
jmp 0x64ec3
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movsd 0x210(%rax), %xmm0
movsd 0x1397a(%rip), %xmm1    # 0x78860
ucomisd %xmm1, %xmm0
jbe 0x64fc5
jmp 0x64ef2
leaq 0x1917a(%rip), %rdi     # 0x7e073
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x2204d(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x2203c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x2202e(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x190f1(%rip), %rsi     # 0x7e038
movl $0x50, %edx
callq 0x10840
movq 0x22008(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x21ffa(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x21fe2(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x21fd2(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x21fc5(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x21fb7(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x650ce
jmp 0x64fc7
jmp 0x64fc9
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %r8
leaq -0x38(%rbp), %rcx
callq 0x118a0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x650a9
jmp 0x64ff1
movq 0x21f68(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x650a1
movq 0x21f54(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x21f46(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x19009(%rip), %rsi     # 0x7e038
movl $0x50, %edx
callq 0x10840
movq 0x21f20(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x21f12(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x21efa(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x21eea(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x21edd(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x21ecf(%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 0x650ce
jmp 0x650ab
movsd -0x38(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x210(%rax)
movq -0x28(%rbp), %rax
movb $0x1, 0x218(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)