// File: /workspace/github_c_makefile_star2_O0/jondurbin[P]dre2/src/dre2_match.c
// Function: dre2_match
struct dre2_match_value dre2_match( struct dre2 *graph, unsigned char *input )
{
  int i, length;
  struct dre2_match_value result;
  int *r_temp, *reachable, *state;

  result.matched = false;

  // Make sure the string is even long enough before attempting matching.
  length = strlen( input );

  if ( length < graph->min_length )
    return result;

  if ( graph->options & DRE2_THREAD_SAFE )
  {
    r_temp = ( int * )malloc( sizeof( int ) * graph->count );
    reachable = ( int * )malloc( sizeof( int ) * graph->count );
    state = ( int * )calloc( graph->count, sizeof( int ) );
  } else
  {
    r_temp = graph->r_temp;
    reachable = graph->reachable;
    state = graph->state;
  }

  if ( graph->options & DRE2_FULL_MATCH )
  {
    result = dre2_full_match( graph, input, length, r_temp, reachable, state );
  } else
  {
    switch ( graph->match_method )
    {
      case DRE2_SN_SC_H:
        result = dre2_sn_sc_horspool( graph, input, length, r_temp, reachable, state );
        break;
      case DRE2_SN_SC:
        result = dre2_sn_sc( graph, input, length, r_temp, reachable, state );
        break;
      case DRE2_SN_MC_H:
        result = dre2_sn_mc_horspool( graph, input, length, r_temp, reachable, state );
        break;
      case DRE2_SN_MC:
        result = dre2_sn_mc( graph, input, length, r_temp, reachable, state );
        break;
      case DRE2_MN:
        result = dre2_mn( graph, input, length, r_temp, reachable, state );
        break;
    }
  }

  if ( result.matched && ( graph->options & DRE2_GREEDY ) && graph->has_loop )
    result = dre2_expanded_match( graph, input, length, r_temp, reachable, state, &result );

  if ( ( graph->options & DRE2_THREAD_SAFE ) || graph->count >= RANGE )
  {
    free( reachable ); reachable = NULL;
    free( r_temp ); r_temp = NULL;
    free( state ); state = NULL;
  }
  return result;
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movl $0x0, 0xb8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x2100
movl %eax, 0xa0(%rsp)
movl 0xa0(%rsp), %eax
movq 0xb0(%rsp), %rcx
cmpl 0x40c(%rcx), %eax
jge 0xb5d2
jmp 0xba0a
movq 0xb0(%rsp), %rax
movl 0x43c(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xb642
movq 0xb0(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x98(%rsp)
movq 0xb0(%rsp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x2280
movq %rax, 0x90(%rsp)
movq 0xb0(%rsp), %rax
movslq 0x8(%rax), %rdi
movl $0x4, %esi
callq 0x21d0
movq %rax, 0x88(%rsp)
jmp 0xb687
movq 0xb0(%rsp), %rax
movq 0x440(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0xb0(%rsp), %rax
movq 0x448(%rax), %rax
movq %rax, 0x90(%rsp)
movq 0xb0(%rsp), %rax
movq 0x450(%rax), %rax
movq %rax, 0x88(%rsp)
movq 0xb0(%rsp), %rax
movl 0x43c(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xb700
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0xa0(%rsp), %edx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0x88(%rsp), %r9
callq 0x22e0
movq %rax, 0x78(%rsp)
movq %rdx, 0x80(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0xb8fd
movq 0xb0(%rsp), %rax
movl 0x424(%rax), %eax
movq %rax, 0x10(%rsp)
subq $0x4, %rax
ja 0xb8fb
movq 0x10(%rsp), %rax
leaq 0x1c7b(%rip), %rcx      # 0xd3a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0xa0(%rsp), %edx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0x88(%rsp), %r9
callq 0x2230
movq %rax, 0x68(%rsp)
movq %rdx, 0x70(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0xb8fb
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0xa0(%rsp), %edx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0x88(%rsp), %r9
callq 0x20c0
movq %rax, 0x58(%rsp)
movq %rdx, 0x60(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0xb8fb
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0xa0(%rsp), %edx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0x88(%rsp), %r9
callq 0x21f0
movq %rax, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0xb8fb
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0xa0(%rsp), %edx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0x88(%rsp), %r9
callq 0x2340
movq %rax, 0x38(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0xb8fb
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0xa0(%rsp), %edx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0x88(%rsp), %r9
callq 0x2170
movq %rax, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0xb8fd
cmpl $0x0, 0xb8(%rsp)
je 0xb996
movq 0xb0(%rsp), %rax
movl 0x43c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb996
movq 0xb0(%rsp), %rax
cmpl $0x0, 0x868(%rax)
je 0xb996
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0xa0(%rsp), %edx
movq 0x98(%rsp), %rcx
movq 0x90(%rsp), %r8
movq 0x88(%rsp), %r9
leaq 0xb8(%rsp), %rax
movq %rax, (%rsp)
callq 0x2380
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xb0(%rsp), %rax
movl 0x43c(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0xb9bd
movq 0xb0(%rsp), %rax
cmpl $0x100, 0x8(%rax)       # imm = 0x100
jl 0xba08
movq 0x90(%rsp), %rdi
callq 0x2070
movq $0x0, 0x90(%rsp)
movq 0x98(%rsp), %rdi
callq 0x2070
movq $0x0, 0x98(%rsp)
movq 0x88(%rsp), %rdi
callq 0x2070
movq $0x0, 0x88(%rsp)
jmp 0xba0a
movq 0xb8(%rsp), %rax
movq 0xc0(%rsp), %rdx
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)