// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq -0xa0(%rbp), %rbx
leaq -0x90(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x80(%rbp), %rdi
callq 0x2210
leaq -0x80(%rbp), %rsi
callq 0x2e7c
movl %eax, %r12d
leaq -0x80(%rbp), %rdi
callq 0x20c0
testl %r12d, %r12d
je 0x3082
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20f0
leaq -0xa8(%rbp), %rsi
movl %r12d, (%rsi)
movb $0x1, %r15b
movq %r14, %rdi
callq 0x3918
jmp 0x31ac
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
callq 0x2210
leaq -0x60(%rbp), %rsi
callq 0x2ec4
movl %eax, %r12d
leaq -0x60(%rbp), %rdi
callq 0x20c0
testb %r12b, %r12b
je 0x30b7
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20f0
pushq $0x1f
jmp 0x30ea
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x2210
leaq -0x40(%rbp), %rsi
callq 0x2f0a
movl %eax, %r12d
leaq -0x40(%rbp), %rdi
callq 0x20c0
testb %r12b, %r12b
je 0x3104
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20f0
pushq $0x20
popq %rax
leaq -0xa8(%rbp), %rsi
movl %eax, (%rsi)
movb $0x1, %r15b
movq %r14, %rdi
callq 0x3918
jmp 0x31ac
movq 0x7ecd(%rip), %rdi      # 0xafd8
leaq 0x3fd6(%rip), %rsi      # 0x70e8
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq 0x7eb2(%rip), %rdi      # 0xafd8
leaq 0x3fc4(%rip), %rsi      # 0x70f1
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2cb8
movq 0x7e8f(%rip), %rdi      # 0xafd8
leaq 0x3fc4(%rip), %rsi      # 0x7114
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2d2c
movq 0x7e6c(%rip), %rdi      # 0xafd8
leaq 0x4307(%rip), %rsi      # 0x747a
callq 0x2170
movq %rax, %rdi
movq %r15, %rsi
callq 0x2160
leaq 0x42f0(%rip), %rsi      # 0x747a
movq %rax, %rdi
callq 0x2170
leaq 0x3f96(%rip), %rsi      # 0x712f
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x20c0
movl %r15d, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x40(%rbp), %rdi
jmp 0x31e0
movq %rax, %r14
leaq -0x60(%rbp), %rdi
jmp 0x31e0
movq %rax, %r14
leaq -0x80(%rbp), %rdi
callq 0x20c0
jmp 0x31ec
jmp 0x31e9
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x2290