// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-assembler/src/tokenizer.cpp
// Function: Tokenizer::_addToken(std::vector<Token, std::allocator<Token>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Tokenizer::_addToken(std::vector<Token>& tokens,
                          const std::string& text) {
  // Find the type of token
  if (opcodes.find(text) != opcodes.end()) {
    // The token is an opcode
    Token t(OPCODE, text);
    tokens.push_back(t);
  } else if (registers.find(text) != registers.end()) {
    // The token is a register
    Token t(REGISTER, text);
    tokens.push_back(t);
  } else if (_isValidData(text)) {
    // The token is data
    std::string data;
    _getData(text, data);
    Token t(DATA, data);
    tokens.push_back(t);
  } else if (':' == text[text.size() - 1] &&
             _isValidLabel(text.substr(0, text.size() - 1))) {
    // The token ends in :, it is a label declaration
    std::string label = text.substr(0, text.size() - 1);
    Token t(LABELDECL, label);
    tokens.push_back(t);
  } else if (_isValidLabel(text)) {
    // The token is a label reference
    Token t(LABELREF, text);
    tokens.push_back(t);
  } else {
    // The token is of an unknown type
    Token t(UNKNOWN, text);
    tokens.push_back(t);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdx, %r14
movq %rsi, %rbx
leaq 0x6bd5(%rip), %rdi      # 0xb190
movq %rdx, %rsi
callq 0x52be
leaq 0x6bce(%rip), %rcx      # 0xb198
cmpq %rcx, %rax
je 0x4602
leaq 0x10(%rsp), %rdi
movl $0x0, -0x8(%rdi)
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x4caa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b78
jmp 0x464e
leaq 0x6bb7(%rip), %rdi      # 0xb1c0
movq %r14, %rsi
callq 0x55ca
leaq 0x6bb0(%rip), %rcx      # 0xb1c8
cmpq %rcx, %rax
je 0x4672
leaq 0x10(%rsp), %rdi
movl $0x1, -0x8(%rdi)
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x4caa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b78
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x4665
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rsi
callq 0x43b8
testb %al, %al
je 0x4707
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x30(%rsp), %rdx
movq %r14, %rsi
callq 0x4468
leaq 0x10(%rsp), %rdi
movl $0x2, -0x8(%rdi)
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
callq 0x4caa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b78
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x46ef
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x4665
movq 0x40(%rsp), %rsi
jmp 0x465d
movq (%r14), %rax
movq 0x8(%r14), %rcx
movb -0x1(%rax,%rcx), %r12b
cmpb $0x3a, %r12b
jne 0x473a
decq %rcx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x21d0
movq %r15, %rsi
callq 0x434c
movl %eax, %ebp
jmp 0x473c
xorl %ebp, %ebp
cmpb $0x3a, %r12b
jne 0x475d
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x475d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21b0
testb %bpl, %bpl
je 0x47df
movq 0x8(%r14), %rcx
decq %rcx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x21d0
leaq 0x10(%rsp), %rdi
movl $0x3, -0x8(%rdi)
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
callq 0x4caa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b78
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x47c3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4665
movq 0x60(%rsp), %rsi
jmp 0x465d
movq %r14, %rsi
callq 0x434c
leaq 0x10(%rsp), %rdi
testb %al, %al
je 0x4821
movl $0x4, -0x8(%rdi)
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x4caa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b78
jmp 0x464e
movl $0x5, -0x8(%rdi)
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x4caa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b78
jmp 0x464e
jmp 0x48be
jmp 0x48be
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x4875
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x4875
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x48d8
movq 0x60(%rsp), %rsi
jmp 0x48d0
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x48ab
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x48ab
jmp 0x48a8
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x48d8
movq 0x40(%rsp), %rsi
jmp 0x48d0
jmp 0x48be
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x48d8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2290