// File: sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_h(char*, int*, block_struct*, double*)
int Interp::read_h(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                    
{
  int value;

  CHKS((line[*counter] != 'h'), NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED);
  *counter = (*counter + 1);
  CHKS((block->h_flag == ON), NCE_MULTIPLE_H_WORDS_ON_ONE_LINE);
  CHP(read_integer_value(line, counter, &value, parameters));
  CHKS((value < -1), NCE_NEGATIVE_H_WORD_USED);
  block->h_flag = ON;
  block->h_number = value;
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %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, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq (%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x68, %eax
je 0x5f4d1
jmp 0x5f3fe
leaq 0x1cfe0(%rip), %rdi     # 0x7c3e5
callq 0x10380
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x27b41(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x27b30(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x27b22(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1e21d(%rip), %rsi     # 0x7d670
movl $0x50, %edx
callq 0x10840
movq 0x27afc(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x27aee(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x27ad6(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x27ac6(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x27ab9(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x27aab(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x5f7b7
jmp 0x5f4d3
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movb 0x190(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5f5cf
jmp 0x5f4fc
leaq 0x1e1a8(%rip), %rdi     # 0x7d6ab
callq 0x10380
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x27a43(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x27a32(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x27a24(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1e11f(%rip), %rsi     # 0x7d670
movl $0x50, %edx
callq 0x10840
movq 0x279fe(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x279f0(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x279d8(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x279c8(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x279bb(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x279ad(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x5f7b7
jmp 0x5f5d1
jmp 0x5f5d3
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %r8
leaq -0x34(%rbp), %rcx
callq 0x11250
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x5f6b6
jmp 0x5f5fb
movq 0x2795e(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x5f6ab
movq 0x2794a(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x2793c(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1e037(%rip), %rsi     # 0x7d670
movl $0x50, %edx
callq 0x10840
movq 0x27916(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x27908(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x278f0(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x278e0(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x278d3(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x278c5(%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 0x5f7b7
jmp 0x5f6b8
jmp 0x5f6ba
cmpl $-0x1, -0x34(%rbp)
jge 0x5f796
jmp 0x5f6c6
leaq 0x1dffb(%rip), %rdi     # 0x7d6c8
callq 0x10380
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x27879(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x27868(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x2785a(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1df55(%rip), %rsi     # 0x7d670
movl $0x50, %edx
callq 0x10840
movq 0x27834(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x27826(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x2780e(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x277fe(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x277f1(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x277e3(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x5f7b7
jmp 0x5f798
movq -0x28(%rbp), %rax
movb $0x1, 0x190(%rax)
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x194(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq