// File: /workspace/github_cpp_makefile_star2_O2/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 0x2775f
movb $0x0, 0x8(%r14)
addq $0x10, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x187be
jmp 0x27955
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl (%r14), %eax
xorl %ecx, %ecx
leaq 0x3ddc(%rip), %r13      # 0x2b558
leaq 0x8(%rsp), %r15
movabsq $0x340000003c005fb1, %rbp # imm = 0x340000003C005FB1
movabsq $0x100002600, %r12      # imm = 0x100002600
xorl %edi, %edi
movl %eax, %esi
movq 0x48(%r14), %r8
cmpq %rsi, %r8
jbe 0x2793a
movq 0x40(%r14), %rdx
movb (%rdx,%rsi), %sil
testb $0x1, %dil
je 0x277c1
cmpb $0xa, %sil
setne %dil
jmp 0x278b9
testb $0x1, %cl
je 0x277df
cmpb $0x2f, %sil
setne %cl
testl %eax, %eax
sete %dil
orb %cl, %dil
je 0x27801
movb $0x1, %cl
jmp 0x278b7
movzbl %sil, %ecx
cmpl $0x2f, %ecx
ja 0x27840
movl %ecx, %edi
btq %rdi, %r12
jae 0x27812
cmpq $0x0, 0x10(%rsp)
je 0x278b5
jmp 0x2793a
leal -0x1(%rax), %ecx
cmpb $0x2a, (%rdx,%rcx)
setne %cl
xorl %edi, %edi
jmp 0x278c3
cmpq $0x2f, %rdi
jne 0x27840
leal 0x1(%rax), %edi
cmpq %rdi, %r8
jbe 0x27845
cmpb $0x2f, (%rdx,%rdi)
jne 0x278cd
cmpq $0x0, 0x10(%rsp)
jne 0x2793a
movb $0x1, %dil
xorl %ecx, %ecx
jmp 0x278c3
incl %eax
movq %rax, %rdi
movsbl %sil, %esi
leal -0x21(%rcx), %eax
cmpq %rdi, %r8
jbe 0x27860
cmpl $0x1d, %eax
ja 0x2787c
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
cmpl $0x3d, %eax
ja 0x2786f
btq %rax, %rbp
jb 0x27922
addl $-0x7b, %ecx
cmpl $0x4, %ecx
jae 0x278a2
jmp 0x27922
addl $-0x5b, %ecx
cmpl $0x23, %ecx
ja 0x278a2
movabsq $0xd0000000d, %rax      # imm = 0xD0000000D
btq %rcx, %rax
jb 0x27922
cmpq $0x21, %rcx
je 0x27982
movq %r15, %rdi
callq 0x7260
movl (%r14), %eax
movq 0x40(%r14), %rcx
movb (%rcx,%rax), %sil
xorl %ecx, %ecx
xorl %edi, %edi
cmpb $0xa, %sil
jne 0x278c3
incl 0x4(%r14)
incl %eax
movl %eax, (%r14)
jmp 0x27797
cmpb $0x2a, (%rdx,%rdi)
jne 0x27845
cmpq $0x0, 0x10(%rsp)
jne 0x2793a
movb $0x1, %cl
jmp 0x2780b
cmpb $0x3d, (%rdx,%rdi)
jne 0x27922
cmpq $0x0, 0x10(%rsp)
jne 0x2793a
leaq 0x8(%rsp), %rdi
callq 0x7260
movl (%r14), %eax
incl %eax
movq 0x40(%r14), %rcx
movsbl (%rcx,%rax), %esi
leaq 0x8(%rsp), %rdi
callq 0x7260
pushq $0x2
jmp 0x27936
movb (%rdx,%rdi), %al
andb $-0x2, %al
cmpb $0x3c, %al
je 0x278ec
cmpq $0x0, 0x10(%rsp)
jne 0x2793a
leaq 0x8(%rsp), %rdi
callq 0x7260
pushq $0x1
popq %rax
addl %eax, (%r14)
movl 0x4(%r14), %edx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x183ac
leaq 0x8(%rsp), %rdi
callq 0x75c8
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x26, (%rdx,%rdi)
je 0x278ec
jmp 0x27922
movb (%rdx,%rdi), %al
addb $-0x3d, %al
cmpb $0x1, %al
jbe 0x278ec
jmp 0x27922
cmpb $0x7c, (%rdx,%rdi)
je 0x278ec
jmp 0x27922
jmp 0x27990
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x75c8
movq %rbx, %rdi
callq 0x7510
nop