// File: /workspace/github_c_makefile_star2_O0/stetre[P]moongl/src/teximage.c
// Function: TextureStorage
static int TextureStorage(lua_State *L)
    {
    GLsizei height, depth;
    int arg = 1;
    GLenum target;
    GLuint texture = checktargetorname(L, arg++, &target, DOMAIN_TEXTURE_TARGET);
    GLsizei levels = luaL_checkinteger(L, arg++);
    GLenum intfmt = checkinternalformat(L, arg++);
    GLsizei width = luaL_checkinteger(L, arg++);
    if(lua_isnoneornil(L, arg))
        {
        if(texture==0)
            glTexStorage1D(target, levels, intfmt, width);
        else
            glTextureStorage1D(texture, levels, intfmt, width);
        CheckError(L);
        return 0;
        }
    height = luaL_checkinteger(L, arg++);
    if(lua_isnoneornil(L, arg))
        {
        if(texture==0)
            glTexStorage2D(target, levels, intfmt, width, height);
        else
            glTextureStorage2D(texture, levels, intfmt, width, height);
        CheckError(L);
        return 0;
        }
    depth = luaL_checkinteger(L, arg++);
    if(texture==0)
        glTexStorage3D(target, levels, intfmt, width, height, depth);
    else
        glTextureStorage3D(texture, levels, intfmt, width, height, depth);
    CheckError(L);
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl $0x1, 0x1c(%rsp)
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
leaq 0x18(%rsp), %rdx
movl $0x13, %ecx
callq 0x11430
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
callq 0x11af0
movl %eax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %edx
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movl $0x11, %esi
callq 0x11160
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
callq 0x11af0
movl %eax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x11860
cmpl $0x0, %eax
jg 0x468c7
cmpl $0x0, 0x14(%rsp)
jne 0x46894
movq 0x2149b(%rip), %rax     # 0x67d18
movq (%rax), %rax
movl 0x18(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
callq *%rax
jmp 0x468b0
movq 0x20c85(%rip), %rax     # 0x67520
movq (%rax), %rax
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
callq *%rax
movq 0x28(%rsp), %rdi
callq 0x11880
movl $0x0, 0x34(%rsp)
jmp 0x469d9
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
callq 0x11af0
movl %eax, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x11860
cmpl $0x0, %eax
jg 0x46957
cmpl $0x0, 0x14(%rsp)
jne 0x4691f
movq 0x20f35(%rip), %rax     # 0x67838
movq (%rax), %rax
movl 0x18(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
movl 0x24(%rsp), %r8d
callq *%rax
jmp 0x46940
movq 0x214ea(%rip), %rax     # 0x67e10
movq (%rax), %rax
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
movl 0x24(%rsp), %r8d
callq *%rax
movq 0x28(%rsp), %rdi
callq 0x11880
movl $0x0, 0x34(%rsp)
jmp 0x469d9
movq 0x28(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
callq 0x11af0
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x14(%rsp)
jne 0x469a1
movq 0x21128(%rip), %rax     # 0x67aa8
movq (%rax), %rax
movl 0x18(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl 0x20(%rsp), %r9d
callq *%rax
jmp 0x469c7
movq 0x21160(%rip), %rax     # 0x67b08
movq (%rax), %rax
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl 0x20(%rsp), %r9d
callq *%rax
movq 0x28(%rsp), %rdi
callq 0x11880
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)