// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_hop.c
// Function: gt_hop_runner
static int gt_hop_runner(GT_UNUSED int argc, GT_UNUSED const char **argv,
    GT_UNUSED int parsed_args, void *tool_arguments, GtError *err)
{
  GtHopArguments *arguments = tool_arguments;
  GtEncseq *encseq;
  GtEncseqLoader *el;
  GtLogger *v_logger;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(arguments);
  v_logger = gt_logger_new(arguments->verbose, GT_LOGGER_DEFLT_PREFIX, stdout);
  gt_logger_log(v_logger, "Correction parameters:");
  gt_logger_log(v_logger, "hmin = "GT_WU"", arguments->hmin);
  gt_logger_log(v_logger, "read-hmin = "GT_WU"", arguments->read_hmin);
  gt_logger_log(v_logger, "altmax = %.2f", arguments->altmax);
  gt_logger_log(v_logger, "cogmin = %.2f", arguments->cogmin);
  gt_logger_log(v_logger, "mapqmin = "GT_WU"", arguments->mapqmin);
  gt_logger_log(v_logger, "qmax = "GT_WU"", arguments->qmax);
  gt_logger_log(v_logger, "covmin = "GT_WU"", arguments->covmin);
  if (arguments->clenmax == ULONG_MAX)
    gt_logger_log(v_logger, "clenmax = unlimited");
  else
    gt_logger_log(v_logger, "clenmax = "GT_WU"", arguments->clenmax);
  gt_logger_log(v_logger, "allow-multiple = %s", arguments->allow_multiple
      ? "yes" : "no");
  if (gt_str_length(arguments->annotation) > 0)
    gt_logger_log(v_logger, "restrict to %s feature in annotation %s",
        gt_str_get(arguments->atype), gt_str_get(arguments->annotation));
  gt_assert(gt_str_length(arguments->encseqinput) > 0);
  el = gt_encseq_loader_new();
  encseq = gt_encseq_loader_load(el, gt_str_get(arguments->encseqinput), err);
  if (encseq == NULL)
  {
    had_err = -1;
  }
  if (!had_err)
  {
    GtHpolProcessor *hpp;
    GtSeqposClassifier *spc = NULL;
    GtSamfileIterator *sfi = NULL;
    GtSamfileEncseqMapping *sem = NULL;
    GtAlignedSegmentsPile *asp = NULL;
    GtFile *outfile = NULL;
    GtAlphabet *dna = gt_alphabet_new_dna();
    GtSeqIterator **readset_iters = NULL;
    GtStrArray **infiles = NULL;
    GtFile **outfiles = NULL;
    GtUword nfiles = 0, i;
    hpp = gt_hpol_processor_new(encseq, arguments->hmin);
    if (gt_str_length(arguments->map) > 0)
    {
      if (!arguments->map_is_sam)
        sfi = gt_samfile_iterator_new_bam(gt_str_get(arguments->map), dna, err);
      else
        sfi = gt_samfile_iterator_new_sam(gt_str_get(arguments->map), dna,
            NULL, err);
      if (sfi == NULL)
        had_err = -1;
      sem = gt_samfile_encseq_mapping_new(sfi, encseq, err);
      if (sem == NULL)
        had_err = -1;
      if (!had_err)
      {
        asp = gt_aligned_segments_pile_new(sfi, sem);
        if (!arguments->chk)
          gt_hpol_processor_enable_segments_hlen_adjustment(hpp, asp,
              arguments->read_hmin, arguments->qmax, arguments->altmax,
              arguments->cogmin, arguments->mapqmin, arguments->covmin,
              arguments->allow_partial, arguments->allow_multiple,
              arguments->clenmax);
        else
          gt_hpol_processor_enable_aligned_segments_refregionscheck(hpp, asp);
        if (arguments->stats || arguments->state_of_truth)
          gt_hpol_processor_enable_statistics_output(hpp,
              arguments->state_of_truth, NULL);
        if (!had_err && gt_str_length(arguments->outfilename) > 0)
        {
          outfile = gt_file_new(gt_str_get(arguments->outfilename), "w", err);
          if (outfile == NULL)
            had_err = -1;
          else
            gt_hpol_processor_enable_direct_segments_output(hpp, outfile);
        }
        else if (!had_err)
        {
          nfiles = gt_str_array_size(arguments->readset);
          if (!had_err && nfiles > 0)
          {
            GtStr *outfn = gt_str_new();
            infiles = gt_calloc((size_t)nfiles, sizeof (*infiles));
            outfiles = gt_calloc((size_t)nfiles, sizeof (*outfiles));
            readset_iters = gt_malloc(sizeof (*readset_iters) * nfiles);
            for (i = 0; i < nfiles && !had_err; i++)
            {
              char *bn;
              gt_str_set(outfn, gt_str_get(arguments->outprefix));
              infiles[i] = gt_str_array_new();
              gt_str_array_add_cstr(infiles[i],
                  gt_str_array_get(arguments->readset, i));
              bn = gt_basename(gt_str_array_get(arguments->readset, i));
              gt_str_append_cstr(outfn, bn);
              outfiles[i] = gt_file_new(gt_str_get(outfn), "w", err);
              if (outfiles[i] == NULL)
                had_err = -1;
              readset_iters[i] =
                gt_seq_iterator_fastq_new(infiles[i], err);
              if (readset_iters[i] == NULL)
                had_err = -1;
              gt_seq_iterator_fastq_relax_check_of_quality_description(
                  (GtSeqIteratorFastQ*)readset_iters[i]);
              gt_free(bn);
            }
            if (!had_err)
              gt_hpol_processor_enable_sorted_segments_output(hpp, nfiles,
                  readset_iters, outfiles);
            gt_str_delete(outfn);
          }
        }
      }
    }
    if (!had_err && gt_str_length(arguments->annotation) > 0)
    {
      spc = gt_seqpos_classifier_new(gt_str_get(arguments->annotation),
          gt_str_get(arguments->atype));
      gt_hpol_processor_restrict_to_feature_type(hpp, spc);
    }
    if (!had_err)
      had_err = gt_hpol_processor_run(hpp, v_logger, err);
    gt_aligned_segments_pile_delete(asp);
    gt_samfile_iterator_delete(sfi);
    gt_samfile_encseq_mapping_delete(sem);
    gt_seqpos_classifier_delete(spc);
    gt_file_delete(outfile);
    gt_hpol_processor_delete(hpp);
    for (i = 0; i < nfiles; i++)
    {
      gt_assert(infiles != NULL);
      gt_assert(readset_iters != NULL);
      gt_assert(outfiles != NULL);
      gt_str_array_delete(infiles[i]);
      gt_seq_iterator_delete(readset_iters[i]);
      gt_file_delete(outfiles[i]);
    }
    gt_free(infiles);
    gt_free(outfiles);
    gt_free(readset_iters);
    gt_alphabet_delete(dna);
  }
  gt_logger_delete(v_logger);
  gt_encseq_delete(encseq);
  gt_encseq_loader_delete(el);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, %r14
movq %rcx, %r15
testq %r8, %r8
je 0xade09
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0xae502
testq %r15, %r15
je 0xae4f8
movzbl 0x60(%r15), %edi
movq 0x4160ca(%rip), %rax    # 0x4c3ee8
movq (%rax), %rdx
leaq 0x2a1aac(%rip), %rsi    # 0x34f8d4
callq 0x108ed0
movq %rax, %rbp
leaq 0x2aa12e(%rip), %rsi    # 0x357f65
movq %rax, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x30(%r15), %rdx
leaq 0x2aa135(%rip), %rsi    # 0x357f81
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x40(%r15), %rdx
leaq 0x2aa11b(%rip), %rsi    # 0x357f7c
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10906e
movsd 0x70(%r15), %xmm0
leaq 0x2aa114(%rip), %rsi    # 0x357f8c
movq %rbp, %rdi
movb $0x1, %al
callq 0x10906e
movsd 0x78(%r15), %xmm0
leaq 0x2aa10b(%rip), %rsi    # 0x357f9a
movq %rbp, %rdi
movb $0x1, %al
callq 0x10906e
movq 0x50(%r15), %rdx
leaq 0x2aa104(%rip), %rsi    # 0x357fa8
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x58(%r15), %rdx
leaq 0x2aa0fd(%rip), %rsi    # 0x357fb6
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x48(%r15), %rdx
leaq 0x2aa0f3(%rip), %rsi    # 0x357fc1
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x38(%r15), %rdx
cmpq $-0x1, %rdx
je 0xadef5
leaq 0x2aa0f9(%rip), %rsi    # 0x357fe2
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10906e
jmp 0xadf06
leaq 0x2aa0d2(%rip), %rsi    # 0x357fce
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10906e
leaq 0x2e24e0(%rip), %rax    # 0x3903ed
leaq 0x31aac7(%rip), %rdx    # 0x3c89db
cmpb $0x0, 0x65(%r15)
cmovneq %rax, %rdx
leaq 0x2aa0cc(%rip), %rsi    # 0x357ff0
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10906e
movq 0x8(%r15), %rdi
callq 0x120d4c
testq %rax, %rax
je 0xadf68
movq 0x20(%r15), %rdi
callq 0x120d23
movq %rax, %rbx
movq 0x8(%r15), %rdi
callq 0x120d23
leaq 0x2aa0ac(%rip), %rsi    # 0x358004
movq %rbp, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10906e
movq (%r15), %rdi
callq 0x120d4c
testq %rax, %rax
je 0xae4fd
callq 0xf36ef
movq %rax, %rbx
movq (%r15), %rdi
callq 0x120d23
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xf374b
movq %rax, %r13
testq %rax, %rax
je 0xadfff
movq %rbx, 0x70(%rsp)
callq 0xd340f
movq %rax, 0x38(%rsp)
movq 0x30(%r15), %rsi
movq %r13, %rdi
callq 0x159c44
movq %rax, 0x18(%rsp)
movq 0x10(%r15), %rdi
callq 0x120d4c
movb $0x1, %r12b
testq %rax, %rax
movq %r14, 0x40(%rsp)
movq %r13, 0x68(%rsp)
je 0xae00a
movq 0x10(%r15), %rdi
movb 0x61(%r15), %bl
callq 0x120d23
movq %rax, %rdi
testb %bl, %bl
je 0xae03d
movq 0x38(%rsp), %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x178eac
jmp 0xae04a
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0xae4ce
xorl %eax, %eax
movq $0x0, 0x30(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x50(%rsp)
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
jmp 0xae37c
movq 0x38(%rsp), %rsi
movq %r14, %rdx
callq 0x178e98
movq %r14, %rdx
testq %rax, %rax
movq %rax, %r14
sete %bl
movq %rax, %rdi
movq %r13, %rsi
callq 0x178abc
testq %rax, %rax
sete %cl
orb %bl, %cl
movq %r14, 0x50(%rsp)
jne 0xae099
movq %r14, %rdi
movq %rax, 0x28(%rsp)
movq %rax, %rsi
callq 0x1266ac
movq %rax, %rbx
cmpb $0x0, 0x62(%r15)
je 0xae0c4
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x159d51
jmp 0xae106
movq $0x0, 0x30(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
jmp 0xae37c
movq 0x40(%r15), %rdx
movq 0x58(%r15), %rcx
movsd 0x70(%r15), %xmm0
movsd 0x78(%r15), %xmm1
movq 0x50(%r15), %r8
movq 0x48(%r15), %r9
movzbl 0x64(%r15), %eax
movzbl 0x65(%r15), %r10d
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
pushq 0x38(%r15)
pushq %r10
pushq %rax
callq 0x159f6d
addq $0x20, %rsp
cmpb $0x0, 0x63(%r15)
jne 0xae114
cmpb $0x1, 0x6a(%r15)
jne 0xae125
movzbl 0x6a(%r15), %esi
movq 0x18(%rsp), %rdi
xorl %edx, %edx
callq 0x15a222
movq %rbx, 0x30(%rsp)
movq 0x18(%r15), %rdi
callq 0x120d4c
testq %rax, %rax
je 0xae18b
movq 0x18(%r15), %rdi
callq 0x120d23
leaq 0x2ee8e9(%rip), %rsi    # 0x39ca31
movq %rax, %rdi
movq 0x40(%rsp), %rdx
callq 0x103957
testq %rax, %rax
je 0xae343
movq %rax, %rbx
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x15a1a6
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
jmp 0xae377
movq 0x80(%r15), %rdi
callq 0x121e78
movq %rax, %r14
xorl %ebx, %ebx
testq %rax, %rax
je 0xae362
movq %r15, 0x20(%rsp)
movq %rbp, 0x60(%rsp)
callq 0x1208f8
movq %rax, 0x58(%rsp)
leaq 0x2a90b5(%rip), %r15    # 0x357275
movl $0x8, %esi
movq %r14, %rdi
movq %r15, %rdx
movl $0x1da, %ecx            # imm = 0x1DA
callq 0x1093ef
movq %rax, %r13
movl $0x8, %esi
movq %r14, %rdi
movq %r15, %rdx
movl $0x1db, %ecx            # imm = 0x1DB
callq 0x1093ef
movq %rax, 0x8(%rsp)
leaq (,%r14,8), %rdi
movq %r15, %rsi
movl $0x1dc, %edx            # imm = 0x1DC
callq 0x1092b2
movq %rax, 0x10(%rsp)
xorl %r15d, %r15d
movq %r14, 0x48(%rsp)
movq 0x20(%rsp), %r14
movq 0x28(%r14), %rdi
callq 0x120d23
movq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq %rax, %rsi
callq 0x1209e4
callq 0x121b54
movq %rax, %r12
movq %rax, (%r13,%r15,8)
movq 0x80(%r14), %rdi
movq %r15, %rsi
callq 0x121cfa
movq %r12, %rdi
movq %rax, %rsi
callq 0x121c30
movq 0x80(%r14), %rdi
movq %r15, %rsi
callq 0x121cfa
movq %rax, %rdi
callq 0xd6450
movq %rax, %r12
movq %rbp, %rdi
movq %rax, %rsi
callq 0x12097f
movq %rbp, %rdi
callq 0x120d23
movq %rax, %rdi
leaq 0x2ee7a1(%rip), %rsi    # 0x39ca31
movq 0x40(%rsp), %r14
movq %r14, %rdx
callq 0x103957
movq %rax, %rbp
movq 0x8(%rsp), %rax
movq %rbp, (%rax,%r15,8)
movq (%r13,%r15,8), %rdi
movq %r14, %rsi
movq 0x48(%rsp), %r14
callq 0x11a3d9
movq 0x10(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
cmpq $0x1, %rbp
movl $0x0, %ecx
sbbl %ecx, %ecx
orl %ebx, %ecx
cmpq $0x1, %rax
movl $0x0, %ebx
sbbl %ebx, %ebx
orl %ecx, %ebx
movq %rax, %rdi
callq 0x11a3c9
movq %r12, %rdi
leaq 0x2a8f85(%rip), %rsi    # 0x357275
movl $0x1ef, %edx            # imm = 0x1EF
callq 0x109670
incq %r15
testl %ebx, %ebx
sete %r12b
cmpq %r14, %r15
jae 0xae310
testl %ebx, %ebx
je 0xae214
testl %ebx, %ebx
jne 0xae32b
movq 0x18(%rsp), %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
callq 0x15a1c0
movq 0x58(%rsp), %rdi
callq 0x121b03
xorl %ebx, %ebx
movq 0x60(%rsp), %rbp
movq 0x20(%rsp), %r15
jmp 0xae377
xorl %ebx, %ebx
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
jmp 0xae377
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq %r14, 0x48(%rsp)
movq %rax, %r14
testb %r12b, %r12b
je 0xae3cc
movq 0x8(%r15), %rdi
callq 0x120d4c
testq %rax, %rax
je 0xae3cc
movq 0x8(%r15), %rdi
callq 0x120d23
movq %r15, %rcx
movq %rax, %r15
movq 0x20(%rcx), %rdi
callq 0x120d23
movq %r15, %rdi
movq %rax, %rsi
callq 0x17bc74
movq %rax, %r15
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x159d36
jmp 0xae3cf
xorl %r15d, %r15d
movl $0xffffffff, 0x20(%rsp) # imm = 0xFFFFFFFF
testb %r12b, %r12b
movq 0x18(%rsp), %r12
je 0xae3f5
movq %r12, %rdi
movq %rbp, %rsi
movq 0x40(%rsp), %rdx
callq 0x15a43b
movl %eax, 0x20(%rsp)
movq 0x30(%rsp), %rdi
callq 0x126aef
movq 0x50(%rsp), %rdi
callq 0x178e1a
movq %r14, %rdi
callq 0x178d02
movq %r15, %rdi
callq 0x17bf5d
movq %rbx, %rdi
callq 0x1040fc
movq %r12, %rdi
callq 0x15b257
movq 0x48(%rsp), %r14
testq %r14, %r14
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r12
je 0xae47e
testq %r13, %r13
je 0xae507
testq %r15, %r15
je 0xae50c
testq %r12, %r12
je 0xae511
xorl %ebx, %ebx
movq (%r13,%rbx,8), %rdi
callq 0x121e8b
movq (%r15,%rbx,8), %rdi
callq 0x119a53
movq (%r12,%rbx,8), %rdi
callq 0x1040fc
incq %rbx
cmpq %rbx, %r14
jne 0xae45a
leaq 0x2a8df0(%rip), %rbx    # 0x357275
movq %r13, %rdi
movq %rbx, %rsi
movl $0x210, %edx            # imm = 0x210
callq 0x109670
movq %r12, %rdi
movq %rbx, %rsi
movl $0x211, %edx            # imm = 0x211
callq 0x109670
movq %r15, %rdi
movq %rbx, %rsi
movl $0x212, %edx            # imm = 0x212
callq 0x109670
movq 0x38(%rsp), %rdi
callq 0xd335d
movq 0x70(%rsp), %rbx
movq 0x68(%rsp), %r13
movl 0x20(%rsp), %r14d
movq %rbp, %rdi
callq 0x10916a
movq %r13, %rdi
callq 0xee90c
movq %rbx, %rdi
callq 0xf424d
movl %r14d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1bc93
callq 0x1bc5a
callq 0x1bb76
callq 0x1bc21
callq 0x1bbe8
callq 0x1bbaf
nop