// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x885c6
movq %r14, %rdi
callq 0xc103
testb %al, %al
jne 0x8874c
testq %rbx, %rbx
je 0x88722
movq %r14, %rdi
callq 0xc24d
movq %rax, %rdi
movq %r14, %rsi
callq 0xbd0f8
movq %rax, %r15
xorl %r14d, %r14d
testq %rax, %rax
je 0x886eb
movq %r15, %rdi
callq 0x1461a
movq %rax, %r12
leaq 0x5c46a(%rip), %rsi     # 0xe4a6d
movq %r15, %rdi
callq 0x13dd3
leaq 0x5c46a(%rip), %rsi     # 0xe4a7c
movq %r12, %rdi
callq 0x13dd3
leaq 0x4d471(%rip), %rdx     # 0xd5a92
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x38a63
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x37b59
cmpl $0x5, %eax
jne 0x88776
leaq 0x51661(%rip), %rdx     # 0xd9caa
pushq $-0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x38a63
movq %rbx, %rdi
movl %ebp, %esi
callq 0x37c2b
testl %eax, %eax
je 0x887a0
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x37f9b
movq %rax, %rdi
callq 0x13da9
movq %rax, %r13
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x377fa
pushq $0x3b
popq %rbp
movq %r13, %rdi
movl %ebp, %esi
callq 0x140b1
movq %r13, %rdi
movq %r15, %rsi
callq 0x13eeb
movq %r13, %rdi
movl %ebp, %esi
callq 0x140b1
movq %r13, %rdi
movq %r12, %rsi
callq 0x13eeb
movq %r13, %rdi
callq 0x143d2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x38431
leaq 0x515d8(%rip), %rdx     # 0xd9caa
movq %rbx, %rdi
pushq $-0x2
popq %rbp
movl %ebp, %esi
callq 0x38f41
movq %rbx, %rdi
movl %ebp, %esi
callq 0x377fa
jmp 0x886f1
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq $0x1, %r15
sbbl %r14d, %r14d
movq %r13, %rdi
callq 0x152db
movq %r15, %rdi
callq 0x152db
movq %r12, %rdi
callq 0x152db
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa588f(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x41933(%rip), %rsi     # 0xca066
leaq 0x4e2bc(%rip), %rdx     # 0xd69f6
leaq 0x5c2fb(%rip), %rcx     # 0xe4a3c
leaq 0x5c30c(%rip), %r8      # 0xe4a54
pushq $0x24
jmp 0x887c8
movq 0xa5865(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x41909(%rip), %rsi     # 0xca066
leaq 0x41ef5(%rip), %rdx     # 0xca659
leaq 0x5c2d1(%rip), %rcx     # 0xe4a3c
leaq 0x5c2e2(%rip), %r8      # 0xe4a54
pushq $0x23
jmp 0x887c8
movq 0xa583b(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x418df(%rip), %rsi     # 0xca066
leaq 0x556ae(%rip), %rdx     # 0xdde3c
leaq 0x5c2a7(%rip), %rcx     # 0xe4a3c
leaq 0x5c2b8(%rip), %r8      # 0xe4a54
pushq $0x2c
jmp 0x887c8
movq 0xa5811(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x418b5(%rip), %rsi     # 0xca066
leaq 0x556ef(%rip), %rdx     # 0xddea7
leaq 0x5c27d(%rip), %rcx     # 0xe4a3c
leaq 0x5c28e(%rip), %r8      # 0xe4a54
pushq $0x2e
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300