// File: /workspace/github_c_makefile_star2_O1/sheneman[P]clearcut/dmat.c
// Function: NJ_get_token
static inline
int
NJ_get_token(FILE *fp,
	     NJ_DIST_TOKEN *token) {

  char c;
  int index;

  c = fgetc(fp);
  if(feof(fp)) {
    token->type = NJ_EOF_STATE;
    return(token->type);
  }

  if(NJ_is_whitespace(c)) {
    token->buf[0] = c;
    token->buf[1] = '\0';
    token->type   = NJ_WS_STATE;

    return NJ_WS_STATE;
  } 

  index = 0;
  while(!NJ_is_whitespace(c)) {

    /* reallocate our buffer if necessary */
    if(index >= token->bufsize) {
      token->bufsize *= 2;
      token->buf = (char *)realloc(token->buf, token->bufsize*sizeof(char));
      if(!token->buf) {
	fprintf(stderr, "Clearcut: Memory allocation error in NJ_get_token()\n");
	exit(-1);
      }
    }

    token->buf[index++] = c;
    
    c = fgetc(fp);
    if(feof(fp)) {
      token->type = NJ_EOF_STATE;
      break;
    }
  }
  
  token->buf[index] = '\0';
  
  if(token->type != NJ_EOF_STATE) {

    if(NJ_is_distance(token->buf)) {
      token->type = NJ_FLOAT_STATE;
    } else {
      token->type = NJ_NAME_STATE;
    }

  }
  
  return(token->type);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2130
movl %eax, %ebp
movq %r14, %rdi
callq 0x21a0
testl %eax, %eax
je 0x5a77
movl $0x67, 0x10(%rbx)
movl $0x67, %eax
jmp 0x5a9c
movzbl %bpl, %eax
leal -0x9(%rax), %ecx
cmpl $0x5, %ecx
jae 0x5aab
movq (%rbx), %rax
movb %bpl, (%rax)
movq (%rbx), %rax
movb $0x0, 0x1(%rax)
movl $0x66, 0x10(%rbx)
movl $0x66, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x20, %eax
je 0x5a83
xorl %r15d, %r15d
movabsq $0x100003e00, %r12      # imm = 0x100003E00
cmpb $0x20, %bpl
ja 0x5acd
movzbl %bpl, %eax
btq %rax, %r12
jb 0x5b18
movq 0x8(%rbx), %rsi
cmpq %r15, %rsi
jg 0x5af1
addq %rsi, %rsi
movq %rsi, 0x8(%rbx)
movq (%rbx), %rdi
callq 0x21e0
movq %rax, (%rbx)
testq %rax, %rax
je 0x5cc9
movq (%rbx), %rax
movb %bpl, (%rax,%r15)
incq %r15
movq %r14, %rdi
callq 0x2130
movl %eax, %ebp
movq %r14, %rdi
callq 0x21a0
testl %eax, %eax
je 0x5abd
movl $0x67, 0x10(%rbx)
movq (%rbx), %rax
movslq %r15d, %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x67, 0x10(%rbx)
je 0x5cc1
movq (%rbx), %r14
testq %r14, %r14
je 0x5cb9
movb (%r14), %cl
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x5b62
cmpb $0x2e, %cl
ja 0x5cb9
movzbl %cl, %ecx
movabsq $0x680000000000, %rdx   # imm = 0x680000000000
btq %rcx, %rdx
jae 0x5cb9
cmpb $0xa, %al
setae %bpl
movq %r14, %rdi
callq 0x20e0
cmpq $0x1, %rax
sete %cl
testb %cl, %bpl
jne 0x5cb9
testq %rax, %rax
je 0x5ca7
xorl %ecx, %ecx
movl $0x1, %esi
xorl %edi, %edi
xorl %r8d, %r8d
xorl %r9d, %r9d
movb (%r14,%rcx), %r10b
leal -0x3a(%r10), %r11d
cmpb $-0xb, %r11b
ja 0x5bcc
movzbl %r10b, %r11d
addl $-0x2b, %r11d
cmpl $0x3a, %r11d
ja 0x5cb9
movabsq $0x40000000400000d, %rdx # imm = 0x40000000400000D
btq %r11, %rdx
jae 0x5cb9
testq %rcx, %rcx
je 0x5bee
testl %r9d, %r9d
jne 0x5bee
cmpb $0x2b, %r10b
je 0x5cb9
movzbl %r10b, %r11d
cmpl $0x2d, %r11d
je 0x5cb9
testl %r8d, %r8d
setne %r11b
testl %r9d, %r9d
je 0x5c16
testl %r8d, %r8d
je 0x5c16
cmpb $0x2b, %r10b
je 0x5cb9
movzbl %r10b, %ebp
cmpl $0x2d, %ebp
je 0x5cb9
testl %r9d, %r9d
je 0x5c25
cmpb $0x2e, %r10b
je 0x5cb9
cmpb $0x2e, %r10b
sete %r15b
testl %r9d, %r9d
setne %r13b
movl %r10d, %ebp
andb $-0x21, %bpl
cmpb $0x45, %bpl
sete %dl
testl %edi, %edi
setne %r12b
testb %dl, %r13b
jne 0x5cb9
andb %r15b, %r12b
jne 0x5cb9
testl %r9d, %r9d
movl $0x1, %r9d
jne 0x5c75
xorl %r9d, %r9d
cmpb $0x45, %bpl
sete %r9b
setne %dl
testl %r8d, %r8d
setne %r11b
orb %dl, %r11b
leal -0x2b(%r10), %edx
xorl %ebp, %ebp
testb $-0x3, %dl
sete %r15b
testb %r11b, %r11b
jne 0x5c8d
movb %r15b, %bpl
movl %ebp, %r8d
cmpb $0x2e, %r10b
movl %edi, %edx
cmovel %esi, %edx
testl %edi, %edi
cmovel %edx, %edi
incq %rcx
cmpq %rcx, %rax
jne 0x5b98
movb -0x1(%r14,%rax), %cl
addb $-0x3a, %cl
movl $0x65, %eax
cmpb $-0xb, %cl
ja 0x5cbe
movl $0x64, %eax
movl %eax, 0x10(%rbx)
movl 0x10(%rbx), %eax
jmp 0x5a9c
callq 0x262c