// File: /workspace/github_c_makefile_star2_O0/jondurbin[P]dre2/src/dre2_match.c
// Function: dre2_sn_mc_horspool
struct dre2_match_value dre2_sn_mc_horspool( 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;

  result.assertion_match = false;
  if ( graph->min_length > 0 )
    pch = input + graph->min_length - 1;
  else
    pch = input;
  while ( pch - input <= length && *pch != '\0' && !graph->starting_chars[*pch] )
    *pch++;
  while ( pch - input <= length && *pch != '\0' )
  {
    result = dre2_matcher( graph, input, pch, graph->count - 1, DRE2_LEFT, length, r_temp, reachable, state );
    if ( result.match != NULL )
    {
      ret_val.matched = true;
      ret_val.start_pos = result.match - input;
      ret_val.end_pos = pch - input + 1;
      return ret_val;
    }
    if ( result.assertion_match )
      pch = input + length;

    pch = pch + graph->skip_table[*pch];
    while ( pch - input <= length && *pch != '\0' && !graph->starting_chars[*pch] )
      *pch++;
  }
  ret_val.matched = false;
  return ret_val;
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movl %edx, 0x7c(%rsp)
movq %rcx, 0x70(%rsp)
movq %r8, 0x68(%rsp)
movq %r9, 0x60(%rsp)
movl $0x0, 0x40(%rsp)
movq 0x88(%rsp), %rax
cmpl $0x0, 0x40c(%rax)
jle 0xa709
movq 0x80(%rsp), %rax
movq 0x88(%rsp), %rcx
movslq 0x40c(%rcx), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0xa716
movq 0x80(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0xa718
movq 0x58(%rsp), %rcx
movq 0x80(%rsp), %rax
subq %rax, %rcx
movslq 0x7c(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x27(%rsp)
jg 0xa76f
movq 0x58(%rsp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x27(%rsp)
je 0xa76f
movq 0x88(%rsp), %rax
movq 0x418(%rax), %rax
movq 0x58(%rsp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, (%rax,%rcx,4)
setne %al
xorb $-0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0xa779
jmp 0xa789
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0xa718
jmp 0xa78b
movq 0x58(%rsp), %rcx
movq 0x80(%rsp), %rax
subq %rax, %rcx
movslq 0x7c(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x26(%rsp)
jg 0xa7bd
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x26(%rsp)
movb 0x26(%rsp), %al
testb $0x1, %al
jne 0xa7ca
jmp 0xa93d
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0x88(%rsp), %rax
movl 0x8(%rax), %r8d
subl $0x1, %r8d
movl 0x7c(%rsp), %ebx
movq 0x70(%rsp), %r11
movq 0x68(%rsp), %r10
movq 0x60(%rsp), %rax
leaq 0x28(%rsp), %rdi
xorl %r9d, %r9d
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x2270
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
je 0xa889
movl $0x1, 0x90(%rsp)
movq 0x50(%rsp), %rax
movq 0x80(%rsp), %rcx
subq %rcx, %rax
movl %eax, 0x98(%rsp)
movq 0x58(%rsp), %rax
movq 0x80(%rsp), %rcx
subq %rcx, %rax
addq $0x1, %rax
movl %eax, 0x9c(%rsp)
jmp 0xa948
cmpl $0x0, 0x40(%rsp)
je 0xa8a5
movq 0x80(%rsp), %rax
movslq 0x7c(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x88(%rsp), %rcx
movq 0x58(%rsp), %rdx
movzbl (%rdx), %edx
movslq 0xc(%rcx,%rdx,4), %rcx
addq %rcx, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rcx
movq 0x80(%rsp), %rax
subq %rax, %rcx
movslq 0x7c(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x25(%rsp)
jg 0xa91e
movq 0x58(%rsp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x25(%rsp)
je 0xa91e
movq 0x88(%rsp), %rax
movq 0x418(%rax), %rax
movq 0x58(%rsp), %rcx
movzbl (%rcx), %ecx
cmpl $0x0, (%rax,%rcx,4)
setne %al
xorb $-0x1, %al
movb %al, 0x25(%rsp)
movb 0x25(%rsp), %al
testb $0x1, %al
jne 0xa928
jmp 0xa938
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0xa8c7
jmp 0xa78b
movl $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
addq $0xa0, %rsp
popq %rbx
retq
nopw %cs:(%rax,%rax)