// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_speck.c
// Function: gt_speck_runner
static int gt_speck_runner(int argc, const char **argv, int parsed_args,
                               void *tool_arguments, GtError *err)
{
  GtNodeStream *gff3_in_stream = NULL, *checker_stream = NULL,
               *a_in_stream = NULL, *a_out_stream = NULL,
               *feature_stream = NULL, *sort_stream = NULL,
               *last_stream = NULL;
  GtNodeVisitor *spec_visitor = NULL;
  GtSpecResults *res = NULL;
  GtFeatureIndex *fi = NULL;
  GtTypeChecker *type_checker = NULL;
  GtTimer *t = NULL;
  GtRegionMapping *rm = NULL;
  GtArray *arr = gt_array_new(sizeof (GtFeatureNode*));
  GtStr *prog, *speclib;
  SpeccheckArguments *arguments = tool_arguments;

  int had_err = 0;
  gt_error_check(err);

  res = gt_spec_results_new();
  gt_assert(res);

  if (gt_file_exists(gt_str_get(arguments->format))) {
    speclib = gt_str_ref(arguments->format);
  } else {
    prog = gt_str_new();
    gt_str_append_cstr_nt(prog, gt_error_get_progname(err),
                    gt_cstr_length_up_to_char(gt_error_get_progname(err), ' '));
    speclib = gt_get_gtdata_path(gt_str_get(prog), NULL);
    gt_str_delete(prog);
    gt_str_append_cstr(speclib, "/spec/output_drivers/");
    gt_str_append_str(speclib, arguments->format);

    if (!gt_file_exists(gt_str_get(speclib))) {
      gt_error_set(err, "output driver file \"%s\" does not exist",
                   gt_str_get(speclib));
      had_err = -1;
    }
  }

  if (!had_err) {
    spec_visitor = gt_spec_visitor_new(gt_str_get(arguments->specfile), res,
                                       err);
    if (!spec_visitor) {
      gt_spec_results_delete(res);
      return -1;
    }
  }

  t = gt_timer_new();
  gt_assert(t);

  /* add region mapping if given */
  if (!had_err && gt_seqid2file_option_used(arguments->s2fi)) {
    rm = gt_seqid2file_region_mapping_new(arguments->s2fi, err);
    if (!rm)
      had_err = -1;
    if (!had_err)
      gt_spec_visitor_add_region_mapping((GtSpecVisitor*) spec_visitor, rm);
  }

  /* set type checker if necessary */
  if (!had_err && gt_typecheck_info_option_used(arguments->tci)) {
    type_checker = gt_typecheck_info_create_type_checker(arguments->tci, err);
    if (!type_checker)
      had_err = -1;
    if (!had_err)
      gt_spec_visitor_add_type_checker((GtSpecVisitor*) spec_visitor,
                                       type_checker);
  }

  if (!had_err) {
    /* set runtime error behaviour */
    if (arguments->fail_hard)
      gt_spec_visitor_fail_on_runtime_error((GtSpecVisitor*) spec_visitor);
    else
      gt_spec_visitor_report_runtime_errors((GtSpecVisitor*) spec_visitor);

    /* redirect warnings */
    gt_warning_set_handler(gt_speck_record_warning, res);

    last_stream = gff3_in_stream = gt_gff3_in_stream_new_unsorted(
                                                            argc - parsed_args,
                                                            argv + parsed_args);
    gt_assert(gff3_in_stream);
    gt_gff3_in_stream_enable_tidy_mode((GtGFF3InStream*) gff3_in_stream);

    /* insert sort stream if requested */
    if (arguments->sort) {
      last_stream = sort_stream = gt_sort_stream_new(last_stream);
    }

    /* if -provideindex is given, collect input features and index them first */
    if (arguments->provideindex) {
      fi = gt_feature_index_memory_new();
      gt_assert(fi);

      last_stream = feature_stream = gt_feature_stream_new(last_stream, fi);
      gt_assert(feature_stream);

      last_stream = a_out_stream = gt_array_out_stream_all_new(last_stream, arr,
                                                               err);
      if (!a_out_stream)
        had_err = -1;

      gt_timer_start(t);

      if (!had_err)
        had_err = gt_node_stream_pull(last_stream, err);

      if (!had_err) {
        gt_spec_visitor_add_feature_index((GtSpecVisitor*) spec_visitor,
                                          gt_feature_index_ref(fi));
        last_stream = a_in_stream = gt_array_in_stream_new(arr, NULL, err);
        if (!a_in_stream)
          had_err = -1;
      }
    } else {
      gt_timer_start(t);
    }

    if (!had_err) {
      checker_stream = gt_visitor_stream_new(last_stream, spec_visitor);
      gt_assert(checker_stream);
    }

    /* perform checking  */
    if (!had_err)
      had_err = gt_node_stream_pull(checker_stream, err);

    gt_timer_stop(t);

    /* reset warnings output */
    gt_warning_set_handler(gt_warning_default_handler, NULL);

    /* output results */
    if (!had_err) {
      GtStr *runtime = gt_str_new();
      gt_timer_get_formatted(t, GT_WD ".%06ld", runtime);
      had_err = gt_spec_results_render_template(res, gt_str_get(speclib),
                                                arguments->outfp,
                                                gt_str_get(arguments->specfile),
                                                arguments->verbose,
                                                arguments->colored,
                                                gt_str_get(runtime), err);
      gt_str_delete(runtime);
    }

    if (!had_err && (gt_spec_results_has_runtime_errors(res)
          || gt_spec_results_has_failures(res))) {
      had_err = -2;
    }
  }

  /* free */
  gt_node_stream_delete(gff3_in_stream);
  gt_node_stream_delete(a_in_stream);
  gt_node_stream_delete(a_out_stream);
  gt_node_stream_delete(checker_stream);
  gt_node_stream_delete(feature_stream);
  gt_node_stream_delete(sort_stream);
  gt_spec_results_delete(res);
  gt_feature_index_delete(fi);
  gt_type_checker_delete(type_checker);
  gt_timer_delete(t);
  gt_array_delete(arr);
  gt_str_delete(speclib);

  return had_err;
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movl %edi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movl %edx, 0x104(%rsp)
movq %rcx, 0xf8(%rsp)
movq %r8, 0xf0(%rsp)
movq $0x0, 0xe8(%rsp)
movq $0x0, 0xe0(%rsp)
movq $0x0, 0xd8(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xc8(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xb8(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa8(%rsp)
movq $0x0, 0xa0(%rsp)
movq $0x0, 0x98(%rsp)
movq $0x0, 0x90(%rsp)
movq $0x0, 0x88(%rsp)
movl $0x8, %edi
callq 0x80990
movq %rax, 0x80(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
cmpq $0x0, 0xf0(%rsp)
je 0x76416
movq 0xf0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x763de
jmp 0x76416
movq 0x5c5bbb(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x49fc24(%rip), %rsi    # 0x516013
leaq 0x49fdc9(%rip), %rdx    # 0x5161bf
leaq 0x4b68a5(%rip), %rcx    # 0x52cca2
leaq 0x4b665c(%rip), %r8     # 0x52ca60
movl $0xaf, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x76418
callq 0x1da610
movq %rax, 0xa8(%rsp)
cmpq $0x0, 0xa8(%rsp)
jne 0x76468
movq 0x5c5b69(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x49fbd2(%rip), %rsi    # 0x516013
leaq 0x51d46f(%rip), %rdx    # 0x5938b7
leaq 0x4b6853(%rip), %rcx    # 0x52cca2
leaq 0x4b660a(%rip), %r8     # 0x52ca60
movl $0xb2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x7646a
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
callq 0xde820
testb $0x1, %al
jne 0x76486
jmp 0x7649e
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11e360
movq %rax, 0x70(%rsp)
jmp 0x76586
callq 0x11d4a0
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xd8c20
movq %rax, 0x50(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xd8c20
movq %rax, %rdi
movl $0x20, %esi
callq 0xa3030
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq %rax, %rdx
callq 0x11d830
movq 0x78(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe0950
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rdi
callq 0x11f560
movq 0x70(%rsp), %rdi
leaq 0x4b6791(%rip), %rsi    # 0x52ccb2
callq 0x11d550
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x11d750
movq 0x70(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
callq 0xde820
testb $0x1, %al
jne 0x76584
movq 0xf0(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x70(%rsp), %rdi
callq 0x11dee0
movq 0x40(%rsp), %rdi
movq %rax, %rdx
leaq 0x4b6753(%rip), %rsi    # 0x52ccc8
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x76586
cmpl $0x0, 0x64(%rsp)
jne 0x765e4
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0xa8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
callq 0x1dced0
movq %rax, 0xb0(%rsp)
cmpq $0x0, 0xb0(%rsp)
jne 0x765e2
movq 0xa8(%rsp), %rdi
callq 0x1dbf10
movl $0xffffffff, 0x114(%rsp) # imm = 0xFFFFFFFF
jmp 0x76c19
jmp 0x765e4
callq 0x121340
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x90(%rsp)
jne 0x76634
movq 0x5c599d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x49fa06(%rip), %rsi    # 0x516013
leaq 0x52183f(%rip), %rdx    # 0x597e53
leaq 0x4b6687(%rip), %rcx    # 0x52cca2
leaq 0x4b643e(%rip), %r8     # 0x52ca60
movl $0xd0, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x76636
cmpl $0x0, 0x64(%rsp)
jne 0x766a0
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1d48f0
testb $0x1, %al
jne 0x76651
jmp 0x766a0
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0xf0(%rsp), %rsi
callq 0x1d4960
movq %rax, 0x88(%rsp)
cmpq $0x0, 0x88(%rsp)
jne 0x76682
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x64(%rsp)
jne 0x7669e
movq 0xb0(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x1dcdc0
jmp 0x766a0
cmpl $0x0, 0x64(%rsp)
jne 0x7670a
movq 0x68(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x1f4a40
testb $0x1, %al
jne 0x766bb
jmp 0x7670a
movq 0x68(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0xf0(%rsp), %rsi
callq 0x1f4ad0
movq %rax, 0x98(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x766ec
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x64(%rsp)
jne 0x76708
movq 0xb0(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x1dce60
jmp 0x7670a
cmpl $0x0, 0x64(%rsp)
jne 0x76b75
movq 0x68(%rsp), %rax
testb $0x1, 0x12(%rax)
je 0x7672f
movq 0xb0(%rsp), %rdi
callq 0x1dccd0
jmp 0x7673c
movq 0xb0(%rsp), %rdi
callq 0x1dcc80
movq 0xa8(%rsp), %rsi
leaq 0x4e5(%rip), %rdi       # 0x76c30
callq 0x1268b0
movl 0x110(%rsp), %edi
subl 0x104(%rsp), %edi
movq 0x108(%rsp), %rsi
movslq 0x104(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x1746b0
movq %rax, 0xe8(%rsp)
movq %rax, 0xb8(%rsp)
cmpq $0x0, 0xe8(%rsp)
jne 0x767cd
movq 0x5c5804(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x49f86d(%rip), %rsi    # 0x516013
leaq 0x4a9c71(%rip), %rdx    # 0x52041e
leaq 0x4b64ee(%rip), %rcx    # 0x52cca2
leaq 0x4b62a5(%rip), %r8     # 0x52ca60
movl $0xf2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x767cf
movq 0xe8(%rsp), %rdi
callq 0x1745c0
movq 0x68(%rsp), %rax
testb $0x1, 0x14(%rax)
je 0x76804
movq 0xb8(%rsp), %rdi
callq 0x1da550
movq %rax, 0xc0(%rsp)
movq %rax, 0xb8(%rsp)
movq 0x68(%rsp), %rax
testb $0x1, 0x13(%rax)
je 0x769aa
callq 0x16bc30
movq %rax, 0xa0(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x76863
movq 0x5c576e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x49f7d7(%rip), %rsi    # 0x516013
leaq 0x4ef9df(%rip), %rdx    # 0x566222
leaq 0x4b6458(%rip), %rcx    # 0x52cca2
leaq 0x4b620f(%rip), %r8     # 0x52ca60
movl $0xfd, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x76865
movq 0xb8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0x1710c0
movq %rax, 0xc8(%rsp)
movq %rax, 0xb8(%rsp)
cmpq $0x0, 0xc8(%rsp)
jne 0x768cd
movq 0x5c5704(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x49f76d(%rip), %rsi    # 0x516013
leaq 0x53ed98(%rip), %rdx    # 0x5b5645
leaq 0x4b63ee(%rip), %rcx    # 0x52cca2
leaq 0x4b61a5(%rip), %r8     # 0x52ca60
movl $0x100, %r9d            # imm = 0x100
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x768cf
movq 0xb8(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0xf0(%rsp), %rdx
callq 0x1330b0
movq %rax, 0xd0(%rsp)
movq %rax, 0xb8(%rsp)
cmpq $0x0, 0xd0(%rsp)
jne 0x7690f
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
movq 0x90(%rsp), %rdi
callq 0x1213f0
cmpl $0x0, 0x64(%rsp)
jne 0x7693c
movq 0xb8(%rsp), %rdi
movq 0xf0(%rsp), %rsi
callq 0x1b1f90
movl %eax, 0x64(%rsp)
cmpl $0x0, 0x64(%rsp)
jne 0x769a8
movq 0xb0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x1693e0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x1dcd20
movq 0x80(%rsp), %rdi
movq 0xf0(%rsp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x132d70
movq %rax, 0xd8(%rsp)
movq %rax, 0xb8(%rsp)
cmpq $0x0, 0xd8(%rsp)
jne 0x769a6
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x769a8
jmp 0x769b7
movq 0x90(%rsp), %rdi
callq 0x1213f0
cmpl $0x0, 0x64(%rsp)
jne 0x76a22
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x1f6b70
movq %rax, 0xe0(%rsp)
cmpq $0x0, 0xe0(%rsp)
jne 0x76a1e
movq 0x5c55b3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x49f61c(%rip), %rsi    # 0x516013
leaq 0x4aaa8b(%rip), %rdx    # 0x521489
leaq 0x4b629d(%rip), %rcx    # 0x52cca2
leaq 0x4b6054(%rip), %r8     # 0x52ca60
movl $0x119, %r9d            # imm = 0x119
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x76a20
jmp 0x76a22
cmpl $0x0, 0x64(%rsp)
jne 0x76a42
movq 0xe0(%rsp), %rdi
movq 0xf0(%rsp), %rsi
callq 0x1b1f90
movl %eax, 0x64(%rsp)
movq 0x90(%rsp), %rdi
callq 0x121490
leaq 0xafe8a(%rip), %rdi     # 0x1268e0
xorl %eax, %eax
movl %eax, %esi
callq 0x1268b0
cmpl $0x0, 0x64(%rsp)
jne 0x76b40
callq 0x11d4a0
movq %rax, 0x58(%rsp)
movq 0x90(%rsp), %rdi
movq 0x58(%rsp), %rdx
leaq 0x4b6267(%rip), %rsi    # 0x52ccef
callq 0x1217d0
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x70(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movb 0x10(%rax), %al
movb %al, 0x16(%rsp)
movq 0x68(%rsp), %rax
movb 0x11(%rax), %al
movb %al, 0x17(%rsp)
movq 0x58(%rsp), %rdi
callq 0x11dee0
movb 0x16(%rsp), %r8b
movb 0x17(%rsp), %r9b
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq %rax, %r10
movq 0xf0(%rsp), %rax
andb $0x1, %r8b
andb $0x1, %r9b
movzbl %r8b, %r8d
movzbl %r9b, %r9d
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1db000
movl %eax, 0x64(%rsp)
movq 0x58(%rsp), %rdi
callq 0x11f560
cmpl $0x0, 0x64(%rsp)
jne 0x76b73
movq 0xa8(%rsp), %rdi
callq 0x1daf40
testb $0x1, %al
jne 0x76b6b
movq 0xa8(%rsp), %rdi
callq 0x1dafa0
testb $0x1, %al
jne 0x76b6b
jmp 0x76b73
movl $0xfffffffe, 0x64(%rsp) # imm = 0xFFFFFFFE
jmp 0x76b75
movq 0xe8(%rsp), %rdi
callq 0x1b1cb0
movq 0xd8(%rsp), %rdi
callq 0x1b1cb0
movq 0xd0(%rsp), %rdi
callq 0x1b1cb0
movq 0xe0(%rsp), %rdi
callq 0x1b1cb0
movq 0xc8(%rsp), %rdi
callq 0x1b1cb0
movq 0xc0(%rsp), %rdi
callq 0x1b1cb0
movq 0xa8(%rsp), %rdi
callq 0x1dbf10
movq 0xa0(%rsp), %rdi
callq 0x169460
movq 0x98(%rsp), %rdi
callq 0x1f4420
movq 0x90(%rsp), %rdi
callq 0x121f00
movq 0x80(%rsp), %rdi
callq 0x81f80
movq 0x70(%rsp), %rdi
callq 0x11f560
movl 0x64(%rsp), %eax
movl %eax, 0x114(%rsp)
movl 0x114(%rsp), %eax
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax,%rax)