// File: /workspace/github_c_makefile_star2_O0/jondurbin[P]dre2/src/dre2_parse.c
// Function: dre2_find_paths_recursive
int dre2_find_paths_recursive( struct dre2 *graph, int id, int *path_count, struct dre2_path **paths )
{
  int i, j;
  int size, last;
  struct dre2_path *path, *next_path;

  if ( *path_count >= 1024 )
  {
    for ( i = 0; i < *path_count; i++ )
    {
      if ( ( *paths )[i].nodes != NULL )
      {
        free( ( *paths )[i].nodes );
        ( *paths )[i].nodes = NULL;
      }
    }
    free( *paths );
    *paths = NULL;
    *path_count = 0;
    return false;
  }

  size = ( *paths )[id].count;
  last = ( *paths )[id].nodes[( *paths )[id].count - 1];

  for ( i = 0; i < graph->v[last].min_n_count; i++ )
  {
    path = &( *paths )[id];
    if ( i == 0 )
    {
      // For the first possible node, just add it to the current path.
      ( *paths )[id].count++;
      ( *paths )[id].nodes[( *paths )[id].count - 1] = graph->v[last].min_n[i];
      if ( dre2_find_paths_recursive( graph, id, path_count, paths ) == false )
        return false;
    } else
    {
      // For the other nodes, split the path.
      *path_count = *path_count + 1;
      *paths = ( struct dre2_path * )realloc( *paths, sizeof( struct dre2_path ) * *path_count );
      next_path = &( *paths )[*path_count - 1];
      next_path->count = size + 1;
      next_path->nodes = ( int * )malloc( sizeof( int ) * graph->count );

      // Copy the previous nodes and add the current one.
      for ( j = 0; j < size; j++ )
        next_path->nodes[j] = ( *paths )[id].nodes[j];
      next_path->nodes[size] = graph->v[last].min_n[i];
      if ( dre2_find_paths_recursive( graph, *path_count - 1, path_count, paths ) == false )
        return false;
    }
  }
  return true;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x400, (%rax)          # imm = 0x400
jl 0x345e
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x342d
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x1c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x341e
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x1c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x2070
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x1c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
jmp 0x3420
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x33c0
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0x2070
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
movq 0x28(%rsp), %rax
movl $0x0, (%rax)
movl $0x0, 0x44(%rsp)
jmp 0x36e8
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x34(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x34(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
movslq 0x34(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x10(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x38(%rsp), %rcx
movq (%rcx), %rcx
movslq 0x10(%rsp), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl 0x38(%rcx), %eax
jge 0x36e0
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x34(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x1c(%rsp)
jne 0x35a4
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x34(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movslq 0x10(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movslq 0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x34(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
movslq 0x34(%rsp), %rsi
shlq $0x4, %rsi
addq %rsi, %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x22a0
cmpl $0x0, %eax
jne 0x359f
movl $0x0, 0x44(%rsp)
jmp 0x36e8
jmp 0x36ce
movq 0x28(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq 0x28(%rsp), %rax
movslq (%rax), %rsi
shlq $0x4, %rsi
callq 0x22b0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movl 0x14(%rsp), %ecx
addl $0x1, %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x38(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x3670
movq 0x20(%rsp), %rax
movq (%rax), %rax
movslq 0x34(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq 0x18(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq (%rsp), %rax
movq (%rax), %rax
movslq 0x18(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x362b
movq 0x38(%rsp), %rax
movq (%rax), %rax
movslq 0x10(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movslq 0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq (%rsp), %rax
movq (%rax), %rax
movslq 0x14(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rax
movl (%rax), %esi
subl $0x1, %esi
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x22a0
cmpl $0x0, %eax
jne 0x36cc
movl $0x0, 0x44(%rsp)
jmp 0x36e8
jmp 0x36ce
jmp 0x36d0
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x34bc
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)