// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rdi, %rbp
testq %rdx, %rdx
je 0x153ec2
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0x154092
testq %rbp, %rbp
je 0x15408d
movq %rbp, %rdi
callq 0xe8760
movq %rax, %rbx
callq 0x11f0ac
movq %rax, %r15
movq %rbx, %rdi
callq 0x172f0
movq %r15, %rdi
movq %rbx, (%rsp)
movq %rbx, %rsi
movq %rax, %rdx
movl $0x20, %ecx
callq 0x11f0c7
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
callq 0x11f2a8
movq %rax, %rdi
movq %r14, %rsi
callq 0x105688
movq %rax, %r12
testq %rax, %rax
je 0x153f51
leaq 0x2373ed(%rip), %rsi    # 0x38b311
movq %r12, %rdi
callq 0x12097f
callq 0x231b44
testq %rax, %rax
je 0x153f3d
movq %rax, %r13
movb $0x1, %al
jmp 0x153f53
leaq 0x2373d3(%rip), %rsi    # 0x38b317
xorl %r13d, %r13d
movq %r14, %rdi
xorl %eax, %eax
callq 0x1019cf
xorl %eax, %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %al, %al
je 0x15404a
movq %r13, %rdi
callq 0x231f72
movq %r12, %rdi
callq 0x120d23
movq %r13, %rdi
movq %rax, %rsi
callq 0x22e0c4
leaq 0x2373c1(%rip), %rdx    # 0x38b343
movq %r13, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x22ec93
movq %r15, %rdi
callq 0x11f2e4
cmpq $0x1, %rax
jne 0x153fc9
movq %rbp, %rdi
callq 0xd6450
movq %rax, %rbx
movq %r12, %rdi
movq %rax, %rsi
callq 0x12097f
leaq 0x23733d(%rip), %rsi    # 0x38b2f7
movq %rbx, %rdi
movl $0x46, %edx
callq 0x109670
jmp 0x153fe8
movq %r15, %rdi
callq 0x11f2e4
leaq -0x1(%rax), %rsi
movq %r15, %rdi
callq 0x11f2a8
movq %r12, %rdi
movq %rax, %rsi
callq 0x12097f
leaq 0x23b73b(%rip), %rsi    # 0x38f72a
movq %r12, %rdi
callq 0x12097f
movq %r12, %rdi
callq 0x120d23
movq %r13, %rdi
movq %rax, %rsi
callq 0x23180b
testl %eax, %eax
jne 0x154022
xorl %ebx, %ebx
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22f092
testl %eax, %eax
je 0x15404a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x22db9e
leaq 0x237315(%rip), %rsi    # 0x38b352
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1019cf
testq %r13, %r13
je 0x154057
movq %r13, %rdi
callq 0x2307b5
movq %r12, %rdi
callq 0x121b03
movq %r15, %rdi
callq 0x11f2f4
leaq 0x237289(%rip), %rsi    # 0x38b2f7
movq (%rsp), %rdi
movl $0x5a, %edx
callq 0x109670
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x473fd
callq 0x473c6
nop