// File: /workspace/github_cpp_makefile_star2_O3/smallsimple[P]CoreInterpreter-CSE5341/Tokenizer.cpp
// Function: Tokenizer::dealToken(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Tokenizer::dealToken(string str){
  int start = 0;
  int flag = 0; 
  Token tok;
  vector<SpecMarker> sMarker1;
  sMarker1 = this->searchSpec(str);
  for (int i = 0; i < sMarker1.size(); i++){
    // deal with string before special symbol if any
    if (start < sMarker1[i].start){
      int len = sMarker1[i].start - start;
      int ID;
      string temp = str.substr(start, len);
      if(!isLegalToken(temp)) {
	cout << "program stopped." << endl;
	exit(0);
      }
    }
    // deal with speical symbol
    tok.name = specSymbols[sMarker1[i].id];
    tok.num = sMarker1[i].id + 12;
    tokens.push_back(tok);
    // move start to end of next speical symbol
    start = sMarker1[i].start + specSymbols[sMarker1[i].id].size();
  }
  
  // if there is token after the last special symbols
  if (start < str.size()){
    string temp = str.substr(start, str.size()-start);
    if(!isLegalToken(temp)) {
      cout << "program stopped." << endl;
      exit(0);
    }
    else{
    }
    
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r15
movq %rdi, %r13
leaq -0x90(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0xd8(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x40ba
leaq -0x50(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0x2fa6
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq -0xe8(%rbp), %rdi
cmpq %r12, %rdi
je 0x36b8
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x21a0
xorl %edx, %edx
subq -0x30(%rbp), %rbx
je 0x37d9
movq %r15, -0x60(%rbp)
sarq $0x3, %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
leaq -0x80(%rbp), %r12
xorl %r15d, %r15d
movq -0x30(%rbp), %r14
movl (%r14,%r15,8), %eax
subl %edx, %eax
jle 0x376e
movslq %edx, %rdx
movslq %eax, %rcx
leaq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x21b0
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x40ba
movq %r12, %rsi
movq %r13, %r12
movq %r13, %rdi
movq %rsi, %r14
callq 0x3250
movl %eax, %r13d
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x3746
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21a0
testb %r13b, %r13b
je 0x38ac
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
movq %r12, %r13
je 0x376b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21a0
movq %r14, %r12
movq -0x30(%rbp), %r14
movslq 0x4(%r14,%r15,8), %rsi
shlq $0x5, %rsi
leaq 0x8b7e(%rip), %rax      # 0xc300
addq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x20e0
movl 0x4(%r14,%r15,8), %eax
addl $0xc, %eax
movl %eax, -0xa8(%rbp)
movq %r13, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3fee
movl (%r14,%r15,8), %edx
movslq 0x4(%r14,%r15,8), %rax
shlq $0x5, %rax
leaq 0x8b3e(%rip), %rcx      # 0xc300
addl 0x8(%rax,%rcx), %edx
incq %r15
cmpq %r15, %rbx
jne 0x36df
movslq %edx, %rdx
movq -0x60(%rbp), %r15
movq 0x8(%r15), %rcx
subq %rdx, %rcx
movq -0x30(%rbp), %rbx
jbe 0x3864
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x21b0
leaq -0xb8(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x40ba
leaq -0xc8(%rbp), %rsi
movq %r13, %rdi
callq 0x3250
movl %eax, %r14d
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3842
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x21a0
testb %r14b, %r14b
je 0x38d7
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3864
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21a0
testq %rbx, %rbx
je 0x3878
movq -0x58(%rbp), %rsi
subq %rbx, %rsi
movq %rbx, %rdi
callq 0x21a0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x389a
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21a0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8725(%rip), %rdi      # 0xbfd8
leaq 0x4860(%rip), %rsi      # 0x811a
movl $0x10, %edx
callq 0x21d0
movq 0x870d(%rip), %rdi      # 0xbfd8
callq 0x20c0
xorl %edi, %edi
callq 0x21f0
movq 0x86fa(%rip), %rdi      # 0xbfd8
leaq 0x4835(%rip), %rsi      # 0x811a
movl $0x10, %edx
callq 0x21d0
movq 0x86e2(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x38d0
movq %rax, %r15
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3925
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x21a0
jmp 0x3925
movq %rax, %r15
jmp 0x393e
movq %rax, %r15
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x393e
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21a0
cmpq $0x0, -0x30(%rbp)
jne 0x39aa
jmp 0x39ba
movq %rax, %r15
movq -0xe8(%rbp), %rdi
cmpq %r12, %rdi
je 0x39ba
movq -0xd8(%rbp), %rsi
incq %rsi
jmp 0x39b5
movq %rax, %r15
jmp 0x39ba
jmp 0x3989
jmp 0x39a7
movq %rax, %r15
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x398c
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21a0
jmp 0x398c
movq %rax, %r15
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x39aa
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21a0
jmp 0x39aa
movq %rax, %r15
movq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rdi
subq %rdi, %rsi
callq 0x21a0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x39dc
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x21a0
movq %r15, %rdi
callq 0x22a0