// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x40(%rax)
movl 0x4c(%r15), %ebp
cmpl %ebp, %eax
jne 0x83f6
movb $0x1, 0x50(%r15)
jmp 0x855e
movq %rbx, 0x10(%rsp)
leaq 0x30(%r15), %rbx
movq %rbx, %r12
movq (%r12), %r12
cmpq %rbx, %r12
je 0x847c
xorl %ecx, %ecx
movq %rcx, %r13
movslq %ebp, %rax
cmpq %rax, %rcx
jg 0x845e
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
movl %r13d, %edx
callq *0x50(%rax)
movq 0x10(%r12), %rcx
movq 0x60(%rcx), %rcx
movl 0x4c(%r15), %ebp
cmpb %al, (%rcx,%r13)
jne 0x845e
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq *0x50(%rax)
movq 0x10(%r12), %rcx
movq 0x58(%rcx), %rdx
leaq 0x1(%r13), %rcx
movl 0x4c(%r15), %ebp
cmpb %al, (%rdx,%r13)
je 0x840d
cmpl %r13d, %ebp
jge 0x8402
cmpq %rbx, %r12
je 0x847c
movq 0x10(%r12), %rdi
movq %rdi, 0x8(%rsp)
movq 0x10(%rsp), %r12
jmp 0x8546
movl $0x80, %edi
callq 0x2200
movq %rax, %r13
incl %ebp
movq %rax, %rdi
movl %ebp, %esi
callq 0x7d48
movq %r13, 0x8(%rsp)
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
movslq 0x4c(%r15), %rsi
cmpq %rsi, %rbp
jg 0x8533
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 0x84fb
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 0x850d
incl 0x68(%r13)
incl 0x70(%r13)
movq 0x60(%r13), %rax
cmpb $0x1, (%rax,%rbp)
jne 0x852b
movq 0x6c(%r13), %xmm0
psubd 0x878b(%rip), %xmm0     # 0x10cb0
movq %xmm0, 0x6c(%r13)
incq %rbp
jmp 0x84a1
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa32c
movq (%r15), %rdi
movq %r12, %rsi
callq 0x8586
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x83c4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x80, %esi
movq %r13, %rdi
callq 0x2210
movq %rbx, %rdi
callq 0x23b0
nop