// File: /workspace/github_cpp_makefile_star2_O1/smallsimple[P]CoreInterpreter-CSE5341/Tokenizer.cpp
// Function: Tokenizer::isLegalToken(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool Tokenizer::isLegalToken(string temp){
  int flag = 0;
  Token tok;
  // is temp a reserved word
  if (int ID = isRes(temp)){
    flag = 1;
    tok.name = temp;
    tok.num = ID;
    tokens.push_back(tok);
  }
  // is temp a integer
  if (flag ==0 && isIntegers(temp)){
    flag = 1;
    tok.name = temp;
    tok.num = 31;
    tokens.push_back(tok);
  }
  // is temp a legal identifier
  if (flag ==0 && isIdenti(temp)){
    flag = 1;
    tok.name = temp;
    tok.num = 32;
    tokens.push_back(tok);
  }
  // temps is not one of reserved word, special symbols, integer and Id
  // print error
  if (flag == 0){
    cout << "Error!!!" << endl;
    cout << "the current recognized tokens are:" << endl;
    this->printTokensName();
    cout << "cooresponding numbers are:" << endl;
    this->printTokensNum();
    cout << "\"" << temp << "\"" << " is not a legal token." << endl;
    return false;
  }
  else{
    return true;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, -0x30(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x88(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0x4146
movq $-0xb, %r12
leaq 0x8eb5(%rip), %r15      # 0xc1b0
leaq -0x98(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x2040
testl %eax, %eax
je 0x331f
addq $0x20, %r15
incq %r12
jne 0x3302
xorl %r12d, %r12d
jmp 0x3323
addl $0xc, %r12d
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0x333e
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21a0
testl %r12d, %r12d
je 0x3367
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x20e0
leaq -0x58(%rbp), %rsi
movl %r12d, (%rsi)
movl $0x1, %r15d
movq -0x30(%rbp), %rdi
callq 0x407e
jmp 0x336a
xorl %r15d, %r15d
testl %r12d, %r12d
je 0x33cd
xorl %r14d, %r14d
testl %r12d, %r12d
jne 0x3396
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3396
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21a0
testb %r14b, %r14b
je 0x33c0
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x20e0
leaq -0x58(%rbp), %rsi
movl $0x1f, (%rsi)
movl $0x1, %r15d
movq -0x30(%rbp), %rdi
callq 0x407e
testl %r15d, %r15d
je 0x3441
xorl %r13d, %r13d
jmp 0x3468
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x4146
movq -0xb0(%rbp), %rax
testq %rax, %rax
sete %r14b
je 0x3372
movq -0xb8(%rbp), %rcx
movsbl (%rcx), %edx
addl $-0x30, %edx
cmpl $0x9, %edx
ja 0x336f
movl $0x1, %esi
movq %rsi, %rdx
cmpq %rsi, %rax
je 0x3435
movsbl (%rcx,%rdx), %edi
addl $-0x30, %edi
leaq 0x1(%rdx), %rsi
cmpl $0xa, %edi
jb 0x341d
cmpq %rdx, %rax
setbe %r14b
jmp 0x3372
leaq -0x68(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x4146
leaq -0x78(%rbp), %rsi
callq 0x3174
movl %eax, %r13d
testl %r15d, %r15d
jne 0x3486
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3486
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21a0
testb %r13b, %r13b
je 0x34b0
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x20e0
leaq -0x58(%rbp), %rsi
movl $0x20, (%rsi)
movl $0x1, %r15d
movq -0x30(%rbp), %rdi
callq 0x407e
testl %r15d, %r15d
jne 0x361d
movq 0x8b18(%rip), %r12      # 0xbfd8
leaq 0x4bf5(%rip), %rsi      # 0x80bc
movl $0x8, %edx
movq %r12, %rdi
callq 0x21d0
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x8ae5(%rip), %rdi      # 0xbfd8
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x8ad1(%rip), %r12      # 0xbfd8
leaq 0x4bb7(%rip), %rsi      # 0x80c5
movl $0x22, %edx
movq %r12, %rdi
callq 0x21d0
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x8a9e(%rip), %rdi      # 0xbfd8
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq -0x30(%rbp), %rdi
callq 0x2e6c
movq 0x8a81(%rip), %r12      # 0xbfd8
leaq 0x4b8a(%rip), %rsi      # 0x80e8
movl $0x1a, %edx
movq %r12, %rdi
callq 0x21d0
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x8a4e(%rip), %rdi      # 0xbfd8
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq -0x30(%rbp), %rdi
callq 0x2f20
movq 0x8a31(%rip), %rdi      # 0xbfd8
leaq 0x4eeb(%rip), %rsi      # 0x8499
movl $0x1, %edx
callq 0x21d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x8a12(%rip), %rdi      # 0xbfd8
callq 0x21d0
movq %rax, %rbx
leaq 0x4ec4(%rip), %rsi      # 0x8499
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
leaq 0x4b1a(%rip), %rsi      # 0x8103
movl $0x16, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3636
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21a0
movl %r15d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0x3682
movq -0x68(%rbp), %rsi
jmp 0x367a
jmp 0x365f
movq %rax, %rbx
jmp 0x3682
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0x3682
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21a0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x369b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0
nop