// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/luahelper.c
// Function: gt_lua_set_modules_path
int gt_lua_set_modules_path(lua_State *L, GtError *err)
{
  GtStr *modules_path = NULL, *external_modules_path = NULL,
         *package_path = NULL;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(L);
  if (!(modules_path = gt_get_gtdata_path(gt_error_get_progname(err), err)))
    had_err = -1;
  if (!had_err) {
    external_modules_path = gt_str_clone(modules_path);
    gt_str_append_cstr(modules_path, "/modules/?.lua");
    gt_str_append_cstr(external_modules_path, "/modules/external/?.lua");
    lua_getglobal(L, "package");
    gt_assert(lua_istable(L, -1));
    lua_getfield(L, -1, "path");
    gt_assert(lua_isstring(L, -1));
    package_path = gt_str_new_cstr(lua_tostring(L, -1));
    lua_pop(L, 1);
    gt_str_append_char(package_path, ';');
    gt_str_append_str(package_path, modules_path);
    gt_str_append_char(package_path, ';');
    gt_str_append_str(package_path, external_modules_path);
    lua_pushstring(L, gt_str_get(package_path));
    lua_setfield(L, -2, "path");
    lua_pop(L, 1);
  }
  gt_str_delete(package_path);
  gt_str_delete(modules_path);
  gt_str_delete(external_modules_path);
  return had_err;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0xa78ec
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0xa7a57
testq %rbx, %rbx
je 0xa7a52
movq %r14, %rdi
callq 0x35072
movq %rax, %rdi
movq %r14, %rsi
callq 0xd617c
movq %rax, %r15
xorl %r14d, %r14d
testq %rax, %rax
je 0xa7a20
movq %r15, %rdi
callq 0x3bc4d
movq %rax, %r12
leaq 0x53e34(%rip), %rsi     # 0xfb75d
movq %r15, %rdi
callq 0x3b7af
leaq 0x53e34(%rip), %rsi     # 0xfb76c
movq %r12, %rdi
callq 0x3b7af
leaq 0x4515b(%rip), %rdx     # 0xecaa2
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x57f56
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x56f9b
cmpl $0x5, %eax
jne 0xa7a5c
leaq 0x49389(%rip), %rdx     # 0xf0cfa
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x57f56
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5706f
testl %eax, %eax
je 0xa7a61
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x573f8
movq %rax, %rdi
callq 0x3b785
movq %rax, %r13
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x56b09
movq %r13, %rdi
movl $0x3b, %esi
callq 0x3b9df
movq %r13, %rdi
movq %r15, %rsi
callq 0x3b87d
movq %r13, %rdi
movl $0x3b, %esi
callq 0x3b9df
movq %r13, %rdi
movq %r12, %rsi
callq 0x3b87d
movq %r13, %rdi
callq 0x3bb5d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5790a
leaq 0x492f6(%rip), %rdx     # 0xf0cfa
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x584c8
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x56b09
jmp 0xa7a26
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq $0x1, %r15
sbbl %r14d, %r14d
movq %r13, %rdi
callq 0x3c87b
movq %r15, %rdi
callq 0x3c87b
movq %r12, %rdi
callq 0x3c87b
movl %r14d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x2382a
callq 0x23785
callq 0x237bc
callq 0x237f3