// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movl %edi, 0x64(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x46275
movq 0x40(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x4623d
jmp 0x46275
movq 0x5f5d5c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4cfdc5(%rip), %rsi    # 0x516013
leaq 0x4cff6a(%rip), %rdx    # 0x5161bf
leaq 0x4dbc55(%rip), %rcx    # 0x521eb1
leaq 0x4dbbf3(%rip), %r8     # 0x521e56
movl $0x59, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x46277
jmp 0x46279
cmpq $0x0, 0x38(%rsp)
jne 0x462b9
movq 0x5f5d18(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4cfd81(%rip), %rsi    # 0x516013
leaq 0x5348c6(%rip), %rdx    # 0x57ab5f
leaq 0x4dbc11(%rip), %rcx    # 0x521eb1
leaq 0x4dbbaf(%rip), %r8     # 0x521e56
movl $0x5a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x462bb
movl $0x8, %edi
callq 0x80990
movq %rax, 0x18(%rsp)
movl 0x54(%rsp), %eax
cmpl 0x64(%rsp), %eax
jge 0x46340
movslq 0x54(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movslq 0x64(%rsp), %rcx
cmpq %rcx, %rax
jae 0x4633e
movq 0x58(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1747b0
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rax
testb $0x1, 0x11(%rax)
je 0x4631a
movq 0x30(%rsp), %rdi
callq 0x1745c0
movq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x462de
jmp 0x46362
xorl %eax, %eax
movl %eax, %edi
callq 0x1747b0
movq %rax, 0x30(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
movq 0x18(%rsp), %rdi
callq 0x1aeb70
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x463b1
movq 0x5f5c20(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4cfc89(%rip), %rsi    # 0x516013
leaq 0x4dbb30(%rip), %rdx    # 0x521ec1
leaq 0x4dbb19(%rip), %rcx    # 0x521eb1
leaq 0x4dbab7(%rip), %r8     # 0x521e56
movl $0x73, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x463b3
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x176d50
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
testb $0x1, 0x10(%rax)
je 0x463e0
movq 0x20(%rsp), %rdi
callq 0x176e50
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x1b1f90
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rdi
callq 0x1b1cb0
movq 0x28(%rsp), %rdi
callq 0x1b1cb0
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x81370
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0x46456
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x80b60
movq (%rax), %rdi
callq 0x1b1cb0
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x46410
movq 0x18(%rsp), %rdi
callq 0x81f80
movl 0xc(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax)