// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0xe7d51
movq 0x28(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xe7d19
jmp 0xe7d51
movq 0xcc2b8(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x7633c(%rip), %rsi     # 0x15e066
leaq 0x76917(%rip), %rdx     # 0x15e648
leaq 0x91e5c(%rip), %rcx     # 0x179b94
leaq 0x91e6d(%rip), %r8      # 0x179bac
movl $0x23, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe7d53
jmp 0xe7d55
cmpq $0x0, 0x30(%rsp)
jne 0xe7d95
movq 0xcc274(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x762f8(%rip), %rsi     # 0x15e066
leaq 0x83089(%rip), %rdx     # 0x16adfe
leaq 0x91e18(%rip), %rcx     # 0x179b94
leaq 0x91e29(%rip), %r8      # 0x179bac
movl $0x24, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe7d97
movq 0x28(%rsp), %rdi
callq 0xc430
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x144e10
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
jne 0xe7dc1
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
cmpl $0x0, 0xc(%rsp)
jne 0xe7f74
movq 0x20(%rsp), %rdi
callq 0x19ce0
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x91dde(%rip), %rsi     # 0x179bc5
callq 0x18fb0
movq 0x18(%rsp), %rdi
leaq 0x91ddc(%rip), %rsi     # 0x179bd4
callq 0x18fb0
movq 0x30(%rsp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0x81e9c(%rip), %rdx     # 0x169caa
callq 0x51640
movq 0x30(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f800
cmpl $0x5, %eax
je 0xe7e5f
movq 0xcc1aa(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x7622e(%rip), %rsi     # 0x15e066
leaq 0x8ae54(%rip), %rdx     # 0x172c93
leaq 0x91d4e(%rip), %rcx     # 0x179b94
leaq 0x91d5f(%rip), %r8      # 0x179bac
movl $0x2c, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe7e61
movq 0x30(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x86282(%rip), %rdx     # 0x16e0f4
callq 0x51640
movq 0x30(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f9e0
cmpl $0x0, %eax
jne 0xe7ec3
movq 0xcc146(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x761ca(%rip), %rsi     # 0x15e066
leaq 0x8ae5b(%rip), %rdx     # 0x172cfe
leaq 0x91cea(%rip), %rcx     # 0x179b94
leaq 0x91cfb(%rip), %r8      # 0x179bac
movl $0x2e, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xe7ec5
movq 0x30(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x50180
movq %rax, %rdi
callq 0x18f70
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4f100
movq 0x10(%rsp), %rdi
movl $0x3b, %esi
callq 0x194d0
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x191b0
movq 0x10(%rsp), %rdi
movl $0x3b, %esi
callq 0x194d0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x191b0
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
callq 0x19940
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x50970
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x86194(%rip), %rdx     # 0x16e0f4
callq 0x51fc0
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4f100
movq 0x10(%rsp), %rdi
callq 0x1afc0
movq 0x20(%rsp), %rdi
callq 0x1afc0
movq 0x18(%rsp), %rdi
callq 0x1afc0
movl 0xc(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)