// File: /workspace/github_c_makefile_star2_O3/ComplexNetworks-DCC-FCUP[P]gtrieScanner/GTrie.cpp
// Function: GTrieNode::insertCond(Graph*, std::__cxx11::list<std::pair<int, int>, std::allocator<std::pair<int, int>>>*)
void GTrieNode::insertCond(Graph *g, list<iPair> *cond) {
  int i;
  GTrieNode *gt;

  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()) {
      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)++;}
      }
      child.push_back(gt);
    } else {
      gt = (*ii);
    }

    gt->insertConditionsFiltered(cond);
    gt->insertCond(g, cond);

  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x40(%rax)
movl 0x4c(%r15), %edx
cmpl %edx, %eax
jne 0x8a76
movq %r15, %r13
jmp 0x8be6
leaq 0x4c(%r15), %rbx
leaq 0x30(%r15), %r12
movq %r12, %rbp
movq (%rbp), %rbp
cmpq %r12, %rbp
je 0x8af0
testl %edx, %edx
js 0x8ae7
xorl %r13d, %r13d
movq (%r14), %rax
movq %r14, %rdi
movl %edx, %esi
movl %r13d, %edx
callq *0x50(%rax)
movq 0x10(%rbp), %rcx
movq 0x60(%rcx), %rcx
movl (%rbx), %edx
cmpb %al, (%rcx,%r13)
jne 0x8add
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %esi
callq *0x50(%rax)
movq 0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movl (%rbx), %edx
cmpb %al, (%rcx,%r13)
jne 0x8add
movslq %edx, %rcx
leaq 0x1(%r13), %rax
cmpq %rcx, %r13
movq %rax, %r13
jl 0x8a91
movl %eax, %r13d
cmpl %edx, %r13d
jle 0x8a81
cmpq %r12, %rbp
je 0x8af0
movq 0x10(%rbp), %r13
jmp 0x8bbe
movl $0x80, %edi
callq 0x21f0
movq %rax, %r13
movl (%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x832c
movl (%rbx), %esi
testl %esi, %esi
js 0x8ba1
xorl %ebp, %ebp
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %edx
callq *0x50(%rax)
movq 0x60(%r13), %rcx
movb %al, (%rcx,%rbp)
movl (%rbx), %edx
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
callq *0x50(%rax)
movq 0x58(%r13), %rcx
movb %al, (%rcx,%rbp)
movl (%rbx), %esi
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %edx
callq *0x58(%rax)
testb %al, %al
je 0x8b5e
movq 0x78(%r13), %rax
movslq 0x74(%r13), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x74(%r13)
movl %ebp, (%rax,%rcx,4)
movq 0x58(%r13), %rax
cmpb $0x1, (%rax,%rbp)
jne 0x8b70
incl 0x68(%r13)
incl 0x70(%r13)
movq 0x60(%r13), %rax
cmpb $0x1, (%rax,%rbp)
jne 0x8b8e
movq 0x6c(%r13), %xmm0
psubd 0x9188(%rip), %xmm0     # 0x11d10
movq %xmm0, 0x6c(%r13)
leaq 0x1(%rbp), %rax
movslq (%rbx), %rsi
cmpq %rsi, %rbp
movq %rax, %rbp
jl 0x8b15
movl $0x18, %edi
callq 0x21f0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2070
incq 0x40(%r15)
movq %r13, %rdi
movq (%rsp), %rsi
callq 0x8c12
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
leaq 0x4c(%r13), %rbx
movl 0x4c(%r13), %edx
movq %r13, %r15
cmpl %edx, %eax
jne 0x8a7a
movb $0x1, 0x50(%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x80, %esi
movq %r13, %rdi
callq 0x2200
movq %rbx, %rdi
callq 0x2370