// File: /workspace/github_cpp_makefile_star2_O3/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 $0x88, %rsp
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x40ba
movq %r15, %r14
movq $-0xb, %r15
leaq 0x8ef7(%rip), %r12      # 0xc1a0
leaq -0x70(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x2040
testl %eax, %eax
je 0x32ca
addq $0x20, %r12
incq %r15
jne 0x32ad
xorl %r15d, %r15d
jmp 0x32ce
addl $0xc, %r15d
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
movq %r14, %r13
je 0x32ea
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21a0
testl %r15d, %r15d
movq %rbx, %r14
je 0x3315
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x20e0
leaq -0x50(%rbp), %rsi
movl %r15d, (%rsi)
movb $0x1, %r14b
movq %r13, %rdi
callq 0x3fee
jmp 0x3590
leaq -0xa0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x40ba
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rax
testq %rax, %rax
je 0x337a
movsbl (%rdi), %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0x33a9
movl $0x1, %edx
movq %rdx, %rcx
cmpq %rdx, %rax
je 0x3371
movsbl (%rdi,%rcx), %esi
addl $-0x30, %esi
leaq 0x1(%rcx), %rdx
cmpl $0xa, %esi
jb 0x3359
cmpq %rcx, %rax
setbe %r15b
jmp 0x337d
movb $0x1, %r15b
cmpq %rbx, %rdi
je 0x3391
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x21a0
testb %r15b, %r15b
je 0x33bd
movl $0x1f, %ebx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x20e0
jmp 0x3418
cmpq %rbx, %rdi
je 0x33bd
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x21a0
leaq -0x80(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x40ba
leaq -0x90(%rbp), %rsi
callq 0x3168
movl %eax, %r12d
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3402
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21a0
testb %r12b, %r12b
je 0x342e
movl $0x20, %ebx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x20e0
leaq -0x50(%rbp), %rsi
movl %ebx, (%rsi)
movb $0x1, %r14b
movq %r13, %rdi
callq 0x3fee
jmp 0x3590
movq 0x8ba3(%rip), %r15      # 0xbfd8
leaq 0x4c80(%rip), %rsi      # 0x80bc
movl $0x8, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x8b71(%rip), %rdi      # 0xbfd8
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x8b5d(%rip), %r15      # 0xbfd8
leaq 0x4c43(%rip), %rsi      # 0x80c5
movl $0x22, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x8b2b(%rip), %rdi      # 0xbfd8
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x2e5c
movq 0x8b0f(%rip), %r15      # 0xbfd8
leaq 0x4c18(%rip), %rsi      # 0x80e8
movl $0x1a, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq 0x8add(%rip), %rdi      # 0xbfd8
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x2f10
movq 0x8ac1(%rip), %rdi      # 0xbfd8
leaq 0x4f7b(%rip), %rsi      # 0x8499
movl $0x1, %edx
callq 0x21d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x8aa2(%rip), %rdi      # 0xbfd8
callq 0x21d0
movq %rax, %rbx
leaq 0x4f54(%rip), %rsi      # 0x8499
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
leaq 0x4baa(%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
xorl %r14d, %r14d
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x35a9
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21a0
movl %r14d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x35f6
movq -0x80(%rbp), %rsi
jmp 0x35ee
jmp 0x35d5
movq %rax, %r14
jmp 0x35f6
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x35f6
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21a0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x360f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21a0
movq %r14, %rdi
callq 0x22a0
nop