// File: /workspace/github_c_makefile_star2_O3/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 0x13940(%rip), %rax     # 0x197a8
leal 0x1(%rsi), %r13d
movq %rsi, -0x38(%rbp)
movslq %esi, %rbx
movl %edi, (%rax,%rbx,4)
cmpl 0x1391f(%rip), %r13d    # 0x1979c
jne 0x5f31
movq %rsp, %r12
movl %r13d, %eax
imull %eax, %eax
movq %rsp, %r15
addl $0x10, %eax
andl $-0x10, %eax
subq %rax, %r15
movq %r15, %rsp
movq 0x13916(%rip), %rdi     # 0x197b8
movq 0x138ff(%rip), %rsi     # 0x197a8
movq %r15, %rdx
callq 0x6eb6
movq 0x13910(%rip), %rdi     # 0x197c8
movq %r15, %rsi
callq 0xbda0
leaq 0x23c1a(%rip), %rax     # 0x29ae1
cmpb $0x1, (%rax)
jne 0x5f29
leaq 0x23c15(%rip), %r14     # 0x29ae8
movq (%r14), %rdi
leaq 0xbd6e(%rip), %rsi      # 0x11c4b
movq %r15, %rdx
xorl %eax, %eax
callq 0x22d0
cmpl $0x0, -0x38(%rbp)
js 0x5f1c
movl %r13d, %r15d
leaq 0xbd1b(%rip), %rbx      # 0x11c12
xorl %r13d, %r13d
movq (%r14), %rdi
movq 0x138a4(%rip), %rax     # 0x197a8
movl (%rax,%r13,4), %edx
incl %edx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22d0
incq %r13
cmpq %r13, %r15
jne 0x5efa
movq (%r14), %rsi
movl $0xa, %edi
callq 0x2280
movq %r12, %rsp
jmp 0x605d
movl %edx, %r14d
movl %r13d, -0x3c(%rbp)
movq %rsp, -0x50(%rbp)
movl 0x1385e(%rip), %eax     # 0x197a0
movq %rsp, %r15
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
testl %edx, %edx
jle 0x5f6d
movl %r14d, %edx
shlq $0x2, %rdx
movq %r15, %rdi
movq %rcx, %rsi
callq 0x21a0
movq %r15, -0x48(%rbp)
movl %r14d, -0x2c(%rbp)
movq 0x1383c(%rip), %rdi     # 0x197b8
movq 0x13825(%rip), %rax     # 0x197a8
movl (%rax,%rbx,4), %esi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, %r13
movq 0x1381f(%rip), %rdi     # 0x197b8
movq 0x13808(%rip), %rax     # 0x197a8
movl (%rax,%rbx,4), %esi
movq (%rdi), %rax
callq *0x70(%rax)
testl %eax, %eax
jle 0x6028
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 0x137d9(%rip), %rcx     # 0x197a8
cmpl (%rcx), %eax
jle 0x6020
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x6001
movq 0x137d7(%rip), %rdi     # 0x197b8
movl (%r13,%r14,4), %esi
movq 0x137bb(%rip), %rax     # 0x197a8
movl (%rax,%rbx,4), %edx
incq %rbx
movq (%rdi), %rax
callq *0x58(%rax)
testb %al, %al
je 0x5fd5
decl %ebx
jmp 0x6004
movl %r15d, %ebx
cmpl -0x38(%rbp), %ebx
jne 0x6020
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 0x5fc3
movl -0x2c(%rbp), %eax
testl %eax, %eax
movl -0x3c(%rbp), %r15d
movq -0x48(%rbp), %r12
jle 0x6059
movl %eax, %ebx
leaq -0x1(%rbx), %r14
movl -0x4(%r12,%rbx,4), %edi
movl %r15d, %esi
movl %r14d, %edx
movq %r12, %rcx
callq 0x5e50
cmpq $0x1, %rbx
movq %r14, %rbx
ja 0x6039
movq -0x50(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq