// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x128(%rsp)
movl %esi, 0x124(%rsp)
movq %rdx, 0x118(%rsp)
movq %rcx, 0x110(%rsp)
movq $0x0, 0x100(%rsp)
movq $0x0, 0xf8(%rsp)
movl $0x0, 0xe4(%rsp)
cmpq $0x0, 0x110(%rsp)
je 0x1abbf
movq 0x110(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1ab87
jmp 0x1abbf
movq 0x621412(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4fb47b(%rip), %rsi    # 0x516013
leaq 0x4fb620(%rip), %rdx    # 0x5161bf
leaq 0x4fb65d(%rip), %rcx    # 0x516203
leaq 0x4fb598(%rip), %r8     # 0x516145
movl $0x1b3, %r9d            # imm = 0x1B3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1abc1
jmp 0x1abc3
cmpq $0x0, 0x128(%rsp)
jne 0x1ac06
movq 0x6213cb(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4fb434(%rip), %rsi    # 0x516013
leaq 0x4fb601(%rip), %rdx    # 0x5161e7
leaq 0x4fb616(%rip), %rcx    # 0x516203
leaq 0x4fb551(%rip), %r8     # 0x516145
movl $0x1b4, %r9d            # imm = 0x1B4
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1ac08
movq 0x128(%rsp), %rax
testb $0x1, 0x3(%rax)
je 0x1ac3b
movq 0x128(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x128(%rsp), %rsi
addq $0x50, %rsi
callq 0x1b3a0
movq 0x128(%rsp), %rax
testb $0x1, 0x2(%rax)
je 0x1ac4e
callq 0x126890
movq 0x128(%rsp), %rax
movl 0x8(%rax), %edi
callq 0x127f20
movl %eax, %ecx
movq 0x128(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x128(%rsp), %rax
movl 0x8(%rax), %esi
leaq 0x4fb58e(%rip), %rdi    # 0x51620b
movb $0x0, %al
callq 0xe7740
movq 0x128(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x1acab
movq 0x128(%rsp), %rdi
callq 0x1b440
movl %eax, 0x134(%rsp)
jmp 0x1b38a
movq 0x128(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
jbe 0x1ad01
movq 0x128(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x128(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11dee0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0x110(%rsp), %rdx
callq 0x1b640
movl %eax, 0x134(%rsp)
jmp 0x1b38a
movq 0x128(%rsp), %rax
testb $0x1, 0x5(%rax)
je 0x1ad20
callq 0x1b890
movl %eax, 0x134(%rsp)
jmp 0x1b38a
movq 0x128(%rsp), %rax
testb $0x1, (%rax)
je 0x1ad4e
movq 0x128(%rsp), %rdi
movq 0x110(%rsp), %rsi
callq 0x1b8a0
movl %eax, 0x134(%rsp)
jmp 0x1b38a
movq 0x128(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
je 0x1adda
movl $0x4000000, %edi        # imm = 0x4000000
leaq 0x4fb3d4(%rip), %rsi    # 0x516145
movl $0x1c4, %edx            # imm = 0x1C4
callq 0xe80f0
movq %rax, 0xf0(%rsp)
movq 0x128(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x4fb3a3(%rip), %rdx    # 0x516145
movl $0x1c5, %ecx            # imm = 0x1C5
callq 0xdace0
movq %rax, 0xe8(%rsp)
movq 0xe8(%rsp), %rdi
callq 0xdb2a0
movq 0xf0(%rsp), %rdi
leaq 0x4fb375(%rip), %rsi    # 0x516145
movl $0x1c7, %edx            # imm = 0x1C7
callq 0xe88c0
cmpl $0x0, 0x124(%rsp)
jne 0x1ae13
movq 0x128(%rsp), %rax
testb $0x1, 0x1(%rax)
jne 0x1ae13
movq 0x110(%rsp), %rdi
leaq 0x4fb412(%rip), %rsi    # 0x516213
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xe4(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0xe4(%rsp)
jne 0x1b2ea
cmpl $0x0, 0x124(%rsp)
je 0x1b2ea
movq 0x128(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1ae62
movq 0x128(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x118(%rsp), %rax
movq (%rax), %rsi
callq 0x1237d0
testb $0x1, %al
jne 0x1b1aa
movq 0x118(%rsp), %rax
movq (%rax), %rdi
callq 0xde820
testb $0x1, %al
jne 0x1ae7b
jmp 0x1afec
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x118(%rsp), %rax
movq (%rax), %rsi
callq 0x1a4050
movq 0x118(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x110(%rsp), %rdi
callq 0xd8c20
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0xa3590
movq %rax, 0xf8(%rsp)
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0xf8(%rsp), %rax
movq (%rax), %rsi
movq 0xf8(%rsp), %rdx
addq $0x8, %rdx
callq 0x1a4160
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x118(%rsp), %rax
movq (%rax), %rsi
callq 0x33b630
cmpl $0x0, %eax
jne 0x1af32
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rdi
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %ecx, %esi
callq 0x3375c0
cmpl $0x0, %eax
je 0x1afe7
jmp 0x1af34
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3347b0
cmpl $0x0, %eax
jne 0x1af87
movq 0x62104a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4fb0b3(%rip), %rsi    # 0x516013
leaq 0x4fb2f1(%rip), %rdx    # 0x516258
leaq 0x4fb295(%rip), %rcx    # 0x516203
leaq 0x4fb1d0(%rip), %r8     # 0x516145
movl $0x1d9, %r9d            # imm = 0x1D9
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1af89
movq 0x110(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x334f50
movq 0x28(%rsp), %rdi
movq %rax, %rdx
leaq 0x4fb2b2(%rip), %rsi    # 0x516271
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xe4(%rsp) # imm = 0xFFFFFFFF
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x333ed0
jmp 0x1b1a5
callq 0x11d4a0
movq %rax, 0xd8(%rsp)
leaq 0x4fb28d(%rip), %rdi    # 0x51628d
callq 0x11d510
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rdi
movq 0x118(%rsp), %rax
movq (%rax), %rsi
callq 0x11d550
movq 0xd8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x11dee0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movq 0x110(%rsp), %rdx
callq 0xdeca0
movl %eax, 0xe4(%rsp)
cmpl $0x0, 0xe4(%rsp)
jne 0x1b15f
movq 0xd8(%rsp), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
jbe 0x1b15f
movq 0x118(%rsp), %rdi
callq 0xa3480
movq %rax, 0xf8(%rsp)
movq 0xd8(%rsp), %rdi
leaq 0x511042(%rip), %rsi    # 0x52c0e6
callq 0x11d550
movq 0xd8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x11d750
movq 0xd8(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x19f08
cmpl $0x0, %eax
jne 0x1b115
movl 0x58(%rsp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x1b115
movq 0xd8(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0xf8(%rsp), %rsi
movq 0x620ec0(%rip), %rax    # 0x63bfc8
movq (%rax), %rdx
callq 0x19c70
cmpl $0x0, %eax
je 0x1b15d
movq 0x110(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x11dee0
movq 0x18(%rsp), %rdi
movq %rax, %rdx
leaq 0x4fb153(%rip), %rsi    # 0x516291
movb $0x0, %al
callq 0xd88c0
movq 0xf8(%rsp), %rdi
callq 0xa3950
movl $0xffffffff, 0xe4(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b18b
movq 0x110(%rsp), %rdi
movq 0x118(%rsp), %rax
movq (%rax), %rdx
leaq 0x4fb138(%rip), %rsi    # 0x5162b1
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xe4(%rsp) # imm = 0xFFFFFFFF
movq 0xd8(%rsp), %rdi
callq 0x11f560
movq 0xd0(%rsp), %rdi
callq 0x11f560
jmp 0x1b2e8
movq 0x128(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x118(%rsp), %rax
movq (%rax), %rsi
callq 0x123900
movq %rax, 0x108(%rsp)
cmpq $0x0, %rax
jne 0x1b23f
movq 0x128(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x118(%rsp), %rax
movq (%rax), %rsi
callq 0x123730
movq %rax, 0x100(%rsp)
cmpq $0x0, 0x100(%rsp)
jne 0x1b23b
movq 0x620d96(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4fadff(%rip), %rsi    # 0x516013
leaq 0x529814(%rip), %rdx    # 0x544a2f
leaq 0x4fafe1(%rip), %rcx    # 0x516203
leaq 0x4faf1c(%rip), %r8     # 0x516145
movl $0x201, %r9d            # imm = 0x201
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1b23d
jmp 0x1b23f
movq 0x118(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x110(%rsp), %rdi
callq 0xd8c20
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0xa3590
movq %rax, 0xf8(%rsp)
movq 0x110(%rsp), %rdi
movq 0xf8(%rsp), %rax
movq (%rax), %rsi
callq 0xd8b80
cmpq $0x0, 0x108(%rsp)
je 0x1b2bb
movq 0x108(%rsp), %rax
movl 0x124(%rsp), %edi
movq 0xf8(%rsp), %rsi
movq 0x110(%rsp), %rdx
callq *%rax
movl %eax, 0xe4(%rsp)
jmp 0x1b2e6
movq 0x100(%rsp), %rdi
movl 0x124(%rsp), %esi
movq 0xf8(%rsp), %rdx
movq 0x110(%rsp), %rcx
callq 0x122bc0
movl %eax, 0xe4(%rsp)
jmp 0x1b2e8
jmp 0x1b2ea
movq 0xf8(%rsp), %rdi
callq 0xa3950
cmpl $0x0, 0xe4(%rsp)
jne 0x1b368
movq 0x128(%rsp), %rax
testb $0x1, 0x1(%rax)
je 0x1b368
movq 0x110(%rsp), %rdi
callq 0xd8c20
movq %rax, %rdi
callq 0x1267b0
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x110(%rsp), %rdi
callq 0xd8c20
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x118(%rsp), %rdx
callq 0x1a4160
movq 0x128(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x1d450
cmpl $0x0, 0xe4(%rsp)
je 0x1b37f
movl $0x1, 0x134(%rsp)
jmp 0x1b38a
movl $0x0, 0x134(%rsp)
movl 0x134(%rsp), %eax
addq $0x138, %rsp            # imm = 0x138
retq
nopl (%rax)