// File: /workspace/github_c_makefile_star2_O3/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
movl $0x3, %esi
callq 0x110b0
movl %eax, %ebp
testl %eax, %eax
je 0x3d1db
movl $0x1, %r14d
movq $0x0, 0x10(%rsp)
jmp 0x3d1f3
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11af0
movq %rax, 0x10(%rsp)
movl $0x2, %r14d
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
movq %rbx, %rdi
movl $0x7, %esi
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
cmpl $0x8367, %r13d          # imm = 0x8367
jg 0x3d2cc
leal -0x1400(%r13), %ecx
cmpl $0xc, %ecx
ja 0x3d30d
movl $0x187f, %edx           # imm = 0x187F
btl %ecx, %edx
jae 0x3d2e9
testl %ebp, %ebp
je 0x3d292
movq 0x19bd5(%rip), %r9      # 0x56e50
movzbl %r15b, %ecx
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %eax, %r8d
callq *(%r9)
jmp 0x3d2b3
movq 0x1960f(%rip), %r10     # 0x568a8
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 $0x8368, %r13d          # imm = 0x8368
je 0x3d270
cmpl $0x8d9f, %r13d          # imm = 0x8D9F
je 0x3d270
cmpl $0x8c3b, %r13d          # imm = 0x8C3B
je 0x3d270
jmp 0x3d30d
cmpl $0xa, %ecx
jne 0x3d30d
testl %ebp, %ebp
je 0x3d338
movq 0x192a7(%rip), %r8      # 0x565a0
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl $0x140a, %edx           # imm = 0x140A
movl %eax, %ecx
callq *(%r8)
jmp 0x3d2b3
leaq 0x1f71(%rip), %rsi      # 0x3f285
leaq 0xeb01(%rip), %rdx      # 0x4be1c
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 0x19409(%rip), %r9      # 0x56748
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %r12d, %edx
movl $0x140a, %ecx           # imm = 0x140A
jmp 0x3d28a