// File: /workspace/github_cpp_makefile_star2_O2/navrajsaini[P]PL_Compiler_design_project/symboltable.cpp
// Function: Symtable::insertNum(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Symtable::insertNum(string s)
{
   int hashval;
   int val = Symtable::search(s);//check if the word is in the table already
   //if not and the table is not full insert it based on if the word is a
   //keyword or special char or a user input ID
   if (val == -1 && Symtable::full() != true)
   {
      hashval = hashfn(s);
      //if and else if statements to create the token for the
      //keywords or the special chars which are then inserted.
      if (spellS (htable[hashval].getSymbol()) == "NONAME")//if the location is empty
      {
	 Token NUM(Symbol::NUM, hashval, s);
	 htable.insert (htable.begin()+hashval, NUM);
	 occupied++;
	 return hashval;
      }
      else//increment the hashval and insert the token into a free loc
      {
	 while ( spellS(htable[hashval].getSymbol()) != "NONAME")
	    //keep looking for a free location
	 {
	    hashval += 1;
	 }
	 Token NUM(Symbol::NUM, hashval, s);
	 htable.insert (htable.begin()+hashval, NUM);
	 occupied++;
	 return hashval;
      }
   }
   else if (val != -1)
   {
      return val;
   }
   else
      return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r12
movq %rdi, %rbx
leaq -0x80(%rbp), %r14
movq %r14, %rdi
callq 0x2240
movq %rbx, %rdi
movq %r14, %rsi
callq 0x755a
movl %eax, %r14d
leaq -0x80(%rbp), %rdi
callq 0x20d0
cmpl $-0x1, %r14d
jne 0x78c1
cmpl $0x133, 0x18(%rbx)      # imm = 0x133
jne 0x777b
pushq $-0x1
popq %r14
jmp 0x78c1
leaq -0xe0(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x2240
imull $0x137, 0x18(%rbx), %eax # imm = 0x137
movl $0x132, %ecx            # imm = 0x132
cltd
idivl %ecx
movl %edx, %r14d
movq %r15, %rdi
callq 0x20d0
movslq %r14d, %rax
movq (%rbx), %rcx
imulq $0x30, %rax, %r15
movl 0x28(%rcx,%r15), %esi
movq %r12, -0x30(%rbp)
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x3898
leaq 0x7b38(%rip), %rsi      # 0xf305
movq %r12, %rdi
callq 0x7926
movl %eax, %r13d
movq %r12, %rdi
callq 0x20d0
testb %r13b, %r13b
je 0x782f
leaq -0xc0(%rbp), %r12
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0x2240
leaq -0x60(%rbp), %rdi
movl $0x101, %esi            # imm = 0x101
movl %r14d, %edx
movq %r12, %rcx
callq 0x7936
leaq -0xc0(%rbp), %rdi
callq 0x20d0
addq (%rbx), %r15
leaq -0x60(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x799a
jmp 0x78b5
decl %r14d
addq $-0x30, %r15
leaq -0x60(%rbp), %r13
movq (%rbx), %rax
movl 0x58(%rax,%r15), %esi
movq %r13, %rdi
callq 0x3898
movq %r13, %rdi
leaq 0x7ab1(%rip), %rsi      # 0xf305
callq 0x7a38
movl %eax, %r12d
movq %r13, %rdi
callq 0x20d0
incl %r14d
addq $0x30, %r15
testb %r12b, %r12b
jne 0x783a
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0x2240
leaq -0x60(%rbp), %rdi
movl $0x101, %esi            # imm = 0x101
movl %r14d, %edx
movq %r12, %rcx
callq 0x7936
leaq -0xa0(%rbp), %rdi
callq 0x20d0
addq (%rbx), %r15
leaq -0x60(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x799a
incl 0x18(%rbx)
leaq -0x58(%rbp), %rdi
callq 0x20d0
movl %r14d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x78d8
movq %rax, %rbx
leaq -0x58(%rbp), %r12
jmp 0x78e6
jmp 0x78e3
movq %rax, %rbx
movq %r12, %rdi
jmp 0x78f2
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x22e0
nop