// File: /workspace/github_c_makefile_star2_O1/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, 0x38(%rsp)
movq %rcx, %r11
movq %rsi, %rbx
movq %rdi, %rbp
movslq 0x864(%rdi), %rax
leaq (%rsi,%rax), %r13
movq %rdx, 0x48(%rsp)
movslq %edx, %r15
cmpl %r15d, %eax
jg 0x698b
leaq (%rbx,%r15), %rcx
incq %rcx
movzbl (%rbx,%rax), %edx
testq %rdx, %rdx
je 0x6985
movq 0x418(%rbp), %rsi
cmpl $0x0, (%rsi,%rdx,4)
jne 0x698b
incq %r13
incq %rax
cmpq %r15, %rax
jle 0x695f
movq %rcx, %r13
jmp 0x698b
addq %rbx, %rax
movq %rax, %r13
movq %r13, %r14
subq %rbx, %r14
cmpq %r15, %r14
jle 0x699f
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0x6b7e
leaq (%rbx,%r15), %rax
movq %rax, 0x18(%rsp)
movl $0x1, %eax
subq %rbx, %rax
movq %rax, 0x50(%rsp)
leaq 0x20(%rsp), %r12
movq %r10, 0x10(%rsp)
movq %r11, 0x8(%rsp)
cmpb $0x0, (%r13)
je 0x6b76
movl 0x410(%rbp), %r8d
testl %r8d, %r8d
je 0x6a95
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %rcx
xorl %r9d, %r9d
pushq %r10
pushq 0x40(%rsp)
pushq %r11
movq 0x60(%rsp), %r14
pushq %r14
callq 0x2290
addq $0x20, %rsp
movl 0x20(%rsp), %ecx
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x6aeb
movl %ecx, 0x44(%rsp)
subl %ebx, %eax
movl %eax, 0x4(%rsp)
movl 0x410(%rbp), %r8d
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %r12
movq %rbx, %rdx
movq %r13, %rcx
movl $0x1, %r9d
pushq 0x10(%rsp)
pushq 0x40(%rsp)
pushq 0x18(%rsp)
pushq %r14
callq 0x2290
addq $0x20, %rsp
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
jne 0x6b96
movl 0x20(%rsp), %ecx
movl 0x28(%rsp), %eax
cmpl $0x0, 0x44(%rsp)
je 0x6afb
movq 0x18(%rsp), %rdx
movq %rdx, %r13
movq 0x10(%rsp), %r10
movq %r12, %rbx
movq 0x8(%rsp), %r11
leaq 0x20(%rsp), %r12
jmp 0x6b24
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movl $0x1, %r9d
pushq %r10
pushq 0x40(%rsp)
pushq %r11
pushq 0x60(%rsp)
callq 0x2290
addq $0x20, %rsp
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
jne 0x6ba3
movslq 0x28(%rsp), %rax
cmpl $-0x1, %eax
je 0x6ada
addq %rbx, %rax
movq %rax, %r13
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r11
leaq 0x20(%rsp), %r12
jmp 0x6b35
movl 0x28(%rsp), %eax
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r11
jmp 0x6b1f
cmpl $-0x1, %eax
movq 0x10(%rsp), %r10
movq %r12, %rbx
movq 0x8(%rsp), %r11
leaq 0x20(%rsp), %r12
je 0x6b1a
movslq %eax, %r13
addq %rbx, %r13
jmp 0x6b1f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rdx
testl %ecx, %ecx
cmovneq %rdx, %r13
cmpl $-0x1, %eax
je 0x6b35
movslq %eax, %r13
addq %rbx, %r13
movq 0x50(%rsp), %rax
addq %r13, %rax
incq %r13
movq %r13, %rdx
movq %rdx, %r13
movq %rax, %r14
cmpq %r15, %rax
jg 0x6b6d
movzbl (%r13), %ecx
testq %rcx, %rcx
je 0x6b6d
movq 0x418(%rbp), %rsi
leaq 0x1(%r13), %rdx
leaq 0x1(%r14), %rax
cmpl $0x0, (%rsi,%rcx,4)
je 0x6b43
cmpq %r15, %r14
jle 0x69c4
xorl %ecx, %ecx
xorl %eax, %eax
movl 0x4(%rsp), %edx
shlq $0x20, %rcx
movl %edx, %edx
orq %rcx, %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq %r12, %rcx
incq %rcx
movl $0x1, %eax
jmp 0x6b7a
subq %rbx, %rcx
incq %rcx
movl $0x1, %eax
movl %r14d, %edx
jmp 0x6b7e