// File: /workspace/github_c_makefile_star2_O2/ComplexNetworks-DCC-FCUP[P]gtrieScanner/GTrie.cpp
// Function: GTrieNode::goCondUndir()
void GTrieNode::goCondUndir() {  
  int i, j, ci, mylim, glaux;
  int ncand;
  int *p;

  mylim = INT_MAX;
  if (!cond_ok) {
    i = 1;
    list< list<iPair> >::const_iterator jj, jjend;
    list<iPair>::const_iterator kk, kkend;
    for (jj=cond.begin(), jjend=cond.end(); jj!=jjend; ++jj) {
      glaux = -1;
      for (kk=(*jj).begin(), kkend=(*jj).end(); kk!=kkend; ++kk)
	if (kk->second<glk && mymap[kk->first] > mymap[kk->second])
	  break;
	else if (kk->second==glk && mymap[kk->first]>glaux)
	  glaux = mymap[kk->first];
      if (kk==kkend) {
	i = 0;
	if (glaux < mylim) mylim=glaux;
      }
    }
    if (i) return;
  }
  if (mylim == INT_MAX) mylim = 0;
    
  ncand=0;
  j=ci=INT_MAX;
  for (i=0; i<nconn; i++) {
    glaux = numnei[mymap[conn[i]]];
    if (glaux<j) {
      ci = mymap[conn[i]];
      j = glaux;
    }
  }

  glaux = j;
  ncand = ci;
  for (p=&fastnei[ncand][j-1], ci= glaux-1; ci>=0; ci--, p--) {    
    i = *p;
    if (i<mylim) break;
    if (used[i]) continue;
    mymap[glk] = i;
    
    bool *b = &adjM[i][0];
    for (j=0; j<glk; j++)
      if (out[j] != *(b+mymap[j]))
	break;
    if (j<glk) continue;
    
    if (is_graph) {
      frequency++;
      if (Global::show_occ) {
	for (int k = 0; k<=glk; k++)
	  for (int l = 0; l<=glk; l++)
	    fputc(adjM[mymap[k]][mymap[l]]?'1':'0', Global::occ_file);
	fputc(':', Global::occ_file);
	for (int k = 0; k<=glk; k++)
	  fprintf(Global::occ_file, " %d", mymap[k]+1);
	fputc('\n', Global::occ_file);
      }
    }

    used[i]=true;
    glk++;
    list<GTrieNode *>::const_iterator ii, iiend;
    for(ii=child.begin(), iiend = child.end(); ii!=iiend; ++ii)
      (*ii)->goCondUndir();
    glk--;
    used[i]=false;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x19249(%rip), %rax     # 0x21b60
cmpb $0x0, 0x48(%rdi)
movq %rdi, (%rsp)
je 0x8b2e
xorl %r12d, %r12d
movl 0x74(%rdi), %ecx
movq 0x1924e(%rip), %rdx     # 0x21b80
movq 0x78(%rdi), %rsi
xorl %r11d, %r11d
testl %ecx, %ecx
cmovlel %r11d, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
cmpq %r11, %rcx
je 0x896c
movslq (%rsi,%r11,4), %r9
movslq (%rax,%r9,4), %r9
movl (%rdx,%r9,4), %r10d
cmpl %r13d, %r10d
cmovll %r9d, %r8d
cmovll %r10d, %r13d
incq %r11
jmp 0x894b
movq 0x19205(%rip), %rax     # 0x21b78
movslq %r8d, %rcx
movq (%rax,%rcx,8), %rax
movslq %r13d, %rcx
decl %r13d
leaq (%rax,%rcx,4), %rbp
addq $-0x4, %rbp
leaq 0x30(%rdi), %r14
leaq 0x21175(%rip), %rbx     # 0x29b08
testl %r13d, %r13d
js 0x8bac
movl (%rbp), %eax
cmpl %r12d, %eax
jl 0x8bac
movslq %eax, %r15
movq 0x191b6(%rip), %rcx     # 0x21b68
cmpb $0x0, (%rcx,%r15)
jne 0x8b22
movq 0x1919c(%rip), %rdx     # 0x21b60
movslq 0x191bd(%rip), %rsi     # 0x21b88
movl %eax, (%rdx,%rsi,4)
movq 0x1919b(%rip), %rax     # 0x21b70
movq (%rax,%r15,8), %rsi
movl 0x191a9(%rip), %eax     # 0x21b88
movq (%rsp), %rdi
movq 0x60(%rdi), %rdi
testl %eax, %eax
movl $0x0, %r8d
cmovgl %eax, %r8d
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x8a11
movb (%rdi,%r9), %r10b
movslq (%rdx,%r9,4), %r11
incq %r9
cmpb (%rsi,%r11), %r10b
je 0x89f6
jmp 0x8b22
movq (%rsp), %rdx
cmpb $0x1, 0x50(%rdx)
movq %r15, 0x8(%rsp)
jne 0x8ae9
incl 0x54(%rdx)
leaq 0x210d3(%rip), %rdx     # 0x29b01
cmpb $0x1, (%rdx)
jne 0x8ae9
movq %rbp, 0x10(%rsp)
xorl %ebp, %ebp
movslq %eax, %rcx
cmpq %rcx, %rbp
jg 0x8a8a
xorl %r15d, %r15d
movslq %eax, %rcx
cmpq %rcx, %r15
jg 0x8a85
movq 0x19118(%rip), %rax     # 0x21b70
movq 0x19101(%rip), %rcx     # 0x21b60
movslq (%rcx,%rbp,4), %rdx
movq (%rax,%rdx,8), %rax
movslq (%rcx,%r15,4), %rcx
movzbl (%rax,%rcx), %edi
orl $0x30, %edi
movq (%rbx), %rsi
callq 0x22a0
incq %r15
movl 0x19105(%rip), %eax     # 0x21b88
jmp 0x8a49
incq %rbp
jmp 0x8a3e
movq (%rbx), %rsi
pushq $0x3a
popq %rdi
callq 0x22a0
xorl %r15d, %r15d
movq 0x10(%rsp), %rbp
movslq 0x190e4(%rip), %rax     # 0x21b88
movq (%rbx), %rsi
cmpq %rax, %r15
jg 0x8acf
movq 0x190ad(%rip), %rax     # 0x21b60
movl (%rax,%r15,4), %edx
incl %edx
movq %rsi, %rdi
leaq 0x80ee(%rip), %rsi      # 0x10bb1
xorl %eax, %eax
callq 0x2310
incq %r15
jmp 0x8a9d
pushq $0xa
popq %rdi
callq 0x22a0
movq 0x1908a(%rip), %rcx     # 0x21b68
movl 0x190a4(%rip), %eax     # 0x21b88
movq 0x8(%rsp), %r15
movb $0x1, (%rcx,%r15)
incl %eax
movl %eax, 0x19092(%rip)     # 0x21b88
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x8b0c
movq 0x10(%r15), %rdi
callq 0x8902
jmp 0x8af9
decl 0x19076(%rip)           # 0x21b88
movq 0x1904f(%rip), %rax     # 0x21b68
movq 0x8(%rsp), %rcx
movb $0x0, (%rax,%rcx)
decl %r13d
addq $-0x4, %rbp
jmp 0x8993
leaq 0x18(%rdi), %rdx
pushq $0x1
popq %rcx
movl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movl 0x19047(%rip), %esi     # 0x21b88
pushq $-0x1
popq %rdi
xorl %r8d, %r8d
movq %rdx, %r9
movq (%r9), %r9
cmpq %rdx, %r9
je 0x8ba8
leaq 0x10(%r9), %r10
movq %r10, %rbx
movl %edi, %r11d
movq (%rbx), %rbx
cmpq %r10, %rbx
je 0x8b91
movslq 0x14(%rbx), %r14
cmpl %esi, %r14d
jge 0x8b7b
movslq 0x10(%rbx), %r15
movl (%rax,%r15,4), %ebp
cmpl (%rax,%r14,4), %ebp
jg 0x8b94
cmpl %esi, %r14d
jne 0x8b5c
movslq 0x10(%rbx), %r14
movl (%rax,%r14,4), %ebp
cmpl %r11d, %ebp
cmovgl %ebp, %r11d
jmp 0x8b5c
movq %r10, %rbx
cmpl %r12d, %r11d
cmovgel %r12d, %r11d
cmpq %r10, %rbx
cmovel %r11d, %r12d
cmovel %r8d, %ecx
jmp 0x8b4a
testl %ecx, %ecx
je 0x8bbb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq (%rsp), %rdi
je 0x8925
jmp 0x8928
nop