// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_orffinder.c
// Function: gt_orffinder_runner
static int gt_orffinder_runner(int argc, const char **argv,
                               int parsed_args, void *tool_arguments,
                               GtError *err)
{
  GtOrffinderArguments *arguments = tool_arguments;
  GtNodeStream *gff3_in_stream   = NULL,
               *last_stream      = NULL,
               *orffinder_stream = NULL,
               *gff3_out_stream  = NULL;
  int had_err = 0, i = 0, arg = parsed_args;
  GtLogger *logger = gt_logger_new(arguments->verbose,
                                   GT_LOGGER_DEFLT_PREFIX, stderr);
  GtHashmap *types = NULL;
  GtRegionMapping *rmap = NULL;

  gt_error_check(err);
  gt_assert(arguments);

  types = gt_hashmap_new(GT_HASH_STRING, NULL, NULL);

  if (gt_str_array_size(arguments->types) == 0) {
    gt_hashmap_add(types, (void*) "all", (void*) 1);
  } else {
    for (i = 0; i < gt_str_array_size(arguments->types); i++) {
      gt_hashmap_add(types,
                     (void*) gt_str_array_get(arguments->types, i),
                     (void*) 1);
      gt_hashmap_add(types, (void*) "all", (void*) 0);
    }
  }

  /* create region mapping */
  if (gt_seqid2file_option_used(arguments->s2fi)) {
    /* create region mapping */
    rmap = gt_seqid2file_region_mapping_new(arguments->s2fi, err);
    if (!rmap)
      had_err = -1;
  } else {
    GtEncseqLoader *el;
    GtEncseq *encseq;
    /* no new-style sequence source option given, fall back to legacy syntax */
    if (argc < 3) {
      gt_error_set(err, "missing argument(s)");
      had_err = -1;
    }
    if (!had_err) {
      el = gt_encseq_loader_new();
      gt_encseq_loader_disable_autosupport(el);
      gt_encseq_loader_require_md5_support(el);
      gt_encseq_loader_require_description_support(el);
      encseq = gt_encseq_loader_load(el, argv[arg], err);
      arg++;
      gt_encseq_loader_delete(el);
      if (!encseq)
        had_err = -1;
      else {
        rmap = gt_region_mapping_new_encseq_seqno(encseq);
        gt_encseq_delete(encseq);
      }
    }
  }
  gt_assert(had_err || rmap);

  if (!had_err) {
    last_stream = gff3_in_stream  = gt_gff3_in_stream_new_unsorted(argc - arg,
                                                                   argv + arg);
    last_stream = orffinder_stream = gt_orf_finder_stream_new(last_stream,
                                                             rmap,
                                                             types,
                                                             arguments->min,
                                                             arguments->max,
                                                             arguments->allorfs,
                                                             err);
    if (!orffinder_stream)
      had_err = -1;

    if (!had_err)  {
      last_stream = gff3_out_stream = gt_gff3_out_stream_new(last_stream,
                                                             arguments->outfp);

      /* pull the features through the stream and free them afterwards */
      had_err = gt_node_stream_pull(last_stream, err);
    }

    gt_node_stream_delete(orffinder_stream);
    gt_node_stream_delete(gff3_in_stream);
    gt_node_stream_delete(gff3_out_stream);
  }
  gt_hashmap_delete(types);
  types = NULL;
  gt_logger_delete(logger);
  gt_region_mapping_delete(rmap);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %r12
movl %edx, 0x8(%rsp)
movq %rsi, 0x20(%rsp)
movl %edi, 0xc(%rsp)
movzbl 0x21(%rcx), %edi
movq 0x403090(%rip), %r14    # 0x437f68
movq (%r14), %rdx
leaq 0x2b19f2(%rip), %rsi    # 0x2e68d4
callq 0x92b50
movq %rax, %r15
testq %rbx, %rbx
je 0x34eff
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x35116
movq %rbx, 0x18(%rsp)
pushq $0x1
popq %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8f330
movq %rax, %r14
movq 0x10(%r12), %rdi
callq 0xae61c
testq %rax, %rax
je 0x34f6b
xorl %r13d, %r13d
pushq $0x1
popq %rbx
leaq 0x32a857(%rip), %rbp    # 0x35f786
movq 0x10(%r12), %rdi
callq 0xae61c
cmpq %r13, %rax
jbe 0x34f7d
movq 0x10(%r12), %rdi
movq %r13, %rsi
callq 0xae386
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x8f4bd
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x8f4bd
incq %r13
jmp 0x34f2f
leaq 0x32a814(%rip), %rsi    # 0x35f786
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x8f4bd
movq 0x28(%r12), %rdi
callq 0x116b18
testb %al, %al
je 0x34fb7
movq 0x28(%r12), %rdi
movq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x116b63
testq %rax, %rax
je 0x350ba
movq %rax, %r13
movq %r15, 0x10(%rsp)
movl 0x8(%rsp), %eax
jmp 0x35040
cmpl $0x2, 0xc(%rsp)
movq 0x18(%rsp), %rbx
jle 0x350a1
movq %r15, 0x10(%rsp)
callq 0x791cd
movq %rax, %r15
movq %rax, %rdi
callq 0x7d046
movq %r15, %rdi
callq 0x7cffe
movq %r15, %rdi
callq 0x7d470
movslq 0x8(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x7921d
movq %rax, %rbx
movq %r15, %rdi
callq 0x79f01
testq %rbx, %rbx
je 0x3510e
movq %rbx, %rdi
callq 0x10f9c4
movq %rax, %r13
movq %rbx, %rdi
callq 0x735fd
testq %r13, %r13
je 0x35147
movl 0x8(%rsp), %eax
incl %eax
movq 0x18(%rsp), %rbx
movl 0xc(%rsp), %edi
subl %eax, %edi
cltq
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
callq 0xdeebd
movq %rax, %rbp
movl 0x8(%r12), %ecx
movl 0xc(%r12), %r8d
movzbl 0x20(%r12), %r9d
movq %rbx, (%rsp)
movq %rax, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x103401
movq %rax, %r15
testq %rax, %rax
je 0x350c2
movq (%r12), %rsi
movq %r15, %rdi
callq 0xe07df
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x102b93
movl %eax, %ebx
jmp 0x350c8
leaq 0x2bc33d(%rip), %rsi    # 0x2f13e5
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbx
jmp 0x350e5
pushq $-0x1
popq %rbx
xorl %r13d, %r13d
jmp 0x350e5
pushq $-0x1
popq %rbx
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x10297b
movq %rbp, %rdi
callq 0x10297b
movq %r12, %rdi
callq 0x10297b
movq 0x10(%rsp), %r15
movq %r14, %rdi
callq 0x8f933
movq %r15, %rdi
callq 0x92fd0
movq %r13, %rdi
callq 0x10f7de
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rbx
xorl %r13d, %r13d
jmp 0x350e0
movq (%r14), %rdi
leaq 0x2afef3(%rip), %rsi    # 0x2e5013
leaq 0x2b0098(%rip), %rdx    # 0x2e51bf
leaq 0x2bc2a3(%rip), %rcx    # 0x2f13d1
leaq 0x2bc101(%rip), %r8     # 0x2f1236
movl $0x9d, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x402e1a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2afebb(%rip), %rsi    # 0x2e5013
leaq 0x2bc29a(%rip), %rdx    # 0x2f13f9
leaq 0x2bc26b(%rip), %rcx    # 0x2f13d1
leaq 0x2bc0c9(%rip), %r8     # 0x2f1236
movl $0xcb, %r9d
jmp 0x3513b
nopl (%rax)