// File: /workspace/github_cpp_makefile_star2_O1/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, %r12
movq %rdi, 0x10(%rsp)
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
subq %rax, %rcx
je 0x792c
sarq $0x2, %rcx
leaq 0x58d7(%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 0x7914
jmp 0x792f
xorl %r15d, %r15d
leaq 0x18(%r12), %rax
movq 0x18(%r12), %rbx
movq %rax, 0x30(%rsp)
cmpq %rax, %rbx
je 0x7a80
movslq %esi, %rax
movq %rax, 0x8(%rsp)
leaq 0x5882(%rip), %r14      # 0xd1d8
movq %r12, 0x28(%rsp)
movl $0x18, %edi
callq 0x21d0
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x3630
movq 0x10(%rbx), %rax
movl 0x4(%rax), %esi
movq %r12, %rdi
leaq 0x4(%rsp), %rdx
callq 0x39cc
cmpl 0x4(%rsp), %eax
leaq 0x18(%rsp), %r12
jle 0x79c4
movl %eax, %ebp
movl (%r14), %eax
movl %eax, 0x18(%rsp)
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x79b1
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r13)
jmp 0x79bc
movq %r13, %rdi
movq %r12, %rdx
callq 0x405e
decl %ebp
cmpl 0x4(%rsp), %ebp
jg 0x7994
movq 0x10(%rbx), %rdx
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x79e0
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r13)
jmp 0x79e8
movq %r13, %rdi
callq 0x3ef0
movq 0x10(%rbx), %rax
movl (%rax), %r12d
addl %r15d, %r12d
movq 0x10(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rsp), %rdx
cmpq $0x0, (%rax,%rdx,8)
jne 0x7a40
movl $0x28, %edi
callq 0x21d0
movq %rax, %rbp
movl $0x64, %esi
movq %rax, %rdi
leaq 0x18(%rsp), %rdx
leaq 0x3(%rsp), %rcx
leaq 0x2(%rsp), %r8
callq 0x7ba6
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 %r12d, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq 0x20(%rbp), %rsi
incq %rsi
movq %rbp, %rdi
callq 0x7f3c
movq %rbp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x8078
movq (%rbx), %rbx
cmpq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r12
jne 0x795b
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 0x7aa7
movq %rax, %rbx
movl $0x18, %esi
movq %r13, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x2350