// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-spmfind.c
// Function: gt_spmfind_state_new
static GtBUstate_spm *gt_spmfind_state_new(bool eqlen, const GtEncseq *encseq,
    GtUword minmatchlength, GtUword w_maxsize, bool elimtrans,
    bool showspm, const char *indexname, unsigned int threadnum,
    GtLogger *default_logger, GtLogger *verbose_logger, GtError *err)
{
  GtBUstate_spmeq *state = gt_calloc((size_t)1, sizeof (*state));

  state->default_logger = default_logger;
  state->verbose_logger = verbose_logger;
  state->err = err;
  state->indexname = indexname;
  state->encseq = encseq;
  state->nofreads = gt_encseq_num_of_sequences(encseq);
  state->first_revcompl = gt_encseq_is_mirrored(encseq) ?
    state->nofreads >> 1 : 0;
  state->totallength = gt_encseq_total_length(encseq);
  state->minmatchlength = minmatchlength;
  state->elimtrans = elimtrans;
  state->w_maxsize = (w_maxsize == 0) ? ULONG_MAX : w_maxsize;\
  if (eqlen)
  {
    state->read_length = gt_encseq_seqlength(encseq, 0);
  }
  else
  {
    GtStr *suffix = gt_str_new();
    state->read_length = 0;
    gt_str_append_char(suffix, '.');
    gt_str_append_uint(suffix, threadnum);
    gt_str_append_cstr(suffix, GT_READJOINER_SUFFIX_CNTLIST);
    state->cntfile = gt_fa_fopen_with_suffix(indexname, gt_str_get(suffix),
        "wb", NULL);
    gt_cntlist_write_bin_header(gt_encseq_is_mirrored(encseq) ?
        state->nofreads >> 1 : state->nofreads, state->cntfile);
    gt_str_delete(suffix);
    if (!state->cntfile)
      exit(-1);
  }
  state->threadnum = threadnum;

  if (threadnum == 0)
  {
    gt_logger_log(verbose_logger, "readset name = %s", indexname);
    if (state->first_revcompl == 0)
      gt_logger_log(verbose_logger, "single strand mode");
    gt_logger_log(default_logger, "number of reads in filtered readset = "GT_WU,
                  state->first_revcompl > 0 ? state->first_revcompl :
                  state->nofreads);
    gt_logger_log(verbose_logger, "total length of filtered readset = "GT_WU"",
        gt_encseq_is_mirrored(encseq) ? (state->totallength -
          state->nofreads + 1) >> 1 : (state->totallength -
            state->nofreads + 1));
    if (eqlen)
      gt_logger_log(verbose_logger, "read length = "GT_WU"",
                    state->read_length); else
      gt_logger_log(verbose_logger, "read length = variable");
    gt_logger_log(verbose_logger, "minimal match length = "GT_WU"",
        state->minmatchlength);
    if (w_maxsize == 0)
      gt_logger_log(verbose_logger, "wset size limit = unlimited");
    else
      gt_logger_log(verbose_logger, "wset size limit = "GT_WU"",
          state->w_maxsize);
    gt_logger_log(verbose_logger, "eliminate transitive SPM = %s",
        state->elimtrans ? "true" : "false");
  }

  if (showspm)
  {
    state->proc = gt_spmproc_show_ascii;
    state->procdata = NULL;
  }
  else
  {
    GtStr *suffix = gt_str_new();
    gt_str_append_char(suffix, '.');
    gt_str_append_uint(suffix, threadnum);
    gt_str_append_cstr(suffix, GT_READJOINER_SUFFIX_SPMLIST);
    /*@ignore@*/
    state->procdata = gt_fa_fopen_with_suffix(indexname, gt_str_get(suffix),
        "wb", NULL);
    /*@end@*/
    gt_str_delete(suffix);
    if (state->procdata == NULL)
      exit(-1);
    if (state->first_revcompl > UINT32_MAX ||
        (state->first_revcompl == 0 && state->nofreads > UINT32_MAX))
    {
      state->proc = gt_spmproc_show_bin64;
      /*@ignore@*/
      gt_spmlist_write_header_bin64((FILE*)state->procdata);
      /*@end@*/
    }
    else
    {
      state->proc = gt_spmproc_show_bin32;
      /*@ignore@*/
      gt_spmlist_write_header_bin32((FILE*)state->procdata);
      /*@end@*/
    }
  }

  state->nofvalidspm = 0;

  initlset_spm(state);
  initwset_spm(state);

  state->stack = (void *) gt_GtArrayGtBUItvinfo_new();

#ifdef GT_READJOINER_STATISTICS
  if (threadnum == 0)
    gt_logger_log(state->verbose_logger,
        "spmfind: additional statistics output activated");
  state->initial_l_allocated = state->l_allocated;
  state->initial_w_allocated = state->w_allocated;
  state->w_per_terminal = gt_disc_distri_new();
#endif

  return state;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0x10(%rsp)
movl %r8d, 0x14(%rsp)
movq %rcx, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %rbp
movl %edi, 0xc(%rsp)
movq 0x78(%rsp), %r12
movq 0x70(%rsp), %r15
movq 0x60(%rsp), %r13
movq 0x80(%rsp), %r14
leaq 0x1d2beb(%rip), %rdx    # 0x34e86c
pushq $0x1
popq %rdi
movl $0x100, %esi            # imm = 0x100
movl $0x273, %ecx            # imm = 0x273
callq 0x9334a
movq %rax, %rbx
movq %r15, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movq %r13, %r14
movq %r13, 0x30(%rax)
movq %rbp, 0x38(%rax)
movq %rbp, %rdi
callq 0x705a1
movq %rax, 0x50(%rbx)
movq %rbp, %rdi
callq 0x81dea
testb %al, %al
je 0x17bcce
movq 0x50(%rbx), %rax
shrq %rax
jmp 0x17bcd0
xorl %eax, %eax
movl 0x68(%rsp), %r12d
movq %rax, 0x58(%rbx)
movq %rbp, %rdi
callq 0x7055e
movq %rax, 0x40(%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rbx)
xorl %eax, %eax
movq 0x20(%rsp), %r13
cmpq $0x1, %r13
sbbq %rax, %rax
movl 0x14(%rsp), %ecx
movb %cl, 0x28(%rbx)
orq %r13, %rax
movq %rax, 0xa0(%rbx)
cmpb $0x0, 0xc(%rsp)
je 0x17bd2c
movq %rbp, %rdi
xorl %esi, %esi
callq 0x75173
movq %rax, 0x48(%rbx)
movq 0x78(%rsp), %r15
jmp 0x17bdc7
callq 0xacb84
movq %rax, %r15
andq $0x0, 0x48(%rbx)
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0xaced9
movq %r15, %rdi
movl %r12d, %esi
callq 0xad151
leaq 0x176aa0(%rip), %rsi    # 0x2f27f6
movq %r15, %rdi
callq 0xacbfb
movq %r15, %rdi
callq 0xad1fa
leaq 0x179d84(%rip), %rdx    # 0x2f5af1
leaq 0x1d2af8(%rip), %rcx    # 0x34e86c
movq %r14, %rdi
movq %rax, %rsi
movl $0x28d, %r8d            # imm = 0x28D
xorl %r9d, %r9d
callq 0x8a449
movq %rax, 0xe0(%rbx)
movq %rbp, %rdi
callq 0x81dea
movq 0x50(%rbx), %rdi
movq 0xe0(%rbx), %rsi
movl %eax, %ecx
shrq %cl, %rdi
callq 0x172084
movq %r15, %rdi
callq 0xae103
cmpq $0x0, 0xe0(%rbx)
movq 0x78(%rsp), %r15
je 0x17c052
movl %r12d, 0xf8(%rbx)
testl %r12d, %r12d
jne 0x17bee9
leaq 0x1769ce(%rip), %rsi    # 0x2f27ac
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x92e71
movq 0x58(%rbx), %rdx
testq %rdx, %rdx
jne 0x17be12
leaq 0x1d2bcd(%rip), %rsi    # 0x34e9c8
movq %r15, %rdi
xorl %eax, %eax
callq 0x92e71
movq 0x58(%rbx), %rdx
testq %rdx, %rdx
jne 0x17be12
movq 0x50(%rbx), %rdx
leaq 0x176fa1(%rip), %rsi    # 0x2f2dba
movq 0x70(%rsp), %rdi
xorl %eax, %eax
callq 0x92e71
movq %rbp, %rdi
callq 0x81dea
movq 0x40(%rbx), %rdx
subq 0x50(%rbx), %rdx
incq %rdx
movl %eax, %ecx
shrq %cl, %rdx
leaq 0x176fa0(%rip), %rsi    # 0x2f2de4
movq %r15, %rdi
xorl %eax, %eax
callq 0x92e71
cmpb $0x0, 0xc(%rsp)
je 0x17be6c
movq 0x48(%rbx), %rdx
leaq 0x176fab(%rip), %rsi    # 0x2f2e0b
movq %r15, %rdi
xorl %eax, %eax
callq 0x92e71
jmp 0x17be7d
leaq 0x176faa(%rip), %rsi    # 0x2f2e1d
movq %r15, %rdi
xorl %eax, %eax
callq 0x92e71
movq 0x20(%rbx), %rdx
leaq 0x1d2b53(%rip), %rsi    # 0x34e9db
movq %r15, %rdi
xorl %eax, %eax
callq 0x92e71
testq %r13, %r13
je 0x17beb1
movq 0xa0(%rbx), %rdx
leaq 0x1d2b6d(%rip), %rsi    # 0x34ea12
movq %r15, %rdi
xorl %eax, %eax
callq 0x92e71
jmp 0x17bec2
leaq 0x1d2b3e(%rip), %rsi    # 0x34e9f6
movq %r15, %rdi
xorl %eax, %eax
callq 0x92e71
leaq 0x1c60fb(%rip), %rax    # 0x341fc4
leaq 0x1aab1c(%rip), %rdx    # 0x3269ec
cmpb $0x0, 0x28(%rbx)
cmovneq %rax, %rdx
leaq 0x1d2b49(%rip), %rsi    # 0x34ea28
movq %r15, %rdi
xorl %eax, %eax
callq 0x92e71
cmpb $0x0, 0x10(%rsp)
je 0x17bf0b
leaq 0x1bb9(%rip), %rax      # 0x17dab0
movq %rax, 0xb0(%rbx)
andq $0x0, 0xb8(%rbx)
jmp 0x17bfc4
callq 0xacb84
movq %r14, %r15
movq %rax, %r14
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0xaced9
movq %r14, %rdi
movl %r12d, %esi
callq 0xad151
leaq 0x177fcc(%rip), %rsi    # 0x2f3eff
movq %r14, %rdi
callq 0xacbfb
movq %r14, %rdi
callq 0xad1fa
leaq 0x179ba7(%rip), %rdx    # 0x2f5af1
leaq 0x1d291b(%rip), %rcx    # 0x34e86c
movq %r15, %rdi
movq %rax, %rsi
movl $0x2be, %r8d            # imm = 0x2BE
xorl %r9d, %r9d
callq 0x8a449
movq %rax, 0xb8(%rbx)
movq %r14, %rdi
callq 0xae103
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x17c052
movq 0x58(%rbx), %rax
movq %rax, %rcx
shrq $0x20, %rcx
je 0x17bfa6
leaq 0x1676(%rip), %rax      # 0x17d60e
movq %rax, 0xb0(%rbx)
callq 0x17d603
jmp 0x17bfc4
testq %rax, %rax
jne 0x17bfb1
cmpl $0x0, 0x54(%rbx)
jne 0x17bf91
leaq 0x158f(%rip), %rax      # 0x17d547
movq %rax, 0xb0(%rbx)
callq 0x17d53c
andq $0x0, 0xc0(%rbx)
movl $0x400, %r15d           # imm = 0x400
movq %r15, 0x70(%rbx)
leaq 0x1d288f(%rip), %r14    # 0x34e86c
movl $0x2000, %edi           # imm = 0x2000
movq %r14, %rsi
movl $0xef, %edx
callq 0x93160
movq %rax, 0x60(%rbx)
andq $0x0, 0x68(%rbx)
movq %r15, 0x88(%rbx)
movl $0x4000, %edi           # imm = 0x4000
movq %r14, %rsi
movl $0x81, %edx
callq 0x93160
movq %rax, 0x78(%rbx)
andq $0x0, 0x80(%rbx)
movq 0x88(%rbx), %rcx
addq $0x8, %rax
subq $0x1, %rcx
jb 0x17c038
andq $0x0, (%rax)
addq $0x10, %rax
jmp 0x17c028
callq 0x2aeef0
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rdi
callq 0x178f0