// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x3
popq %rsi
callq 0x110b0
movl %eax, %ebp
testl %eax, %eax
je 0x39d14
pushq $0x1
popq %r14
movq $0x0, 0x10(%rsp)
jmp 0x39d28
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x11af0
movq %rax, 0x10(%rsp)
pushq $0x2
popq %r14
leal 0x1(%r14), %r15d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x11af0
movq %rax, 0x8(%rsp)
leal 0x2(%r14), %r13d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x11af0
movq %rax, %r12
leal 0x3(%r14), %r15d
pushq $0x7
popq %rsi
movq %rbx, %rdi
movl %r13d, %edx
callq 0x11150
movl %eax, %r13d
orl $0x4, %r14d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x11500
movl %eax, %r15d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x11af0
leal -0x1400(%r13), %ecx
cmpl $0xc, %ecx
ja 0x39e1a
movl $0x187f, %edx           # imm = 0x187F
btl %ecx, %edx
jae 0x39df6
testl %ebp, %ebp
je 0x39dbc
movq 0x1c0ab(%rip), %r9      # 0x55e50
movzbl %r15b, %ecx
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %eax, %r8d
callq *(%r9)
jmp 0x39ddd
movq 0x1bae5(%rip), %r10     # 0x558a8
movzbl %r15b, %r8d
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %r12d, %edx
movl %r13d, %ecx
movl %eax, %r9d
callq *(%r10)
movq %rbx, %rdi
callq 0x11870
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xa, %ecx
jne 0x39e1a
testl %ebp, %ebp
je 0x39e6c
movq 0x1b79a(%rip), %r8      # 0x555a0
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl $0x140a, %edx           # imm = 0x140A
movl %eax, %ecx
callq *(%r8)
jmp 0x39ddd
cmpl $0x8368, %r13d          # imm = 0x8368
je 0x39d9a
cmpl $0x8d9f, %r13d          # imm = 0x8D9F
je 0x39d9a
cmpl $0x8c3b, %r13d          # imm = 0x8C3B
je 0x39d9a
leaq 0x143d(%rip), %rsi      # 0x3b285
leaq 0xdff5(%rip), %rdx      # 0x47e44
movq %rbx, %rdi
movl $0x163, %ecx            # imm = 0x163
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11ae0
movq 0x1b8d5(%rip), %r9      # 0x55748
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %r12d, %edx
movl $0x140a, %ecx           # imm = 0x140A
jmp 0x39db4