// File: /workspace/github_c_makefile_star2_O0/stetre[P]moongl/src/vertex_array.c
// Function: VertexAttribFormat
static int VertexAttribFormat(lua_State *L)
/* vertex_attrib_format(index, size, type, normalized, offset)
 * vertex_attrib_format(array, index, size, type, normalized, offset) 
 */
    {
    int arg, named = 0;
    GLuint index, offset, array = 0;
    GLint size;
    GLenum type;
    GLboolean normalized;
    arg = 1;
    if(!lua_isstring(L, 3)) /* 'type' */
        {
        named = 1;
        array = luaL_checkinteger(L, arg++);
        }
    index = luaL_checkinteger(L, arg++);
    size = luaL_checkinteger(L, arg++); /* no. of components */
    type = checktype(L, arg++);
    normalized = checkboolean(L, arg++);
    offset = luaL_checkinteger(L, arg++);
    switch(type)
        {
        case GL_BYTE:
        case GL_UNSIGNED_BYTE:
        case GL_SHORT:
        case GL_UNSIGNED_SHORT:
        case GL_INT:
        case GL_UNSIGNED_INT:
        case GL_INT_2_10_10_10_REV:
        case GL_UNSIGNED_INT_2_10_10_10_REV:
        case GL_UNSIGNED_INT_10F_11F_11F_REV:
        case GL_FIXED:
        case GL_FLOAT:
        case GL_HALF_FLOAT:
                if(named)
                    glVertexArrayAttribFormat(array, index, size, type, normalized, offset);
                    //glVertexArrayAttribIFormat(index, size, type, offset);
                else
                    glVertexAttribFormat(index, size, type, normalized, offset);
                    //glVertexAttribIFormat(index, size, type, offset);
                break;
        case GL_DOUBLE:
                if(named)
                    glVertexArrayAttribLFormat(array, index, size, GL_DOUBLE, offset);
                else
                    glVertexAttribLFormat(index, size, GL_DOUBLE, offset);
                break;
        default:
            return luaL_error(L, UNEXPECTED_ERROR);
        }
    CheckError(L);
    return 0;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x1, 0x24(%rsp)
movq 0x28(%rsp), %rdi
movl $0x3, %esi
callq 0x110b0
cmpl $0x0, %eax
jne 0x4fa28
movl $0x1, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
callq 0x11af0
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl %esi, %eax
incl %eax
movl %eax, 0x24(%rsp)
callq 0x11af0
movl %eax, 0x1c(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl %esi, %eax
incl %eax
movl %eax, 0x24(%rsp)
callq 0x11af0
movl %eax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %edx
movl %edx, %eax
incl %eax
movl %eax, 0x24(%rsp)
movl $0x7, %esi
callq 0x11160
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl %esi, %eax
incl %eax
movl %eax, 0x24(%rsp)
callq 0x11510
movb %al, 0xb(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl %esi, %eax
incl %eax
movl %eax, 0x24(%rsp)
callq 0x11af0
movl %eax, 0x18(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x4(%rsp)
addl $0xffffec00, %eax       # imm = 0xFFFFEC00
subl $0x7, %eax
jb 0x4fb0f
jmp 0x4fac3
movl 0x4(%rsp), %eax
subl $0x140a, %eax           # imm = 0x140A
je 0x4fb68
jmp 0x4fad4
movl 0x4(%rsp), %eax
addl $0xffffebf5, %eax       # imm = 0xFFFFEBF5
subl $0x2, %eax
jb 0x4fb0f
jmp 0x4fae4
movl 0x4(%rsp), %eax
subl $0x8368, %eax           # imm = 0x8368
je 0x4fb0f
jmp 0x4faf1
movl 0x4(%rsp), %eax
subl $0x8c3b, %eax           # imm = 0x8C3B
je 0x4fb0f
jmp 0x4fafe
movl 0x4(%rsp), %eax
subl $0x8d9f, %eax           # imm = 0x8D9F
jne 0x4fbb2
jmp 0x4fb0f
cmpl $0x0, 0x20(%rsp)
je 0x4fb42
movq 0x17c6b(%rip), %rax     # 0x67788
movq (%rax), %rax
movl 0x14(%rsp), %edi
movl 0x1c(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movb 0xb(%rsp), %r8b
movl 0x18(%rsp), %r9d
movzbl %r8b, %r8d
callq *%rax
jmp 0x4fb66
movq 0x182bf(%rip), %rax     # 0x67e08
movq (%rax), %rax
movl 0x1c(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movb 0xb(%rsp), %cl
movl 0x18(%rsp), %r8d
movzbl %cl, %ecx
callq *%rax
jmp 0x4fbd7
cmpl $0x0, 0x20(%rsp)
je 0x4fb93
movq 0x17a92(%rip), %rax     # 0x67608
movq (%rax), %rax
movl 0x14(%rsp), %edi
movl 0x1c(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0x18(%rsp), %r8d
movl $0x140a, %ecx           # imm = 0x140A
callq *%rax
jmp 0x4fbb0
movq 0x1788e(%rip), %rax     # 0x67428
movq (%rax), %rax
movl 0x1c(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0x18(%rsp), %ecx
movl $0x140a, %edx           # imm = 0x140A
callq *%rax
jmp 0x4fbd7
movq 0x28(%rsp), %rdi
leaq 0x26c7(%rip), %rsi      # 0x52285
leaq 0xea1b(%rip), %rdx      # 0x5e5e0
movl $0x163, %ecx            # imm = 0x163
movb $0x0, %al
callq 0x11ae0
movl %eax, 0x34(%rsp)
jmp 0x4fbe9
movq 0x28(%rsp), %rdi
callq 0x11880
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)