// File: sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_t(char*, int*, block_struct*, double*)
int Interp::read_t(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] != 't'), NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED);
  *counter = (*counter + 1);
  CHKS((block->t_number > -1), NCE_MULTIPLE_T_WORDS_ON_ONE_LINE);
  CHP(read_integer_value(line, counter, &value, parameters));
  CHKS((value < 0), NCE_NEGATIVE_TOOL_ID_USED);
  block->t_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 $0x74, %eax
je 0x68471
jmp 0x6839e
leaq 0x14040(%rip), %rdi     # 0x7c3e5
callq 0x10380
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1eba1(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1eb90(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1eb82(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16458(%rip), %rsi     # 0x7e84b
movl $0x50, %edx
callq 0x10840
movq 0x1eb5c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1eb4e(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1eb36(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1eb26(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1eb19(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1eb0b(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x68745
jmp 0x68473
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
cmpl $-0x1, 0x240(%rax)
jle 0x68568
jmp 0x68495
leaq 0x163ea(%rip), %rdi     # 0x7e886
callq 0x10380
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1eaaa(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1ea99(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1ea8b(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16361(%rip), %rsi     # 0x7e84b
movl $0x50, %edx
callq 0x10840
movq 0x1ea65(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ea57(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1ea3f(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1ea2f(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1ea22(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1ea14(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x68745
jmp 0x6856a
jmp 0x6856c
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 0x6864f
jmp 0x68594
movq 0x1e9c5(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x68644
movq 0x1e9b1(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1e9a3(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16279(%rip), %rsi     # 0x7e84b
movl $0x50, %edx
callq 0x10840
movq 0x1e97d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1e96f(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1e957(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1e947(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1e93a(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1e92c(%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 0x68745
jmp 0x68651
jmp 0x68653
cmpl $0x0, -0x34(%rbp)
jge 0x6872f
jmp 0x6865f
leaq 0x1623d(%rip), %rdi     # 0x7e8a3
callq 0x10380
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x1e8e0(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x1e8cf(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x1e8c1(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x16197(%rip), %rsi     # 0x7e84b
movl $0x50, %edx
callq 0x10840
movq 0x1e89b(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1e88d(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x1e875(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x1e865(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x1e858(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x1e84a(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x68745
jmp 0x68731
movl -0x34(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x240(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop