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

  result.assertion_match = false;
  c = graph->c;
  pch = memchr( input + graph->initial_skip, c, length );
  while ( pch != NULL && pch - input <= length && *pch != '\0' )
  {
    if ( graph->starting_point == 0 )
    {
      result = dre2_matcher( graph, input, pch, graph->starting_point, DRE2_RIGHT, length, r_temp, reachable, state );
      if ( result.match != NULL )
      {
        ret_val.matched = true;
        ret_val.start_pos = pch - input;
        ret_val.end_pos = result.match - input + 1;
        return ret_val;
      }
      if ( result.skip_to != DRE2_INFINITE )
        pch = input + result.skip_to;
    } else
    {
      result = dre2_matcher( graph, input, pch, graph->starting_point, DRE2_LEFT, length, r_temp, reachable, state );
      if ( result.match != NULL )
      {
        ret_val.start_pos = result.match - input;
        result = dre2_matcher( graph, input, pch, graph->starting_point, DRE2_RIGHT, length, r_temp, reachable, state );
        if ( result.match != NULL )
        {
          ret_val.matched = true;
          ret_val.end_pos = result.match - input + 1;
          return ret_val;
        }
        if ( result.skip_to != DRE2_INFINITE )
          pch = input + result.skip_to;
      }
      if ( result.assertion_match )
          pch = input + length;
    }
    pch = memchr( pch + 1, c, length - ( pch - input ) );
  }
  ret_val.matched = false;
  return ret_val;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x50(%rsp)
movq %r8, %r15
movq %rcx, %rbx
movl %edx, %r13d
movq %rsi, %r14
movzbl 0x428(%rdi), %esi
movq %rdi, 0x48(%rsp)
movslq 0x864(%rdi), %rdi
addq %r14, %rdi
movslq %edx, %r12
movl %esi, 0x1c(%rsp)
movq %r12, %rdx
callq 0x21e0
testq %rax, %rax
je 0x67cb
movq %rax, %rbp
movq %r12, 0x40(%rsp)
addq %r14, %r12
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
movq %r14, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq %r15, 0x38(%rsp)
movq %r13, %r14
movq %rbx, %r13
movq %r15, %rbx
movq 0x50(%rsp), %r15
movq %rbp, %r12
subq %rdx, %r12
cmpq 0x40(%rsp), %r12
jg 0x67c0
cmpb $0x0, (%rbp)
je 0x67c0
movq 0x48(%rsp), %rsi
movl 0x410(%rsi), %r8d
testl %r8d, %r8d
je 0x6735
movq %rsi, %r12
movq %rbp, %rcx
xorl %r9d, %r9d
pushq %r15
pushq %rbx
movq %r13, %rbx
pushq %r13
movq %r14, %r13
pushq %r14
callq 0x2290
addq $0x20, %rsp
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x6781
movq %r13, %r10
movl %eax, %r13d
movq 0x8(%rsp), %rdx
subl %edx, %r13d
movl 0x410(%r12), %r8d
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rcx
movl $0x1, %r9d
pushq %r15
movq 0x40(%rsp), %r12
pushq %r12
movq %rbx, %r15
pushq %rbx
pushq %r10
callq 0x2290
addq $0x20, %rsp
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
jne 0x67e8
movq %r12, %rdx
movl 0x20(%rsp), %eax
movslq 0x28(%rsp), %rcx
cmpl $-0x1, %ecx
movq 0x10(%rsp), %r12
movl %r13d, 0x4(%rsp)
je 0x672a
addq 0x8(%rsp), %rcx
movq %rcx, %rbp
movq %r14, %r13
movq %r15, %rbx
movq %rdx, %r15
jmp 0x678f
movq %rbp, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %r15
pushq %rbx
pushq %r13
pushq %r14
callq 0x2290
addq $0x20, %rsp
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
jne 0x67f7
movslq 0x28(%rsp), %rax
cmpl $-0x1, %eax
je 0x6771
addq 0x8(%rsp), %rax
movq %rax, %rbp
movq %rbx, %r15
movq %r13, %rbx
movq %r14, %r13
movq 0x10(%rsp), %r12
jmp 0x6795
movl 0x20(%rsp), %eax
movq 0x10(%rsp), %r12
movq 0x38(%rsp), %r15
testl %eax, %eax
cmovneq %r12, %rbp
movq %r12, %rdx
subq %rbp, %rdx
incq %rbp
movq %rbp, %rdi
movl 0x1c(%rsp), %esi
callq 0x21e0
movq %rax, %rbp
testq %rax, %rax
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
jne 0x664f
xorl %ecx, %ecx
xorl %eax, %eax
movl 0x4(%rsp), %r13d
jmp 0x67cf
xorl %eax, %eax
xorl %ecx, %ecx
shlq $0x20, %rcx
movl %r13d, %edx
orq %rcx, %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq 0x8(%rsp), %rcx
incq %rcx
movl $0x1, %eax
jmp 0x67cf
subq 0x8(%rsp), %rcx
incq %rcx
movl $0x1, %eax
movl %r12d, %r13d
jmp 0x67cf