// File: sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_s(char*, int*, block_struct*, double*)
int Interp::read_s(char *line,   //!< string: line of RS274NGC 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] != 's'), NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED);
  *counter = (*counter + 1);
  CHKS((block->s_number > -1.0), NCE_MULTIPLE_S_WORDS_ON_ONE_LINE);
  CHP(read_real_value(line, counter, &value, parameters));
  CHKS((value < 0.0), NCE_NEGATIVE_SPINDLE_SPEED_USED);
  block->s_number = value;
  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 $0x73, %eax
je 0x68061
jmp 0x67f8e
leaq 0x14450(%rip), %rdi     # 0x7c3e5
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1efb1(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1efa0(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1ef92(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x167f4(%rip), %rsi     # 0x7e7d7
movl $0x50, %edx
callq 0x10840
movq 0x1ef6c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ef5e(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1ef46(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1ef36(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1ef29(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ef1b(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x6834a
jmp 0x68063
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movsd 0x238(%rax), %xmm0
movsd 0x107da(%rip), %xmm1    # 0x78860
ucomisd %xmm1, %xmm0
jbe 0x68165
jmp 0x68092
leaq 0x16779(%rip), %rdi     # 0x7e812
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1eead(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1ee9c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1ee8e(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x166f0(%rip), %rsi     # 0x7e7d7
movl $0x50, %edx
callq 0x10840
movq 0x1ee68(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ee5a(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1ee42(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1ee32(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1ee25(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ee17(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x6834a
jmp 0x68167
jmp 0x68169
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 0x6824c
jmp 0x68191
movq 0x1edc8(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x68241
movq 0x1edb4(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1eda6(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16608(%rip), %rsi     # 0x7e7d7
movl $0x50, %edx
callq 0x10840
movq 0x1ed80(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ed72(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1ed5a(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1ed4a(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1ed3d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ed2f(%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 0x6834a
jmp 0x6824e
jmp 0x68250
xorps %xmm0, %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0x68330
jmp 0x68260
leaq 0x165c8(%rip), %rdi     # 0x7e82f
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1ecdf(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1ecce(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1ecc0(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16522(%rip), %rsi     # 0x7e7d7
movl $0x50, %edx
callq 0x10840
movq 0x1ec9a(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ec8c(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1ec74(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1ec64(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1ec57(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ec49(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x6834a
jmp 0x68332
movsd -0x38(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x238(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)