// File: /workspace/github_c_makefile_star2_O0/ComplexNetworks-DCC-FCUP[P]gtrieScanner/Conditions.cpp
// Function: Conditions::isomorphicExtensions()
void Conditions::isomorphicExtensions() {
  int i, j, cand[_subgraph_size], ncand;
  int *v, num;

  if (pos == _subgraph_size) {

    smallNode *v = new smallNode[_subgraph_size];
    for (i=0; i<fastf->numf; i++) v[i]=fastf->f[i];
    fastvv->push_back(v);

  } else {    

    list<iPair>::iterator ii;
    int n, m;
    int flag;

    int count[_subgraph_size];

    ncand=0;
    for (i=0; i<_subgraph_size; i++) count[i]=0;

    for (i=0; i<_subgraph_size; i++)     // For all nodes of H already mapped
      if (fastf->f[i]!=INVALID) {        // find their not mapped neighbours
	v = fastg->arrayNeighbours(i);    
	num = fastg->numNeighbours(i);
	for (j=0; j<num; j++)
	  if (fastf->f[v[j]]==INVALID) {
	    if (count[v[j]]==0) 
	      cand[ncand++]=v[j];	    
	    count[v[j]]++;
	  }	
      }

   // Find most constrained neighbour 'm' (with more mapped neighbours)
    m = 0;
    for (i=1; i<ncand; i++)    
      if (count[i]>count[m])  // Later: add more restraining conditions??
	m = i;
    m = cand[m];

    ncand=0;
    bool already[_subgraph_size];
    for (i=0; i<_subgraph_size; i++) already[i]=false;

    for (i=0; i<_subgraph_size; i++)  // For all nodes of G already mapped
      if (fastf->f[i]!=INVALID) {         // find their not mapped neighbours 
	v = fastg->arrayNeighbours(fastf->f[i]);    
	num = fastg->numNeighbours(fastf->f[i]);    
	for (j=0; j<num; j++)
	  if (!already[v[j]] && fastf->r[v[j]]==INVALID && fasts[m*_subgraph_size+v[j]])  {
	    cand[ncand++]=v[j];
	    already[v[j]]=true;
	  }
      }
        
    for (i=0; i<ncand; i++) {
      n = cand[i];

      flag = false;

      for (j=0; j<_subgraph_size; j++)
	if (fastf->f[j]!=INVALID) {
	  if      (adj[m][j] != adj[n][fastf->f[j]])      {flag=true; break;}
	  else if (adj[j][m] != adj[fastf->f[j]][n])      {flag=true; break;}
	}

      if (!flag) {	
	fastf->add(m, n);
	pos++;
	isomorphicExtensions();
	pos--;
	fastf->remove(m);
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl 0x21193(%rip), %eax     # 0x2d264
movq %rsp, %rcx
movq %rcx, -0x10(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq %rcx, %rsp
movq %rax, -0x18(%rbp)
movl 0x2116d(%rip), %eax     # 0x2d268
cmpl 0x21163(%rip), %eax     # 0x2d264
jne 0xc167
movslq 0x2115a(%rip), %rdi     # 0x2d264
callq 0x3030
movq %rax, -0x38(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq 0x2114c(%rip), %rcx     # 0x2d270
cmpl (%rcx), %eax
jge 0xc152
movq 0x21141(%rip), %rax     # 0x2d270
movq 0x8(%rax), %rax
movslq -0x4(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movb %al, %dl
movq -0x38(%rbp), %rax
movslq -0x4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc11a
movq 0x21127(%rip), %rdi     # 0x2d280
leaq -0x38(%rbp), %rsi
callq 0xc940
jmp 0xc60a
leaq -0x40(%rbp), %rdi
callq 0xc9b0
movl 0x210ee(%rip), %eax     # 0x2d264
movq %rsp, %rcx
movq %rcx, -0x58(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x78(%rbp)
movq %rcx, %rsp
movq %rax, -0x60(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x210b3(%rip), %eax     # 0x2d264
jge 0xc1cd
movq -0x78(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc1a8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x21087(%rip), %eax     # 0x2d264
jge 0xc2c3
movq 0x21086(%rip), %rax     # 0x2d270
movq 0x8(%rax), %rax
movslq -0x4(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
je 0xc2b3
movq 0x21075(%rip), %rdi     # 0x2d278
movl -0x4(%rbp), %esi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, -0x28(%rbp)
movq 0x2105e(%rip), %rdi     # 0x2d278
movl -0x4(%rbp), %esi
movq (%rdi), %rax
callq *0x70(%rax)
movl %eax, -0x2c(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xc2b1
movq 0x21034(%rip), %rax     # 0x2d270
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $-0x1, (%rax,%rcx,4)
jne 0xc2a1
movq -0x78(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xc288
movq -0x70(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x78(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0xc2a3
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xc22d
jmp 0xc2b3
jmp 0xc2b5
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc1d4
movl $0x0, -0x48(%rbp)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xc300
movq -0x78(%rbp), %rcx
movslq -0x4(%rbp), %rax
movl (%rcx,%rax,4), %eax
movslq -0x48(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0xc2f3
movl -0x4(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0xc2f5
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc2d1
movq -0x70(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movl $0x0, -0x1c(%rbp)
movl 0x20f49(%rip), %eax     # 0x2d264
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x80(%rbp)
movq %rcx, %rsp
movq %rax, -0x68(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x20f1d(%rip), %eax     # 0x2d264
jge 0xc360
movq -0x80(%rbp), %rax
movslq -0x4(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc33e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x20ef4(%rip), %eax     # 0x2d264
jge 0xc498
movq 0x20ef3(%rip), %rax     # 0x2d270
movq 0x8(%rax), %rax
movslq -0x4(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
je 0xc488
movq 0x20ee2(%rip), %rdi     # 0x2d278
movq 0x20ed3(%rip), %rax     # 0x2d270
movq 0x8(%rax), %rax
movslq -0x4(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, -0x28(%rbp)
movq 0x20ebc(%rip), %rdi     # 0x2d278
movq 0x20ead(%rip), %rax     # 0x2d270
movq 0x8(%rax), %rax
movslq -0x4(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movq (%rdi), %rax
callq *0x70(%rax)
movl %eax, -0x2c(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xc486
movq -0x80(%rbp), %rax
movq -0x28(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
testb $0x1, (%rax,%rcx)
jne 0xc476
movq 0x20e69(%rip), %rax     # 0x2d270
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $-0x1, (%rax,%rcx,4)
jne 0xc476
movq 0x20e64(%rip), %rax     # 0x2d288
movl -0x48(%rbp), %ecx
imull 0x20e36(%rip), %ecx     # 0x2d264
movq -0x28(%rbp), %rdx
movslq -0x8(%rbp), %rsi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
testb $0x1, (%rax,%rcx)
je 0xc476
movq -0x80(%rbp), %rax
movq -0x70(%rbp), %rcx
movq -0x28(%rbp), %rdx
movslq -0x8(%rbp), %rsi
movl (%rdx,%rsi,4), %esi
movl -0x1c(%rbp), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, -0x1c(%rbp)
movslq %edx, %rdx
movl %esi, (%rcx,%rdx,4)
movq -0x28(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xc478
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xc3de
jmp 0xc488
jmp 0xc48a
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc367
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xc603
movq -0x70(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x20d94(%rip), %eax     # 0x2d264
jge 0xc5a9
movq 0x20d93(%rip), %rax     # 0x2d270
movq 0x8(%rax), %rax
movslq -0x8(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
je 0xc599
movq 0x20d9a(%rip), %rax     # 0x2d290
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x8(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %eax
movq 0x20d7f(%rip), %rcx     # 0x2d290
movslq -0x44(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x20d50(%rip), %rdx     # 0x2d270
movq 0x8(%rdx), %rdx
movslq -0x8(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movb (%rcx,%rdx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0xc542
movl $0x1, -0x4c(%rbp)
jmp 0xc5a9
movq 0x20d47(%rip), %rax     # 0x2d290
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x48(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %eax
movq 0x20d2c(%rip), %rcx     # 0x2d290
movq 0x20d05(%rip), %rdx     # 0x2d270
movq 0x8(%rdx), %rdx
movslq -0x8(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x44(%rbp), %rdx
movb (%rcx,%rdx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0xc595
movl $0x1, -0x4c(%rbp)
jmp 0xc5a9
jmp 0xc597
jmp 0xc599
jmp 0xc59b
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xc4c7
cmpl $0x0, -0x4c(%rbp)
jne 0xc5f3
movq 0x20cba(%rip), %rdi     # 0x2d270
movl -0x48(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0xc8d0
movl 0x20ca1(%rip), %eax     # 0x2d268
addl $0x1, %eax
movl %eax, 0x20c98(%rip)     # 0x2d268
callq 0xc0c0
movl 0x20c8d(%rip), %eax     # 0x2d268
addl $-0x1, %eax
movl %eax, 0x20c84(%rip)     # 0x2d268
movq 0x20c85(%rip), %rdi     # 0x2d270
movl -0x48(%rbp), %esi
callq 0xc900
jmp 0xc5f5
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc49f
movq -0x58(%rbp), %rax
movq %rax, %rsp
movq -0x10(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)