// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %rbx
testq %r8, %r8
je 0xa6ba9
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0xa6cb7
testq %r15, %r15
je 0xa6cb2
movslq %ebp, %rax
movq (%rbx,%rax,8), %rdi
callq 0x145d7c
movq %rax, %rbx
cmpb $0x1, 0x4(%r15)
jne 0xa6bd0
movq %rbx, %rdi
callq 0x145b36
movq 0x18(%r15), %rdi
movq %r14, %rsi
callq 0x172fdd
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xa6c45
movq %rax, %r12
movq 0x10(%r15), %rdi
callq 0x11b0a1
movzbl (%r15), %ecx
movzbl 0x1(%r15), %r8d
movzbl 0x2(%r15), %r9d
movzbl 0x3(%r15), %r10d
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
pushq 0x30(%r15)
pushq 0x20(%r15)
pushq %r10
callq 0x13f770
addq $0x20, %rsp
movq %rax, %r12
cmpb $0x1, 0x6(%r15)
jne 0xa6c37
movq %r12, %rdi
callq 0x13f7b0
movl 0x8(%r15), %edi
cmpl $0x1, %edi
jne 0xa6c4d
xorl %r13d, %r13d
jmp 0xa6c68
xorl %r13d, %r13d
xorl %r12d, %r12d
jmp 0xa6c84
movq %r14, %rsi
callq 0x11dfba
testq %rax, %rax
je 0xa6cad
movq %rax, %r13
movq %r12, %rdi
movq %rax, %rsi
callq 0x13f7c9
cmpb $0x1, 0x5(%r15)
jne 0xa6c77
movq %r12, %rdi
callq 0x13f7e8
movq %r12, %rdi
movq %r14, %rsi
callq 0x162f5d
movl %eax, %ebp
movq %r12, %rdi
callq 0x162dee
movq %rbx, %rdi
callq 0x162dee
movq %r13, %rdi
callq 0x11e318
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
jmp 0xa6c84
callq 0x1a866
callq 0x1a82d