// File: /workspace/github_c_makefile_star2_O0/ComplexNetworks-DCC-FCUP[P]gtrieScanner/GTrie.cpp
// Function: GTrie::census(Graph*)
void GTrie::census(Graph *g) {
  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(); 
  
  if (g->type() == DIRECTED) GTrieNode::isdir = true;
  else                       GTrieNode::isdir = false;
  for (i=0; i<num_nodes; i++)
    GTrieNode::used[i]=false;

  GTrieNode *c = *(_root->child.begin());
  list<GTrieNode *>::iterator ii;
  GTrieNode::glk=1;

  for (i = 0; i<num_nodes; i++) {
    GTrieNode::mymap[0] = i;
    GTrieNode::used[i]=true;
    if (g->type() == DIRECTED)
      for(ii=c->child.begin(); ii!=c->child.end(); ii++)
	(*ii)->goCondDir();
    else
      for(ii=c->child.begin(); ii!=c->child.end(); ii++)
	(*ii)->goCondUndir();
    GTrieNode::used[i]=false;
  }
        
  delete [] GTrieNode::mymap;
  delete [] GTrieNode::used;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x13c80
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %ecx
movq -0x70(%rbp), %rax
movl %ecx, -0x1c(%rbp)
movq (%rax), %rdi
callq 0x115c0
movslq -0x18(%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, 0x218a6(%rip)     # 0x355d0
movslq -0x1c(%rbp), %rdi
callq 0x3030
movq %rax, 0x2189e(%rip)     # 0x355d8
movl -0x1c(%rbp), %eax
movl %eax, 0x218b9(%rip)     # 0x355fc
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0xa0(%rax)
movq %rax, 0x21891(%rip)     # 0x355e8
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *(%rax)
movq %rax, 0x21879(%rip)     # 0x355e0
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0xb0(%rax)
movq %rax, 0x21875(%rip)     # 0x355f0
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
cmpl $0x0, %eax
jne 0x13d93
movb $0x1, 0x2186f(%rip)     # 0x35600
jmp 0x13d9a
movb $0x0, 0x21866(%rip)     # 0x35600
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x13dc3
movq 0x21828(%rip), %rax     # 0x355d8
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13da1
movq -0x70(%rbp), %rax
movq (%rax), %rdi
addq $0x30, %rdi
callq 0x153b0
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x15440
movq (%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x15390
movl $0x1, 0x217fe(%rip)     # 0x355f8
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x13f16
movl -0x14(%rbp), %ecx
movq 0x217b9(%rip), %rax     # 0x355d0
movl %ecx, (%rax)
movq 0x217b8(%rip), %rax     # 0x355d8
movslq -0x14(%rbp), %rcx
movb $0x1, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
cmpl $0x0, %eax
jne 0x13e98
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
callq 0x153b0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
callq 0x15410
movq %rax, -0x48(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x153e0
testb $0x1, %al
jne 0x13e74
jmp 0x13e96
leaq -0x38(%rbp), %rdi
callq 0x15440
movq (%rax), %rdi
callq 0x11e30
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x15460
movq %rax, -0x50(%rbp)
jmp 0x13e50
jmp 0x13ef9
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
callq 0x153b0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
callq 0x15410
movq %rax, -0x60(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x153e0
testb $0x1, %al
jne 0x13ed5
jmp 0x13ef7
leaq -0x38(%rbp), %rdi
callq 0x15440
movq (%rax), %rdi
callq 0x117a0
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x15460
movq %rax, -0x68(%rbp)
jmp 0x13eb1
jmp 0x13ef9
movq 0x216d8(%rip), %rax     # 0x355d8
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13e01
movq 0x216b3(%rip), %rax     # 0x355d0
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
je 0x13f30
movq -0x78(%rbp), %rdi
callq 0x3360
movq 0x216a1(%rip), %rax     # 0x355d8
movq %rax, -0x80(%rbp)
cmpq $0x0, %rax
je 0x13f4a
movq -0x80(%rbp), %rdi
callq 0x3360
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)