// File: /workspace/github_c_makefile_star2_O3/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 0x14c8ea
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x14caad
testq %rbp, %rbp
je 0x14caa8
movq %rbp, %rdi
callq 0xe4290
movq %rax, %r13
callq 0x119478
movq %rax, %r14
movq %r13, %rdi
callq 0x172f0
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
movl $0x20, %ecx
callq 0x119493
movq %r14, %rdi
xorl %esi, %esi
callq 0x119674
movq %rax, %rdi
movq %r15, %rsi
callq 0x100758
movq %rax, %r12
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x14ca73
movq %r13, (%rsp)
leaq 0x23560c(%rip), %rsi    # 0x381f5e
movq %r12, %rdi
callq 0x11acf3
callq 0x22810a
testq %rax, %rax
je 0x14c9d0
movq %rax, %r13
movq %rax, %rdi
callq 0x228538
movq %r12, %rdi
callq 0x11b0a1
movq %r13, %rdi
movq %rax, %rsi
callq 0x2243ba
leaq 0x235607(%rip), %rdx    # 0x381f90
movq %r13, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x224f78
movq %r14, %rdi
callq 0x1196b0
cmpq $0x1, %rax
jne 0x14c9e6
movq %rbp, %rdi
callq 0xd3e84
movq %rax, %rbx
movq %r12, %rdi
movq %rax, %rsi
callq 0x11acf3
leaq 0x235583(%rip), %rsi    # 0x381f44
movq %rbx, %rdi
movl $0x46, %edx
callq 0x1045eb
jmp 0x14ca05
leaq 0x23558d(%rip), %rsi    # 0x381f64
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x14ca6f
movq %r14, %rdi
callq 0x1196b0
leaq -0x1(%rax), %rsi
movq %r14, %rdi
callq 0x119674
movq %r12, %rdi
movq %rax, %rsi
callq 0x11acf3
leaq 0x23993e(%rip), %rsi    # 0x38634a
movq %r12, %rdi
callq 0x11acf3
movq %r12, %rdi
callq 0x11b0a1
movq %r13, %rdi
movq %rax, %rsi
callq 0x227ca2
testl %eax, %eax
jne 0x14ca3f
xorl %ebx, %ebx
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22537b
testl %eax, %eax
je 0x14ca67
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x223ea8
leaq 0x235545(%rip), %rsi    # 0x381f9f
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfcb67
movq %r13, %rdi
callq 0x226b39
movq (%rsp), %r13
movq %r12, %rdi
callq 0x11bdbf
movq %r14, %rdi
callq 0x1196c0
leaq 0x2354ba(%rip), %rsi    # 0x381f44
movq %r13, %rdi
movl $0x5a, %edx
callq 0x1045eb
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x46635
callq 0x465fe
nop