// File: rfotino[P]consolite-assembler/src/tokenizer.cpp
// Function: Tokenizer::getLineOfTokens(std::vector<Token, std::allocator<Token>>&)
void Tokenizer::getLineOfTokens(std::vector<Token> &tokens) {
  if (hasError()) {
    return;
  }

  std::string line;
  std::getline(_input, line);
  _charsRead = line.size();
  tokens.clear();

  size_t start = 0;
  for (size_t end = 0; end <= line.size(); end++) {
    if (end == line.size() || ';' == line[end] || ' ' == line[end]) {
      // We are on a token boundary
      size_t token_size = end - start;
      if (0 != token_size) {
        std::string token_text = line.substr(start, token_size);
        _addToken(tokens, token_text);
      }
      start = end + 1;
    }
    // If we're at the start of a comment, end tokenization
    if (end != line.size() && ';' == line[end]) {
      break;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x6a40
testb $0x1, %al
jne 0x5f86
jmp 0x5f8b
jmp 0x615f
leaq -0x30(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x22e0
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x2060
jmp 0x5fad
leaq -0x30(%rbp), %rdi
callq 0x2150
movq %rax, %rcx
movq -0x80(%rbp), %rax
movl %ecx, 0x208(%rax)
movq -0x10(%rbp), %rdi
callq 0x6a70
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2150
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
ja 0x6156
movq -0x50(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2150
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
je 0x6078
movq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2400
movq %rax, -0xa0(%rbp)
jmp 0x603c
movq -0xa0(%rbp), %rax
movsbl (%rax), %ecx
movl $0x3b, %eax
cmpl %ecx, %eax
je 0x6078
movq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2400
movq %rax, -0xa8(%rbp)
jmp 0x6065
movq -0xa8(%rbp), %rax
movsbl (%rax), %ecx
movl $0x20, %eax
cmpl %ecx, %eax
jne 0x60f5
movq -0x50(%rbp), %rax
subq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
xorl %eax, %eax
cmpq -0x58(%rbp), %rax
je 0x60e9
movq -0x48(%rbp), %rdx
movq -0x58(%rbp), %rcx
leaq -0x78(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2220
jmp 0x60a3
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x5b00
jmp 0x60b6
leaq -0x78(%rbp), %rdi
callq 0x2120
jmp 0x60e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6168
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x2120
jmp 0x6168
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2150
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
je 0x6143
movq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2400
movq %rax, -0xb8(%rbp)
jmp 0x612e
movq -0xb8(%rbp), %rax
movsbl (%rax), %ecx
movl $0x3b, %eax
cmpl %ecx, %eax
jne 0x6143
jmp 0x6156
jmp 0x6145
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x5fdc
leaq -0x30(%rbp), %rdi
callq 0x2120
addq $0xc0, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x2120
movq -0x38(%rbp), %rdi
callq 0x23a0
nopw (%rax,%rax)