// File: /workspace/github_cpp_makefile_star2_O3/zakimjz[P]SLEUTH/hashtable.cpp
// Function: FreqHT::add(int, Eqclass*)
void FreqHT::add(int iter, Eqclass *eq){
   vector<int> *iset;
   int phval = 0;
   int i;
   for (i=0; i < eq->prefix().size(); i++)
      if (eq->prefix()[i] != BranchIt) phval += eq->prefix()[i];
   
   
   int hval = 0;
   int scope, scnt;
   list<Eqnode *>::iterator ni = eq->nlist().begin();
   for (; ni != eq->nlist().end(); ni++){
      iset = new vector<int>(eq->prefix());
      scnt = eq->get_scope((*ni)->pos, scope); //what is the scope of node.pos
      while(scnt > scope){
         iset->push_back(BranchIt);
         scnt--;
      }
      iset->push_back((*ni)->val);
      hval = phval + (*ni)->val;
      if (chtable[iter] == NULL) chtable[iter] = new cHTable(FHTSIZE);
      int hres = chtable[iter]->hash_funct()(hval);
      chtable[iter]->insert(cHTPair(hres, iset));
      //cout << "ADD " << hres << " xx " << *iset << endl;
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rdi, 0x10(%rsp)
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
subq %rax, %rcx
je 0x7cb8
sarq $0x2, %rcx
leaq 0x554b(%rip), %rdx      # 0xd1d8
cmpq $0x1, %rcx
adcq $0x0, %rcx
movq (%rdx), %rdx
xorl %edi, %edi
xorl %r8d, %r8d
xorl %r15d, %r15d
movslq (%rax,%r8,4), %r9
cmpq %r9, %rdx
cmovel %edi, %r9d
addl %r9d, %r15d
incq %r8
cmpq %r8, %rcx
jne 0x7ca0
jmp 0x7cbb
xorl %r15d, %r15d
leaq 0x18(%rbx), %rax
movq 0x18(%rbx), %r14
movq %rax, 0x20(%rsp)
cmpq %rax, %r14
je 0x7e09
movslq %esi, %rax
movq %rax, 0x8(%rsp)
leaq 0x28(%rsp), %r12
movq %rbx, 0x18(%rsp)
movl $0x18, %edi
callq 0x21d0
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
callq 0x35c0
movq 0x10(%r14), %rax
movl 0x4(%rax), %esi
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
callq 0x396c
cmpl 0x4(%rsp), %eax
leaq 0x54be(%rip), %rbx      # 0xd1d8
jle 0x7d51
movl %eax, %ebp
movq (%rbx), %rax
movl %eax, 0x28(%rsp)
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x7d3b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r13)
jmp 0x7d49
movq %r13, %rdi
movq %r12, %rdx
callq 0x400e
movq (%rbx), %rax
decl %ebp
cmpl 0x4(%rsp), %ebp
jg 0x7d21
movq 0x10(%r14), %rdx
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x7d6d
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r13)
jmp 0x7d75
movq %r13, %rdi
callq 0x3e9a
movq 0x10(%r14), %rax
movl (%rax), %ebx
addl %r15d, %ebx
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rbp
testq %rbp, %rbp
jne 0x7dd3
movl $0x28, %edi
callq 0x21d0
movq %rax, %rbp
movl $0x64, %esi
movq %rax, %rdi
movq %r12, %rdx
leaq 0x3(%rsp), %rcx
leaq 0x2(%rsp), %r8
callq 0x7f38
movq 0x10(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rsp), %rdx
movq %rbp, (%rax,%rdx,8)
movq (%rcx), %rax
movq (%rax,%rdx,8), %rbp
movl %ebx, 0x28(%rsp)
movq %r13, 0x30(%rsp)
movq 0x20(%rbp), %rsi
incq %rsi
movq %rbp, %rdi
callq 0x8520
movq %rbp, %rdi
movq %r12, %rsi
callq 0x8650
movq (%r14), %r14
cmpq 0x20(%rsp), %r14
movq 0x18(%rsp), %rbx
jne 0x7ce3
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x28, %esi
movq %rbp, %rdi
jmp 0x7e30
movq %rax, %rbx
movl $0x18, %esi
movq %r13, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x2350