// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-errfind.c
// Function: gt_errfind
int gt_errfind(Sequentialsuffixarrayreader *ssar, const GtEncseq *encseq,
    GtUword k, GtUword c, GtUword debug_value,
    bool edit_twobitencoding, const char *indexname, GtError *err)
{
  GtBUstate_errfind *state;
  int had_err = 0;

  state = gt_malloc(sizeof (*state));
  state->alphasize = gt_alphabet_num_of_chars(gt_encseq_alphabet(encseq));
  state->kpositions = gt_malloc(sizeof (GtUword) * state->alphasize * c);
  state->count = gt_malloc(sizeof (GtUword) * state->alphasize);
  state->encseq = encseq;
  state->totallength = gt_encseq_total_length(encseq);
  state->firstmirrorpos = state->totallength;
  if (gt_encseq_is_mirrored(encseq))
    state->firstmirrorpos >>= 1;

  state->editor = NULL;
  if (edit_twobitencoding)
  {
    state->editor = gt_twobitenc_editor_new(encseq, indexname, err);
    if (state->editor == NULL)
      had_err = -1;
  }
  if (had_err == 0)
  {
    state->k = k;
    state->c = c;
    state->debug_value = debug_value;
    state->quiet = (state->debug_value == GT_UNDEF_UWORD ? false : true);
    gt_errfind_reset(state);
    had_err = gt_esa_bottomup_errfind(ssar, state, err);
  }

  if (state->editor != NULL)
  {
    gt_twobitenc_editor_delete(state->editor);
  }

  gt_free(state->kpositions);
  gt_free(state->count);
  gt_free(state);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0x18(%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, 0x28(%rsp)
leaq 0x1d52d7(%rip), %r13    # 0x34e3d7
pushq $0x78
popq %rdi
movq %r13, %rsi
movl $0x105, %edx            # imm = 0x105
callq 0x93160
movq %rax, %rbx
movq %rbp, %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x56c8e
movl %eax, 0x18(%rbx)
movl %eax, %edi
imulq %r15, %rdi
shlq $0x3, %rdi
movq %r13, %rsi
movl $0x107, %edx            # imm = 0x107
callq 0x93160
movq %rax, 0x30(%rbx)
movl 0x18(%rbx), %edi
shlq $0x3, %rdi
movq %r13, %rsi
movl $0x108, %edx            # imm = 0x108
callq 0x93160
movq %rax, 0x38(%rbx)
movq %rbp, 0x10(%rbx)
movq %rbp, %rdi
callq 0x7055e
movq %rax, 0x60(%rbx)
movq %rax, 0x58(%rbx)
movq %rbp, %rdi
callq 0x81dea
testb %al, %al
je 0x17917d
shrq 0x58(%rbx)
movq 0x78(%rsp), %rdx
andq $0x0, 0x68(%rbx)
cmpb $0x0, 0x18(%rsp)
je 0x1791a8
movq 0x70(%rsp), %rsi
movq %rbp, %rdi
callq 0x188510
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x1796e7
movq %r12, 0x20(%rbx)
movq %r15, 0x28(%rbx)
movq %r14, 0x48(%rbx)
cmpq $-0x1, %r14
setne 0x50(%rbx)
movq %rbx, %rdi
callq 0x179b31
callq 0x179084
movq %rax, %r14
movq 0x10(%rax), %rsi
cmpq 0x8(%rax), %rsi
jae 0x1791db
movq (%r14), %rax
jmp 0x1791f5
jne 0x179b00
movq (%r14), %rdi
leaq 0x20(%rsi), %rdx
callq 0x179b52
movq %rax, (%r14)
addq $0x20, 0x8(%r14)
testq %rax, %rax
movq 0x28(%rsp), %rdi
je 0x179a67
movq 0x10(%r14), %rcx
imulq $0x18, %rcx, %rdx
incq %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%rdx)
movq %rcx, 0x10(%r14)
orq $-0x1, 0x10(%rax,%rdx)
callq 0x151d3d
movq %rax, 0x30(%rsp)
movb $0x1, %al
movl %eax, 0x14(%rsp)
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %ebp, %ebp
testb $0x1, %r13b
jne 0x179892
cmpq 0x30(%rsp), %rbp
jae 0x179892
movq 0x28(%rsp), %rdi
cmpb $0x1, 0x40(%rdi)
movq %r13, 0x18(%rsp)
jne 0x179374
movq (%rdi), %r13
movl 0xd4(%r13), %eax
cmpl 0xd0(%r13), %eax
jb 0x1792cd
movq 0xd8(%r13), %rdi
movq 0xe0(%r13), %rcx
movl $0x1000, %edx           # imm = 0x1000
pushq $0x1
popq %rsi
callq 0x17ad0
movq %rax, %r15
movl %r15d, 0xd0(%r13)
movq 0xe0(%r13), %rdi
callq 0x17e70
testl %eax, %eax
jne 0x1799ad
andl $0x0, 0xd4(%r13)
xorl %eax, %eax
testl %r15d, %r15d
movq 0x28(%rsp), %rdi
je 0x1796ef
movq 0xd8(%r13), %rcx
leal 0x1(%rax), %edx
movl %edx, 0xd4(%r13)
movl %eax, %eax
movzbl (%rcx,%rax), %r15d
cmpq $0xff, %r15
jne 0x1793c6
movq (%rdi), %r13
movl 0xec(%r13), %eax
cmpl 0xe8(%r13), %eax
jb 0x179356
movq 0xf0(%r13), %rdi
movq 0xf8(%r13), %rcx
movl $0x1000, %edx           # imm = 0x1000
pushq $0x10
popq %rsi
callq 0x17ad0
movq %rax, %r15
movl %r15d, 0xe8(%r13)
movq 0xf8(%r13), %rdi
callq 0x17e70
testl %eax, %eax
jne 0x1799f5
andl $0x0, 0xec(%r13)
xorl %eax, %eax
testl %r15d, %r15d
movq 0x28(%rsp), %rdi
je 0x1797ef
movq 0xf0(%r13), %rcx
leal 0x1(%rax), %edx
movl %edx, 0xec(%r13)
movl %eax, %eax
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %r15
jmp 0x1793c6
movq (%rdi), %rcx
movq 0x20(%rdi), %rax
cmpq 0x10(%rdi), %rax
jae 0x1796ce
movq 0x60(%rcx), %rdx
leaq 0x1(%rax), %rsi
movq %rsi, 0x20(%rdi)
movzbl (%rdx,%rax), %r15d
cmpq $0xff, %r15
jne 0x1793c6
movq 0x68(%rcx), %rcx
movq 0x28(%rdi), %rdx
movq %rdx, %rsi
shlq $0x4, %rsi
cmpq %rax, (%rcx,%rsi)
jne 0x1799c7
addq %rsi, %rcx
incq %rdx
movq %rdx, 0x28(%rdi)
movq 0x8(%rcx), %r15
movq (%rdi), %r13
cmpb $0x1, 0x40(%rdi)
jne 0x179458
movq 0xb0(%r13), %rcx
testq %rcx, %rcx
je 0x179471
movl 0xa4(%r13), %eax
cmpl 0xa0(%r13), %eax
jb 0x1794fb
movq 0xa8(%r13), %rdi
movl $0x1000, %edx           # imm = 0x1000
pushq $0x8
popq %rsi
callq 0x17ad0
movq %rax, 0x20(%rsp)
movl %eax, 0xa0(%r13)
movq 0xb0(%r13), %rdi
callq 0x17e70
testl %eax, %eax
je 0x1794e6
movq 0x78(%rsp), %rdi
leaq 0x180792(%rip), %rsi    # 0x2f9bc9
leaq 0x2098ed(%rip), %rdx    # 0x382d2b
xorl %eax, %eax
callq 0x89dbb
movl 0xa4(%r13), %eax
movb $0x1, %cl
movq %rcx, 0x18(%rsp)
jmp 0x1794fb
movq 0x58(%r13), %rax
movq 0x18(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x18(%rdi)
movq (%rax,%rcx,8), %rsi
jmp 0x17953f
movl 0x8c(%r13), %eax
cmpl 0x88(%r13), %eax
jb 0x179529
movq 0x90(%r13), %rdi
movq 0x98(%r13), %rcx
movl $0x1000, %edx           # imm = 0x1000
pushq $0x4
popq %rsi
callq 0x17ad0
movq %rax, 0x20(%rsp)
movl %eax, 0x88(%r13)
movq 0x98(%r13), %rdi
callq 0x17e70
testl %eax, %eax
je 0x179514
movq 0x78(%rsp), %rdi
leaq 0x180701(%rip), %rsi    # 0x2f9bc9
leaq 0x180b04(%rip), %rdx    # 0x2f9fd3
xorl %eax, %eax
callq 0x89dbb
movl 0x8c(%r13), %eax
movb $0x1, %cl
movq %rcx, 0x18(%rsp)
jmp 0x179529
andl $0x0, 0xa4(%r13)
xorl %eax, %eax
cmpl $0x0, 0x20(%rsp)
je 0x179873
movq 0xa8(%r13), %rcx
leal 0x1(%rax), %edx
movl %edx, 0xa4(%r13)
movl %eax, %eax
movq (%rcx,%rax,8), %rsi
jmp 0x17953f
andl $0x0, 0x8c(%r13)
xorl %eax, %eax
cmpl $0x0, 0x20(%rsp)
je 0x179873
movq 0x90(%r13), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8c(%r13)
movl %eax, %eax
movl (%rcx,%rax,4), %esi
movq 0x10(%r14), %rax
testq %rax, %rax
movq 0x18(%rsp), %r13
je 0x179975
movq (%r14), %rcx
imulq $0x18, %rax, %rax
movq -0x18(%rcx,%rax), %rdi
cmpq %rdi, %r15
movq %rsi, 0x20(%rsp)
ja 0x17958a
movzbl 0x14(%rsp), %eax
testb $0x1, %al
movl %eax, %edx
movl $0x0, %ecx
cmovnel %ecx, %edx
testq %rdi, %rdi
cmovnel %eax, %edx
movl %edx, 0x14(%rsp)
movq %rbx, %rdx
callq 0x179be7
testq %r12, %r12
jne 0x179947
testb $0x1, %r13b
jne 0x1796c3
xorl %r12d, %r12d
movq (%r14), %rax
movq 0x10(%r14), %rsi
imulq $0x18, %rsi, %rcx
movq -0x18(%rax,%rcx), %rdi
cmpq %rdi, %r15
jae 0x179608
decq %rsi
movq %rsi, 0x10(%r14)
imulq $0x18, %rsi, %rcx
leaq (%rax,%rcx), %r12
movq %rbp, 0x10(%rax,%rcx)
movq %rbx, %rsi
callq 0x179cfa
movq (%r14), %rax
imulq $0x18, 0x10(%r14), %rcx
movq -0x18(%rax,%rcx), %rdi
cmpq %rdi, %r15
ja 0x1795a0
movzbl 0x14(%rsp), %eax
testb $0x1, %al
movl %eax, %edx
movl $0x0, %ecx
cmovnel %ecx, %edx
testq %rdi, %rdi
cmovnel %eax, %edx
movl %edx, 0x14(%rsp)
movq %rbx, %rsi
callq 0x179e2e
jmp 0x17959d
jbe 0x1796c6
testq %r12, %r12
je 0x17966c
movq 0x8(%r12), %r12
cmpq 0x8(%r14), %rsi
jb 0x179645
jne 0x179a1c
leaq 0x20(%rsi), %rdx
movq %rax, %rdi
callq 0x179b52
movq %rax, (%r14)
addq $0x20, 0x8(%r14)
testq %rax, %rax
je 0x179a36
movq 0x10(%r14), %rsi
imulq $0x18, %rsi, %rcx
movq %r15, (%rax,%rcx)
movq %r12, 0x8(%rax,%rcx)
incq %rsi
movq %rsi, 0x10(%r14)
orq $-0x1, 0x10(%rax,%rcx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x179e2e
jmp 0x1796c3
cmpq 0x8(%r14), %rsi
jb 0x179699
jne 0x179ab5
leaq 0x20(%rsi), %rdx
movq %rax, %rdi
callq 0x179b52
movq %rax, (%r14)
addq $0x20, 0x8(%r14)
testq %rax, %rax
je 0x179acf
movq 0x10(%r14), %rsi
imulq $0x18, %rsi, %rcx
movq %r15, (%rax,%rcx)
movq %rbp, 0x8(%rax,%rcx)
incq %rsi
movq %rsi, 0x10(%r14)
orq $-0x1, 0x10(%rax,%rcx)
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movq %rbx, %rdx
callq 0x179be7
xorl %r12d, %r12d
incq %rbp
jmp 0x179240
movq 0x58(%rcx), %rax
movq 0x18(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x18(%rdi)
movq (%rax,%rcx,8), %rax
jmp 0x17986c
pushq $-0x1
popq %rbp
jmp 0x1798fd
movq (%rdi), %r12
movq 0xb0(%r12), %rcx
testq %rcx, %rcx
movq 0x18(%rsp), %r13
je 0x179779
movl 0xa4(%r12), %eax
cmpl 0xa0(%r12), %eax
jb 0x179829
movq 0xa8(%r12), %rdi
pushq $0x8
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x17ad0
movq %rax, %r15
movl %r15d, 0xa0(%r12)
movq 0xb0(%r12), %rdi
callq 0x17e70
testl %eax, %eax
je 0x179819
leaq 0x180473(%rip), %rsi    # 0x2f9bc9
leaq 0x2095ce(%rip), %rdx    # 0x382d2b
movq 0x78(%rsp), %rdi
xorl %eax, %eax
callq 0x89dbb
movl 0xa4(%r12), %eax
movb $0x1, %r13b
jmp 0x179829
movl 0x8c(%r12), %eax
cmpl 0x88(%r12), %eax
jb 0x179854
movq 0x90(%r12), %rdi
movq 0x98(%r12), %rcx
pushq $0x4
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x17ad0
movq %rax, %r15
movl %r15d, 0x88(%r12)
movq 0x98(%r12), %rdi
callq 0x17e70
testl %eax, %eax
je 0x179844
leaq 0x1803fa(%rip), %rsi    # 0x2f9bc9
leaq 0x1807fd(%rip), %rdx    # 0x2f9fd3
movq 0x78(%rsp), %rdi
xorl %eax, %eax
callq 0x89dbb
movl 0x8c(%r12), %eax
movb $0x1, %r13b
jmp 0x179854
leaq 0x180327(%rip), %rsi    # 0x2f9b1d
leaq 0x1d4b77(%rip), %rdx    # 0x34e374
movq $0x0, 0x8(%rsp)
movq 0x78(%rsp), %rdi
movl $0x9d, %ecx
xorl %eax, %eax
callq 0x89dbb
jmp 0x17988f
andl $0x0, 0xa4(%r12)
xorl %eax, %eax
testl %r15d, %r15d
je 0x179873
movq 0xa8(%r12), %rcx
leal 0x1(%rax), %edx
movl %edx, 0xa4(%r12)
movl %eax, %eax
movq (%rcx,%rax,8), %rax
jmp 0x17986c
andl $0x0, 0x8c(%r12)
xorl %eax, %eax
testl %r15d, %r15d
je 0x179873
movq 0x90(%r12), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8c(%r12)
movl %eax, %eax
movl (%rcx,%rax,4), %eax
movq %rax, 0x8(%rsp)
jmp 0x179892
leaq 0x180741(%rip), %rsi    # 0x2f9fbb
movq $0x0, 0x8(%rsp)
movq 0x78(%rsp), %rdi
xorl %eax, %eax
callq 0x89dbb
movb $0x1, %r13b
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x179a84
testb $0x1, %r13b
jne 0x1798dd
movq (%r14), %rcx
imulq $0x18, %rax, %rax
movq -0x18(%rcx,%rax), %rdi
testq %rdi, %rdi
je 0x1798dd
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
callq 0x179be7
movq (%r14), %rax
imulq $0x18, 0x10(%r14), %rcx
movq %rbp, -0x8(%rax,%rcx)
movq -0x18(%rax,%rcx), %rdi
movq %rbx, %rsi
callq 0x179cfa
movq %r14, %rdi
callq 0x1790a4
andb $0x1, %r13b
movzbl %r13b, %ebp
negl %ebp
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x1798fd
callq 0x188668
movq 0x30(%rbx), %rdi
leaq 0x1d4acf(%rip), %r14    # 0x34e3d7
movq %r14, %rsi
movl $0x125, %edx            # imm = 0x125
callq 0x936f9
movq 0x38(%rbx), %rdi
movq %r14, %rsi
movl $0x126, %edx            # imm = 0x126
callq 0x936f9
movq %rbx, %rdi
movq %r14, %rsi
movl $0x127, %edx            # imm = 0x127
callq 0x936f9
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2be61a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b6bb(%rip), %rsi    # 0x2e5013
leaq 0x1cb0ca(%rip), %rdx    # 0x344a29
leaq 0x1d4a89(%rip), %rcx    # 0x34e3ef
leaq 0x1d4a07(%rip), %r8     # 0x34e374
movl $0xb4, %r9d
jmp 0x1799a1
movq 0x2be5ec(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b68d(%rip), %rsi    # 0x2e5013
leaq 0x1cb07d(%rip), %rdx    # 0x344a0a
leaq 0x1d4a5b(%rip), %rcx    # 0x34e3ef
leaq 0x1d49d9(%rip), %r8     # 0x34e374
movl $0x9f, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2be5b4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18020b(%rip), %rsi    # 0x2f9bc9
leaq 0x180226(%rip), %rdx    # 0x2f9beb
jmp 0x179a0d
movq 0x2be59a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b63b(%rip), %rsi    # 0x2e5013
leaq 0x18017b(%rip), %rdx    # 0x2f9b5a
leaq 0x1d4a09(%rip), %rcx    # 0x34e3ef
leaq 0x1d4987(%rip), %r8     # 0x34e374
movl $0x9d, %r9d
jmp 0x1799a1
movq 0x2be56c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1801c3(%rip), %rsi    # 0x2f9bc9
leaq 0x1de5ec(%rip), %rdx    # 0x357ff9
xorl %eax, %eax
callq 0x17a50
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x2be545(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b5e6(%rip), %rsi    # 0x2e5013
leaq 0x1caf63(%rip), %rdx    # 0x344997
jmp 0x179a4e
movq 0x2be52b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b5cc(%rip), %rsi    # 0x2e5013
leaq 0x1caf9c(%rip), %rdx    # 0x3449ea
leaq 0x1d499a(%rip), %rcx    # 0x34e3ef
leaq 0x1d4918(%rip), %r8     # 0x34e374
movl $0xdf, %r9d
jmp 0x1799a1
movq 0x2be4fa(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b59b(%rip), %rsi    # 0x2e5013
leaq 0x1caf6b(%rip), %rdx    # 0x3449ea
jmp 0x179b18
movq 0x2be4dd(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b57e(%rip), %rsi    # 0x2e5013
leaq 0x1caf6e(%rip), %rdx    # 0x344a0a
leaq 0x1d494c(%rip), %rcx    # 0x34e3ef
leaq 0x1d48ca(%rip), %r8     # 0x34e374
movl $0xfb, %r9d
jmp 0x1799a1
movq 0x2be4ac(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b54d(%rip), %rsi    # 0x2e5013
leaq 0x1caeca(%rip), %rdx    # 0x344997
jmp 0x179ae7
movq 0x2be492(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b533(%rip), %rsi    # 0x2e5013
leaq 0x1caf03(%rip), %rdx    # 0x3449ea
leaq 0x1d4901(%rip), %rcx    # 0x34e3ef
leaq 0x1d487f(%rip), %r8     # 0x34e374
movl $0xee, %r9d
jmp 0x1799a1
movq 0x2be461(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16b502(%rip), %rsi    # 0x2e5013
leaq 0x1cae7f(%rip), %rdx    # 0x344997
leaq 0x1d48d0(%rip), %rcx    # 0x34e3ef
leaq 0x1d484e(%rip), %r8     # 0x34e374
movl $0x99, %r9d
jmp 0x1799a1