// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/gtr.c
// Function: gtr_run
int gtr_run(GtR *gtr, int argc, const char **argv, GtError *err)
{
  GtToolfunc toolfunc;
  GtTool *tool = NULL;
  char **nargv = NULL;
  void *mem, *map;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(gtr);
  if (gtr->debug)
    enable_logging(gt_str_get(gtr->debugfp), &gtr->logfp);
  if (gtr->quiet)
    gt_warning_disable();
  gtr->seed = gt_ya_rand_init(gtr->seed);
  gt_log_log("seed=%u", gtr->seed);
  if (gtr->list)
    return list_tools(gtr);
  if (gt_str_length(gtr->manoutdir) > 0)
    return create_manpages(gtr, gt_str_get(gtr->manoutdir), err);
  if (gtr->check64bit)
    return check64bit();
  if (gtr->test)
    return run_tests(gtr, err);
  if (gt_str_length(gtr->testspacepeak)) {
    mem = gt_malloc(1 << 26); /* alloc 64 MB */;
    map = gt_fa_xmmap_read(gt_str_get(gtr->testspacepeak), NULL);
    gt_fa_xmunmap(map);
    gt_free(mem);
  }
  if (argc == 0 && !gtr->interactive) {
    gt_error_set(err, "neither tool nor script specified; option -help lists "
                      "possible tools");
    had_err = -1;
  }
  if (!had_err && argc) {
    if (!gtr->tools || !gt_toolbox_has_tool(gtr->tools, argv[0])) {
      /* no tool found -> try to open script */
      if (gt_file_exists(argv[0])) {
        /* export script */
        gt_lua_set_script_dir(gtr->L, argv[0]);
        /* run script */
        nargv = gt_cstr_array_prefix_first(argv, gt_error_get_progname(err));
        gt_lua_set_arg(gtr->L, nargv[0], (const char**) nargv+1);
        if (luaL_dofile(gtr->L, argv[0])) {
          /* error */
          gt_assert(lua_isstring(gtr->L, -1)); /* error message on top */
          gt_error_set(err, "could not execute script %s",
                       lua_tostring(gtr->L, -1));
          had_err = -1;
          lua_pop(gtr->L, 1); /* pop error message */
        }
      }
      else {
        GtStr *extpath, *extname;
        extpath = gt_str_new();
        extname = gt_str_new_cstr("gt-");
        gt_str_append_cstr(extname, argv[0]);
        had_err = gt_file_find_in_path(extpath, gt_str_get(extname), err);
        if (!had_err && gt_str_length(extpath) > 0) {
          extern char **environ;
          struct stat sb;
          nargv = gt_cstr_array_dup(argv);
          gt_str_append_cstr(extpath, "/");
          gt_str_append_str(extpath, extname);
          if (!(stat(gt_str_get(extpath), &sb) == 0 && sb.st_mode & S_IXUSR) ||
               execve(gt_str_get(extpath), nargv, environ)) {
            gt_error_set(err, "could not execute userscript %s",
                         gt_str_get(extpath));
            gt_cstr_array_delete(nargv);
            had_err = -1;
          }
        } else {
          /* neither tool nor script found */
          gt_error_set(err, "neither tool nor script '%s' found; option -help "
                            "lists possible tools", argv[0]);
          had_err = -1;
        }
        gt_str_delete(extpath);
        gt_str_delete(extname);
      }
    }
    else {
      /* run tool */
      if (!(toolfunc = gt_toolbox_get(gtr->tools, argv[0]))) {
        tool = gt_toolbox_get_tool(gtr->tools, argv[0]);
        gt_assert(tool);
      }
      nargv = gt_cstr_array_prefix_first(argv, gt_error_get_progname(err));
      gt_error_set_progname(err, nargv[0]);
      if (toolfunc)
        had_err = toolfunc(argc, (const char**) nargv, err);
      else
        had_err = gt_tool_run(tool, argc, (const char**) nargv, err);
    }
  }
  gt_cstr_array_delete(nargv);
  if (!had_err && gtr->interactive) {
    gt_showshortversion(gt_error_get_progname(err));
    gt_lua_set_arg(gtr->L, gt_error_get_progname(err), argv);
    run_interactive_lua_interpreter(gtr->L);
  }
  if (had_err)
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2028, %rsp           # imm = 0x2028
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
testq %rcx, %rcx
je 0x9a2cc
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0x9aabb
testq %r14, %r14
je 0x9aab6
cmpb $0x1, 0x3(%r14)
jne 0x9a34f
movq 0x10(%r14), %rdi
callq 0x120d23
movq %rax, %rbx
callq 0x108dea
leaq 0x32e2c7(%rip), %rsi    # 0x3c85bb
movq %rbx, %rdi
callq 0x17a40
testl %eax, %eax
je 0x9a337
leaq 0x2b41ce(%rip), %rsi    # 0x34e4d5
movq %rbx, %rdi
callq 0x17a40
testl %eax, %eax
je 0x9a340
leaq 0x302717(%rip), %rsi    # 0x39ca31
leaq 0x2b3e24(%rip), %rdx    # 0x34e145
movq %rbx, %rdi
movl $0x1a7, %ecx            # imm = 0x1A7
callq 0x101dbd
movq %rax, %rdi
movq %rax, 0x50(%r14)
jmp 0x9a34a
movq 0x429baa(%rip), %rax    # 0x4c3ee8
jmp 0x9a347
movq 0x429c39(%rip), %rax    # 0x4c3f80
movq (%rax), %rdi
callq 0x108eb5
cmpb $0x1, 0x2(%r14)
jne 0x9a35b
callq 0x1254eb
movl 0x8(%r14), %edi
callq 0x125c2c
movl %eax, 0x8(%r14)
leaq 0x2b3e9c(%rip), %rdi    # 0x34e20b
movl %eax, %esi
xorl %eax, %eax
callq 0x108e02
cmpb $0x1, 0x4(%r14)
jne 0x9a4dc
callq 0x1208f8
movq %rax, %rbx
movl $0xa, %edi
callq 0x17a20
leaq 0x2b4300(%rip), %rdi    # 0x34e69c
callq 0x17bd0
movq %r14, %rdi
callq 0x99fca
movq %rax, %r15
movq %rax, %rdi
callq 0x10ff5a
leaq 0x2b423a(%rip), %rdi    # 0x34e5f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movq %r15, %rdi
callq 0x10f2d0
movq 0x20(%r14), %rdi
callq 0x123664
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movl $0x20, %edx
callq 0x123724
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x12375f
testb %al, %al
je 0x9a4c5
leaq 0x20(%rsp), %r13
leaq 0x10(%rsp), %r12
movq 0x10(%rsp), %rdi
callq 0x1235c4
movq %rax, %r15
movq %rbx, %rdi
callq 0x120d23
movq 0x18(%rsp), %r9
movl $0x2000, %esi           # imm = 0x2000
movq %r13, %rdi
leaq 0x2b41c5(%rip), %rdx    # 0x34e5fb
movl $0x20, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x17c60
movq %r13, %rdi
callq 0xe8760
movq %rax, %rbp
movq %rax, %rdi
movl $0x20, %esi
movl $0x5f, %edx
callq 0xe87ec
movl $0xa, %edi
callq 0x17a20
leaq 0x2b4191(%rip), %rdi    # 0x34e604
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x17070
movq %r15, %rdi
callq 0x10ff5a
leaq 0x2b4166(%rip), %rdi    # 0x34e5f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movq %rbp, %rdi
leaq 0x2b3ca2(%rip), %rsi    # 0x34e145
movl $0x11f, %edx            # imm = 0x11F
callq 0x109670
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
movq %r12, %rdx
callq 0x12375f
testb %al, %al
jne 0x9a40d
movq %r14, %rdi
callq 0x1238a8
movq %rbx, %rdi
callq 0x121b03
xorl %ebx, %ebx
jmp 0x9aa9a
movq 0x30(%r14), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x9a634
movq 0x30(%r14), %rdi
callq 0x120d23
movq %rax, %r13
callq 0x1208f8
movq %rax, 0x8(%rsp)
testq %r12, %r12
je 0x9a519
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0x9aac0
movq %r12, %r15
leaq 0x42f05d(%rip), %r12    # 0x4c9580
movb $0x1, (%r12)
movq %r14, %rdi
callq 0x99fca
movq %rax, %rbx
leaq 0x354583(%rip), %rsi    # 0x3eeabd
movq %r13, %rdi
movq %rax, %rdx
movq %r15, %rcx
callq 0x9ab7d
movl %eax, %ebp
movq %rbx, %rdi
callq 0x10f2d0
movl $0x1, %ebx
testl %ebp, %ebp
jne 0x9a620
movq 0x20(%r14), %rdi
callq 0x123664
movq %rax, %r14
movq %rax, %rdi
movq 0x8(%rsp), %rsi
movl $0x20, %edx
callq 0x123724
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x12375f
xorl %ebx, %ebx
testb %al, %al
je 0x9a611
movq %r15, %r12
leaq 0x20(%rsp), %rbp
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rdi
callq 0x1235c4
movq %rax, %rbx
movq %r15, %rdi
callq 0x120d23
movq 0x18(%rsp), %r9
movl $0x2000, %esi           # imm = 0x2000
movq %rbp, %rdi
leaq 0x2b4030(%rip), %rdx    # 0x34e5fb
movl $0x20, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x17c60
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r12, %rcx
callq 0x9ab7d
movl %eax, %ebx
testl %eax, %eax
jne 0x9a607
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x12375f
testb %al, %al
jne 0x9a5a2
testl %ebx, %ebx
movl $0x0, %ebx
setne %bl
movq %r14, %rdi
callq 0x1238a8
leaq 0x42ef60(%rip), %r12    # 0x4c9580
movq 0x8(%rsp), %rdi
callq 0x121b03
movb $0x0, (%r12)
jmp 0x9aa9a
xorl %ebx, %ebx
cmpb $0x0, 0x5(%r14)
jne 0x9aa9a
cmpb $0x1, (%r14)
jne 0x9a6e0
movl $0x0, 0x20(%rsp)
testq %r12, %r12
je 0x9a668
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0x9aac5
movl 0x8(%r14), %esi
leaq 0x2b4003(%rip), %rdi    # 0x34e676
xorl %eax, %eax
callq 0x17070
movq %r12, %rdi
callq 0x105b56
cmpq $0x0, 0x28(%r14)
je 0x9a8a2
movq 0x38(%r14), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x9a882
movq 0x38(%r14), %rdi
callq 0x120d23
movq %rax, %rbx
movq 0x28(%r14), %rdi
movq %rax, %rsi
callq 0x105a11
testq %rax, %rax
je 0x9a910
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rcx
callq 0x12532c
testl %eax, %eax
je 0x9a8a2
callq 0x1829e
movq 0x18(%r14), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x9a743
leaq 0x2b3a50(%rip), %rbx    # 0x34e145
movl $0x4000000, %edi        # imm = 0x4000000
movq %rbx, %rsi
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x1092b2
movq %r12, %r13
movq %rax, %r12
movq 0x18(%r14), %rdi
callq 0x120d23
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movl $0x1c5, %ecx            # imm = 0x1C5
callq 0x1028fd
movq %rax, %rdi
callq 0x102b12
movq %r12, %rdi
movq %r13, %r12
movq %rbx, %rsi
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x109670
xorl %r13d, %r13d
movb $0x1, %bl
testl %ebp, %ebp
jne 0x9a76c
cmpb $0x0, 0x1(%r14)
jne 0x9a76c
leaq 0x2b3ab9(%rip), %rsi    # 0x34e213
xorl %ebx, %ebx
movq %r12, %rdi
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testl %ebp, %ebp
sete %al
xorb $0x1, %bl
orb %al, %bl
jne 0x9a7b3
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0x9a7bd
movq (%r15), %rsi
callq 0x123a17
testb %al, %al
je 0x9a7bd
movq 0x20(%r14), %rdi
movq (%r15), %rsi
callq 0x123a87
movq %rax, %r13
testq %rax, %rax
je 0x9a9e3
movq $0x0, 0x8(%rsp)
jmp 0x9a9fd
movq %r12, %rbp
xorl %ebx, %ebx
jmp 0x9aa4b
movq (%r15), %rdi
callq 0x10415c
testb %al, %al
je 0x9a8ae
movq 0x40(%r14), %rdi
movq (%r15), %rsi
callq 0x16401e
movq %r12, %rbp
movq %r12, %rdi
callq 0x101b22
movq %r15, %rdi
movq %rax, %rsi
callq 0xe8b1a
movq %rax, %rbx
movq 0x40(%r14), %rdi
movq (%rax), %rsi
leaq 0x8(%rax), %rdx
callq 0x1640c4
movq 0x40(%r14), %rdi
movq (%r15), %rsi
callq 0x23180b
testl %eax, %eax
jne 0x9a82f
movq 0x40(%r14), %rdi
xorl %r13d, %r13d
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x22f092
testl %eax, %eax
je 0x9aa4b
movq 0x40(%r14), %rdi
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x22d88c
testl %eax, %eax
je 0x9aacf
movq 0x40(%r14), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x22db9e
leaq 0x2b3a0f(%rip), %rsi    # 0x34e271
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1019cf
movq 0x40(%r14), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x22d42e
jmp 0x9aa4b
movq 0x28(%r14), %rdi
leaq 0x8aa9f(%rip), %rsi     # 0x12532c
leaq 0x20(%rsp), %rdx
movq %r12, %rcx
callq 0x105b27
testl %eax, %eax
jne 0x9aaca
xorl %ebx, %ebx
cmpl $0x0, 0x20(%rsp)
jmp 0x9aa97
callq 0x1208f8
movq %rax, %rbx
leaq 0x2b39d0(%rip), %rdi    # 0x34e28d
callq 0x120955
movq %rax, %r13
movq (%r15), %rsi
movq %rax, %rdi
callq 0x12097f
movq %r13, %rdi
callq 0x120d23
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rbp
movq %r12, %rdx
movq %rbx, %r12
callq 0x104343
testl %eax, %eax
movq %r13, 0x8(%rsp)
je 0x9a92e
movq (%r15), %rdx
leaq 0x2b39b2(%rip), %rsi    # 0x34e2b1
xorl %ebx, %ebx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x9a9c9
leaq 0x2b3d71(%rip), %rsi    # 0x34e688
movq %r12, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0x1, %ebx
jmp 0x9aa9a
movq %r12, %rdi
callq 0x120d4c
testq %rax, %rax
je 0x9a8f5
movq %r15, %rdi
callq 0xe8aa0
movq %rax, %rbx
leaq 0x2c965e(%rip), %rsi    # 0x363fab
movq %r12, %rdi
callq 0x12097f
movq %r12, %rdi
movq %r13, %rsi
callq 0x120a43
movq %r12, %rdi
callq 0x120d23
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x18000
testl %eax, %eax
jne 0x9a9a5
testb $0x40, 0x38(%rsp)
je 0x9a9a5
movq %r12, %rdi
callq 0x120d23
movq 0x429629(%rip), %rcx    # 0x4c3fb8
movq (%rcx), %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x17d50
testl %eax, %eax
je 0x9aaae
movq %r12, %rdi
callq 0x120d23
leaq 0x2b38dd(%rip), %rsi    # 0x34e291
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1019cf
movq %rbx, %rdi
callq 0xe8d46
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %r12, %rdi
callq 0x121b03
movq 0x8(%rsp), %rdi
callq 0x121b03
jmp 0x9aa4b
movq 0x20(%r14), %rdi
movq (%r15), %rsi
callq 0x1239f1
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x9aad4
movq %r12, %rdi
callq 0x101b22
movq %r15, %rdi
movq %rax, %rsi
callq 0xe8b1a
movq %rax, %rbx
movq (%rax), %rsi
movq %r12, %rdi
callq 0x101ada
testq %r13, %r13
je 0x9aa33
movl %ebp, %edi
movq %rbx, %rsi
movq %r12, %rbp
movq %r12, %rdx
callq *%r13
jmp 0x9aa48
movq 0x8(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r12, %rbp
movq %r12, %rcx
callq 0x123470
movl %eax, %r13d
movq %rbx, %rdi
callq 0xe8d46
testl %r13d, %r13d
jne 0x9aa92
cmpb $0x1, 0x1(%r14)
jne 0x9aa92
movq %rbp, %rdi
callq 0x101b22
movq %rax, %rdi
callq 0x125430
movq 0x40(%r14), %rbx
movq %rbp, %rdi
callq 0x101b22
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1640c4
movq 0x40(%r14), %rdi
callq 0x9bbf8
xorl %ebx, %ebx
testl %r13d, %r13d
setne %bl
movl %ebx, %eax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
jmp 0x9a9cf
callq 0x18310
callq 0x18181
callq 0x181ba
callq 0x18265
callq 0x182d7
callq 0x1822c
callq 0x181f3