// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/tools/gt_extractfeat.c
// Function: gt_extractfeat_runner
static int gt_extractfeat_runner(GT_UNUSED int argc, const char **argv,
                                 int parsed_args, void *tool_arguments,
                                 GtError *err)
{
  GtNodeStream *gff3_in_stream = NULL, *extract_feature_stream = NULL;
  GtExtractFeatArguments *arguments = tool_arguments;
  GtRegionMapping *region_mapping;
  GtTransTable *ttable = NULL;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(arguments);

  if (!had_err) {
    /* create gff3 input stream */
    gff3_in_stream = gt_gff3_in_stream_new_sorted(argv[parsed_args]);
    if (arguments->verbose)
      gt_gff3_in_stream_show_progress_bar((GtGFF3InStream*) gff3_in_stream);

    /* create region mapping */
    region_mapping = gt_seqid2file_region_mapping_new(arguments->s2fi, err);
    if (!region_mapping)
      had_err = -1;
  }

  if (!had_err) {
    /* create extract feature stream */
    extract_feature_stream =
      gt_extract_feature_stream_new(gff3_in_stream,
                                    region_mapping,
                                    gt_str_get(arguments->type),
                                    arguments->join,
                                    arguments->translate,
                                    arguments->seqid,
                                    arguments->target,
                                    arguments->width,
                                    arguments->outfp);

    if (arguments->retainids)
      gt_extract_feature_stream_retain_id_attributes((GtExtractFeatureStream*)
                                                       extract_feature_stream);

    if (arguments->gcode != GT_STANDARD_TRANSLATION_SCHEME) {
      ttable = gt_trans_table_new(arguments->gcode, err);
      if (!ttable) {
        had_err = -1;
      } else {
        gt_extract_feature_stream_set_trans_table((GtExtractFeatureStream*)
                                                       extract_feature_stream,
                                                   ttable);
      }
    }
  }

  if (!had_err) {
    if (arguments->showcoords)
      gt_extract_feature_stream_show_coords((GtExtractFeatureStream*)
                                                        extract_feature_stream);

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

  /* free */
  gt_node_stream_delete(extract_feature_stream);
  gt_node_stream_delete(gff3_in_stream);
  gt_trans_table_delete(ttable);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
testq %r8, %r8
je 0xa8f29
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0xa9047
testq %r14, %r14
je 0xa9042
movslq %ebp, %rax
movq (%r15,%rax,8), %rdi
callq 0x14d0a8
movq %rax, %r15
cmpb $0x1, 0x4(%r14)
jne 0xa8f50
movq %r15, %rdi
callq 0x14ce62
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x17b3bd
testq %rax, %rax
movq %r15, (%rsp)
je 0xa8fc7
movq %rax, %r12
movq 0x10(%r14), %rdi
callq 0x120d23
movzbl (%r14), %ecx
movzbl 0x1(%r14), %r8d
movzbl 0x2(%r14), %r9d
movzbl 0x3(%r14), %r10d
subq $0x8, %rsp
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
pushq 0x30(%r14)
pushq 0x20(%r14)
pushq %r10
callq 0x1469dc
addq $0x20, %rsp
movq %rax, %r12
cmpb $0x1, 0x6(%r14)
jne 0xa8fb6
movq %r12, %rdi
callq 0x146a1c
movl 0x8(%r14), %edi
movb $0x1, %r15b
cmpl $0x1, %edi
jne 0xa8fcc
xorl %r13d, %r13d
jmp 0xa8fef
xorl %r12d, %r12d
jmp 0xa8fe9
movq %rbx, %rsi
callq 0x123cca
testq %rax, %rax
je 0xa8fe9
movq %rax, %r13
movq %r12, %rdi
movq %rax, %rsi
callq 0x146a35
jmp 0xa8fef
xorl %r13d, %r13d
xorl %r15d, %r15d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %r15b, %r15b
movq (%rsp), %r15
je 0xa9019
cmpb $0x1, 0x5(%r14)
jne 0xa900c
movq %r12, %rdi
callq 0x146a54
movq %r12, %rdi
movq %rbx, %rsi
callq 0x16adca
movl %eax, %ebp
movq %r12, %rdi
callq 0x16ac6e
movq %r15, %rdi
callq 0x16ac6e
movq %r13, %rdi
callq 0x124000
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1a929
callq 0x1a8f0