// File: /workspace/github_cpp_makefile_star2_O3/mikeakohn[P]drumsplusplus/build/../src/Tokens.cxx
// Function: Tokens::get(char*)
int Tokens::get(char *token)
{
  int token_type = 0;
  int ch, ptr;
  int dotflag;

  ptr = 0;
  dotflag = 0;

  while (1)
  {
    if (pushback == 0)
    {
      ch=getc(in);
    }
      else
    {
      ch = pushback;
      pushback = 0;
    }
    
    if (ch == EOF) { break; }
    if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r')
    {
      if (ch == '\r' || ch == '\n') { line++; }
      if (ch == '\r')
      {
        ch = getc(in);
        if (ch!='\n') { pushback = ch; }
      }

      if (token_type != 0) { break; }
      continue;
    } 

    ch = tolower(ch);

    if (token_type == 0)
    {
      if (ch == '/')
      {
        ch = getc(in);

        if (ch == '/')
        {
          while (1)
          {
            ch = getc(in);
            if (ch == '\n' || ch == '\r' || ch == EOF) { break; }
          }

          line++;

          if (ch == '\r')
          {
            ch = getc(in);
            if (ch != '\n') { pushback = ch; }
          }
          continue;
        }
          else
        if (ch == '*')
        {
          while (1)
          {
            ch = getc(in);

            if (ch == EOF) { return -1; }
            if (ch == '*')
            {
              // FIXME: Get rid of this goto :(
again:
              ch = getc(in);

              if (ch == '/') { break; }
              if (ch == '*') { goto again; }
            }
          }

          continue;
        }
          else
        {
          pushback = ch;
          token[ptr++] = '/';
          token_type = TOKEN_SYMBOL;
          break;
        }
      }
        else
      if (ch >= 'a' && ch <= 'z')
      {
        token[ptr++] = ch;
        token_type = TOKEN_ALPHA;
      }
        else
      if (ch >= '0' && ch <= '9')
      {
        token[ptr++] = ch;
        token_type = TOKEN_NUMBER;
      }
        else
      if (ch == '.')
      {
        token[ptr++] = '0';
        token[ptr++] = ch;
        token_type = TOKEN_NUMBER;
      }
        else
      if (ch == '"')
      {
        token_type = TOKEN_STRING;
      }
        else
      {
        token[ptr++] = ch;
        token_type = TOKEN_SYMBOL;
        break;
      }
    }
      else
    if (token_type == TOKEN_ALPHA)
    {
      if ((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '_')
      {
        token[ptr++] = ch;
      }
        else
      {
        pushback = ch;
        break;
      }
    }
      else
    if (token_type == TOKEN_NUMBER)
    {
      if (ch >= '0' && ch <= '9')
      {
        token[ptr++] = ch;
      }
        else
      if (ch == '.' && dotflag == 0)
      {
        token[ptr++] = ch;
        dotflag++;
      }
        else
      {
        pushback = ch;
        break;
      }
    }
      else
    if (token_type == TOKEN_STRING)
    {
      if (ch == '"') { break; }
      token[ptr++] = ch;
    }
  }

  if (token_type == TOKEN_STRING && ch != '"')
  {
    printf(">> In file: %s\n", get_filename());
    printf("Error: Unterminated string on line %d.\n", line);
    return -1;
  }

  token[ptr] = 0;
  if (ptr == 0) { return -1; }

  return token_type;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %ecx, %ecx
movl $0x4801, %r15d          # imm = 0x4801
xorl %ebp, %ebp
xorl %r12d, %r12d
movl %ecx, %r13d
movl 0x28(%r14), %eax
testl %eax, %eax
je 0x28b7
movl $0x0, 0x28(%r14)
jmp 0x28bf
movq (%r14), %rdi
callq 0x20a0
cmpl $0xc, %eax
jg 0x28d8
cmpl $0x9, %eax
je 0x2905
cmpl $0xa, %eax
je 0x28e2
cmpl $-0x1, %eax
jne 0x2914
jmp 0x2aa2
cmpl $0x20, %eax
je 0x2905
cmpl $0xd, %eax
jne 0x2914
incl 0x2c(%r14)
cmpl $0xd, %eax
jne 0x2905
movq (%r14), %rdi
callq 0x20a0
movl %eax, %ecx
movl $0xa, %eax
cmpl $0xa, %ecx
je 0x2905
movl %ecx, 0x28(%r14)
movl %ecx, %eax
movl $0x0, %ecx
testl %r13d, %r13d
je 0x28a2
jmp 0x2aa2
movl %eax, %edi
callq 0x2270
testl %r13d, %r13d
jne 0x29b7
cmpl $0x2f, %eax
jne 0x2a41
movq (%r14), %rdi
callq 0x20a0
cmpl $0x2f, %eax
je 0x296e
cmpl $0x2a, %eax
jne 0x2ad8
movq (%r14), %rdi
callq 0x20a0
cmpl $0x2a, %eax
je 0x295a
cmpl $-0x1, %eax
jne 0x2943
jmp 0x2afc
movq (%r14), %rdi
callq 0x20a0
cmpl $0x2a, %eax
je 0x295a
cmpl $0x2f, %eax
jne 0x2943
jmp 0x29b0
movq (%r14), %rdi
callq 0x20a0
leal 0x1(%rax), %ecx
cmpl $0xe, %ecx
ja 0x296e
btl %ecx, %r15d
jae 0x296e
incl 0x2c(%r14)
movl $0x0, %ecx
cmpl $0xd, %eax
jne 0x28a2
movq (%r14), %rdi
callq 0x20a0
movl $0x0, %ecx
cmpl $0xa, %eax
je 0x28a2
movl %eax, 0x28(%r14)
xorl %ecx, %ecx
jmp 0x28a2
cmpl $0x1, %r13d
je 0x29e4
cmpl $0x2, %r13d
je 0x2a04
cmpl $0x4, %r13d
jne 0x2a37
cmpl $0x22, %eax
je 0x2b0b
movslq %ebp, %rcx
incl %ebp
movb %al, (%rbx,%rcx)
movl $0x4, %ecx
jmp 0x28a2
leal -0x61(%rax), %ecx
cmpl $0x1a, %ecx
jb 0x2a49
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
setae %cl
cmpl $0x5f, %eax
setne %dl
testb %cl, %dl
je 0x2a49
jmp 0x2b1f
leal -0x30(%rax), %ecx
cmpl $0x9, %ecx
jbe 0x2a63
cmpl $0x2e, %eax
jne 0x2b13
testl %r12d, %r12d
jne 0x2b13
movslq %ebp, %rax
incl %ebp
movb $0x2e, (%rbx,%rax)
movl $0x1, %r12d
movl $0x2, %ecx
jmp 0x28a2
movl $0x3, %ecx
jmp 0x28a2
leal -0x61(%rax), %ecx
cmpl $0x19, %ecx
ja 0x2a5b
movslq %ebp, %rcx
incl %ebp
movb %al, (%rbx,%rcx)
movl $0x1, %ecx
jmp 0x28a2
leal -0x30(%rax), %ecx
cmpl $0x9, %ecx
ja 0x2a75
movslq %ebp, %rcx
incl %ebp
movb %al, (%rbx,%rcx)
movl $0x2, %ecx
jmp 0x28a2
movl $0x4, %ecx
cmpl $0x22, %eax
je 0x28a2
cmpl $0x2e, %eax
jne 0x2b2b
movslq %ebp, %rax
movw $0x2e30, (%rbx,%rax)    # imm = 0x2E30
addl $0x2, %ebp
movl $0x2, %ecx
jmp 0x28a2
cmpl $0x4, %r13d
jne 0x2aeb
cmpl $0x22, %eax
je 0x2aeb
movq 0x8(%r14), %rsi
leaq 0x46fc(%rip), %rdi      # 0x71b4
xorl %eax, %eax
callq 0x2050
movl 0x2c(%r14), %esi
leaq 0x46fa(%rip), %rdi      # 0x71c4
xorl %eax, %eax
callq 0x2050
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2afc
movl %eax, 0x28(%r14)
movslq %ebp, %rax
incl %ebp
movb $0x2f, (%rbx,%rax)
movl $0x3, %r13d
movslq %ebp, %rcx
movb $0x0, (%rbx,%rcx)
xorl %eax, %eax
cmpl $0x1, %ecx
sbbl %eax, %eax
orl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %r13d
jmp 0x2aeb
movl %eax, 0x28(%r14)
movl $0x2, %r13d
jmp 0x2aeb
movl %eax, 0x28(%r14)
movl $0x1, %r13d
jmp 0x2aeb
movslq %ebp, %rcx
incl %ebp
movb %al, (%rbx,%rcx)
jmp 0x2ae5
nopl (%rax)