// File: /workspace/github_c_makefile_star2_O1/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 0x1e3929(%rip), %rdx    # 0x3b7b1c
movl $0x1, %edi
movl $0x100, %esi            # imm = 0x100
movl $0x273, %ecx            # imm = 0x273
callq 0x1093ef
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 0xec1e8
movq %rax, 0x50(%rbx)
movq %rbp, %rdi
callq 0xfac80
testb %al, %al
je 0x1d4242
movq 0x50(%rbx), %rax
shrq %rax
jmp 0x1d4244
xorl %eax, %eax
movl 0x68(%rsp), %r12d
movq %rax, 0x58(%rbx)
movq %rbp, %rdi
callq 0xec1d8
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 0x1d42a0
movq %rbp, %rdi
xorl %esi, %esi
callq 0xeffd3
movq %rax, 0x48(%rbx)
movq 0x78(%rsp), %r15
jmp 0x1d4340
callq 0x1208f8
movq %rax, %r15
movq $0x0, 0x48(%rbx)
movq %rax, %rdi
movl $0x2e, %esi
callq 0x120ba5
movq %r15, %rdi
movl %r12d, %esi
callq 0x120cd6
leaq 0x18754f(%rip), %rsi    # 0x35b81e
movq %r15, %rdi
callq 0x12097f
movq %r15, %rdi
callq 0x120d23
leaq 0x18a827(%rip), %rdx    # 0x35eb0d
leaq 0x1e382f(%rip), %rcx    # 0x3b7b1c
movq %r14, %rdi
movq %rax, %rsi
movl $0x28d, %r8d            # imm = 0x28D
xorl %r9d, %r9d
callq 0x101dff
movq %rax, 0xe0(%rbx)
movq %rbp, %rdi
callq 0xfac80
movq 0x50(%rbx), %rdi
movq 0xe0(%rbx), %rsi
movl %eax, %ecx
shrq %cl, %rdi
callq 0x1cad5c
movq %r15, %rdi
callq 0x121b03
cmpq $0x0, 0xe0(%rbx)
movq 0x78(%rsp), %r15
je 0x1d4658
movl %r12d, 0xf8(%rbx)
testl %r12d, %r12d
jne 0x1d4460
leaq 0x18747d(%rip), %rsi    # 0x35b7d4
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10906e
cmpq $0x0, 0x58(%rbx)
jne 0x1d437c
leaq 0x1e3906(%rip), %rsi    # 0x3b7c78
movq %r15, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x58(%rbx), %rdx
testq %rdx, %rdx
jne 0x1d4389
movq 0x50(%rbx), %rdx
leaq 0x187a52(%rip), %rsi    # 0x35bde2
movq 0x70(%rsp), %rdi
xorl %eax, %eax
callq 0x10906e
movq %rbp, %rdi
callq 0xfac80
movq 0x40(%rbx), %rdx
subq 0x50(%rbx), %rdx
incq %rdx
movl %eax, %ecx
shrq %cl, %rdx
leaq 0x187a51(%rip), %rsi    # 0x35be0c
movq %r15, %rdi
xorl %eax, %eax
callq 0x10906e
cmpb $0x0, 0xc(%rsp)
je 0x1d43e3
movq 0x48(%rbx), %rdx
leaq 0x187a5c(%rip), %rsi    # 0x35be33
movq %r15, %rdi
xorl %eax, %eax
callq 0x10906e
jmp 0x1d43f4
leaq 0x187a5b(%rip), %rsi    # 0x35be45
movq %r15, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x20(%rbx), %rdx
leaq 0x1e388c(%rip), %rsi    # 0x3b7c8b
movq %r15, %rdi
xorl %eax, %eax
callq 0x10906e
testq %r13, %r13
je 0x1d4428
movq 0xa0(%rbx), %rdx
leaq 0x1e38a6(%rip), %rsi    # 0x3b7cc2
movq %r15, %rdi
xorl %eax, %eax
callq 0x10906e
jmp 0x1d4439
leaq 0x1e3877(%rip), %rsi    # 0x3b7ca6
movq %r15, %rdi
xorl %eax, %eax
callq 0x10906e
leaq 0x1d6df2(%rip), %rax    # 0x3ab232
leaq 0x1bb585(%rip), %rdx    # 0x38f9cc
cmpb $0x0, 0x28(%rbx)
cmovneq %rax, %rdx
leaq 0x1e3882(%rip), %rsi    # 0x3b7cd8
movq %r15, %rdi
xorl %eax, %eax
callq 0x10906e
cmpb $0x0, 0x10(%rsp)
je 0x1d4485
leaq 0x19aa(%rip), %rax      # 0x1d5e18
movq %rax, 0xb0(%rbx)
movq $0x0, 0xb8(%rbx)
jmp 0x1d4540
callq 0x1208f8
movq %r14, %r15
movq %rax, %r14
movq %rax, %rdi
movl $0x2e, %esi
callq 0x120ba5
movq %r14, %rdi
movl %r12d, %esi
callq 0x120cd6
leaq 0x188a78(%rip), %rsi    # 0x35cf27
movq %r14, %rdi
callq 0x12097f
movq %r14, %rdi
callq 0x120d23
leaq 0x18a647(%rip), %rdx    # 0x35eb0d
leaq 0x1e364f(%rip), %rcx    # 0x3b7b1c
movq %r15, %rdi
movq %rax, %rsi
movl $0x2be, %r8d            # imm = 0x2BE
xorl %r9d, %r9d
callq 0x101dff
movq %rax, 0xb8(%rbx)
movq %r14, %rdi
callq 0x121b03
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x1d4658
movq 0x58(%rbx), %rax
movq %rax, %rcx
shrq $0x20, %rcx
je 0x1d4522
leaq 0x14b3(%rip), %rax      # 0x1d59c7
movq %rax, 0xb0(%rbx)
callq 0x1d59ba
jmp 0x1d4540
testq %rax, %rax
jne 0x1d452d
cmpl $0x0, 0x54(%rbx)
jne 0x1d450d
leaq 0x1421(%rip), %rax      # 0x1d5955
movq %rax, 0xb0(%rbx)
callq 0x1d5948
xorl %r15d, %r15d
movq %r15, 0xc0(%rbx)
movl $0x400, %r12d           # imm = 0x400
movq %r12, 0x70(%rbx)
leaq 0x1e35c1(%rip), %r14    # 0x3b7b1c
movl $0x2000, %edi           # imm = 0x2000
movq %r14, %rsi
movl $0xef, %edx
callq 0x1092b2
movq %rax, 0x60(%rbx)
movq %r15, 0x68(%rbx)
movq %r12, 0x88(%rbx)
movl $0x4000, %edi           # imm = 0x4000
movq %r14, %rsi
movl $0x81, %edx
callq 0x1092b2
movq %rax, 0x78(%rbx)
movq %r15, 0x80(%rbx)
movq 0x88(%rbx), %rdx
testq %rdx, %rdx
je 0x1d463e
leaq 0x1(%rdx), %rcx
andq $-0x2, %rcx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
addq $0x18, %rax
movdqa 0x18d4a6(%rip), %xmm1   # 0x361a70
movdqa 0x18d4ae(%rip), %xmm2   # 0x361a80
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x18d4ae(%rip), %xmm4   # 0x361a90
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edx
notl %edx
testb $0x1, %dl
je 0x1d461b
movq $0x0, -0x10(%rax)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x1d4630
movq $0x0, (%rax)
paddq %xmm4, %xmm1
addq $0x20, %rax
addq $-0x2, %rcx
jne 0x1d45e2
callq 0x319fe0
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x17940