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

  result.assertion_match = false;
  c = graph->c;
  if ( graph->min_length > 0 )
    pch = memchr( input + graph->min_length - 1, c, length - graph->min_length + 1 );
  else
    pch = input;

  while ( pch != NULL && pch - input <= length && *pch != '\0' )
  {
    result = dre2_matcher( graph, input, pch, graph->starting_point, DRE2_LEFT, length, r_temp, reachable, state );
    if ( result.match != NULL )
    {
      ret_val.can_continue = graph->has_loop;
      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 = memchr( pch + graph->skip_table[*pch], c, length - ( pch - input ) );
  }
  ret_val.matched = false;
  return ret_val;
}

// Assembly:
pushq %rbx
subq $0xb0, %rsp
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movl %edx, 0x8c(%rsp)
movq %rcx, 0x80(%rsp)
movq %r8, 0x78(%rsp)
movq %r9, 0x70(%rsp)
movl $0x0, 0x48(%rsp)
movq 0x98(%rsp), %rax
movb 0x428(%rax), %al
movb %al, 0x6b(%rsp)
movq 0x98(%rsp), %rax
cmpl $0x0, 0x40c(%rax)
jle 0xa0a6
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rax
movslq 0x40c(%rax), %rax
addq %rax, %rdi
addq $-0x1, %rdi
movzbl 0x6b(%rsp), %esi
movl 0x8c(%rsp), %eax
movq 0x98(%rsp), %rcx
subl 0x40c(%rcx), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x21b0
movq %rax, 0x60(%rsp)
jmp 0xa0b3
movq 0x90(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0xa0b5
xorl %eax, %eax
cmpq $0x0, 0x60(%rsp)
movb %al, 0x2f(%rsp)
je 0xa0f8
movq 0x60(%rsp), %rcx
movq 0x90(%rsp), %rax
subq %rax, %rcx
movslq 0x8c(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x2f(%rsp)
jg 0xa0f8
movq 0x60(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x2f(%rsp)
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0xa105
jmp 0xa246
movq 0x98(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x98(%rsp), %rax
movl 0x410(%rax), %r8d
movl 0x8c(%rsp), %ebx
movq 0x80(%rsp), %r11
movq 0x78(%rsp), %r10
movq 0x70(%rsp), %rax
leaq 0x30(%rsp), %rdi
xorl %r9d, %r9d
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x2270
movq 0x30(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0xa1db
movq 0x98(%rsp), %rax
movl 0x868(%rax), %eax
movl %eax, 0xa4(%rsp)
movl $0x1, 0xa0(%rsp)
movq 0x58(%rsp), %rax
movq 0x90(%rsp), %rcx
subq %rcx, %rax
movl %eax, 0xa8(%rsp)
movq 0x60(%rsp), %rax
movq 0x90(%rsp), %rcx
subq %rcx, %rax
addq $0x1, %rax
movl %eax, 0xac(%rsp)
jmp 0xa251
cmpl $0x0, 0x48(%rsp)
je 0xa1fa
movq 0x90(%rsp), %rax
movslq 0x8c(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
movq 0x98(%rsp), %rax
movq 0x60(%rsp), %rcx
movzbl (%rcx), %ecx
movslq 0xc(%rax,%rcx,4), %rax
addq %rax, %rdi
movzbl 0x6b(%rsp), %esi
movslq 0x8c(%rsp), %rdx
movq 0x60(%rsp), %rax
movq 0x90(%rsp), %rcx
subq %rcx, %rax
subq %rax, %rdx
callq 0x21b0
movq %rax, 0x60(%rsp)
jmp 0xa0b5
movl $0x0, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq 0xa8(%rsp), %rdx
addq $0xb0, %rsp
popq %rbx
retq
nopw (%rax,%rax)