// File: /workspace/github_c_makefile_star2_O0/ComplexNetworks-DCC-FCUP[P]gtrieScanner/Esu.cpp
// Function: Esu::_goSample(int, int, int, int*)
void Esu::_goSample(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);
  } 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--;
      if (Random::getDouble()<=_prob[size])
	_goSample(ext2[next2], size, next2, ext2);
    }
  }
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movl -0x4(%rbp), %edx
movq 0x21b19(%rip), %rax     # 0x2d238
movl -0x8(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x8(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x8(%rbp), %eax
cmpl 0x21af3(%rip), %eax     # 0x2d22c
jne 0xb795
movl 0x21aeb(%rip), %ecx     # 0x2d22c
imull %ecx, %ecx
movl %ecx, %eax
incl %eax
movq %rsp, %rdx
movq %rdx, -0x20(%rbp)
addl $0x10, %ecx
andl $-0x10, %ecx
movq %rsp, %rdx
subq %rcx, %rdx
movq %rdx, -0x60(%rbp)
movq %rdx, %rsp
movq %rax, -0x28(%rbp)
movq 0x21adb(%rip), %rdi     # 0x2d248
movq 0x21ac4(%rip), %rsi     # 0x2d238
callq 0xda80
movq -0x60(%rbp), %rsi
movq 0x21ad4(%rip), %rdi     # 0x2d258
callq 0x19d30
movq -0x20(%rbp), %rax
movq %rax, %rsp
jmp 0xb940
movl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
movl 0x21a8f(%rip), %eax     # 0x2d230
movq %rsp, %rcx
movq %rcx, -0x40(%rbp)
leaq 0xf(,%rax,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rax, -0x48(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xb7f5
movq -0x68(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xb7cc
movq 0x21a4c(%rip), %rdi     # 0x2d248
movq 0x21a35(%rip), %rax     # 0x2d238
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, -0x50(%rbp)
movq 0x21a25(%rip), %rdi     # 0x2d248
movq 0x21a0e(%rip), %rax     # 0x2d238
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movq (%rdi), %rax
callq *0x70(%rax)
movl %eax, -0x54(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0xb8f2
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x219d4(%rip), %rcx     # 0x2d238
cmpl (%rcx), %eax
jg 0xb86a
jmp 0xb8e4
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0xb8b7
movq 0x219c5(%rip), %rdi     # 0x2d248
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movq 0x219a3(%rip), %rax     # 0x2d238
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq (%rdi), %rax
callq *0x58(%rax)
testb $0x1, %al
jne 0xb8a8
jmp 0xb8aa
jmp 0xb8b7
jmp 0xb8ac
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xb871
movl -0x30(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jne 0xb8e2
movq -0x68(%rbp), %rax
movq -0x50(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
movl -0x34(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x34(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xb8e4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xb846
jmp 0xb8f4
cmpl $0x0, -0x34(%rbp)
jle 0xb939
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
callq 0x18ce0
movaps %xmm0, %xmm1
movq 0x2193e(%rip), %rax     # 0x2d250
movslq -0x8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0xb937
movq -0x68(%rbp), %rcx
movslq -0x34(%rbp), %rax
movl (%rcx,%rax,4), %edi
movl -0x8(%rbp), %esi
movl -0x34(%rbp), %edx
callq 0xb700
jmp 0xb8f4
movq -0x40(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)