// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/tools/gt_merge.c
// Function: gt_merge_runner
static int gt_merge_runner(int argc, const char **argv, int parsed_args,
                           void *tool_arguments, GtError *err)
{
  MergeArguments *arguments = tool_arguments;
  GtNodeStream *gff3_in_stream,
                *merge_stream,
                *gff3_out_stream;
  GtArray *genome_streams;
  GtUword i;
  int had_err;

  gt_error_check(err);
  gt_assert(arguments);

  /* alloc */
  genome_streams = gt_array_new(sizeof (GtNodeStream*));

  /* XXX: check for multiple specification of '-' */

  /* create an gff3 input stream for each given file */
  if (parsed_args < argc) {
    /* we got files to open */
    for (i = parsed_args; i < argc; i++) {
      gff3_in_stream = gt_gff3_in_stream_new_sorted(argv[i]);
      if (arguments->tidy)
        gt_gff3_in_stream_enable_tidy_mode((GtGFF3InStream*) gff3_in_stream);
      gt_array_add(genome_streams, gff3_in_stream);
    }
   }
   else {
     /* use stdin */
     gff3_in_stream = gt_gff3_in_stream_new_sorted(NULL);
     gt_array_add(genome_streams, gff3_in_stream);
   }

  /* create a merge stream */
  merge_stream = gt_merge_stream_new(genome_streams);
  gt_assert(merge_stream);

  /* create a gff3 output stream */
  gff3_out_stream = gt_gff3_out_stream_new(merge_stream, arguments->outfp);
  if (arguments->retainids)
    gt_gff3_out_stream_retain_id_attributes((GtGFF3OutStream*) gff3_out_stream);

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

  /* free */
  gt_node_stream_delete(gff3_out_stream);
  gt_node_stream_delete(merge_stream);
  for (i = 0; i < gt_array_size(genome_streams); i++)
    gt_node_stream_delete(*(GtNodeStream**) gt_array_get(genome_streams, i));
  gt_array_delete(genome_streams);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r12
movl %edi, %r13d
testq %r8, %r8
je 0xb09bc
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0xb0ae6
testq %r15, %r15
je 0xb0adc
movq %rbx, 0x10(%rsp)
movl $0x8, %edi
callq 0xd214c
movq %rax, %rbx
cmpl %r13d, %ebp
jge 0xb0a20
jae 0xb0a3c
movslq %r13d, %r14
movslq %ebp, %rbp
leaq 0x8(%rsp), %r13
movq (%r12,%rbp,8), %rdi
callq 0x145d7c
movq %rax, 0x8(%rsp)
cmpb $0x1, 0x11(%r15)
jne 0xb0a06
movq %rax, %rdi
callq 0x145c94
movl $0x8, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xd2410
incq %rbp
cmpq %r14, %rbp
jb 0xb09e9
jmp 0xb0a3c
xorl %edi, %edi
callq 0x145d7c
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movl $0x8, %edx
movq %rbx, %rdi
callq 0xd2410
movq %rbx, %rdi
callq 0x16167d
testq %rax, %rax
je 0xb0ae1
movq %rax, %r12
movq 0x8(%r15), %rsi
movq %rax, %rdi
callq 0x146fc0
movq %rax, %r13
cmpb $0x1, 0x10(%r15)
movq 0x10(%rsp), %r14
jne 0xb0a73
movq %r13, %rdi
callq 0x14703c
movq %r13, %rdi
movq %r14, %rsi
callq 0x162f5d
movl %eax, %ebp
movq %r13, %rdi
callq 0x162dee
movq %r12, %rdi
callq 0x162dee
movq %rbx, %rdi
callq 0xd24e0
testq %rax, %rax
je 0xb0ac3
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd2207
movq (%rax), %rdi
callq 0x162dee
incq %r14
movq %rbx, %rdi
callq 0xd24e0
cmpq %rax, %r14
jb 0xb0aa0
movq %rbx, %rdi
callq 0xd2938
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1c8bb
callq 0x1c884
callq 0x1c84d
nop