// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x44(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x181d5a
movq 0x70(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x181d22
jmp 0x181d5a
movq 0x4ba277(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3942e0(%rip), %rsi    # 0x516013
leaq 0x394485(%rip), %rdx    # 0x5161bf
leaq 0x3d287c(%rip), %rcx    # 0x5545bd
leaq 0x3d2889(%rip), %r8     # 0x5545d1
movl $0x29, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x181d5c
jmp 0x181d5e
cmpq $0x0, 0x80(%rsp)
jne 0x181da1
movq 0x4ba230(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x394299(%rip), %rsi    # 0x516013
leaq 0x3b95bf(%rip), %rdx    # 0x53b340
leaq 0x3d2835(%rip), %rcx    # 0x5545bd
leaq 0x3d2842(%rip), %r8     # 0x5545d1
movl $0x2a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x181da3
movq 0x80(%rsp), %rdi
callq 0xa2db0
movq %rax, 0x50(%rsp)
callq 0x11afb0
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rdi
callq 0x192b0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq %rax, %rdx
movl $0x20, %ecx
callq 0x11afd0
movq 0x68(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11b4c0
movq %rax, %rdi
movq 0x70(%rsp), %rsi
callq 0xe0950
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x181e24
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x44(%rsp)
jne 0x181e6b
movq 0x60(%rsp), %rdi
leaq 0x3d27b4(%rip), %rsi    # 0x5545eb
callq 0x11d550
callq 0x33bb50
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0x181e69
movq 0x70(%rsp), %rdi
leaq 0x3d2797(%rip), %rsi    # 0x5545f1
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x181e6b
cmpl $0x0, 0x44(%rsp)
jne 0x181fc5
movq 0x58(%rsp), %rdi
callq 0x33c100
movq 0x58(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rdi
callq 0x11dee0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x335740
movq 0x58(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x3d276b(%rip), %rdx    # 0x55461d
callq 0x336d90
movq 0x68(%rsp), %rdi
callq 0x11b5b0
cmpq $0x1, %rax
jne 0x181f00
movq 0x80(%rsp), %rdi
callq 0x83ee0
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x11d550
movq 0x48(%rsp), %rdi
leaq 0x3d26dd(%rip), %rsi    # 0x5545d1
movl $0x46, %edx
callq 0xe88c0
jmp 0x181f3c
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rdi
callq 0x11b5b0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x11b4c0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x11d550
movq 0x60(%rsp), %rdi
leaq 0x3d6b79(%rip), %rsi    # 0x558ac1
callq 0x11d550
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rdi
callq 0x11dee0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x33b630
cmpl $0x0, %eax
jne 0x181f88
movq 0x58(%rsp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x3375c0
cmpl $0x0, %eax
je 0x181fc3
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x334f50
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x3d2678(%rip), %rsi    # 0x55462c
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x181fc5
cmpq $0x0, 0x58(%rsp)
je 0x181fd7
movq 0x58(%rsp), %rdi
callq 0x339e40
movq 0x60(%rsp), %rdi
callq 0x11f560
movq 0x68(%rsp), %rdi
callq 0x11b600
movq 0x50(%rsp), %rdi
leaq 0x3d25da(%rip), %rsi    # 0x5545d1
movl $0x5a, %edx
callq 0xe88c0
movl 0x44(%rsp), %eax
addq $0x88, %rsp
retq
nopl (%rax)