// File: /workspace/github_c_makefile_star2_O3/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, 0xc(%rsp)
movq %rsi, 0x20(%rsp)
movl %edi, %ebp
movzbl 0x21(%rcx), %edi
movq 0x407844(%rip), %rax    # 0x4b8f80
movq (%rax), %rdx
leaq 0x29518e(%rip), %rsi    # 0x3468d4
callq 0x103e40
movq %rax, %r15
testq %rbx, %rbx
je 0xb1763
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0xb1990
movq %rbx, 0x18(%rsp)
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1008fc
movq %rax, %r14
movq 0x10(%r12), %rdi
callq 0x11c131
testq %rax, %rax
je 0xb17df
movq 0x10(%r12), %rdi
callq 0x11c131
testq %rax, %rax
je 0xb17f3
xorl %r13d, %r13d
leaq 0x30db95(%rip), %rbx    # 0x3bf336
movq 0x10(%r12), %rdi
movq %r13, %rsi
callq 0x11bfb3
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x100b18
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x100b18
incq %r13
movq 0x10(%r12), %rdi
callq 0x11c131
cmpq %r13, %rax
ja 0xb17a1
jmp 0xb17f3
leaq 0x30db50(%rip), %rsi    # 0x3bf336
movl $0x1, %edx
movq %r14, %rdi
callq 0x100b18
movq 0x28(%r12), %rdi
callq 0x172f92
testb %al, %al
je 0xb182d
movq 0x28(%r12), %rdi
movq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x172fdd
testq %rax, %rax
je 0xb192e
movq %rax, %r13
movq %r15, 0x10(%rsp)
movl 0xc(%rsp), %eax
jmp 0xb18b4
cmpl $0x2, %ebp
movq 0x18(%rsp), %rbx
jle 0xb1913
movq %r15, 0x10(%rsp)
callq 0xef0cd
movq %rax, %r15
movq %rax, %rdi
callq 0xf238b
movq %r15, %rdi
callq 0xf2376
movq %r15, %rdi
callq 0xf2485
movslq 0xc(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0xef129
movq %rax, %rbx
movq %r15, %rdi
callq 0xefbe3
testq %rbx, %rbx
je 0xb1986
movq %rbx, %rdi
callq 0x16d798
movq %rax, %r13
movq %rbx, %rdi
callq 0xea375
testq %r13, %r13
je 0xb1995
movl 0xc(%rsp), %eax
incl %eax
movq 0x18(%rsp), %rbx
subl %eax, %ebp
cltq
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
movl %ebp, %edi
callq 0x145cdf
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 0x16341d
movq %rax, %r15
testq %rax, %rax
je 0xb1938
movq (%r12), %rsi
movq %r15, %rdi
callq 0x146fc0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x162f5d
movl %eax, %ebx
jmp 0xb1940
leaq 0x29fab8(%rip), %rsi    # 0x3513d2
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xb195d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
jmp 0xb195d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x162dee
movq %rbp, %rdi
callq 0x162dee
movq %r12, %rdi
callq 0x162dee
movq 0x10(%rsp), %r15
movq %r14, %rdi
callq 0x10109b
movq %r15, %rdi
callq 0x1040e0
movq %r13, %rdi
callq 0x16d652
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r13d, %r13d
jmp 0xb1958
callq 0x1cca7
callq 0x1cce0
nop