// File: /workspace/github_c_makefile_star2_O2/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 0x13f34(%rip), %rax     # 0x197c8
leal 0x1(%rsi), %r8d
movq %rsi, -0x40(%rbp)
movslq %esi, %r12
movl %edi, (%rax,%r12,4)
cmpl 0x13f12(%rip), %r8d     # 0x197bc
jne 0x594f
movq %rsp, %r15
imull %r8d, %r8d
movq %rsp, %r14
addl $0x10, %r8d
andl $-0x10, %r8d
subq %r8, %r14
movq %r14, %rsp
movq 0x13f09(%rip), %rdi     # 0x197d8
movq 0x13ef2(%rip), %rsi     # 0x197c8
movq %r14, %rdx
callq 0x692a
movq 0x13f03(%rip), %rdi     # 0x197e8
movq %r14, %rsi
callq 0xb4b4
leaq 0x2420d(%rip), %rax     # 0x29b01
cmpb $0x1, (%rax)
jne 0x5a7f
leaq 0x24204(%rip), %r13     # 0x29b08
movq (%r13), %rdi
leaq 0xb2db(%rip), %rsi      # 0x10bea
movq %r14, %rdx
xorl %eax, %eax
callq 0x2310
leaq 0xb291(%rip), %rbx      # 0x10bb1
xorl %r14d, %r14d
movq (%r13), %rsi
cmpq %r12, %r14
jg 0x5a77
movq 0x13e91(%rip), %rax     # 0x197c8
movl (%rax,%r14,4), %edx
incl %edx
movq %rsi, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2310
incq %r14
jmp 0x5923
movq %rsp, -0x48(%rbp)
movl 0x13e67(%rip), %eax     # 0x197c0
movq %rsp, %r14
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
xorl %eax, %eax
testl %edx, %edx
movl $0x0, %edi
cmovgl %edx, %edi
cmpq %rax, %rdi
je 0x598b
movl (%rcx,%rax,4), %esi
movl %esi, (%r14,%rax,4)
incq %rax
jmp 0x597a
movl %edx, -0x2c(%rbp)
movq %r8, -0x50(%rbp)
movq 0x13e3f(%rip), %rdi     # 0x197d8
movq 0x13e28(%rip), %rax     # 0x197c8
movl (%rax,%r12,4), %esi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, %r13
movq 0x13e21(%rip), %rdi     # 0x197d8
movq 0x13e0a(%rip), %rax     # 0x197c8
movl (%rax,%r12,4), %esi
movq (%rdi), %rax
callq *0x70(%rax)
xorl %r15d, %r15d
testl %r12d, %r12d
movl $0x0, %r12d
cmovgl -0x40(%rbp), %r12d
testl %eax, %eax
cmovlel %r15d, %eax
movq %rax, -0x38(%rbp)
cmpq %rax, %r15
je 0x5a4b
movl (%r13,%r15,4), %edx
movq 0x13dd4(%rip), %rcx     # 0x197c8
cmpl (%rcx), %edx
jle 0x5a46
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x5a26
movq 0x13dd2(%rip), %rdi     # 0x197d8
movl (%r13,%r15,4), %esi
movq 0x13db6(%rip), %rax     # 0x197c8
movl (%rax,%rbx,4), %edx
incq %rbx
movq (%rdi), %rax
callq *0x58(%rax)
testb %al, %al
je 0x59fa
decl %ebx
jmp 0x5a29
movl %r12d, %ebx
cmpl -0x40(%rbp), %ebx
jne 0x5a42
movl (%r13,%r15,4), %eax
movl -0x2c(%rbp), %edx
movslq %edx, %rcx
incl %edx
movl %edx, -0x2c(%rbp)
movl %eax, (%r14,%rcx,4)
movq -0x38(%rbp), %rax
incq %r15
jmp 0x59e3
movl -0x2c(%rbp), %r15d
movq -0x50(%rbp), %rbx
testl %r15d, %r15d
jle 0x5a71
decq %r15
movl %r15d, %eax
movl (%r14,%rax,4), %edi
movl %ebx, %esi
movl %r15d, %edx
movq %r14, %rcx
callq 0x587c
jmp 0x5a53
movq -0x48(%rbp), %rsp
jmp 0x5a82
pushq $0xa
popq %rdi
callq 0x22a0
movq %r15, %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop