// File: /workspace/github_c_makefile_star2_O3/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 $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %r12d
movl %eax, 0x132c8(%rip)     # 0x197d4
movl $0x18, %edi
callq 0x21f0
movq %rax, %r15
movq %rax, %rdi
movl %r12d, %esi
movl %r12d, %edx
callq 0x6422
movl 0x132a7(%rip), %eax     # 0x197d4
movq %rax, %rcx
imulq %rax, %rcx
movq %rsp, %rdx
leaq 0xf(,%rcx,4), %rcx
andq $-0x10, %rcx
subq %rcx, %rdx
movq %rdx, %rsp
testl %eax, %eax
jle 0x6672
movq %rbx, -0x30(%rbp)
movq %r15, -0x38(%rbp)
leaq (,%rax,4), %r15
xorl %r12d, %r12d
movq %rdx, -0x40(%rbp)
movq %rdx, %rbx
testl %eax, %eax
jle 0x65ac
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 0x6595
movq (%r14), %rax
movq %r14, %rdi
movl %r13d, %esi
callq *0x70(%rax)
movl %eax, (%rbx,%r13,4)
incq %r13
movl 0x13232(%rip), %eax     # 0x197d4
movslq %eax, %rcx
cmpq %rcx, %r13
jl 0x6572
jmp 0x65af
movslq %eax, %rcx
incq %r12
addq %r15, %rbx
cmpq %rcx, %r12
jl 0x656b
testl %eax, %eax
jle 0x666a
xorl %ebx, %ebx
leaq -0x1af(%rip), %r12      # 0x641c
movq -0x40(%rbp), %r13
movslq %eax, %rsi
movl $0x4, %edx
movq %r13, %rdi
movq %r12, %rcx
callq 0x23c0
incq %rbx
movslq 0x131e8(%rip), %rax     # 0x197d4
addq %r15, %r13
cmpq %rax, %rbx
jl 0x65cf
movl %eax, %ecx
imull %ecx, %ecx
movq %rsp, %r12
addl $0xf, %ecx
andl $-0x10, %ecx
subq %rcx, %r12
movq %r12, %rsp
testl %eax, %eax
jle 0x6744
xorl %ecx, %ecx
movq -0x40(%rbp), %r11
movq %r11, %rdx
movq -0x30(%rbp), %rbx
movq %rcx, %rsi
imulq %rax, %rsi
addq %r12, %rsi
movq %r11, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
movl (%rdx,%r9,4), %r10d
cmpl (%rdi,%r9,4), %r10d
jne 0x6647
incq %r9
cmpq %r9, %rax
jne 0x6630
movb $0x1, %r9b
jmp 0x664a
xorl %r9d, %r9d
movb %r9b, (%rsi,%r8)
incq %r8
addq %r15, %rdi
cmpq %rax, %r8
jne 0x662d
incq %rcx
addq %r15, %rdx
cmpq %rax, %rcx
jne 0x661d
movq -0x38(%rbp), %r15
jmp 0x6684
movq -0x38(%rbp), %r15
movq -0x30(%rbp), %rbx
imull %eax, %eax
movq %rsp, %r12
addl $0xf, %eax
andl $-0x10, %eax
subq %rax, %r12
movq %r12, %rsp
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x6691
movq %rax, 0x8(%rbx)
movq %r15, 0x13148(%rip)     # 0x197e0
movq %r14, 0x13149(%rip)     # 0x197e8
movq %rbx, 0x1314a(%rip)     # 0x197f0
movq %r12, 0x1314b(%rip)     # 0x197f8
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movq %rax, 0x13144(%rip)     # 0x19800
movl 0x13112(%rip), %eax     # 0x197d4
testl %eax, %eax
jle 0x6720
xorl %ebx, %ebx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %ebx, %ecx
imull %eax, %ecx
movslq %ecx, %rcx
cmpb $0x1, (%r12,%rcx)
jne 0x6715
movq 0x8(%r15), %rax
movl %ebx, (%rax)
movq 0x10(%r15), %rax
movl $0x0, (%rax,%rbx,4)
movl $0x1, 0x130e0(%rip)     # 0x197d8
callq 0x676a
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
movslq (%rax), %rdx
movl %r14d, (%rcx,%rdx,4)
movl %r14d, (%rax)
movl 0x130bf(%rip), %eax     # 0x197d4
incq %rbx
movslq %eax, %rcx
cmpq %rcx, %rbx
jl 0x66ce
movq %r15, %rdi
callq 0x64c2
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 -0x38(%rbp), %r15
movq -0x30(%rbp), %rbx
jmp 0x6684
movq %rax, %r14
movl $0x18, %esi
movq %r15, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x2370
nop