// File: /workspace/github_c_makefile_star2_O0/jondurbin[P]dre2/src/dre2_parse.c
// Function: dre2_use_paths
int dre2_use_paths( struct dre2 *graph, int best, struct dre2_fl_cost *cost )
{
  int i, j;
  struct dre2_node *node;
  int b_n_count, b_c_count, b_frequency;
  int p_n_count, p_c_count, p_frequency;
  int *original, *tp;
  double bf, pf, diff;
  unsigned char *temp;
  struct dre2_cost node_cost;

  if ( best == 0 )
  {
    b_n_count = cost->f_n_count;
    b_c_count = cost->f_c_count;
    b_frequency = cost->f_frequency;
  } else if ( best == graph->count - 1 )
  {
    b_n_count = cost->l_n_count;
    b_c_count = cost->l_c_count;
    b_frequency = cost->l_frequency;
  } else
  {
    node_cost = dre2_single_cost( graph, best );
    b_n_count = 1;
    b_c_count = node_cost.c_count;
    b_frequency = node_cost.frequency;
  }

  temp = ( unsigned char * )calloc( RANGE, sizeof( unsigned char ) );
  tp = ( int * )calloc( RANGE, sizeof( int ) );
  original = graph->starting_chars;
  graph->starting_chars = tp;

  p_n_count = graph->starting_count;
  for ( i = 0; i < RANGE; i++ )
    tp[i] = false;
  graph->starting_chars = tp;

  p_c_count = 0;
  p_frequency = 0;
  for ( i = 0; i < graph->starting_count; i++ )
  {
    dre2_set_chars( graph, graph->starting_points[i] );
    for ( j = 1; j < RANGE; j++ )
    {
      if ( graph->starting_chars[j] && !dre2_contains_char( temp, j ) )
      {
        p_c_count++;
        temp[p_c_count - 1] = j;
        p_frequency += dre2_frequency[j];
      }
    }
  }

  graph->starting_chars = original;
  free( temp );
  temp = NULL;
  free( tp );
  tp = NULL;

  if ( b_n_count * b_c_count < p_n_count * p_c_count ||
     ( b_n_count * b_c_count == p_n_count * p_c_count && b_frequency <= p_frequency ) )
    return false;
  return true;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x78(%rsp)
movl %esi, 0x74(%rsp)
movq %rdx, 0x68(%rsp)
cmpl $0x0, 0x74(%rsp)
jne 0x4fa1
movq 0x68(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x54(%rsp)
movq 0x68(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x50(%rsp)
movq 0x68(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x4c(%rsp)
jmp 0x500f
movl 0x74(%rsp), %eax
movq 0x78(%rsp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4fda
movq 0x68(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0x54(%rsp)
movq 0x68(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x50(%rsp)
movq 0x68(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, 0x4c(%rsp)
jmp 0x500d
movq 0x78(%rsp), %rdi
movl 0x74(%rsp), %esi
callq 0x2260
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x1, 0x54(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x50(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x4c(%rsp)
jmp 0x500f
movl $0x100, %edi            # imm = 0x100
movl $0x1, %esi
callq 0x21d0
movq %rax, 0x10(%rsp)
movl $0x100, %edi            # imm = 0x100
movl $0x4, %esi
callq 0x21d0
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rax
movq 0x418(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x30(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x418(%rax)
movq 0x78(%rsp), %rax
movl 0x438(%rax), %eax
movl %eax, 0x48(%rsp)
movl $0x0, 0x64(%rsp)
cmpl $0x100, 0x64(%rsp)      # imm = 0x100
jge 0x5098
movq 0x30(%rsp), %rax
movslq 0x64(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x5070
movq 0x30(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x418(%rax)
movl $0x0, 0x44(%rsp)
movl $0x0, 0x40(%rsp)
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
movq 0x78(%rsp), %rcx
cmpl 0x438(%rcx), %eax
jge 0x518e
movq 0x78(%rsp), %rdi
movq 0x78(%rsp), %rax
movq 0x430(%rax), %rax
movslq 0x64(%rsp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x2240
movl $0x1, 0x60(%rsp)
cmpl $0x100, 0x60(%rsp)      # imm = 0x100
jge 0x517c
movq 0x78(%rsp), %rax
movq 0x418(%rax), %rax
movslq 0x60(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x516d
movq 0x10(%rsp), %rdi
movl 0x60(%rsp), %eax
movzbl %al, %esi
callq 0x2140
cmpl $0x0, %eax
jne 0x516d
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
movl 0x60(%rsp), %eax
movb %al, %dl
movq 0x10(%rsp), %rax
movl 0x44(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movslq 0x60(%rsp), %rcx
movq 0xce86(%rip), %rax      # 0x11fe8
movl (%rax,%rcx,4), %eax
addl 0x40(%rsp), %eax
movl %eax, 0x40(%rsp)
jmp 0x516f
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x50fc
jmp 0x517e
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x50c1
movq 0x38(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x418(%rax)
movq 0x10(%rsp), %rdi
callq 0x2070
movq $0x0, 0x10(%rsp)
movq 0x30(%rsp), %rdi
callq 0x2070
movq $0x0, 0x30(%rsp)
movl 0x54(%rsp), %eax
imull 0x50(%rsp), %eax
movl 0x48(%rsp), %ecx
imull 0x44(%rsp), %ecx
cmpl %ecx, %eax
jl 0x51fb
movl 0x54(%rsp), %eax
imull 0x50(%rsp), %eax
movl 0x48(%rsp), %ecx
imull 0x44(%rsp), %ecx
cmpl %ecx, %eax
jne 0x5208
movl 0x4c(%rsp), %eax
cmpl 0x40(%rsp), %eax
jg 0x5208
movl $0x0, 0x84(%rsp)
jmp 0x5213
movl $0x1, 0x84(%rsp)
movl 0x84(%rsp), %eax
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)