// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltrharvest_stream.c
// Function: gt_ltrharvest_stream_new
GtNodeStream* gt_ltrharvest_stream_new(GtStr *str_indexname,
                                       GtRange searchrange,
                                       GtUword minseedlength,
                                       GtUword minltrlength,
                                       GtUword maxltrlength,
                                       GtUword mindistance,
                                       GtUword maxdistance,
                                       double similaritythreshold,
                                       int xdropbelowscore,
                                       GtXdropArbitraryscores arbitscores,
                                       GtLTRFourCharMotif *motif,
                                       bool verbosemode,
                                       bool nooverlaps,
                                       bool bestoverlaps,
                                       bool scanfile,
                                       GtUword offset,
                                       unsigned int minlengthTSD,
                                       unsigned int maxlengthTSD,
                                       GtUword vicinity,
                                       GtError *err)
{
  int had_err = 0;
  GtUword max_contiglength;
  GtNodeStream *ns = gt_node_stream_create(gt_ltrharvest_stream_class(), false);
  GtLTRharvestStream *ltrh_stream = gt_ltrharvest_stream_cast(ns);

  ltrh_stream->str_indexname = str_indexname;
  ltrh_stream->minseedlength = minseedlength;
  ltrh_stream->similaritythreshold = similaritythreshold;
  ltrh_stream->xdropbelowscore = xdropbelowscore;
  ltrh_stream->arbitscores = arbitscores;
  ltrh_stream->motif = motif;
  ltrh_stream->verbosemode = verbosemode;
  ltrh_stream->offset = offset;
  ltrh_stream->repeatinfo.ltrsearchseqrange = searchrange;
  ltrh_stream->minlengthTSD = minlengthTSD;
  ltrh_stream->maxlengthTSD = maxlengthTSD;
  ltrh_stream->nooverlaps = nooverlaps;
  ltrh_stream->bestoverlaps = bestoverlaps;
  ltrh_stream->vicinityforcorrectboundaries = vicinity;
  ltrh_stream->cur_elem_index = 0;
  ltrh_stream->output_md5 = false;
  ltrh_stream->output_seqids = false;
  ltrh_stream->state = GT_LTRHARVEST_STREAM_STATE_START;
  /* init array for maximal repeats */
  GT_INITARRAY(&ltrh_stream->arrayLTRboundaries, LTRboundaries);

  ltrh_stream->ssar =
    gt_newSequentialsuffixarrayreaderfromfile(gt_str_get(str_indexname),
                                                SARR_LCPTAB | SARR_SUFTAB |
                                                SARR_ESQTAB |
                                                SARR_SSPTAB | SARR_SDSTAB,
                                                scanfile,
                                                NULL,
                                                err);
  if (ltrh_stream->ssar == NULL)
  {
    gt_node_stream_delete(ns);
    return NULL;
  }
  /* get encseq associated with suffix array */
  ltrh_stream->encseq = gt_encseqSequentialsuffixarrayreader(ltrh_stream->ssar);
  /* let's print a warning if a mirrored index is used, this might have
     probably unintended effects if the user is reusing indexes from
     TIRvish */
  if (gt_encseq_is_mirrored(ltrh_stream->encseq)) {
    gt_warning("running LTRharvest on a mirrored index, "
               "results may be duplicated");
  }
  max_contiglength = gt_encseq_max_seq_length(ltrh_stream->encseq);
  ltrh_stream->repeatinfo.dmax = GT_MIN(maxdistance,max_contiglength);
  ltrh_stream->repeatinfo.dmin = mindistance;
  ltrh_stream->repeatinfo.lmin = minltrlength;
  ltrh_stream->repeatinfo.lmax = maxltrlength;

  /* encode motif according to encseq alphabet */
  had_err = gt_ltr_four_char_motif_encode(motif, ltrh_stream->encseq, err);
  if (had_err)
  {
    gt_node_stream_delete(ns);
    return NULL;
  }

  return had_err ? NULL : ns;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r11
movq %rsi, %rbx
movq %rdi, %r10
movq 0x10(%rsp), %rdi
movq 0x110(%rsp), %rax
movq 0x108(%rsp), %rax
movl 0x100(%rsp), %eax
movl 0xf8(%rsp), %eax
movq 0xf0(%rsp), %rax
movb 0xe8(%rsp), %al
movb 0xe0(%rsp), %cl
movb 0xd8(%rsp), %dl
movb 0xd0(%rsp), %sil
movq 0xc8(%rsp), %r14
leaq 0xb8(%rsp), %r14
movq %r14, 0x18(%rsp)
movl 0xb0(%rsp), %ebp
movq 0xa8(%rsp), %r14
movq 0xa0(%rsp), %r14
movq %rbx, 0x68(%rsp)
movq %r11, 0x70(%rsp)
movq %r10, 0x60(%rsp)
movq %rdi, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x48(%rsp)
movsd %xmm0, 0x40(%rsp)
andb $0x1, %sil
movb %sil, 0x3f(%rsp)
andb $0x1, %dl
movb %dl, 0x3e(%rsp)
andb $0x1, %cl
movb %cl, 0x3d(%rsp)
andb $0x1, %al
movb %al, 0x3c(%rsp)
movl $0x0, 0x38(%rsp)
callq 0x30e100
movq %rax, %rdi
xorl %esi, %esi
callq 0x1b1b80
movq %rax, 0x28(%rsp)
callq 0x30e100
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x1b20f0
movq 0x18(%rsp), %rcx
movq %rax, 0x20(%rsp)
movq 0x60(%rsp), %rdx
movq 0x20(%rsp), %rax
movq %rdx, 0x58(%rax)
movq 0x58(%rsp), %rdx
movq 0x20(%rsp), %rax
movq %rdx, 0x60(%rax)
movsd 0x40(%rsp), %xmm0
movq 0x20(%rsp), %rax
movsd %xmm0, 0x68(%rax)
movl 0xb0(%rsp), %edx
movq 0x20(%rsp), %rax
movl %edx, 0x70(%rax)
movq 0x20(%rsp), %rax
movq (%rcx), %rdx
movq %rdx, 0x74(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x7c(%rax)
movq 0xc8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x88(%rax)
movb 0x3f(%rsp), %cl
movq 0x20(%rsp), %rax
andb $0x1, %cl
movb %cl, 0xe8(%rax)
movq 0xf0(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x90(%rax)
movq 0x20(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rcx, 0x48(%rax)
movq 0x70(%rsp), %rcx
movq %rcx, 0x50(%rax)
movl 0xf8(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x98(%rax)
movl 0x100(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x9c(%rax)
movb 0x3e(%rsp), %cl
movq 0x20(%rsp), %rax
andb $0x1, %cl
movb %cl, 0xe9(%rax)
movb 0x3d(%rsp), %cl
movq 0x20(%rsp), %rax
andb $0x1, %cl
movb %cl, 0xea(%rax)
movq 0x108(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0xa8(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0xf0(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0xeb(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0xec(%rax)
movq 0x20(%rsp), %rax
movl $0x0, 0xf8(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0xc0(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0xd0(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0xc8(%rax)
movq 0x60(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movb 0x3c(%rsp), %al
movq 0x110(%rsp), %r8
movl $0xa7, %esi
xorl %ecx, %ecx
andb $0x1, %al
movzbl %al, %edx
callq 0x23b3e0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0xe0(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0xe0(%rax)
jne 0x30fa79
movq 0x28(%rsp), %rdi
callq 0x1b1cb0
movq $0x0, 0x78(%rsp)
jmp 0x30fb99
movq 0x20(%rsp), %rax
movq 0xe0(%rax), %rdi
callq 0x23bd50
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0xd8(%rax)
movq 0x20(%rsp), %rax
movq 0xd8(%rax), %rdi
callq 0xc2ec0
testb $0x1, %al
jne 0x30fab0
jmp 0x30fabe
leaq 0x28487d(%rip), %rdi    # 0x594334
movb $0x0, %al
callq 0x1267d0
movq 0x20(%rsp), %rax
movq 0xd8(%rax), %rdi
callq 0xb10b0
movq %rax, 0x30(%rsp)
movq 0xa8(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x30faf2
movq 0xa8(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x30fafc
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0xa0(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x50(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x48(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0xc8(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0xd8(%rax), %rsi
movq 0x110(%rsp), %rdx
callq 0x4e9950
movl %eax, 0x38(%rsp)
cmpl $0x0, 0x38(%rsp)
je 0x30fb78
movq 0x28(%rsp), %rdi
callq 0x1b1cb0
movq $0x0, 0x78(%rsp)
jmp 0x30fb99
cmpl $0x0, 0x38(%rsp)
je 0x30fb87
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x30fb90
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw (%rax,%rax)