// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rcx, %r12
movl %edx, %ebx
movq %rsi, 0x18(%rsp)
movl %edi, 0xc(%rsp)
movzbl 0x21(%rcx), %edi
movq 0x4104f0(%rip), %rax    # 0x4c3f80
movq (%rax), %rdx
leaq 0x29be3a(%rip), %rsi    # 0x34f8d4
callq 0x108ed0
movq %rax, %r14
testq %r15, %r15
je 0xb3ab7
movq %r15, %rdi
callq 0x101a9a
testb %al, %al
jne 0xb3ce7
testq %r12, %r12
je 0xb3cdd
movq %r15, 0x10(%rsp)
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x105830
movq %rax, %r15
movq 0x10(%r12), %rdi
callq 0x121e78
testq %rax, %rax
je 0xb3b3c
movq 0x10(%r12), %rdi
callq 0x121e78
testq %rax, %rax
je 0xb3b50
xorl %r13d, %r13d
leaq 0x314eb8(%rip), %rbp    # 0x3c89b6
movq 0x10(%r12), %rdi
movq %r13, %rsi
callq 0x121cfa
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rsi
callq 0x105a4c
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x105a4c
incq %r13
movq 0x10(%r12), %rdi
callq 0x121e78
cmpq %r13, %rax
ja 0xb3afe
jmp 0xb3b50
leaq 0x314e73(%rip), %rsi    # 0x3c89b6
movl $0x1, %edx
movq %r15, %rdi
callq 0x105a4c
movq 0x28(%r12), %rdi
callq 0x17b372
testb %al, %al
je 0xb3b7b
movq 0x28(%r12), %rdi
movq 0x10(%rsp), %rsi
callq 0x17b3bd
movq %rax, %r13
testq %rax, %rax
sete %al
jmp 0xb3c09
cmpl $0x2, 0xc(%rsp)
jle 0xb3be7
movq %r14, %rbp
callq 0xf36ef
movq %rax, %r13
movq %rax, %rdi
callq 0xf69cc
movq %r13, %rdi
callq 0xf69b7
movq %r13, %rdi
callq 0xf6ac6
movslq %ebx, %rbx
movq 0x18(%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq %r13, %rdi
movq 0x10(%rsp), %rdx
callq 0xf374b
movq %rax, %r14
incl %ebx
movq %r13, %rdi
callq 0xf424d
testq %r14, %r14
je 0xb3c01
movq %r14, %rdi
callq 0x175a20
movq %rax, %r13
movq %r14, %rdi
callq 0xee90c
xorl %eax, %eax
jmp 0xb3c06
leaq 0x2a681f(%rip), %rsi    # 0x35a40d
xorl %r13d, %r13d
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %al
jmp 0xb3c09
movb $0x1, %al
xorl %r13d, %r13d
movq %rbp, %r14
testb %al, %al
jne 0xb3c16
testq %r13, %r13
je 0xb3ce2
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %al, %al
jne 0xb3cb4
movq %r14, 0x20(%rsp)
movl 0xc(%rsp), %edi
subl %ebx, %edi
movslq %ebx, %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
callq 0x14d00b
movq %rax, %rbx
movl 0x8(%r12), %ecx
movl 0xc(%r12), %r8d
movzbl 0x20(%r12), %r9d
movq 0x10(%rsp), %rbp
movq %rbp, (%rsp)
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x16b28f
movq %rax, %r14
testq %rax, %rax
je 0xb3c8f
movq (%r12), %rsi
movq %r14, %rdi
callq 0x14e310
movq %rax, %r12
movq %rax, %rdi
movq %rbp, %rsi
callq 0x16adca
movl %eax, %ebp
jmp 0xb3c97
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x16ac6e
movq %rbx, %rdi
callq 0x16ac6e
movq %r12, %rdi
callq 0x16ac6e
movq 0x20(%rsp), %r14
movq %r15, %rdi
callq 0x105f7d
movq %r14, %rdi
callq 0x10916a
movq %r13, %rdi
callq 0x1758da
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1ce4e
callq 0x1ce15
callq 0x1cddc