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

  assertion_match = false;
  result.assertion_match = false;

  pch = input + graph->initial_skip;
  while ( pch - input <= length && *pch != '\0' && !graph->starting_chars[*pch] )
    *pch++;
  while ( 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 )
      {
        assertion_match = result.assertion_match;
        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 ( assertion_match )
          pch = input + length;
        else if( result.skip_to != DRE2_INFINITE )
          pch = input + result.skip_to;
      }
      if ( result.assertion_match )
        pch = input + length;
      if ( result.skip_to != DRE2_INFINITE )
        pch = input + result.skip_to;
    }
    *pch++;
    while ( pch - input <= length && *pch != 0 && !graph->starting_chars[*pch] )
      *pch++;
  }
  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, %r10
movq %r8, 0x28(%rsp)
movq %rcx, %r11
movq %rdx, 0x48(%rsp)
movq %rsi, %rbx
movq %rdi, %rbp
movslq 0x864(%rdi), %rax
leaq (%rsi,%rax), %r13
movslq %edx, %r12
cmpl %r12d, %eax
jg 0x69be
leaq (%rbx,%r12), %rcx
incq %rcx
movzbl (%rbx,%rax), %edx
testq %rdx, %rdx
je 0x69be
movq 0x418(%rbp), %rsi
cmpl $0x0, (%rsi,%rdx,4)
jne 0x69b8
incq %r13
incq %rax
cmpq %r12, %rax
jle 0x6992
movq %rcx, %r13
jmp 0x69be
addq %rbx, %rax
movq %rax, %r13
movq %r13, %r14
subq %rbx, %r14
cmpq %r12, %r14
jg 0x6b8f
cmpb $0x0, (%r13)
je 0x6b8f
leaq (%rbx,%r12), %rax
movq %rax, 0x20(%rsp)
movl $0x1, %eax
subq %rbx, %rax
movq %rax, 0x50(%rsp)
leaq 0x30(%rsp), %rdi
movq %r10, 0x10(%rsp)
movq %r11, 0x8(%rsp)
movl 0x410(%rbp), %r8d
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %rcx
testl %r8d, %r8d
je 0x6ab2
xorl %r9d, %r9d
pushq %r10
pushq 0x30(%rsp)
pushq %r11
movq 0x60(%rsp), %r14
pushq %r14
callq 0x2290
addq $0x20, %rsp
movl 0x30(%rsp), %r15d
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x6afa
subl %ebx, %eax
movl %eax, 0x1c(%rsp)
movl 0x410(%rbp), %r8d
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movl $0x1, %r9d
pushq 0x10(%rsp)
pushq 0x30(%rsp)
pushq 0x18(%rsp)
pushq %r14
callq 0x2290
addq $0x20, %rsp
movq 0x40(%rsp), %rcx
testq %rcx, %rcx
jne 0x6bb3
movl 0x30(%rsp), %ecx
movl 0x38(%rsp), %eax
testl %r15d, %r15d
je 0x6b1b
movq 0x20(%rsp), %rdx
movq %rdx, %r13
movl %ecx, %r15d
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r11
jmp 0x6b0d
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %r10
pushq 0x30(%rsp)
pushq %r11
pushq 0x60(%rsp)
callq 0x2290
addq $0x20, %rsp
movq 0x40(%rsp), %rcx
testq %rcx, %rcx
jne 0x6bc0
movslq 0x38(%rsp), %rax
cmpl $-0x1, %eax
je 0x6aee
addq %rbx, %rax
movq %rax, %r13
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r11
jmp 0x6b35
movl 0x38(%rsp), %eax
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r11
movq 0x20(%rsp), %rdx
testl %r15d, %r15d
cmovneq %rdx, %r13
cmpl $-0x1, %eax
jne 0x6b2f
jmp 0x6b35
cmpl $-0x1, %eax
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r11
movq 0x20(%rsp), %rdx
je 0x6b87
movslq %eax, %r13
addq %rbx, %r13
movq 0x50(%rsp), %rax
addq %r13, %rax
incq %r13
movq %r13, %rdx
cmpq %r12, %rax
jg 0x6b95
movq %rdx, %r13
movq %rax, %r14
movzbl (%rdx), %ecx
testq %rcx, %rcx
je 0x6b6b
movq 0x418(%rbp), %rsi
leaq 0x1(%r13), %rdx
leaq 0x1(%r14), %rax
cmpl $0x0, (%rsi,%rcx,4)
je 0x6b43
cmpb $0x0, (%r13)
movl $0x0, %ecx
movl $0x0, %eax
leaq 0x30(%rsp), %rdi
jne 0x69fd
jmp 0x6b99
testl %ecx, %ecx
cmovneq %rdx, %r13
jmp 0x6b35
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0x6b99
xorl %ecx, %ecx
xorl %eax, %eax
shlq $0x20, %rcx
movl 0x1c(%rsp), %edx
orq %rcx, %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq %rbx, %rcx
incq %rcx
movl $0x1, %eax
jmp 0x6b99
subq %rbx, %rcx
incq %rcx
movl $0x1, %eax
movl %r14d, 0x1c(%rsp)
jmp 0x6b99