// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movb %r9b, %al
movq 0x58(%rsp), %r9
movq 0x50(%rsp), %r9
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
andb $0x1, %al
movb %al, 0x1f(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x78, %edi
leaq 0x2fdecb(%rip), %rsi    # 0x580b9f
movl $0x105, %edx            # imm = 0x105
callq 0xe80f0
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rdi
callq 0xb0f00
movq %rax, %rdi
callq 0x7e8c0
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x10(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, %edi
shlq $0x3, %rdi
imulq 0x28(%rsp), %rdi
leaq 0x2fde85(%rip), %rsi    # 0x580b9f
movl $0x107, %edx            # imm = 0x107
callq 0xe80f0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x10(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x2fde5a(%rip), %rsi    # 0x580b9f
movl $0x108, %edx            # imm = 0x108
callq 0xe80f0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x38(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x38(%rsp), %rdi
callq 0xa9d00
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x10(%rsp), %rax
movq 0x60(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x38(%rsp), %rdi
callq 0xc2ec0
testb $0x1, %al
jne 0x282da1
jmp 0x282db1
movq 0x10(%rsp), %rax
movq 0x58(%rax), %rcx
shrq %rcx
movq %rcx, 0x58(%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x68(%rax)
testb $0x1, 0x1f(%rsp)
je 0x282dfb
movq 0x38(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x2a01e0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x282df9
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x282dfb
cmpl $0x0, 0xc(%rsp)
jne 0x282e76
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdx
movl $0x1, %eax
xorl %ecx, %ecx
cmpq $-0x1, %rdx
cmovel %ecx, %eax
cmpl $0x0, %eax
setne %cl
movq 0x10(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x50(%rax)
movq 0x10(%rsp), %rdi
callq 0x282ef0
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x282f50
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x68(%rax)
je 0x282e90
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rdi
callq 0x2a04c0
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rdi
leaq 0x2fdcff(%rip), %rsi    # 0x580b9f
movl $0x125, %edx            # imm = 0x125
callq 0xe88c0
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rdi
leaq 0x2fdce5(%rip), %rsi    # 0x580b9f
movl $0x126, %edx            # imm = 0x126
callq 0xe88c0
movq 0x10(%rsp), %rdi
leaq 0x2fdccf(%rip), %rsi    # 0x580b9f
movl $0x127, %edx            # imm = 0x127
callq 0xe88c0
movl 0xc(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)