// File: /workspace/github_c_makefile_star2_O3/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
cmpb $0x0, 0x48(%rdi)
je 0x91d8
xorl %ebp, %ebp
movslq 0x74(%rdi), %rax
testq %rax, %rax
jle 0x927a
movq 0x189d2(%rip), %rcx     # 0x21b60
movq 0x189ab(%rip), %rdx     # 0x21b40
movq 0x78(%rdi), %rsi
movl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %r8d, %r8d
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movslq (%rsi,%r8,4), %r9
movslq (%rdx,%r9,4), %r9
movl (%rcx,%r9,4), %r10d
cmpl %r15d, %r10d
cmovll %r9d, %r11d
cmovll %r10d, %r15d
incq %r8
cmpq %r8, %rax
jne 0x91a8
testl %r15d, %r15d
jle 0x9477
movslq %r11d, %rax
jmp 0x9285
leaq 0x18(%rdi), %rax
movq 0x18(%rdi), %rcx
cmpq %rax, %rcx
je 0x9477
movl 0x18979(%rip), %esi     # 0x21b68
movl $0x1, %edx
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq 0x18940(%rip), %r15     # 0x21b40
xorl %r8d, %r8d
movl %ebp, %r9d
leaq 0x10(%rcx), %r10
movq 0x10(%rcx), %r11
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r10, %r11
je 0x9244
movslq 0x14(%r11), %rbx
cmpl %esi, %ebx
jge 0x922e
movslq 0x10(%r11), %r14
movl (%r15,%r14,4), %r14d
cmpl (%r15,%rbx,4), %r14d
jg 0x9247
cmpl %esi, %ebx
jne 0x923f
movslq 0x10(%r11), %rbx
movl (%r15,%rbx,4), %ebx
cmpl %ebp, %ebx
cmovgl %ebx, %ebp
movq (%r11), %r11
jmp 0x9213
movq %r10, %r11
cmpl %r9d, %ebp
cmovgel %r9d, %ebp
cmpq %r10, %r11
cmovnel %r9d, %ebp
cmovel %r8d, %edx
movq (%rcx), %rcx
cmpq %rax, %rcx
jne 0x9203
testl %edx, %edx
jne 0x9477
cmpl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
je 0x9178
jmp 0x917a
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
decl %r15d
movq 0x188c9(%rip), %rcx     # 0x21b58
leaq (,%r15,4), %r11
addq (%rcx,%rax,8), %r11
leaq 0x30(%rdi), %r13
leaq 0x20842(%rip), %rbx     # 0x29ae8
movq %rdi, 0x8(%rsp)
movl (%r11), %eax
cmpl %ebp, %eax
jl 0x9477
movslq %eax, %r12
movq 0x18888(%rip), %rcx     # 0x21b48
cmpb $0x0, (%rcx,%r12)
jne 0x9463
movq 0x1886e(%rip), %rdx     # 0x21b40
movslq 0x1888f(%rip), %rsi     # 0x21b68
movl %eax, (%rdx,%rsi,4)
movslq 0x18885(%rip), %rax     # 0x21b68
testq %rax, %rax
jle 0x9314
movq 0x18861(%rip), %rsi     # 0x21b50
movq (%rsi,%r12,8), %rsi
movq 0x60(%rdi), %r14
xorl %r8d, %r8d
movb (%r14,%r8), %r9b
movslq (%rdx,%r8,4), %r10
cmpb (%rsi,%r10), %r9b
jne 0x9463
incq %r8
cmpq %r8, %rax
jne 0x92fa
cmpb $0x1, 0x50(%rdi)
jne 0x940e
incl 0x54(%rdi)
leaq 0x207b9(%rip), %rdx     # 0x29ae1
cmpb $0x1, (%rdx)
jne 0x940e
movq %r12, (%rsp)
movq %r11, 0x10(%rsp)
testl %eax, %eax
js 0x9398
xorl %r14d, %r14d
testl %eax, %eax
js 0x9389
movq $-0x1, %r12
movq 0x187fd(%rip), %rax     # 0x21b50
movq 0x187e6(%rip), %rcx     # 0x21b40
movslq (%rcx,%r14,4), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x4(%rcx,%r12,4), %rcx
movzbl (%rax,%rcx), %edi
orl $0x30, %edi
movq (%rbx), %rsi
callq 0x2280
movl 0x187ec(%rip), %eax     # 0x21b68
movslq %eax, %rcx
incq %r12
cmpq %rcx, %r12
jl 0x934c
jmp 0x938c
movslq %eax, %rcx
leaq 0x1(%r14), %rdx
cmpq %rcx, %r14
movq %rdx, %r14
jl 0x9341
movq (%rbx), %rsi
movl $0x3a, %edi
callq 0x2280
cmpl $0x0, 0x187bc(%rip)     # 0x21b68
leaq 0x885f(%rip), %r12      # 0x11c12
js 0x93e6
movq $-0x1, %r14
movq (%rbx), %rdi
movq 0x1877a(%rip), %rax     # 0x21b40
movl 0x4(%rax,%r14,4), %edx
incl %edx
movq %r12, %rsi
xorl %eax, %eax
callq 0x22d0
movslq 0x1878a(%rip), %rax     # 0x21b68
incq %r14
cmpq %rax, %r14
jl 0x93bc
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x2280
movq 0x1874e(%rip), %rcx     # 0x21b48
movl 0x18768(%rip), %eax     # 0x21b68
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %r11
movq (%rsp), %r12
movb $0x1, (%rcx,%r12)
leal 0x1(%rax), %edx
movl %edx, 0x1874c(%rip)     # 0x21b68
movq (%r13), %r14
cmpq %r13, %r14
je 0x9458
movq %r12, (%rsp)
movq %r11, %r12
movq 0x10(%r14), %rdi
callq 0x9164
movq (%r14), %r14
cmpq %r13, %r14
jne 0x942c
movl 0x18725(%rip), %eax     # 0x21b68
movq 0x186fe(%rip), %rcx     # 0x21b48
decl %eax
movq %r12, %r11
movq 0x8(%rsp), %rdi
movq (%rsp), %r12
movl %eax, 0x1870a(%rip)     # 0x21b68
movb $0x0, (%rcx,%r12)
leal -0x1(%r15), %eax
addq $-0x4, %r11
testl %r15d, %r15d
movl %eax, %r15d
jg 0x92ab
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq