// File: /workspace/github_cpp_makefile_star2_O1/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 0x32fd1
movb $0x0, 0x8(%r14)
leaq 0x13db4(%rip), %rax     # 0x46d50
movq %rax, (%rbx)
movl 0x18(%r14), %eax
movl %eax, 0x8(%rbx)
leaq 0x13d33(%rip), %rax     # 0x46ce0
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 0xc014
jmp 0x331ff
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl (%r14), %eax
movq 0x48(%r14), %rsi
cmpq %rax, %rsi
jbe 0x331ad
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
xorl %r13d, %r13d
xorl %r15d, %r15d
testb $0x1, %r13b
je 0x3301a
movq 0x40(%r14), %rcx
cmpb $0xa, (%rcx,%rax)
movzbl %r13b, %r13d
cmovel %ebp, %r13d
jmp 0x33065
movq 0x40(%r14), %rdx
movzbl (%rdx,%rax), %ecx
testb $0x1, %r15b
je 0x33041
testl %eax, %eax
je 0x33065
cmpb $0x2f, %cl
jne 0x33065
decl %eax
cmpb $0x2a, (%rdx,%rax)
movzbl %r15b, %r15d
cmovel %ebp, %r15d
jmp 0x33065
cmpl $0x20, %ecx
ja 0x3308d
movl %ecx, %r8d
movabsq $0x100002600, %r9       # imm = 0x100002600
btq %r8, %r9
jae 0x3308d
cmpq $0x0, 0x10(%rsp)
jne 0x331ad
movl (%r14), %eax
movq 0x40(%r14), %rcx
cmpb $0xa, (%rcx,%rax)
jne 0x33076
incl 0x4(%r14)
incl %eax
movl %eax, (%r14)
movq 0x48(%r14), %rsi
cmpq %rax, %rsi
ja 0x33002
jmp 0x331ad
cmpl $0x2f, %ecx
jne 0x330bd
leal 0x1(%rax), %r8d
cmpq %r8, %rsi
jbe 0x330a7
cmpb $0x2f, (%rdx,%r8)
jne 0x330a7
movb $0x1, %r13b
jmp 0x33059
cmpl $0x2f, %ecx
jne 0x330bd
cmpq %r8, %rsi
jbe 0x330bd
cmpb $0x2a, (%rdx,%r8)
jne 0x330bd
movb $0x1, %r15b
jmp 0x33059
incl %eax
cmpq %rax, %rsi
jbe 0x33160
cmpl $0x3c, %ecx
jg 0x330d4
cmpl $0x21, %ecx
jne 0x330f2
jmp 0x3311a
cmpl $0x3d, %ecx
je 0x3310b
cmpl $0x7c, %ecx
jne 0x33124
cmpb $0x7c, (%rdx,%rax)
je 0x33211
cmpl $0x21, %ecx
je 0x3311a
cmpl $0x3d, %ecx
je 0x3310b
cmpl $0x26, %ecx
jne 0x33124
cmpb $0x26, (%rdx,%rax)
je 0x33211
cmpl $0x21, %ecx
je 0x3311a
cmpl $0x3d, %ecx
jne 0x33124
cmpb $0x3d, (%rdx,%rax)
je 0x33211
cmpl $0x21, %ecx
jne 0x33124
cmpb $0x3d, (%rdx,%rax)
je 0x33211
cmpl $0x3c, %ecx
jne 0x33133
cmpb $0x3d, (%rdx,%rax)
je 0x33211
cmpl $0x3e, %ecx
jne 0x33142
cmpb $0x3d, (%rdx,%rax)
je 0x33211
cmpl $0x3c, %ecx
jne 0x33151
cmpb $0x3c, (%rdx,%rax)
je 0x33211
cmpl $0x3e, %ecx
jne 0x33160
cmpb $0x3e, (%rdx,%rax)
je 0x33211
leal -0x21(%rcx), %eax
cmpl $0x3d, %eax
ja 0x33178
movabsq $0x340000003c005fb1, %rdx # imm = 0x340000003C005FB1
btq %rax, %rdx
jb 0x33190
leal -0x7b(%rcx), %eax
cmpl $0x4, %eax
jb 0x33190
movsbl %cl, %esi
movq %r12, %rdi
callq 0x7260
jmp 0x33065
cmpq $0x0, 0x10(%rsp)
jne 0x331ad
movl $0x1, %ebp
movsbl %cl, %esi
leaq 0x8(%rsp), %rdi
callq 0x7260
addl %ebp, (%r14)
movl 0x4(%r14), %ebp
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
leaq 0x13b21(%rip), %rax     # 0x46ce0
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 0xc014
movl %ebp, 0x8(%rbx)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x331ff
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
cmpq $0x0, 0x10(%rsp)
jne 0x331ad
movsbl %cl, %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 0x331aa
jmp 0x33249
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x33268
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, %rdi
callq 0x74f0