// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonassimp/src/mesh.c
// Function: AllTextureCoords
static int AllTextureCoords(lua_State *L)
    {
    vector3_t *coords;
    vector2_t vec2;
    unsigned int ncomp;
    mesh_t *mesh = checkmesh(L, 1);
    unsigned int chan;
    unsigned int i;

    lua_newtable(L);
    for(chan = 0; chan < AI_MAX_NUMBER_OF_TEXTURECOORDS; chan++)
        {
        if(mesh->mTextureCoords[chan] == NULL) break;
        ncomp = mesh->mNumUVComponents[chan]; /* no. of components */
        lua_newtable(L);
        for(i=0; i<mesh->mNumVertices; i++)
            {
            coords =  &(mesh->mTextureCoords[chan][i]);
            switch(ncomp)
                {
                case 3: pushvector3(L, coords, 1); break;
                case 2: {
                        vec2.x = coords->x;
                        vec2.y = coords->y;
                        pushvector2(L, &vec2, 1);
                        break;
                        }
                case 1: {
                        lua_newtable(L);
                        lua_pushnumber(L, coords->x);
                        lua_rawseti(L, -2, 1);
                        break;
                        }
                default:
                    return unexpected(L); /* 4 components are currently not supported */
                }
            lua_rawseti(L, -2, i+1);
            }
        lua_rawseti(L, -2, chan+1);
        }
    return 1;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x7de0(%rip), %rdx      # 0x171da
callq 0x6700
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x6250
movl $0x0, 0x14(%rsp)
cmpl $0x8, 0x14(%rsp)
jae 0xf5c1
movq 0x18(%rsp), %rax
movl 0x14(%rsp), %ecx
cmpq $0x0, 0x70(%rax,%rcx,8)
jne 0xf43b
jmp 0xf5c1
movq 0x18(%rsp), %rax
movl 0x14(%rsp), %ecx
movl 0xb0(%rax,%rcx,4), %eax
movl %eax, 0x24(%rsp)
movq 0x38(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x6250
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jae 0xf597
movq 0x18(%rsp), %rax
movl 0x14(%rsp), %ecx
movq 0x70(%rax,%rcx,8), %rax
movl 0x10(%rsp), %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,4), %rax
movq %rax, 0x30(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0xc(%rsp)
subl $0x1, %eax
je 0xf50d
jmp 0xf4a5
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0xf4d8
jmp 0xf4b0
movl 0xc(%rsp), %eax
subl $0x3, %eax
jne 0xf548
jmp 0xf4bf
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x6610
jmp 0xf56d
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0x28(%rsp)
movq 0x30(%rsp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, 0x2c(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x1, %edx
callq 0x6170
jmp 0xf56d
movq 0x38(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x6250
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x6500
movq 0x38(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x1, %edx
callq 0x6470
jmp 0xf56d
movq 0x38(%rsp), %rdi
leaq 0x6c62(%rip), %rsi      # 0x161b6
leaq 0x6c79(%rip), %rdx      # 0x161d4
movl $0x152, %ecx            # imm = 0x152
movb $0x0, %al
callq 0x67b0
movl %eax, 0x44(%rsp)
jmp 0xf5c9
movq 0x38(%rsp), %rdi
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xf465
movq 0x38(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xf41a
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)