// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
cmpl 0x4c(%r15), %eax
je 0x8a5b
leaq 0x30(%r15), %r12
movq %r12, %rbp
movq (%rbp), %rbp
cmpq %r12, %rbp
je 0x896f
movl 0x4c(%r15), %esi
testl %esi, %esi
js 0x8967
xorl %r13d, %r13d
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %edx
callq *0x50(%rax)
movq 0x10(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpb %al, (%rcx,%r13)
jne 0x8962
movl 0x4c(%r15), %edx
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %esi
callq *0x50(%rax)
movq 0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpb %al, (%rcx,%r13)
jne 0x8962
leaq 0x1(%r13), %rax
movslq 0x4c(%r15), %rsi
cmpq %rsi, %r13
movq %rax, %r13
jl 0x8918
jmp 0x8969
movq %r13, %rax
jmp 0x8969
xorl %eax, %eax
cmpl 0x4c(%r15), %eax
jle 0x8904
cmpq %r12, %rbp
je 0x897d
movq 0x10(%rbp), %r13
jmp 0x8a48
movl $0x80, %edi
callq 0x21f0
movq %rax, %r13
movl 0x4c(%r15), %esi
incl %esi
movq %rax, %rdi
callq 0x81fc
movl 0x4c(%r15), %esi
testl %esi, %esi
js 0x8a2b
xorl %ebp, %ebp
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %edx
callq *0x50(%rax)
movq 0x60(%r13), %rcx
movb %al, (%rcx,%rbp)
movl 0x4c(%r15), %edx
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
callq *0x50(%rax)
movq 0x58(%r13), %rcx
movb %al, (%rcx,%rbp)
movl 0x4c(%r15), %esi
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %edx
callq *0x58(%rax)
testb %al, %al
je 0x89f3
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 0x8a05
incl 0x68(%r13)
incl 0x70(%r13)
movq 0x60(%r13), %rax
cmpb $0x1, (%rax,%rbp)
jne 0x8a17
incl 0x6c(%r13)
incl 0x70(%r13)
leaq 0x1(%rbp), %rax
movslq 0x4c(%r15), %rsi
cmpq %rsi, %rbp
movq %rax, %rbp
jl 0x89a6
movl $0x18, %edi
callq 0x21f0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2070
incq 0x40(%r15)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8a88
movq %r13, %r15
jmp 0x88ea
movb $0x1, 0x50(%r15)
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
nop