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

  if (!cond_ok) {
    list< list<iPair> >::const_iterator jj, jjend;
    list<iPair>::const_iterator kk, kkend;
    for (jj=cond.begin(), jjend=cond.end(); jj!=jjend; ++jj) {
      for (kk=(*jj).begin(), kkend=(*jj).end(); kk!=kkend; ++kk)
	if ( mymap[kk->first]>mymap[kk->second])
	  break;
      if (kk==kkend) break;
    }
    if (jj==jjend) return;
  }

  ncand=0;
  j=ci=INT_MAX;
  if (nconn == 0) ncand = numNodes;
  else {
    for (i=0; i<nconn; i++) {
      glaux = numnei[mymap[conn[i]]];
      if (glaux<j) {
	ci = mymap[conn[i]];
	j = glaux;
      }
    }
    ncand = j;
  }
  int cand[ncand];

  ncand=0;
  if (nconn == 0) { // We are at a node with no connections to ancestors
    for (i=numNodes-1; i>=0; i--)
      if (!used[i]) 
	cand[ncand++]=i;
  } else {
    for (i=0; i<j; i++) {
      glaux = fastnei[ci][i];
      if (!used[glaux])
	cand[ncand++]=glaux;
    }
  }

  if (cond_this_ok) mylim = 0;
  else {
    list< list<int> >::const_iterator jjj;
    list<int>::const_iterator kkk;
    mylim = INT_MAX;
    for (jjj=this_node_cond.begin(); jjj!=this_node_cond.end(); ++jjj) {
      glaux = -1;
      for (kkk=(*jjj).begin(); kkk!=(*jjj).end(); ++kkk)
	if (mymap[*kkk]>glaux) glaux = mymap[*kkk];
      if (glaux<mylim) mylim=glaux;
    }
  }

  for (ci=ncand-1; ci>=0; ci--) {
    i = cand[ci];
    if (i<mylim) break;
    mymap[glk] = i;

    if (isdir) {  
      for (j=0; j<glk; j++)
	if (in[j]  != adjM[mymap[j]][i] ||
	    out[j] != adjM[i][mymap[j]])
	  break;
    } else {
      for (j=0; j<glk; j++)
	if (in[j]  != adjM[mymap[j]][i])
	  break;
    }
    if (j<glk) continue;

    if (is_graph) {      
      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);
      }
      frequency++;
    }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
testb $0x1, 0x48(%rax)
jne 0x14518
leaq -0x28(%rbp), %rdi
callq 0x15200
leaq -0x30(%rbp), %rdi
callq 0x15200
leaq -0x38(%rbp), %rdi
callq 0x15220
leaq -0x40(%rbp), %rdi
callq 0x15220
movq -0x108(%rbp), %rdi
addq $0x18, %rdi
callq 0x154b0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x15c80
movq -0x108(%rbp), %rdi
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x18, %rdi
callq 0x15510
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x15c80
movq -0x58(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x15d30
testb $0x1, %al
jne 0x14420
jmp 0x144fe
leaq -0x28(%rbp), %rdi
callq 0x15d60
movq %rax, %rdi
callq 0x15d90
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x15d60
movq %rax, %rdi
callq 0x15dc0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x15df0
testb $0x1, %al
jne 0x1446d
jmp 0x144d9
movq 0x2115c(%rip), %rax     # 0x355d0
movq %rax, -0x120(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x15e20
movq %rax, %rcx
movq -0x120(%rbp), %rax
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10c(%rbp)
movq 0x2112f(%rip), %rax     # 0x355d0
movq %rax, -0x118(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x15e20
movq -0x118(%rbp), %rcx
movq %rax, %rdx
movl -0x10c(%rbp), %eax
movslq 0x4(%rdx), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x144cc
jmp 0x144d9
jmp 0x144ce
leaq -0x38(%rbp), %rdi
callq 0x15e40
jmp 0x1445a
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x15e60
testb $0x1, %al
jne 0x144ec
jmp 0x144ee
jmp 0x144fe
jmp 0x144f0
leaq -0x28(%rbp), %rdi
callq 0x15e90
jmp 0x1440a
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x16160
testb $0x1, %al
jne 0x14511
jmp 0x14516
jmp 0x14c7f
jmp 0x14518
movq -0x108(%rbp), %rax
movl $0x0, -0x20(%rbp)
movl $0x7fffffff, -0x14(%rbp) # imm = 0x7FFFFFFF
movl $0x7fffffff, -0x10(%rbp) # imm = 0x7FFFFFFF
cmpl $0x0, 0x74(%rax)
jne 0x14548
movl 0x210bc(%rip), %eax     # 0x355fc
movl %eax, -0x20(%rbp)
jmp 0x145ca
movl $0x0, -0xc(%rbp)
movq -0x108(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x74(%rcx), %eax
jge 0x145c4
movq -0x108(%rbp), %rdx
movq 0x21084(%rip), %rax     # 0x355f0
movq 0x2105d(%rip), %rcx     # 0x355d0
movq 0x78(%rdx), %rdx
movslq -0xc(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x145b7
movq -0x108(%rbp), %rcx
movq 0x21031(%rip), %rax     # 0x355d0
movq 0x78(%rcx), %rcx
movslq -0xc(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x145b9
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1454f
movl -0x10(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x108(%rbp), %rax
movl -0x20(%rbp), %ecx
movq %rsp, %rdx
movq %rdx, -0x78(%rbp)
leaq 0xf(,%rcx,4), %rsi
andq $-0x10, %rsi
movq %rsp, %rdx
subq %rsi, %rdx
movq %rdx, -0x128(%rbp)
movq %rdx, %rsp
movq %rcx, -0x80(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0x0, 0x74(%rax)
jne 0x14655
movl 0x20fee(%rip), %eax     # 0x355fc
subl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x14653
movq 0x20fb7(%rip), %rax     # 0x355d8
movslq -0xc(%rbp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x14646
movq -0x128(%rbp), %rax
movl -0xc(%rbp), %edx
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x14648
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x14614
jmp 0x146b8
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x146b6
movq 0x20f7d(%rip), %rax     # 0x355e8
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movq 0x20f54(%rip), %rax     # 0x355d8
movslq -0x1c(%rbp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x146a9
movq -0x128(%rbp), %rax
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x146ab
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1465c
jmp 0x146b8
movq -0x108(%rbp), %rax
testb $0x1, 0x49(%rax)
je 0x146d1
movl $0x0, -0x18(%rbp)
jmp 0x1485c
leaq -0x88(%rbp), %rdi
callq 0x16190
leaq -0x90(%rbp), %rdi
callq 0x161b0
movq -0x108(%rbp), %rdi
movl $0x7fffffff, -0x18(%rbp) # imm = 0x7FFFFFFF
callq 0x15680
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x161d0
movq -0x98(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x108(%rbp), %rdi
callq 0x156e0
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x161d0
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x161f0
testb $0x1, %al
jne 0x14766
jmp 0x1485a
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
leaq -0x88(%rbp), %rdi
callq 0x16220
movq %rax, %rdi
callq 0x16250
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x16220
movq %rax, %rdi
callq 0x162b0
movq %rax, -0xc0(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x16280
testb $0x1, %al
jne 0x147ca
jmp 0x14839
movq 0x20dff(%rip), %rax     # 0x355d0
movq %rax, -0x130(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x162e0
movq %rax, %rcx
movq -0x130(%rbp), %rax
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x1c(%rbp), %eax
jle 0x14826
movq 0x20dd0(%rip), %rax     # 0x355d0
movq %rax, -0x138(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x162e0
movq %rax, %rcx
movq -0x138(%rbp), %rax
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
jmp 0x14828
leaq -0x90(%rbp), %rdi
callq 0x16310
jmp 0x14796
movl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x14847
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x14849
leaq -0x88(%rbp), %rdi
callq 0x16330
jmp 0x14724
jmp 0x1485c
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x14c78
movq -0x128(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x1488d
jmp 0x14c78
movl -0xc(%rbp), %edx
movq 0x20d39(%rip), %rax     # 0x355d0
movslq 0x20d5a(%rip), %rcx     # 0x355f8
movl %edx, (%rax,%rcx,4)
testb $0x1, 0x20d58(%rip)     # 0x35600
je 0x1495c
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x20d3a(%rip), %eax     # 0x355f8
jge 0x1495a
movq -0x108(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x10(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %eax
movq 0x20cfe(%rip), %rcx     # 0x355e0
movq 0x20ce7(%rip), %rdx     # 0x355d0
movslq -0x10(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0xc(%rbp), %rdx
movb (%rcx,%rdx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x14948
movq -0x108(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x10(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %eax
movq 0x20cbc(%rip), %rcx     # 0x355e0
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x20c9d(%rip), %rdx     # 0x355d0
movslq -0x10(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movb (%rcx,%rdx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x1494a
jmp 0x1495a
jmp 0x1494c
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x148b5
jmp 0x149c1
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x20c8c(%rip), %eax     # 0x355f8
jge 0x149bf
movq -0x108(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x10(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %eax
movq 0x20c54(%rip), %rcx     # 0x355e0
movq 0x20c3d(%rip), %rdx     # 0x355d0
movslq -0x10(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0xc(%rbp), %rdx
movb (%rcx,%rdx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x149b2
jmp 0x149bf
jmp 0x149b4
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x14963
jmp 0x149c1
movl -0x10(%rbp), %eax
cmpl 0x20c2e(%rip), %eax     # 0x355f8
jge 0x149d1
jmp 0x14c6a
movq -0x108(%rbp), %rax
testb $0x1, 0x50(%rax)
je 0x14b48
leaq 0x28b88(%rip), %rax     # 0x3d571
testb $0x1, (%rax)
je 0x14b38
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl 0x20bf0(%rip), %eax     # 0x355f8
jg 0x14abb
movl $0x0, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
cmpl 0x20bd4(%rip), %eax     # 0x355f8
jg 0x14aa5
movq 0x20bb3(%rip), %rax     # 0x355e0
movq 0x20b9c(%rip), %rcx     # 0x355d0
movslq -0xc4(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20b86(%rip), %rcx     # 0x355d0
movslq -0xc8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movb (%rax,%rcx), %cl
movb $0x31, %al
movb $0x30, %dl
movb %dl, -0x13a(%rbp)
testb $0x1, %cl
movb %al, -0x139(%rbp)
jne 0x14a79
movb -0x13a(%rbp), %al
movb %al, -0x139(%rbp)
movb -0x139(%rbp), %al
movsbl %al, %edi
leaq 0x28aef(%rip), %rax     # 0x3d578
movq (%rax), %rsi
callq 0x3350
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x14a18
jmp 0x14aa7
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x149fc
leaq 0x28ab6(%rip), %rax     # 0x3d578
movq (%rax), %rsi
movl $0x3a, %edi
callq 0x3350
movl $0x0, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
cmpl 0x20b13(%rip), %eax     # 0x355f8
jg 0x14b24
leaq 0x28a8a(%rip), %rax     # 0x3d578
movq (%rax), %rdi
movq 0x20ad8(%rip), %rax     # 0x355d0
movslq -0xcc(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0xc03b(%rip), %rsi      # 0x20b47
movb $0x0, %al
callq 0x33a0
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0x14ad9
leaq 0x28a4d(%rip), %rax     # 0x3d578
movq (%rax), %rsi
movl $0xa, %edi
callq 0x3350
movq -0x108(%rbp), %rax
movl 0x54(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x54(%rax)
movq 0x20a89(%rip), %rax     # 0x355d8
movslq -0xc(%rbp), %rcx
movb $0x1, (%rax,%rcx)
movl 0x20a9b(%rip), %eax     # 0x355f8
addl $0x1, %eax
movl %eax, 0x20a92(%rip)     # 0x355f8
leaq -0xd8(%rbp), %rdi
callq 0x15eb0
leaq -0xe0(%rbp), %rdi
callq 0x15eb0
movq -0x108(%rbp), %rdi
addq $0x30, %rdi
callq 0x153b0
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x15ed0
movq -0x108(%rbp), %rdi
movq -0xe8(%rbp), %rax
movq %rax, -0xd8(%rbp)
addq $0x30, %rdi
callq 0x15410
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x15ed0
movq -0xf8(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x15ef0
testb $0x1, %al
jne 0x14c07
jmp 0x14c4c
callq 0x18ce0
movaps %xmm0, %xmm1
movq 0x209f2(%rip), %rax     # 0x35608
movslq 0x209db(%rip), %rcx     # 0x355f8
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0x14c3c
leaq -0xd8(%rbp), %rdi
callq 0x15f20
movq (%rax), %rdi
callq 0x14370
jmp 0x14c3e
leaq -0xd8(%rbp), %rdi
callq 0x15f50
jmp 0x14bee
movl 0x209a6(%rip), %eax     # 0x355f8
addl $-0x1, %eax
movl %eax, 0x2099d(%rip)     # 0x355f8
movq 0x20976(%rip), %rax     # 0x355d8
movslq -0xc(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x14865
movq -0x78(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)