// File: /workspace/github_c_makefile_star2_O2/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 0x4efc
movl $0x67, 0x10(%rbx)
pushq $0x67
jmp 0x4f2c
movabsq $0x100003e00, %r12      # imm = 0x100003E00
cmpb $0x20, %bpl
ja 0x4f3c
movzbl %bpl, %eax
btq %rax, %r12
jae 0x4f3c
movq (%rbx), %rax
movb %bpl, (%rax)
movq (%rbx), %rax
movb $0x0, 0x1(%rax)
movl $0x66, 0x10(%rbx)
pushq $0x66
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
cmpb $0x20, %bpl
ja 0x4f4f
movzbl %bpl, %eax
btq %rax, %r12
jb 0x4f9a
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
cmpq %r15, %rsi
jg 0x4f76
addq %rsi, %rsi
movq %rsi, 0x8(%rbx)
movq %rax, %rdi
callq 0x21e0
movq %rax, (%rbx)
testq %rax, %rax
je 0x5144
movb %bpl, (%rax,%r15)
incq %r15
movq %r14, %rdi
callq 0x2130
movl %eax, %ebp
movq %r14, %rdi
callq 0x21a0
testl %eax, %eax
je 0x4f3f
movl $0x67, 0x10(%rbx)
movq (%rbx), %rax
movslq %r15d, %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x67, 0x10(%rbx)
je 0x4ef8
movq (%rbx), %r14
testq %r14, %r14
je 0x5128
movb (%r14), %cl
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x4fe4
cmpb $0x2e, %cl
ja 0x5128
movzbl %cl, %ecx
movabsq $0x680000000000, %rdx   # imm = 0x680000000000
btq %rcx, %rdx
jae 0x5128
cmpb $0xa, %al
setae %bpl
movq %r14, %rdi
callq 0x20e0
cmpq $0x1, %rax
sete %cl
testb %cl, %bpl
jne 0x5128
xorl %ecx, %ecx
pushq $0x1
popq %rsi
xorl %r9d, %r9d
xorl %edi, %edi
xorl %r8d, %r8d
cmpq %rcx, %rax
je 0x511d
movb (%r14,%rcx), %r10b
leal -0x3a(%r10), %r11d
movzbl %r10b, %r15d
cmpb $-0xb, %r11b
ja 0x504c
leal -0x2b(%r15), %r11d
cmpl $0x3a, %r11d
ja 0x5128
movabsq $0x40000000400000d, %rdx # imm = 0x40000000400000D
btq %r11, %rdx
jae 0x5128
testq %rcx, %rcx
je 0x507a
testl %r9d, %r9d
jne 0x507a
cmpb $0x2b, %r10b
je 0x5128
cmpl $0x2d, %r15d
je 0x5128
testl %edi, %edi
setne %r11b
cmpb $0x2e, %r10b
sete %bpl
jmp 0x50b0
testl %edi, %edi
setne %r11b
testl %r9d, %r9d
je 0x509d
testl %edi, %edi
je 0x509d
cmpb $0x2b, %r10b
je 0x5128
cmpl $0x2d, %r15d
je 0x5128
cmpb $0x2e, %r10b
sete %bpl
testl %r9d, %r9d
je 0x50b0
cmpb $0x2e, %r10b
je 0x5128
testl %r9d, %r9d
setne %r13b
movl %r10d, %r15d
andb $-0x21, %r15b
cmpb $0x45, %r15b
sete %dl
testl %r8d, %r8d
setne %r12b
testb %dl, %r13b
jne 0x5128
andb %bpl, %r12b
jne 0x5128
testl %r9d, %r9d
je 0x50e0
movl %esi, %r9d
jmp 0x50f1
xorl %r9d, %r9d
cmpb $0x45, %r15b
sete %r9b
setne %dl
orb %dl, %r11b
addb $-0x2b, %r10b
xorl %edx, %edx
testb $-0x3, %r10b
sete %dl
testb $0x1, %r11b
cmovel %edx, %edi
testb %bpl, %bpl
movl %r8d, %edx
cmovnel %esi, %edx
testl %r8d, %r8d
cmovel %edx, %r8d
incq %rcx
jmp 0x500f
movb -0x1(%r14,%rax), %al
addb $-0x3a, %al
cmpb $-0xa, %al
jae 0x5136
movl $0x64, 0x10(%rbx)
pushq $0x64
jmp 0x4f2c
movl $0x65, 0x10(%rbx)
pushq $0x65
jmp 0x4f2c
movq 0x6ead(%rip), %rax      # 0xbff8
movq (%rax), %rcx
leaq 0x26ad(%rip), %rdi      # 0x7802
pushq $0x34
popq %rsi
pushq $0x1
popq %rdx
callq 0x2230
pushq $-0x1
popq %rdi
callq 0x2220