// File: /workspace/github_c_makefile_star2_O3/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, %r13
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
testq %rcx, %rcx
je 0x98121
movq %r13, %rdi
callq 0xfcc32
testb %al, %al
jne 0x988ed
testq %r14, %r14
je 0x988e8
cmpb $0x1, 0x3(%r14)
jne 0x981a4
movq 0x10(%r14), %rdi
callq 0x11b0a1
movq %rax, %rbx
callq 0x103d5a
leaq 0x326df2(%rip), %rsi    # 0x3bef3b
movq %rbx, %rdi
callq 0x17a40
testl %eax, %eax
je 0x9818c
leaq 0x2ad379(%rip), %rsi    # 0x3454d5
movq %rbx, %rdi
callq 0x17a40
testl %eax, %eax
je 0x98195
leaq 0x2fb446(%rip), %rsi    # 0x3935b5
leaq 0x2acfcf(%rip), %rdx    # 0x345145
movq %rbx, %rdi
movl $0x1a7, %ecx            # imm = 0x1A7
callq 0xfcf55
movq %rax, %rdi
movq %rax, 0x50(%r14)
jmp 0x9819f
movq 0x420d45(%rip), %rax    # 0x4b8ed8
jmp 0x9819c
movq 0x420de4(%rip), %rax    # 0x4b8f80
movq (%rax), %rdi
callq 0x103e25
cmpb $0x1, 0x2(%r14)
jne 0x981b0
callq 0x11f72f
movl 0x8(%r14), %edi
callq 0x11fe6c
movl %eax, 0x8(%r14)
leaq 0x2ad047(%rip), %rdi    # 0x34520b
movl %eax, %esi
xorl %eax, %eax
callq 0x103d72
cmpb $0x1, 0x4(%r14)
jne 0x98331
callq 0x11ac6c
movq %rax, %rbx
movl $0xa, %edi
callq 0x17a20
leaq 0x2ad4ab(%rip), %rdi    # 0x34569c
callq 0x17bd0
movq %r14, %rdi
callq 0x97e1f
movq %rax, %r15
movq %rax, %rdi
callq 0x10ad3e
leaq 0x2ad3e5(%rip), %rdi    # 0x3455f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movq %r15, %rdi
callq 0x10a0b4
movq 0x20(%r14), %rdi
callq 0x11d954
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movl $0x20, %edx
callq 0x11da14
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x11da4f
testb %al, %al
je 0x9831a
leaq 0x20(%rsp), %r12
leaq 0x10(%rsp), %rbp
movq 0x10(%rsp), %rdi
callq 0x11d8ad
movq %rax, %r15
movq %rbx, %rdi
callq 0x11b0a1
movq 0x18(%rsp), %r9
movl $0x2000, %esi           # imm = 0x2000
movq %r12, %rdi
leaq 0x2ad370(%rip), %rdx    # 0x3455fb
movl $0x20, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x17c60
movq %r12, %rdi
callq 0xe4290
movq %rax, %r13
movq %rax, %rdi
movl $0x20, %esi
movl $0x5f, %edx
callq 0xe431c
movl $0xa, %edi
callq 0x17a20
leaq 0x2ad33c(%rip), %rdi    # 0x345604
movq %r13, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x17070
movq %r15, %rdi
callq 0x10ad3e
leaq 0x2ad311(%rip), %rdi    # 0x3455f5
movq %rax, %rsi
xorl %eax, %eax
callq 0x17070
movq %r13, %rdi
leaq 0x2ace4d(%rip), %rsi    # 0x345145
movl $0x11f, %edx            # imm = 0x11F
callq 0x1045eb
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
movq %rbp, %rdx
callq 0x11da4f
testb %al, %al
jne 0x98262
movq %r14, %rdi
callq 0x11db95
movq %rbx, %rdi
callq 0x11bdbf
xorl %eax, %eax
jmp 0x98884
movq 0x30(%r14), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x983c5
movq 0x30(%r14), %rdi
callq 0x11b0a1
movq %rax, %r15
callq 0x11ac6c
movq %rax, 0x8(%rsp)
testq %r13, %r13
je 0x9836e
movq %r13, %rdi
callq 0xfcc32
testb %al, %al
jne 0x988f2
leaq 0x42620b(%rip), %r12    # 0x4be580
movb $0x1, (%r12)
movq %r14, %rdi
callq 0x97e1f
movq %rax, %rbx
leaq 0x34cf6d(%rip), %rsi    # 0x3e52f9
movq %r15, %rdi
movq %rax, %rdx
movq %r13, %rcx
callq 0x989af
movl %eax, %ebp
movq %rbx, %rdi
callq 0x10a0b4
testl %ebp, %ebp
je 0x9846f
movq 0x8(%rsp), %rdi
callq 0x11bdbf
movb $0x0, (%r12)
movl $0x1, %eax
jmp 0x98884
cmpb $0x0, 0x5(%r14)
jne 0x9832a
cmpb $0x1, (%r14)
jne 0x98520
movl $0x0, 0x20(%rsp)
testq %r13, %r13
je 0x983f7
movq %r13, %rdi
callq 0xfcc32
testb %al, %al
jne 0x988f7
movl 0x8(%r14), %esi
leaq 0x2ad274(%rip), %rdi    # 0x345676
xorl %eax, %eax
callq 0x17070
movq %r13, %rdi
callq 0x100c22
cmpq $0x0, 0x28(%r14)
je 0x986b3
movq 0x38(%r14), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x98693
movq 0x38(%r14), %rdi
callq 0x11b0a1
movq %rax, %rbx
movq 0x28(%r14), %rdi
movq %rax, %rsi
callq 0x100add
testq %rax, %rax
je 0x98741
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rcx
callq 0x11f570
testl %eax, %eax
je 0x986b3
callq 0x1829e
movq %r13, %r12
movq 0x20(%r14), %rdi
callq 0x11d954
movq %rax, %r14
movq %rax, %rdi
movq 0x8(%rsp), %rsi
movl $0x20, %edx
callq 0x11da14
leaq 0x20(%rsp), %r13
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x11da4f
movl %eax, %ebx
testb %al, %al
je 0x984fc
movq 0x10(%rsp), %rdi
callq 0x11d8ad
movq %rax, %rbp
movq 0x8(%rsp), %rdi
callq 0x11b0a1
movq 0x18(%rsp), %r9
movl $0x2000, %esi           # imm = 0x2000
movq %r13, %rdi
leaq 0x2ad123(%rip), %rdx    # 0x3455fb
movl $0x20, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x17c60
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x989af
testl %eax, %eax
je 0x98495
movq %r14, %rdi
callq 0x11db95
movq 0x8(%rsp), %rdi
callq 0x11bdbf
leaq 0x42606b(%rip), %rax    # 0x4be580
movb $0x0, (%rax)
movzbl %bl, %eax
jmp 0x98884
movq 0x18(%r14), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x9857d
leaq 0x2acc10(%rip), %rbx    # 0x345145
movl $0x4000000, %edi        # imm = 0x4000000
movq %rbx, %rsi
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x104226
movq %rax, %r12
movq 0x18(%r14), %rdi
callq 0x11b0a1
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movl $0x1c5, %ecx            # imm = 0x1C5
callq 0xfda4b
movq %rax, %rdi
callq 0xfdc54
movq %r12, %rdi
movq %rbx, %rsi
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x1045eb
testl %ebp, %ebp
je 0x9867c
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0x985c0
movq (%r15), %rsi
callq 0x11dd07
testb %al, %al
je 0x985c0
movq 0x20(%r14), %rdi
movq (%r15), %rsi
callq 0x11dd77
movq %rax, %rbx
testq %rax, %rax
je 0x98813
movq $0x0, 0x8(%rsp)
jmp 0x9882d
movq (%r15), %rdi
callq 0xff28c
testb %al, %al
je 0x986c2
movq 0x40(%r14), %rdi
movq (%r15), %rsi
callq 0x15c282
movq %r13, %rdi
callq 0xfccba
movq %r15, %rdi
movq %rax, %rsi
callq 0xe464a
movq %rax, %r12
movq 0x40(%r14), %rdi
movq (%rax), %rsi
leaq 0x8(%rax), %rdx
callq 0x15c328
movq 0x40(%r14), %rdi
movq (%r15), %rsi
callq 0x227ca2
testl %eax, %eax
jne 0x9862c
movq 0x40(%r14), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x22537b
testl %eax, %eax
je 0x988d9
movq 0x40(%r14), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x223b1f
testl %eax, %eax
je 0x98901
movq 0x40(%r14), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x223ea8
leaq 0x2acc18(%rip), %rsi    # 0x345271
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
movq 0x40(%r14), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2235b9
movq %r12, %rdi
jmp 0x98737
cmpb $0x1, 0x1(%r14)
jne 0x98724
xorl %edi, %edi
callq 0xe487c
jmp 0x98896
movq 0x28(%r14), %rdi
leaq 0x86ed2(%rip), %rsi     # 0x11f570
leaq 0x20(%rsp), %rdx
movq %r13, %rcx
callq 0x100bf3
testl %eax, %eax
jne 0x988fc
xorl %eax, %eax
cmpl $0x0, 0x20(%rsp)
setne %al
jmp 0x98884
callq 0x11ac6c
movq %r13, %rbx
movq %rax, %r13
leaq 0x2acbb9(%rip), %rdi    # 0x34528d
callq 0x11acc9
movq %rax, %rbp
movq (%r15), %rsi
movq %rax, %rdi
callq 0x11acf3
movq %rbp, %rdi
callq 0x11b0a1
movq %r13, %rdi
movq %rax, %rsi
movq %rbx, 0x8(%rsp)
movq %rbx, %rdx
callq 0xff45b
testl %eax, %eax
je 0x9875a
movq (%r15), %rdx
leaq 0x2acba1(%rip), %rsi    # 0x3452b1
xorl %r12d, %r12d
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x987f7
leaq 0x2acae8(%rip), %rsi    # 0x345213
movq %r13, %rdi
xorl %eax, %eax
callq 0xfcb67
xorl %edi, %edi
callq 0xe487c
jmp 0x983bb
leaq 0x2acf40(%rip), %rsi    # 0x345688
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xfcb67
jmp 0x983bb
movq %r13, %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x98706
movq %r15, %rdi
callq 0xe45d0
movq %rax, %r12
leaq 0x2c6a29(%rip), %rsi    # 0x35f1a2
movq %r13, %rdi
callq 0x11acf3
movq %r13, %rdi
movq %rbp, %rsi
callq 0x11adc1
movq %r13, %rdi
callq 0x11b0a1
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x18000
testl %eax, %eax
jne 0x987d1
testb $0x40, 0x38(%rsp)
je 0x987d1
movq %r13, %rdi
callq 0x11b0a1
movq 0x4207fd(%rip), %rcx    # 0x4b8fb8
movq (%rcx), %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x17d50
testl %eax, %eax
je 0x988e1
movq %r13, %rdi
callq 0x11b0a1
leaq 0x2acab1(%rip), %rsi    # 0x345291
movq 0x8(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
movq %r12, %rdi
callq 0xe487c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %r13, %rdi
callq 0x11bdbf
movq %rbp, %rdi
callq 0x11bdbf
movq 0x8(%rsp), %r13
jmp 0x98873
movq 0x20(%r14), %rdi
movq (%r15), %rsi
callq 0x11dce1
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x98906
movq %r13, %rdi
callq 0xfccba
movq %r15, %rdi
movq %rax, %rsi
callq 0xe464a
movq %rax, %r12
movq (%rax), %rsi
movq %r13, %rdi
callq 0xfcc72
testq %rbx, %rbx
je 0x9885f
movl %ebp, %edi
movq %r12, %rsi
movq %r13, %rdx
callq *%rbx
jmp 0x98871
movq 0x8(%rsp), %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0x11d751
movl %eax, %ebx
movq %r12, %rdi
callq 0xe487c
movl $0x1, %eax
testl %ebx, %ebx
je 0x98896
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x1, 0x1(%r14)
jne 0x9832a
movq %r13, %rdi
callq 0xfccba
movq %rax, %rdi
callq 0x11f674
movq 0x40(%r14), %rbx
movq %r13, %rdi
callq 0xfccba
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x15c328
movq 0x40(%r14), %rdi
callq 0x99a2c
jmp 0x9832a
movq %r12, %rdi
jmp 0x98689
xorl %ebx, %ebx
jmp 0x987fc
callq 0x18310
callq 0x18181
callq 0x181ba
callq 0x18265
callq 0x182d7
callq 0x1822c
callq 0x181f3