// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/GTrie.cpp
// Function: GTrieNode::insert(Graph*)
void GTrieNode::insert(Graph *g) {
  int i;


  if (g->numNodes() == depth) {
    is_graph = true;
  } else {
    list<GTrieNode *>::iterator ii;
    for(ii=child.begin(); ii!=child.end(); ii++) {
      for (i=0; i<=depth; i++)
	if (g->hasEdge(depth, i) != (*ii)->out[i] ||
	    g->hasEdge(i, depth) != (*ii)->in[i])
	  break;
      if (i>depth) break;
    }
    if (ii==child.end()) {
      GTrieNode *gt = new GTrieNode(depth+1);
      for (i=0; i<=depth; i++) {
      	gt->out[i] = g->hasEdge(depth, i);	
      	gt->in[i]  = g->hasEdge(i, depth);
	if (g->isConnected(depth, i)) 
	  gt->conn[(gt->nconn)++] = i;

	if (gt->in[i])  { (gt->total_in)++;  (gt->total_edges)++;}
	if (gt->out[i]) { (gt->total_out)++; (gt->total_edges)++;}
      }
      gt->insert(g);
      child.push_back(gt);
    } else
      (*ii)->insert(g);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x40(%rax)
movl 0x4c(%r15), %ebp
cmpl %ebp, %eax
jne 0x8892
movb $0x1, 0x50(%r15)
jmp 0x8a21
leaq 0x4c(%r15), %rbx
movq %r15, (%rsp)
addq $0x30, %r15
movq %r15, %r13
movq (%r13), %r13
cmpq %r15, %r13
je 0x8930
testl %ebp, %ebp
js 0x890e
xorl %r12d, %r12d
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq *0x50(%rax)
movq 0x10(%r13), %rcx
movq 0x60(%rcx), %rcx
movl (%rbx), %ebp
cmpb %al, (%rcx,%r12)
jne 0x8904
movq (%r14), %rax
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq *0x50(%rax)
movq 0x10(%r13), %rcx
movq 0x58(%rcx), %rcx
movl (%rbx), %ebp
cmpb %al, (%rcx,%r12)
jne 0x8904
movslq %ebp, %rcx
leaq 0x1(%r12), %rax
cmpq %rcx, %r12
movq %rax, %r12
jl 0x88b5
movl %eax, %r12d
cmpl %ebp, %r12d
jle 0x88a1
cmpq %r15, %r13
je 0x8930
movq 0x10(%r13), %r15
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
leaq 0x4c(%r15), %rbx
movl 0x4c(%r15), %ebp
cmpl %ebp, %eax
jne 0x8896
jmp 0x8888
movl $0x80, %edi
callq 0x21f0
movq %rax, %r12
incl %ebp
movq %rax, %rdi
movl %ebp, %esi
callq 0x832c
movl (%rbx), %esi
testl %esi, %esi
js 0x89f5
xorl %r13d, %r13d
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %edx
callq *0x50(%rax)
movq 0x60(%r12), %rcx
movb %al, (%rcx,%r13)
movl (%rbx), %edx
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %esi
callq *0x50(%rax)
movq 0x58(%r12), %rcx
movb %al, (%rcx,%r13)
movl (%rbx), %esi
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %edx
callq *0x58(%rax)
testb %al, %al
je 0x89aa
movq 0x78(%r12), %rax
movslq 0x74(%r12), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x74(%r12)
movl %r13d, (%rax,%rcx,4)
movq 0x58(%r12), %rax
cmpb $0x1, (%rax,%r13)
jne 0x89c0
incl 0x68(%r12)
incl 0x70(%r12)
movq 0x60(%r12), %rax
cmpb $0x1, (%rax,%r13)
jne 0x89e2
movq 0x6c(%r12), %xmm0
psubd 0x9335(%rip), %xmm0     # 0x11d10
movq %xmm0, 0x6c(%r12)
leaq 0x1(%r13), %rax
movslq (%rbx), %rsi
cmpq %rsi, %r13
movq %rax, %r13
jl 0x8956
movq %r12, %rdi
movq %r14, %rsi
callq 0x8866
movl $0x18, %edi
callq 0x21f0
movq %r12, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x2070
movq (%rsp), %rax
incq 0x40(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x80, %esi
movq %r12, %rdi
callq 0x2200
movq %rbx, %rdi
callq 0x2370