// File: /workspace/github_c_makefile_star2_O1/ComplexNetworks-DCC-FCUP[P]gtrieScanner/Esu.cpp
// Function: Esu::_go(int, int, int, int*)
void Esu::_go(int n, int size, int next, int *ext) {
  _current[size++] = n;

  if (size==_motif_size) {
    char s[_motif_size*_motif_size+1];
    Isomorphism::canonicalStrNauty(_g, _current, s);
    _sg->incrementString(s);

    if (Global::show_occ) {
      fprintf(Global::occ_file, "%s:", s);
      for (int i=0; i<size; i++)
	fprintf(Global::occ_file, " %d", _current[i]+1);
      fputc('\n', Global::occ_file);
    }

  } else {
    int i,j;
    int next2 = next;
    int ext2[_graph_size];

    for (i=0;i<next;i++) ext2[i] = ext[i];

    int *v  = _g->arrayNeighbours(_current[size-1]);
    int num = _g->numNeighbours(_current[size-1]);


    for (i=0;i<num;i++) {
      if (v[i]<=_current[0]) continue;
      for (j=0;j+1<size;j++)
	if (_g->isConnected(v[i],_current[j])) break;
      if (j+1==size) ext2[next2++]=v[i];      
    }

    while (next2>0) {      
      next2--;
      _go(ext2[next2], size, next2, ext2);
    }
  }
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x13a94(%rip), %rax     # 0x197a8
leal 0x1(%rsi), %r12d
movq %rsi, -0x38(%rbp)
movslq %esi, %rbx
movl %edi, (%rax,%rbx,4)
movl 0x13a74(%rip), %eax     # 0x1979c
cmpl %eax, %r12d
jne 0x5dda
imull %eax, %eax
movq %rsp, %r15
addl $0x10, %eax
andl $-0x10, %eax
subq %rax, %r15
movq %r15, %rsp
movq 0x13a6e(%rip), %rdi     # 0x197b8
movq 0x13a57(%rip), %rsi     # 0x197a8
movq %r15, %rdx
callq 0x6da6
movq 0x13a68(%rip), %rdi     # 0x197c8
movq %r15, %rsi
callq 0xbc4c
leaq 0x23d72(%rip), %rax     # 0x29ae1
cmpb $0x1, (%rax)
jne 0x5efe
leaq 0x23d69(%rip), %r14     # 0x29ae8
movq (%r14), %rdi
leaq 0xbea9(%rip), %rsi      # 0x11c32
movq %r15, %rdx
xorl %eax, %eax
callq 0x22d0
cmpl $0x0, -0x38(%rbp)
js 0x5dc8
movl %r12d, %r15d
leaq 0xbe56(%rip), %rbx      # 0x11bf9
xorl %r12d, %r12d
movq (%r14), %rdi
movq 0x139f8(%rip), %rax     # 0x197a8
movl (%rax,%r12,4), %edx
incl %edx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22d0
incq %r12
cmpq %r12, %r15
jne 0x5da6
movq (%r14), %rsi
movl $0xa, %edi
callq 0x2280
jmp 0x5efe
movl %edx, %r14d
movl %r12d, -0x3c(%rbp)
movl 0x139b9(%rip), %eax     # 0x197a0
movq %rsp, %r15
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
testl %edx, %edx
jle 0x5e12
movl %r14d, %edx
shlq $0x2, %rdx
movq %r15, %rdi
movq %rcx, %rsi
callq 0x21a0
movq %r15, -0x48(%rbp)
movl %r14d, -0x2c(%rbp)
movq 0x13997(%rip), %rdi     # 0x197b8
movq 0x13980(%rip), %rax     # 0x197a8
movl (%rax,%rbx,4), %esi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, %r13
movq 0x1397a(%rip), %rdi     # 0x197b8
movq 0x13963(%rip), %rax     # 0x197a8
movl (%rax,%rbx,4), %esi
movq (%rdi), %rax
callq *0x70(%rax)
testl %eax, %eax
jle 0x5ecd
xorl %r14d, %r14d
movq -0x38(%rbp), %rcx
testl %ecx, %ecx
movl $0x0, %r15d
cmovgl %ecx, %r15d
movl %eax, %r12d
movl (%r13,%r14,4), %eax
movq 0x13934(%rip), %rcx     # 0x197a8
cmpl (%rcx), %eax
jle 0x5ec5
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x5ea6
movq 0x13932(%rip), %rdi     # 0x197b8
movl (%r13,%r14,4), %esi
movq 0x13916(%rip), %rax     # 0x197a8
movl (%rax,%rbx,4), %edx
incq %rbx
movq (%rdi), %rax
callq *0x58(%rax)
testb %al, %al
je 0x5e7a
decl %ebx
jmp 0x5ea9
movl %r15d, %ebx
cmpl -0x38(%rbp), %ebx
jne 0x5ec5
movl (%r13,%r14,4), %eax
movl -0x2c(%rbp), %edx
movslq %edx, %rcx
incl %edx
movl %edx, -0x2c(%rbp)
movq -0x48(%rbp), %rdx
movl %eax, (%rdx,%rcx,4)
incq %r14
cmpq %r12, %r14
jne 0x5e68
movl -0x2c(%rbp), %eax
testl %eax, %eax
movl -0x3c(%rbp), %r15d
movq -0x48(%rbp), %r12
jle 0x5efe
movl %eax, %ebx
leaq -0x1(%rbx), %r14
movl -0x4(%r12,%rbx,4), %edi
movl %r15d, %esi
movl %r14d, %edx
movq %r12, %rcx
callq 0x5cfc
cmpq $0x1, %rbx
movq %r14, %rbx
jg 0x5ede
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop