// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/tir_stream.c
// Function: gt_tir_stream_new
GtNodeStream* gt_tir_stream_new(GtStr *str_indexname,
                                GtUword min_seed_length,
                                GtUword min_TIR_length,
                                GtUword max_TIR_length,
                                GtUword min_TIR_distance,
                                GtUword max_TIR_distance,
                                GtXdropArbitraryscores arbit_scores,
                                int xdrop_belowscore,
                                double similarity_threshold,
                                bool best_overlaps,
                                bool longest_overlaps,
                                bool no_overlaps,
                                GtUword min_TSD_length,
                                GtUword max_TSD_length,
                                GtUword vicinity,
                                GtError *err)
{
  int had_err = 0;
  GtNodeStream *ns = gt_node_stream_create(gt_tir_stream_class(), false);
  GtTIRStream *tir_stream = gt_node_stream_cast(gt_tir_stream_class(), ns);
  tir_stream->num_of_tirs = 0;
  tir_stream->tir_pairs = NULL;
  tir_stream->cur_elem_index = 0;
  tir_stream->prev_seqnum = GT_UNDEF_UWORD;
  tir_stream->state = GT_TIR_STREAM_STATE_START;

  tir_stream->str_indexname = gt_str_ref(str_indexname);
  tir_stream->min_seed_length = min_seed_length;
  tir_stream->min_TIR_length = min_TIR_length;
  tir_stream->max_TIR_length = max_TIR_length;
  tir_stream->min_TIR_distance = min_TIR_distance;
  tir_stream->max_TIR_distance = max_TIR_distance;
  tir_stream->arbit_scores = arbit_scores;
  tir_stream->xdrop_belowscore = xdrop_belowscore;
  tir_stream->similarity_threshold = similarity_threshold;
  tir_stream->best_overlaps = best_overlaps;
  tir_stream->longest_overlaps = longest_overlaps;
  tir_stream->no_overlaps = no_overlaps;
  tir_stream->min_TSD_length = min_TSD_length;
  tir_stream->max_TSD_length = max_TSD_length;
  tir_stream->vicinity = vicinity;
  tir_stream->output_seqids = true;
  tir_stream->output_md5 = false;

  tir_stream->seedinfo.max_tir_length = max_TIR_length;
  tir_stream->seedinfo.min_tir_length = min_TIR_length;
  tir_stream->seedinfo.max_tir_distance = max_TIR_distance;
  tir_stream->seedinfo.min_tir_distance = min_TIR_distance;

  tir_stream->ssar =
      gt_newSequentialsuffixarrayreaderfromfile(gt_str_get(str_indexname),
                                                SARR_LCPTAB | SARR_SUFTAB |
                                                SARR_ESQTAB | SARR_DESTAB |
                                                SARR_SSPTAB | SARR_SDSTAB,
                                                true,
                                                NULL,
                                                err);
  if (tir_stream->ssar == NULL) {
    gt_node_stream_delete(ns);
    return NULL;
  }
  tir_stream->encseq = gt_encseqSequentialsuffixarrayreader(tir_stream->ssar);
  if (!gt_encseq_is_mirrored(tir_stream->encseq)) {
    gt_error_set(err, "index for '%s' is not mirrored (suffixerator option "
                      "-mirrored)!", gt_str_get(str_indexname));
    gt_node_stream_delete(ns);
    return NULL;
  }
  GT_INITARRAY(&tir_stream->seedinfo.seed, Seed);
  GT_INITARRAY(&tir_stream->first_pairs, TIRPair);
  tir_stream->seedinfo.num_of_contigs =
                                 gt_encseq_num_of_sequences(tir_stream->encseq);
  tir_stream->seedinfo.totallength =
                                 gt_encseq_total_length(tir_stream->encseq);
  tir_stream->seedinfo.midpos =
                           (gt_encseq_total_length(tir_stream->encseq) - 1) / 2;

  if (!had_err)
    return ns;

  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, 0x10(%rsp)
movq %r9, %rbp
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
callq 0x127ca0
movq %rax, %rdi
xorl %esi, %esi
callq 0x10289f
movq %rax, %r15
callq 0x127ca0
movq %rax, %rdi
movq %r15, (%rsp)
movq %r15, %rsi
callq 0x102c81
movq %rax, %r15
andq $0x0, 0x70(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rax)
orq $-0x1, 0xa8(%rax)
andl $0x0, 0x90(%rax)
movq %r12, %rdi
callq 0xad4d2
movq %rax, 0xb0(%r15)
movq 0x8(%rsp), %rax
movq %rax, 0xb8(%r15)
movq %r14, 0xc0(%r15)
movq %rbx, 0xc8(%r15)
movq %r13, 0xd0(%r15)
movq %rbp, 0xd8(%r15)
movaps 0x50(%rsp), %xmm0
movups %xmm0, 0xe0(%r15)
movl 0x60(%rsp), %eax
movl %eax, 0xf0(%r15)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xf8(%r15)
movb 0x68(%rsp), %al
movb %al, 0x101(%r15)
movb 0x70(%rsp), %al
movb %al, 0x102(%r15)
movb 0x78(%rsp), %al
movb %al, 0x100(%r15)
movaps 0x80(%rsp), %xmm0
movups %xmm0, 0x108(%r15)
movq 0x90(%rsp), %rax
movq %rax, 0x118(%r15)
movw $0x1, 0x103(%r15)
movq %rbx, 0x38(%r15)
movq %r14, 0x40(%r15)
movq 0x98(%rsp), %r14
movq %rbp, 0x48(%r15)
movq %r13, 0x50(%r15)
movq %r12, %rdi
callq 0xad1fa
pushq $0x1
popq %rdx
movq %rax, %rdi
movl $0xb7, %esi
xorl %ecx, %ecx
movq %r14, %r8
callq 0x1516ac
movq %rax, 0x18(%r15)
testq %rax, %rax
je 0x1292fd
movq (%rsp), %rbx
movq %rax, %rdi
callq 0x151c21
movq %rax, 0x10(%r15)
movq %rax, %rdi
callq 0x81dea
testb %al, %al
je 0x129303
movq %r15, %rax
addq $0x20, %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movups %xmm0, 0x78(%r15)
andq $0x0, 0x88(%r15)
movq 0x10(%r15), %rdi
callq 0x705a1
movq %rax, 0x58(%r15)
movq 0x10(%r15), %rdi
callq 0x7055e
movq %rax, 0x68(%r15)
movq 0x10(%r15), %rdi
callq 0x7055e
decq %rax
shrq %rax
movq %rax, 0x60(%r15)
movq %rbx, %rax
jmp 0x129329
movq (%rsp), %rdi
jmp 0x129322
movq %r12, %rdi
callq 0xad1fa
leaq 0x20d878(%rip), %rsi    # 0x336b8a
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x89dbb
movq %rbx, %rdi
callq 0x10297b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq