// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/gtdatahelp.c
// Function: gt_gtdata_show_help
int gt_gtdata_show_help(const char *progname, GT_UNUSED void *unused,
                        GtError *err)
{
  GtSplitter *splitter;
  GtStr *doc_file;
  lua_State *L = NULL;
  char *prog, *bn;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(progname);

  prog = gt_cstr_dup(progname); /* create modifiable copy for splitter */
  splitter = gt_splitter_new();
  gt_splitter_split(splitter, prog, strlen(prog), ' ');
  doc_file = gt_get_gtdata_path(gt_splitter_get_token(splitter, 0), err);
  if (!doc_file)
    had_err = -1;

  if (!had_err) {
    gt_str_append_cstr(doc_file, "/doc/");
    /* create Lua & push gtdata_doc_dir to Lua */
    L = luaL_newstate();
    if (!L) {
      gt_error_set(err, "out of memory (cannot create new Lua state)");
      had_err = -1;
    }
  }

  if (!had_err) {
    luaL_openlibs(L);
    lua_pushstring(L, gt_str_get(doc_file));
    lua_setglobal(L, "gtdata_doc_dir");
    /* finish creating doc_file */
    if (gt_splitter_size(splitter) == 1) {
      /* special case for `gt` */
      bn = gt_basename(progname);
      gt_str_append_cstr(doc_file, bn);
      gt_free(bn);
    }
    else {
      /* general case for the tools */
      gt_str_append_cstr(doc_file,
                      gt_splitter_get_token(splitter,
                                         gt_splitter_size(splitter) - 1));
    }
    gt_str_append_cstr(doc_file, ".lua");
    /* execute doc_file */
    if (luaL_loadfile(L, gt_str_get(doc_file)) || lua_pcall(L, 0, 0, 0)) {
      gt_error_set(err, "cannot run doc file: %s", lua_tostring(L, -1));
      had_err = -1;
    }
  }

  /* free */
  if (L) lua_close(L);
  gt_str_delete(doc_file);
  gt_splitter_delete(splitter);
  gt_free(prog);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbp
testq %rdx, %rdx
je 0xe7512
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0xe76ed
testq %rbp, %rbp
je 0xe76c3
movq %rbp, %rdi
callq 0x6c2be
movq %rax, %r13
callq 0xab2f4
movq %rax, %r14
movq %r13, %rdi
callq 0x172d0
pushq $0x20
popq %rcx
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0xab309
movq %r14, %rdi
xorl %esi, %esi
callq 0xab58d
movq %rax, %rdi
movq %r15, %rsi
callq 0x8f124
movq %rax, %r12
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0xe7690
movq %r13, (%rsp)
leaq 0x23adf5(%rip), %rsi    # 0x32236b
movq %r12, %rdi
callq 0xacbfb
callq 0x1df5e2
testq %rax, %rax
je 0xe75f2
movq %rax, %r13
movq %rax, %rdi
callq 0x1df9e1
movq %r12, %rdi
callq 0xad1fa
movq %r13, %rdi
movq %rax, %rsi
callq 0x1dc009
leaq 0x23adf0(%rip), %rdx    # 0x32239d
movq %r13, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x1dcb19
movq %r14, %rdi
callq 0xab625
cmpq $0x1, %rax
jne 0xe7608
movq %rbp, %rdi
callq 0x5a384
movq %rax, %rbx
movq %r12, %rdi
movq %rax, %rsi
callq 0xacbfb
leaq 0x23ad6c(%rip), %rsi    # 0x322351
pushq $0x46
popq %rdx
movq %rbx, %rdi
callq 0x936f9
jmp 0xe7627
leaq 0x23ad78(%rip), %rsi    # 0x322371
movq %r15, %rdi
xorl %eax, %eax
callq 0x89dbb
jmp 0xe768c
movq %r14, %rdi
callq 0xab625
leaq -0x1(%rax), %rsi
movq %r14, %rdi
callq 0xab58d
movq %r12, %rdi
movq %rax, %rsi
callq 0xacbfb
leaq 0x23f11c(%rip), %rsi    # 0x32674a
movq %r12, %rdi
callq 0xacbfb
movq %r12, %rdi
callq 0xad1fa
movq %r13, %rdi
movq %rax, %rsi
callq 0x1df308
testl %eax, %eax
jne 0xe7661
xorl %ebx, %ebx
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1dcedd
testl %eax, %eax
je 0xe7684
pushq $-0x1
popq %rbx
movq %r13, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x1dbb73
leaq 0x23ad35(%rip), %rsi    # 0x3223ac
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x89dbb
movq %r13, %rdi
callq 0x1de4cb
movq (%rsp), %r13
movq %r12, %rdi
callq 0xae103
movq %r14, %rdi
callq 0xab666
leaq 0x23acaa(%rip), %rsi    # 0x322351
pushq $0x5a
popq %rdx
movq %r13, %rdi
callq 0x936f9
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x35089e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fd93f(%rip), %rsi    # 0x2e5013
leaq 0x22270e(%rip), %rdx    # 0x309de9
leaq 0x23ac5b(%rip), %rcx    # 0x32233d
leaq 0x23ac68(%rip), %r8     # 0x322351
pushq $0x2a
jmp 0xe7715
movq 0x350874(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fd915(%rip), %rsi    # 0x2e5013
leaq 0x1fdaba(%rip), %rdx    # 0x2e51bf
leaq 0x23ac31(%rip), %rcx    # 0x32233d
leaq 0x23ac3e(%rip), %r8     # 0x322351
pushq $0x29
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nop