// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/string_matching.c
// Function: gt_string_matching_unit_test
int gt_string_matching_unit_test(GtError *err)
{
  char s[STRING_MATCHING_MAX_STRING_LENGTH+1],
       p[STRING_MATCHING_MAX_PATTERN_LENGTH+1], *text = "foo";
  GtArray *brute_force_matches,
        *bmh_matches,
        *kmp_matches,
        *shift_and_matches;
  GtUword i, brute_force_match, bmh_match, kmp_match, shift_and_match;
  int had_err = 0;

  gt_error_check(err);

  brute_force_matches = gt_array_new(sizeof (GtUword));
  bmh_matches = gt_array_new(sizeof (GtUword));
  kmp_matches = gt_array_new(sizeof (GtUword));
  shift_and_matches = gt_array_new(sizeof (GtUword));

  /* match the empty pattern */
  gt_string_matching_brute_force(text, strlen(text), "", 0, store_match,
                              brute_force_matches);
  gt_string_matching_bmh(text, strlen(text), "", 0, store_match, bmh_matches);
  gt_string_matching_kmp(text, strlen(text), "", 0, store_match, kmp_matches);
  gt_string_matching_shift_and(text, strlen(text), "", 0, store_match,
                            shift_and_matches);

  gt_ensure(!gt_array_size(brute_force_matches));
  gt_ensure(!gt_array_size(bmh_matches));
  gt_ensure(!gt_array_size(kmp_matches));
  gt_ensure(!gt_array_size(shift_and_matches));

  for (i = 0; !had_err && i < STRING_MATCHING_NUM_OF_TESTS; i++) {
    GtUword j, n, m;
    /* generate random string and pattern */
    n = gt_rand_max(STRING_MATCHING_MAX_STRING_LENGTH);
    m = gt_rand_max(STRING_MATCHING_MAX_PATTERN_LENGTH);
    for (j = 0; j < n; j++)
      s[j] = gt_rand_char();
    s[n] = '\0';
    for (j = 0; j < m; j++)
      p[j] = gt_rand_char();
    p[m] = '\0';
    /* matching (first match) */
    brute_force_match = GT_UNDEF_UWORD;
    bmh_match = GT_UNDEF_UWORD;
    kmp_match = GT_UNDEF_UWORD;
    shift_and_match = GT_UNDEF_UWORD;
    gt_string_matching_brute_force(s, n, p, m, store_first_match,
                                &brute_force_match);
    gt_string_matching_bmh(s, n, p, m, store_first_match, &bmh_match);
    gt_string_matching_kmp(s, n, p, m, store_first_match, &kmp_match);
    gt_string_matching_shift_and(s, n, p, m, store_first_match,
                                 &shift_and_match);
    /* comparing (first match) */
    gt_ensure(brute_force_match == bmh_match);
    gt_ensure(brute_force_match == kmp_match);
    gt_ensure(brute_force_match == shift_and_match);
    /* matching (all matches) */
    gt_string_matching_brute_force(s, n, p, m, store_match,
                                   brute_force_matches);
    gt_string_matching_bmh(s, n, p, m, store_match, bmh_matches);
    gt_string_matching_kmp(s, n, p, m, store_match, kmp_matches);
    gt_string_matching_shift_and(s, n, p, m, store_match, shift_and_matches);
    /* comparing (all matches) */
    gt_ensure(gt_array_size(brute_force_matches) ==
                    gt_array_size(bmh_matches));
    gt_ensure(gt_array_size(brute_force_matches) ==
                    gt_array_size(kmp_matches));
    gt_ensure(gt_array_size(brute_force_matches) ==
                    gt_array_size(shift_and_matches));
    gt_ensure(!gt_array_cmp(brute_force_matches, bmh_matches));
    gt_ensure(!gt_array_cmp(brute_force_matches, kmp_matches));
    gt_ensure(!gt_array_cmp(brute_force_matches, shift_and_matches));
    /* reset */
    gt_array_reset(brute_force_matches);
    gt_array_reset(bmh_matches);
    gt_array_reset(kmp_matches);
    gt_array_reset(shift_and_matches);
  }

  gt_array_delete(shift_and_matches);
  gt_array_delete(bmh_matches);
  gt_array_delete(kmp_matches);
  gt_array_delete(brute_force_matches);

  return had_err;
}

// Assembly:
subq $0x187b8, %rsp          # imm = 0x187B8
movq %rdi, 0x187b0(%rsp)
leaq 0x353a37(%rip), %rax    # 0x53de9d
movq %rax, 0xa8(%rsp)
movl $0x0, 0x5c(%rsp)
cmpq $0x0, 0x187b0(%rsp)
je 0x1ea4cc
movq 0x187b0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1ea494
jmp 0x1ea4cc
movq 0x451b05(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x32bb6e(%rip), %rsi    # 0x516013
leaq 0x32bd13(%rip), %rdx    # 0x5161bf
leaq 0x37dd1a(%rip), %rcx    # 0x5681cd
leaq 0x37dca1(%rip), %r8     # 0x56815b
movl $0xcd, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ea4ce
movl $0x8, %edi
callq 0x80990
movq %rax, 0xa0(%rsp)
movl $0x8, %edi
callq 0x80990
movq %rax, 0x98(%rsp)
movl $0x8, %edi
callq 0x80990
movq %rax, 0x90(%rsp)
movl $0x8, %edi
callq 0x80990
movq %rax, 0x88(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x192b0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movq 0xa0(%rsp), %r9
leaq 0x3b30e1(%rip), %rdx    # 0x59d628
xorl %eax, %eax
movl %eax, %ecx
leaq 0x88e(%rip), %r8        # 0x1eade0
callq 0x1ea2f0
movq 0xa8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x192b0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
movq 0x98(%rsp), %r9
leaq 0x3b30a0(%rip), %rdx    # 0x59d628
xorl %eax, %eax
movl %eax, %ecx
leaq 0x84d(%rip), %r8        # 0x1eade0
callq 0x1e9a30
movq 0xa8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x192b0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
movq 0x90(%rsp), %r9
leaq 0x3b305f(%rip), %rdx    # 0x59d628
xorl %eax, %eax
movl %eax, %ecx
leaq 0x80c(%rip), %r8        # 0x1eade0
callq 0x1e9cd0
movq 0xa8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x192b0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0x88(%rsp), %r9
leaq 0x3b301e(%rip), %rdx    # 0x59d628
xorl %eax, %eax
movl %eax, %ecx
leaq 0x7cb(%rip), %r8        # 0x1eade0
callq 0x1ea050
cmpl $0x0, 0x5c(%rsp)
jne 0x1ea66f
movq 0xa0(%rsp), %rdi
callq 0x81370
cmpq $0x0, %rax
je 0x1ea66d
movq 0x187b0(%rsp), %rdi
leaq 0x344fb7(%rip), %rsi    # 0x52f5fa
leaq 0x37dba0(%rip), %rdx    # 0x5681ea
leaq 0x37db7c(%rip), %rcx    # 0x5681cd
leaq 0x37db03(%rip), %r8     # 0x56815b
movl $0xdc, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ea66f
jmp 0x1ea671
jmp 0x1ea673
cmpl $0x0, 0x5c(%rsp)
jne 0x1ea6c8
movq 0x98(%rsp), %rdi
callq 0x81370
cmpq $0x0, %rax
je 0x1ea6c6
movq 0x187b0(%rsp), %rdi
leaq 0x344f5e(%rip), %rsi    # 0x52f5fa
leaq 0x37db6b(%rip), %rdx    # 0x56820e
leaq 0x37db23(%rip), %rcx    # 0x5681cd
leaq 0x37daaa(%rip), %r8     # 0x56815b
movl $0xdd, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ea6c8
jmp 0x1ea6ca
jmp 0x1ea6cc
cmpl $0x0, 0x5c(%rsp)
jne 0x1ea721
movq 0x90(%rsp), %rdi
callq 0x81370
cmpq $0x0, %rax
je 0x1ea71f
movq 0x187b0(%rsp), %rdi
leaq 0x344f05(%rip), %rsi    # 0x52f5fa
leaq 0x37db2e(%rip), %rdx    # 0x56822a
leaq 0x37daca(%rip), %rcx    # 0x5681cd
leaq 0x37da51(%rip), %r8     # 0x56815b
movl $0xde, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ea721
jmp 0x1ea723
jmp 0x1ea725
cmpl $0x0, 0x5c(%rsp)
jne 0x1ea77a
movq 0x88(%rsp), %rdi
callq 0x81370
cmpq $0x0, %rax
je 0x1ea778
movq 0x187b0(%rsp), %rdi
leaq 0x344eac(%rip), %rsi    # 0x52f5fa
leaq 0x37daf1(%rip), %rdx    # 0x568246
leaq 0x37da71(%rip), %rcx    # 0x5681cd
leaq 0x37d9f8(%rip), %r8     # 0x56815b
movl $0xdf, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ea77a
jmp 0x1ea77c
movq $0x0, 0x80(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x5c(%rsp)
movb %al, 0x1f(%rsp)
jne 0x1ea7a8
cmpq $0x100, 0x80(%rsp) # imm = 0x100
setb %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x1ea7b5
jmp 0x1ead98
movl $0x186a0, %edi          # imm = 0x186A0
callq 0xec350
movq %rax, 0x48(%rsp)
movl $0x42, %edi
callq 0xec350
movq %rax, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0x1ea80b
callq 0xec5f0
movb %al, %cl
movq 0x50(%rsp), %rax
movb %cl, 0x100(%rsp,%rax)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x1ea7dc
movq 0x48(%rsp), %rax
movb $0x0, 0x100(%rsp,%rax)
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x40(%rsp), %rax
jae 0x1ea850
callq 0xec5f0
movb %al, %cl
movq 0x50(%rsp), %rax
movb %cl, 0xb0(%rsp,%rax)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x1ea821
movq 0x40(%rsp), %rax
movb $0x0, 0xb0(%rsp,%rax)
movq $-0x1, 0x78(%rsp)
movq $-0x1, 0x70(%rsp)
movq $-0x1, 0x68(%rsp)
movq $-0x1, 0x60(%rsp)
leaq 0x100(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq 0x40(%rsp), %rcx
leaq 0x5be(%rip), %r8        # 0x1eae60
leaq 0x78(%rsp), %r9
callq 0x1ea2f0
leaq 0x100(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq 0x40(%rsp), %rcx
leaq 0x593(%rip), %r8        # 0x1eae60
leaq 0x70(%rsp), %r9
callq 0x1e9a30
leaq 0x100(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq 0x40(%rsp), %rcx
leaq 0x568(%rip), %r8        # 0x1eae60
leaq 0x68(%rsp), %r9
callq 0x1e9cd0
leaq 0x100(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq 0x40(%rsp), %rcx
leaq 0x53d(%rip), %r8        # 0x1eae60
leaq 0x60(%rsp), %r9
callq 0x1ea050
cmpl $0x0, 0x5c(%rsp)
jne 0x1ea97b
movq 0x78(%rsp), %rax
cmpq 0x70(%rsp), %rax
je 0x1ea979
movq 0x187b0(%rsp), %rdi
leaq 0x344cab(%rip), %rsi    # 0x52f5fa
leaq 0x37d912(%rip), %rdx    # 0x568268
leaq 0x37d870(%rip), %rcx    # 0x5681cd
leaq 0x37d7f7(%rip), %r8     # 0x56815b
movl $0xf8, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ea97b
jmp 0x1ea97d
jmp 0x1ea97f
cmpl $0x0, 0x5c(%rsp)
jne 0x1ea9cd
movq 0x78(%rsp), %rax
cmpq 0x68(%rsp), %rax
je 0x1ea9cb
movq 0x187b0(%rsp), %rdi
leaq 0x344c59(%rip), %rsi    # 0x52f5fa
leaq 0x37d8df(%rip), %rdx    # 0x568287
leaq 0x37d81e(%rip), %rcx    # 0x5681cd
leaq 0x37d7a5(%rip), %r8     # 0x56815b
movl $0xf9, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ea9cd
jmp 0x1ea9cf
jmp 0x1ea9d1
cmpl $0x0, 0x5c(%rsp)
jne 0x1eaa1f
movq 0x78(%rsp), %rax
cmpq 0x60(%rsp), %rax
je 0x1eaa1d
movq 0x187b0(%rsp), %rdi
leaq 0x344c07(%rip), %rsi    # 0x52f5fa
leaq 0x37d8ac(%rip), %rdx    # 0x5682a6
leaq 0x37d7cc(%rip), %rcx    # 0x5681cd
leaq 0x37d753(%rip), %r8     # 0x56815b
movl $0xfa, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eaa1f
jmp 0x1eaa21
leaq 0x100(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0xa0(%rsp), %r9
leaq 0x396(%rip), %r8        # 0x1eade0
callq 0x1ea2f0
leaq 0x100(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x98(%rsp), %r9
leaq 0x368(%rip), %r8        # 0x1eade0
callq 0x1e9a30
leaq 0x100(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x90(%rsp), %r9
leaq 0x33a(%rip), %r8        # 0x1eade0
callq 0x1e9cd0
leaq 0x100(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x88(%rsp), %r9
leaq 0x30c(%rip), %r8        # 0x1eade0
callq 0x1ea050
cmpl $0x0, 0x5c(%rsp)
jne 0x1eab47
movq 0xa0(%rsp), %rdi
callq 0x81370
movq %rax, 0x10(%rsp)
movq 0x98(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
je 0x1eab45
movq 0x187b0(%rsp), %rdi
leaq 0x344adf(%rip), %rsi    # 0x52f5fa
leaq 0x37d7a9(%rip), %rdx    # 0x5682cb
leaq 0x37d6a4(%rip), %rcx    # 0x5681cd
leaq 0x37d62b(%rip), %r8     # 0x56815b
movl $0x103, %r9d            # imm = 0x103
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eab47
jmp 0x1eab49
jmp 0x1eab4b
cmpl $0x0, 0x5c(%rsp)
jne 0x1eabb9
movq 0xa0(%rsp), %rdi
callq 0x81370
movq %rax, 0x8(%rsp)
movq 0x90(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
je 0x1eabb7
movq 0x187b0(%rsp), %rdi
leaq 0x344a6d(%rip), %rsi    # 0x52f5fa
leaq 0x37d778(%rip), %rdx    # 0x56830c
leaq 0x37d632(%rip), %rcx    # 0x5681cd
leaq 0x37d5b9(%rip), %r8     # 0x56815b
movl $0x105, %r9d            # imm = 0x105
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eabb9
jmp 0x1eabbb
jmp 0x1eabbd
cmpl $0x0, 0x5c(%rsp)
jne 0x1eac29
movq 0xa0(%rsp), %rdi
callq 0x81370
movq %rax, (%rsp)
movq 0x88(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
je 0x1eac27
movq 0x187b0(%rsp), %rdi
leaq 0x3449fd(%rip), %rsi    # 0x52f5fa
leaq 0x37d749(%rip), %rdx    # 0x56834d
leaq 0x37d5c2(%rip), %rcx    # 0x5681cd
leaq 0x37d549(%rip), %r8     # 0x56815b
movl $0x107, %r9d            # imm = 0x107
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eac29
jmp 0x1eac2b
jmp 0x1eac2d
cmpl $0x0, 0x5c(%rsp)
jne 0x1eac89
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x81740
cmpl $0x0, %eax
je 0x1eac87
movq 0x187b0(%rsp), %rdi
leaq 0x34499d(%rip), %rsi    # 0x52f5fa
leaq 0x37d730(%rip), %rdx    # 0x568394
leaq 0x37d562(%rip), %rcx    # 0x5681cd
leaq 0x37d4e9(%rip), %r8     # 0x56815b
movl $0x108, %r9d            # imm = 0x108
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eac89
jmp 0x1eac8b
jmp 0x1eac8d
cmpl $0x0, 0x5c(%rsp)
jne 0x1eace9
movq 0xa0(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x81740
cmpl $0x0, %eax
je 0x1eace7
movq 0x187b0(%rsp), %rdi
leaq 0x34493d(%rip), %rsi    # 0x52f5fa
leaq 0x37d700(%rip), %rdx    # 0x5683c4
leaq 0x37d502(%rip), %rcx    # 0x5681cd
leaq 0x37d489(%rip), %r8     # 0x56815b
movl $0x109, %r9d            # imm = 0x109
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eace9
jmp 0x1eaceb
jmp 0x1eaced
cmpl $0x0, 0x5c(%rsp)
jne 0x1ead49
movq 0xa0(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x81740
cmpl $0x0, %eax
je 0x1ead47
movq 0x187b0(%rsp), %rdi
leaq 0x3448dd(%rip), %rsi    # 0x52f5fa
leaq 0x37d6d0(%rip), %rdx    # 0x5683f4
leaq 0x37d4a2(%rip), %rcx    # 0x5681cd
leaq 0x37d429(%rip), %r8     # 0x56815b
movl $0x10a, %r9d            # imm = 0x10A
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x5c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1ead49
jmp 0x1ead4b
movq 0xa0(%rsp), %rdi
callq 0x814a0
movq 0x98(%rsp), %rdi
callq 0x814a0
movq 0x90(%rsp), %rdi
callq 0x814a0
movq 0x88(%rsp), %rdi
callq 0x814a0
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x1ea788
movq 0x88(%rsp), %rdi
callq 0x81f80
movq 0x98(%rsp), %rdi
callq 0x81f80
movq 0x90(%rsp), %rdi
callq 0x81f80
movq 0xa0(%rsp), %rdi
callq 0x81f80
movl 0x5c(%rsp), %eax
addq $0x187b8, %rsp          # imm = 0x187B8
retq
nopl (%rax,%rax)