// File: /workspace/github_c_makefile_star2_O1/ComplexNetworks-DCC-FCUP[P]gtrieScanner/Conditions.cpp
// Function: Conditions::findAutomorphisms(Graph*, std::vector<char*, std::allocator<char*>>*)
void Conditions::findAutomorphisms(Graph *G, VVsmallNode *vv) {
  int i,j,k;
  int g;

  _subgraph_size = G->numNodes();
  GMap *f = new GMap(_subgraph_size, _subgraph_size);

  int sequence[_subgraph_size][_subgraph_size];

  for (i=0; i<_subgraph_size; i++)
    for (j=0; j<_subgraph_size; j++)
      if (G->isConnected(i,j))
	sequence[i][j] = G->numNeighbours(j);
      else
	sequence[i][j] = 0;

  for (i=0; i<_subgraph_size; i++)
    qsort(sequence[i], _subgraph_size, sizeof(int), int_compare);

  bool support[_subgraph_size*_subgraph_size];
  for (i=0; i<_subgraph_size; i++)
    for (j=0; j<_subgraph_size; j++) {
      for (k=0; k<_subgraph_size; k++)
	if (sequence[i][k] != sequence[j][k]) break;      
      if (k<_subgraph_size) support[i*_subgraph_size+j]=false;
      else support[i*_subgraph_size+j]=true;
    }

  vv->clear();
  fastf  = f;
  fastg  = G;
  fastvv = vv;
  fasts  = support;
  adj = G->adjacencyMatrix();
  for (g=0; g<_subgraph_size; g++)
    if (support[g*_subgraph_size]) {
      f->add(0,g);
      pos = 1;
      isomorphicExtensions();
      f->remove(0);
    }

  delete f;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, -0x48(%rbp)
movq %rdi, %r14
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %r12d
movl %eax, 0x13417(%rip)     # 0x197d4
movl $0x18, %edi
callq 0x21f0
movq %rax, -0x40(%rbp)
movq %rax, %rdi
movl %r12d, %esi
movl %r12d, %edx
callq 0x62ca
movl 0x133f5(%rip), %ecx     # 0x197d4
movq %rcx, %rax
imulq %rcx, %rax
movq %rsp, %r15
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %rcx, -0x30(%rbp)
testl %ecx, %ecx
jle 0x646e
movq -0x30(%rbp), %rax
leaq (,%rax,4), %rax
movq %rax, -0x38(%rbp)
xorl %r12d, %r12d
movq %r15, %rbx
cmpl $0x0, 0x133b4(%rip)     # 0x197d4
jle 0x645b
xorl %r13d, %r13d
movq (%r14), %rax
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq *0x58(%rax)
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0x6448
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %esi
callq *0x70(%rax)
movl %eax, (%rbx,%r13,4)
incq %r13
movslq 0x1337e(%rip), %rax     # 0x197d4
cmpq %rax, %r13
jl 0x6425
incq %r12
movslq 0x1336f(%rip), %rax     # 0x197d4
addq -0x38(%rbp), %rbx
cmpq %rax, %r12
jl 0x6419
movl 0x13360(%rip), %eax     # 0x197d4
testl %eax, %eax
jle 0x64b3
movq -0x30(%rbp), %rcx
leaq (,%rcx,4), %rbx
xorl %r12d, %r12d
movq %r15, %r13
movslq %eax, %rsi
movl $0x4, %edx
movq %r13, %rdi
leaq -0x1d8(%rip), %rcx      # 0x62c4
callq 0x23c0
incq %r12
movslq 0x13329(%rip), %rax     # 0x197d4
addq %rbx, %r13
cmpq %rax, %r12
jl 0x648a
movl %eax, %ecx
imull %ecx, %ecx
movq %rsp, %r13
addl $0xf, %ecx
andl $-0x10, %ecx
subq %rcx, %r13
movq %r13, %rsp
testl %eax, %eax
movq -0x30(%rbp), %r12
jle 0x6564
movl %eax, %eax
leaq 0x4(%r15), %r8
leaq (,%r12,4), %rdx
leaq -0x1(%rax), %rsi
xorl %edi, %edi
movq %r8, -0x50(%rbp)
movq %r13, -0x38(%rbp)
movq %rdi, %rcx
imulq %r12, %rcx
movl (%r15,%rcx,4), %r9d
movq %rdi, %r10
imulq %rax, %r10
addq %r13, %r10
movq -0x50(%rbp), %r11
xorl %ebx, %ebx
movq %rbx, %rcx
imulq %r12, %rcx
cmpl (%r15,%rcx,4), %r9d
jne 0x653a
xorl %r13d, %r13d
cmpq %r13, %rsi
je 0x653f
movl (%r8,%r13,4), %r12d
leaq 0x1(%r13), %rcx
cmpl (%r11,%r13,4), %r12d
movq %rcx, %r13
je 0x651a
cmpq %rax, %rcx
jae 0x653f
xorl %r13d, %r13d
jmp 0x6542
xorl %r13d, %r13d
jmp 0x6546
movb $0x1, %r13b
movq -0x30(%rbp), %r12
movb %r13b, (%r10,%rbx)
incq %rbx
addq %rdx, %r11
cmpq %rax, %rbx
jne 0x650a
incq %rdi
addq %rdx, %r8
cmpq %rax, %rdi
movq -0x38(%rbp), %r13
jne 0x64ef
movq -0x48(%rbp), %rcx
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
je 0x6575
movq %rax, 0x8(%rcx)
movq -0x40(%rbp), %r15
movq %r15, 0x13260(%rip)     # 0x197e0
movq %r14, 0x13261(%rip)     # 0x197e8
movq %rcx, 0x13262(%rip)     # 0x197f0
movq %r13, 0x13263(%rip)     # 0x197f8
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movq %rax, 0x1325c(%rip)     # 0x19800
movl 0x1322a(%rip), %eax     # 0x197d4
testl %eax, %eax
jle 0x6607
xorl %ebx, %ebx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %ebx, %ecx
imull %eax, %ecx
movslq %ecx, %rax
cmpb $0x1, (%r13,%rax)
jne 0x65f8
movq 0x8(%r15), %rax
movl %ebx, (%rax)
movq 0x10(%r15), %rax
movl $0x0, (%rax,%rbx,4)
movl $0x1, 0x131f7(%rip)     # 0x197d8
callq 0x6644
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
movslq (%rax), %rdx
movl %r14d, (%rcx,%rdx,4)
movl %r14d, (%rax)
incq %rbx
movslq 0x131d2(%rip), %rax     # 0x197d4
cmpq %rax, %rbx
jl 0x65b6
movq %r15, %rdi
callq 0x6372
movl $0x18, %esi
movq %r15, %rdi
callq 0x2200
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x18, %esi
movq -0x40(%rbp), %rdi
callq 0x2200
movq %r14, %rdi
callq 0x2370