// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/src/lauxlib.c
// Function: luaL_openlib
LUALIB_API void luaI_openlib (lua_State *L, const char *libname,
                              const luaL_Reg *l, int nup) {
  if (libname) {
    int size = libsize(l);
    /* check whether lib already exists */
    luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1);
    lua_getfield(L, -1, libname);  /* get _LOADED[libname] */
    if (!lua_istable(L, -1)) {  /* not found? */
      lua_pop(L, 1);  /* remove previous result */
      /* try global variable (and create one if it does not exist) */
      if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL)
        luaL_error(L, "name conflict for module " LUA_QS, libname);
      lua_pushvalue(L, -1);
      lua_setfield(L, -3, libname);  /* _LOADED[libname] = new table */
    }
    lua_remove(L, -2);  /* remove _LOADED table */
    lua_insert(L, -(nup+1));  /* move library table to below upvalues */
  }
  for (; l->name; l++) {
    int i;
    for (i=0; i<nup; i++)  /* copy upvalues to the top */
      lua_pushvalue(L, -nup);
    lua_pushcclosure(L, l->func, nup);
    lua_setfield(L, -(nup+2), l->name);
  }
  lua_pop(L, nup);  /* remove upvalues */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rdi, %rbx
movl %ecx, %r14d
notl %r14d
testq %rsi, %rsi
je 0x5b679
movq %rsi, %r12
cmpq $0x0, (%r15)
je 0x5b5d8
leaq 0x10(%r15), %rax
xorl %r13d, %r13d
incl %r13d
cmpq $0x0, (%rax)
leaq 0x10(%rax), %rax
jne 0x5b5c9
jmp 0x5b5db
xorl %r13d, %r13d
leaq 0x9262b(%rip), %rdx     # 0xedc0d
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
movl $0x1, %ecx
callq 0x5b750
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r12, %rdx
callq 0x58b98
movq 0x10(%rbx), %rcx
leaq -0x10(%rcx), %rax
cmpq 0xf59bd(%rip), %rax     # 0x150fd0
je 0x5b61b
cmpl $0x5, -0x8(%rcx)
je 0x5b661
movq %rax, 0x10(%rbx)
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
movq %r12, %rdx
movl %r13d, %ecx
callq 0x5b750
testq %rax, %rax
jne 0x5b73c
movq 0x10(%rbx), %rax
movq -0x10(%rax), %rcx
movq %rcx, (%rax)
movl -0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
addq $0x10, 0x10(%rbx)
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
movq %r12, %rdx
callq 0x59137
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x57916
movq %rbx, %rdi
movl %r14d, %esi
callq 0x57a06
movl %r14d, 0x4(%rsp)
cmpq $0x0, (%r15)
je 0x5b6e6
movl %ebp, %r12d
negl %r12d
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
subl %ebp, %r13d
testl %ebp, %ebp
jle 0x5b6bf
movl %ebp, %r14d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x57945
movq 0x10(%rbx), %rcx
movq (%rax), %rdx
movq %rdx, (%rcx)
movl 0x8(%rax), %eax
movl %eax, 0x8(%rcx)
addq $0x10, 0x10(%rbx)
decl %r14d
jne 0x5b69a
movq 0x8(%r15), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x58930
movq (%r15), %rdx
movq %rbx, %rdi
movl %r13d, %esi
callq 0x59137
cmpq $0x0, 0x10(%r15)
leaq 0x10(%r15), %r15
jne 0x5b693
testl %ebp, %ebp
js 0x5b700
movq 0x10(%rbx), %rax
movslq 0x4(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x10, %rax
jmp 0x5b729
movl 0x4(%rsp), %eax
shlq $0x4, %rax
addq 0x18(%rbx), %rax
movq 0x10(%rbx), %rcx
cmpq %rax, %rcx
jae 0x5b729
movl $0x0, 0x8(%rcx)
addq $0x10, %rcx
cmpq %rax, %rcx
jb 0x5b715
movq %rcx, 0x10(%rbx)
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x924d2(%rip), %rsi     # 0xedc15
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x5af61