// File: sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_x(char*, int*, block_struct*, double*)
int Interp::read_x(char *line,   //!< string: line of RS274 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] != 'x'), NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED);
  *counter = (*counter + 1);
  CHKS((block->x_flag != OFF), NCE_MULTIPLE_X_WORDS_ON_ONE_LINE);
  CHP(read_real_value(line, counter, &value, parameters));
  block->x_flag = ON;
  if(_setup.lathe_diameter_mode)
  {
    block->x_number = value / 2;
  }else
  {
  block->x_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 $0x78, %eax
je 0x69a61
jmp 0x6998e
leaq 0x12a50(%rip), %rdi     # 0x7c3e5
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1d5b1(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1d5a0(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1d592(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1511e(%rip), %rsi     # 0x7eb01
movl $0x50, %edx
callq 0x10840
movq 0x1d56c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1d55e(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1d546(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1d536(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1d529(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1d51b(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x69c97
jmp 0x69a63
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movb 0x270(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x69b5f
jmp 0x69a8c
leaq 0x150a9(%rip), %rdi     # 0x7eb3c
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1d4b3(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1d4a2(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1d494(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x15020(%rip), %rsi     # 0x7eb01
movl $0x50, %edx
callq 0x10840
movq 0x1d46e(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1d460(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1d448(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1d438(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1d42b(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1d41d(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x69c97
jmp 0x69b61
jmp 0x69b63
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 0x69c43
jmp 0x69b8b
movq 0x1d3ce(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x69c3b
movq 0x1d3ba(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1d3ac(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x14f38(%rip), %rsi     # 0x7eb01
movl $0x50, %edx
callq 0x10840
movq 0x1d386(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1d378(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1d360(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1d350(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1d343(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1d335(%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 0x69c97
jmp 0x69c45
movq -0x28(%rbp), %rax
movb $0x1, 0x270(%rax)
movq 0x1d309(%rip), %rax     # 0x86f60
testb $0x1, 0x1e6d8(%rax)
je 0x69c7f
movsd -0x38(%rbp), %xmm0
movsd 0xd39b(%rip), %xmm1     # 0x77008
divsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x278(%rax)
jmp 0x69c90
movsd -0x38(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x278(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq