// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq -0x60(%rbp), %rcx
cmpl 0x4c(%rcx), %eax
jne 0x106d8
movq -0x60(%rbp), %rax
movb $0x1, 0x50(%rax)
jmp 0x109ae
leaq -0x20(%rbp), %rdi
callq 0x15390
movq -0x60(%rbp), %rdi
addq $0x30, %rdi
callq 0x153b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x60(%rbp), %rdi
addq $0x30, %rdi
callq 0x15410
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x153e0
testb $0x1, %al
jne 0x10721
jmp 0x107f4
movl $0x0, -0x14(%rbp)
movq -0x60(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x4c(%rcx), %eax
jg 0x107d0
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x4c(%rax), %esi
movl -0x14(%rbp), %edx
movq (%rdi), %rax
callq *0x50(%rax)
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x64(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x15440
movq %rax, %rcx
movl -0x64(%rbp), %eax
movq (%rcx), %rcx
movq 0x60(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movb (%rcx,%rdx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x107be
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl 0x4c(%rax), %edx
movq (%rdi), %rax
callq *0x50(%rax)
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x68(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x15440
movq %rax, %rcx
movl -0x68(%rbp), %eax
movq (%rcx), %rcx
movq 0x58(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movb (%rcx,%rdx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x107c0
jmp 0x107d0
jmp 0x107c2
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x10728
movq -0x60(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x4c(%rcx), %eax
jle 0x107de
jmp 0x107f4
jmp 0x107e0
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x15460
movq %rax, -0x38(%rbp)
jmp 0x106fa
movq -0x60(%rbp), %rdi
addq $0x30, %rdi
callq 0x15410
movq %rax, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x15870
testb $0x1, %al
jne 0x1081b
jmp 0x10997
movl $0x80, %edi
callq 0x3270
movq %rax, %rdi
movq -0x60(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x70(%rbp)
movl 0x4c(%rax), %esi
incl %esi
callq 0xfc80
jmp 0x1083f
movq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x60(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x4c(%rcx), %eax
jg 0x10977
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x4c(%rax), %esi
movl -0x14(%rbp), %edx
movq (%rdi), %rax
callq *0x50(%rax)
movb %al, %sil
movq -0x60(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x60(%rcx), %rcx
movslq -0x14(%rbp), %rdx
andb $0x1, %sil
movb %sil, (%rcx,%rdx)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl 0x4c(%rax), %edx
movq (%rdi), %rax
callq *0x50(%rax)
movb %al, %sil
movq -0x60(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x58(%rcx), %rcx
movslq -0x14(%rbp), %rdx
andb $0x1, %sil
movb %sil, (%rcx,%rdx)
movq -0x10(%rbp), %rdi
movl 0x4c(%rax), %esi
movl -0x14(%rbp), %edx
movq (%rdi), %rax
callq *0x58(%rax)
testb $0x1, %al
jne 0x108ce
jmp 0x1090f
movl -0x14(%rbp), %edx
movq -0x48(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x48(%rbp), %rsi
movl 0x74(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x74(%rsi)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x1090f
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
movl $0x80, %esi
callq 0x3280
jmp 0x109b4
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x14(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x1093b
movq -0x48(%rbp), %rax
movl 0x68(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x68(%rax)
movq -0x48(%rbp), %rax
movl 0x70(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x70(%rax)
movq -0x48(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x14(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x10967
movq -0x48(%rbp), %rax
movl 0x6c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x6c(%rax)
movq -0x48(%rbp), %rax
movl 0x70(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x70(%rax)
jmp 0x10969
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1084e
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x106a0
movq -0x60(%rbp), %rdi
addq $0x30, %rdi
leaq -0x48(%rbp), %rsi
callq 0x158a0
jmp 0x109ac
leaq -0x20(%rbp), %rdi
callq 0x15440
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x106a0
jmp 0x109ae
addq $0x70, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3440
nopl (%rax)