// File: /workspace/github_cpp_makefile_star2_O3/rfotino[P]consolite-compiler/src/tokenizer.cpp
// Function: Tokenizer::getNext()
AtomToken Tokenizer::getNext() {
  // If we have already peeked at this token, we can return
  // it directly.
  if (_hasNext) {
    _hasNext = false;
    return _next;
  }
  std::string token;
  bool singleComment = false;
  bool multiComment = false;
  while (_offset < _data.length()) {
    // In the single line comment state, consume until newline.
    if (singleComment) {
      if ('\n' == _data[_offset]) {
        singleComment = false;
      }
    // In the multi-line comment state, consume until "*/".
    } else if (multiComment) {
      if ('/' == _data[_offset] && 1 <= _offset &&
          '*' == _data[_offset - 1]) {
        multiComment = false;
      }
    // If next char is whitespace, break if we have a partial token,
    // otherwise consume the characters.
    } else if (' ' == _data[_offset] || '\t' == _data[_offset] ||
               '\n' == _data[_offset] || '\r' == _data[_offset]) {
      if (0 < token.length()) {
        break;
      }
    // If next characters start a single line comment, break
    // if we have a partial token, otherwise go into single line
    // comment state.
    } else if ('/' == _data[_offset] && _offset + 1 < _data.length() &&
               '/' == _data[_offset + 1]) {
      if (0 < token.length()) {
        break;
      } else {
        singleComment = true;
      }
    // If next characters start a multi-line comment, break
    // if we have a partial token, otherwise go into multi-line
    // comment state.
    } else if ('/' == _data[_offset] && _offset + 1 < _data.length() &&
               '*' == _data[_offset + 1]) {
      if (0 < token.length()) {
        break;
      } else {
        multiComment = true;
      }
    // If next two characters form a known two-character operator,
    // break if we have a partial token, otherwise set the next
    // two characters as the token and break.
    } else if (_offset + 1 < _data.length() &&
               (('|' == _data[_offset] && '|' == _data[_offset + 1]) ||
                ('&' == _data[_offset] && '&' == _data[_offset + 1]) ||
                ('=' == _data[_offset] && '=' == _data[_offset + 1]) ||
                ('!' == _data[_offset] && '=' == _data[_offset + 1]) ||
                ('<' == _data[_offset] && '=' == _data[_offset + 1]) ||
                ('>' == _data[_offset] && '=' == _data[_offset + 1]) ||
                ('<' == _data[_offset] && '<' == _data[_offset + 1]) ||
                ('>' == _data[_offset] && '>' == _data[_offset + 1]))) {
      if (0 == token.length()) {
        token += _data[_offset];
        token += _data[_offset + 1];
        _offset += 2;
      }
      break;
    // If next character forms a known single-character operator,
    // break if we have a partial token, otherwise set the next
    // character as the token and break;
    } else if ('+' == _data[_offset] || '-' == _data[_offset] ||
               '*' == _data[_offset] || '/' == _data[_offset] ||
               '%' == _data[_offset] || '&' == _data[_offset] ||
               '|' == _data[_offset] || '^' == _data[_offset] ||
               '=' == _data[_offset] || '<' == _data[_offset] ||
               '>' == _data[_offset] || '!' == _data[_offset] ||
               '~' == _data[_offset] || ',' == _data[_offset] ||
               ';' == _data[_offset] || '[' == _data[_offset] ||
               ']' == _data[_offset] || '(' == _data[_offset] ||
               ')' == _data[_offset] || '{' == _data[_offset] ||
               '}' == _data[_offset]) {
      if (0 == token.length()) {
        token += _data[_offset];
        _offset++;
      }
      break;
    // If none of the above rules hold, append the next character
    // to the token.
    } else {
      token += _data[_offset];
    }
    if ('\n' == _data[_offset]) {
      _lineNum++;
    }
    _offset++;
  }
  return AtomToken(token, _lineNum);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0x8(%rsi)
jne 0x32953
movb $0x0, 0x8(%r14)
movl 0x18(%r14), %eax
movl %eax, 0x8(%rbx)
leaq 0x133e1(%rip), %rax     # 0x45d10
movq %rax, (%rbx)
leaq 0x10(%rbx), %rdi
leaq 0x20(%rbx), %rax
movq %rax, 0x10(%rbx)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
callq 0xbd58
jmp 0x32b85
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movl (%r14), %eax
movq 0x48(%r14), %r8
cmpq %rax, %r8
jbe 0x32b38
xorl %edi, %edi
leaq 0x4c14(%rip), %rbp      # 0x37598
leaq 0x8(%rsp), %r15
movabsq $0x100002600, %r13      # imm = 0x100002600
xorl %esi, %esi
movq 0x40(%r14), %rcx
movzbl (%rcx,%rax), %edx
testb $0x1, %dil
je 0x329af
cmpl $0xa, %edx
setne %dil
jmp 0x32aa2
testb $0x1, %sil
je 0x329db
xorl %edi, %edi
movb $0x1, %sil
testl %eax, %eax
je 0x32aa2
cmpb $0x2f, %dl
jne 0x32aa2
leal -0x1(%rax), %edx
cmpb $0x2a, (%rcx,%rdx)
setne %sil
jmp 0x32aa0
cmpl $0x2f, %edx
ja 0x32a24
movl %edx, %esi
btq %rsi, %r13
jae 0x329f9
cmpq $0x0, 0x10(%rsp)
je 0x32a9e
jmp 0x32b38
cmpq $0x2f, %rsi
jne 0x32a24
leal 0x1(%rax), %esi
cmpq %rsi, %r8
jbe 0x32a29
cmpb $0x2f, (%rcx,%rsi)
jne 0x32ac2
cmpq $0x0, 0x10(%rsp)
jne 0x32b38
movb $0x1, %dil
xorl %esi, %esi
jmp 0x32aa2
incl %eax
movq %rax, %rsi
leal -0x21(%rdx), %eax
cmpq %rsi, %r8
jbe 0x32a40
cmpl $0x1d, %eax
ja 0x32a66
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
cmpl $0x3d, %eax
ja 0x32a59
movabsq $0x340000003c005fb1, %rcx # imm = 0x340000003C005FB1
btq %rax, %rcx
jb 0x32b1b
leal -0x7b(%rdx), %eax
cmpl $0x4, %eax
jae 0x32a8c
jmp 0x32b1b
leal -0x5b(%rdx), %eax
cmpl $0x23, %eax
ja 0x32a8c
movabsq $0xd0000000d, %rdi      # imm = 0xD0000000D
btq %rax, %rdi
jb 0x32b1b
cmpq $0x21, %rax
je 0x32bb8
movsbl %dl, %esi
movq %r15, %rdi
callq 0x7260
movl (%r14), %eax
movq 0x40(%r14), %rcx
xorl %esi, %esi
xorl %edi, %edi
movl %eax, %edx
cmpb $0xa, (%rcx,%rdx)
jne 0x32aae
incl 0x4(%r14)
incl %eax
movl %eax, (%r14)
movq 0x48(%r14), %r8
cmpq %rax, %r8
ja 0x32995
jmp 0x32b38
cmpb $0x2a, (%rcx,%rsi)
jne 0x32a29
cmpq $0x0, 0x10(%rsp)
jne 0x32b38
movb $0x1, %sil
jmp 0x32aa0
cmpb $0x3d, (%rcx,%rsi)
jne 0x32b1b
cmpq $0x0, 0x10(%rsp)
jne 0x32b38
movsbl %dl, %esi
leaq 0x8(%rsp), %rdi
callq 0x7260
movl (%r14), %eax
incl %eax
movq 0x40(%r14), %rcx
movsbl (%rcx,%rax), %esi
movl $0x2, %ebp
leaq 0x8(%rsp), %rdi
callq 0x7260
jmp 0x32b35
movb (%rcx,%rsi), %al
andb $-0x2, %al
cmpb $0x3c, %al
je 0x32adf
cmpq $0x0, 0x10(%rsp)
jne 0x32b38
movl $0x1, %ebp
movsbl %dl, %esi
leaq 0x8(%rsp), %rdi
callq 0x7260
addl %ebp, (%r14)
movl 0x4(%r14), %ebp
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
leaq 0x131c6(%rip), %rax     # 0x45d10
movq %rax, (%rbx)
leaq 0x10(%rbx), %rdi
leaq 0x20(%rbx), %rax
movq %rax, 0x10(%rbx)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
callq 0xbd58
movl %ebp, 0x8(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x32b85
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x26, (%rcx,%rsi)
je 0x32adf
jmp 0x32b1b
movb (%rcx,%rsi), %al
addb $-0x3d, %al
cmpb $0x1, %al
jbe 0x32adf
jmp 0x32b1b
cmpb $0x7c, (%rcx,%rsi)
je 0x32adf
jmp 0x32b1b
jmp 0x32bc9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x32be3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, %rdi
callq 0x74f0
nop