// File: /workspace/github_c_makefile_star2_O0/ComplexNetworks-DCC-FCUP[P]gtrieScanner/GTrie.cpp
// Function: GTrie::censusSample(Graph*, double*)
void GTrie::censusSample(Graph *g, double *p) {
  int i;
  int subgraph_size = maxDepth();
  int num_nodes = g->numNodes();

  _root->zeroFrequency();
  
  GTrieNode::mymap = new int[subgraph_size];
  GTrieNode::used  = new bool[num_nodes];
  GTrieNode::numNodes = num_nodes;
  GTrieNode::fastnei  = g->matrixNeighbours();
  GTrieNode::adjM     = g->adjacencyMatrix();
  GTrieNode::numnei   = g->arrayNumNeighbours(); 
  GTrieNode::prob     = p;

  if (g->type() == DIRECTED) GTrieNode::isdir = true;
  else                       GTrieNode::isdir = false;
  for (i=0; i<num_nodes; i++)
    GTrieNode::used[i]=false;


  list<GTrieNode *>::iterator ii, iiend;
  GTrieNode::glk=0;
  for(ii=_root->child.begin(), iiend = _root->child.end(); ii!=iiend; ii++)
    if (Random::getDouble()<=GTrieNode::prob[0]) {
      (*ii)->goCondSample();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x13c80
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, -0x24(%rbp)
movq (%rax), %rdi
callq 0x115c0
movslq -0x20(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, 0x213b5(%rip)     # 0x355d0
movslq -0x24(%rbp), %rdi
callq 0x3030
movq %rax, 0x213ad(%rip)     # 0x355d8
movl -0x24(%rbp), %eax
movl %eax, 0x213c8(%rip)     # 0x355fc
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0xa0(%rax)
movq %rax, 0x213a0(%rip)     # 0x355e8
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *(%rax)
movq %rax, 0x21388(%rip)     # 0x355e0
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0xb0(%rax)
movq %rax, 0x21384(%rip)     # 0x355f0
movq -0x18(%rbp), %rax
movq %rax, 0x21391(%rip)     # 0x35608
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
cmpl $0x0, %eax
jne 0x1428f
movb $0x1, 0x21373(%rip)     # 0x35600
jmp 0x14296
movb $0x0, 0x2136a(%rip)     # 0x35600
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x142bf
movq 0x2132c(%rip), %rax     # 0x355d8
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1429d
leaq -0x30(%rbp), %rdi
callq 0x15390
leaq -0x38(%rbp), %rdi
callq 0x15390
movq -0x58(%rbp), %rax
movl $0x0, 0x21319(%rip)     # 0x355f8
movq (%rax), %rdi
addq $0x30, %rdi
callq 0x153b0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rdi
addq $0x30, %rdi
callq 0x15410
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x153e0
testb $0x1, %al
jne 0x14329
jmp 0x14366
callq 0x18ce0
movaps %xmm0, %xmm1
movq 0x212d0(%rip), %rax     # 0x35608
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x14353
leaq -0x30(%rbp), %rdi
callq 0x15440
movq (%rax), %rdi
callq 0x14370
jmp 0x14355
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x15460
movq %rax, -0x50(%rbp)
jmp 0x14316
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)