// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonassimp/src/material.c
// Function: AllTextures
static int AllTextures(lua_State *L)
    {
    unsigned int count, i, tot;
    unsigned int type;
    material_t *material = checkmaterial(L, 1);
#define ADD(t) do {                                     \
    count = aiGetMaterialTextureCount(material, t);     \
    for(i=0; i < count; i++)                            \
        {                                               \
        PushTexture(L, material, t, i);                 \
        lua_rawseti(L, -2, ++tot);                      \
        }                                               \
} while(0)

    tot = 0;
    if(!lua_isnoneornil(L, 2))
        {
        lua_newtable(L);
        type = checktexturetype(L, 2);
        ADD((enum aiTextureType)type);
        }
    else
        {
        lua_newtable(L);
//      ADD(aiTextureType_NONE);
        ADD(aiTextureType_DIFFUSE);
        ADD(aiTextureType_SPECULAR);
        ADD(aiTextureType_AMBIENT);
        ADD(aiTextureType_EMISSIVE);
        ADD(aiTextureType_HEIGHT);
        ADD(aiTextureType_NORMALS);
        ADD(aiTextureType_SHININESS);
        ADD(aiTextureType_OPACITY);
        ADD(aiTextureType_DISPLACEMENT);
        ADD(aiTextureType_LIGHTMAP);
        ADD(aiTextureType_REFLECTION);
        ADD(aiTextureType_UNKNOWN);
        }
#undef ADD
    return 1;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movl $0x1, %esi
leaq 0x9bb6(%rip), %rdx      # 0x16e90
callq 0x6700
movq %rax, 0x8(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movl $0x2, %esi
callq 0x68e0
cmpl $0x0, %eax
jle 0xd392
movq 0x20(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x6250
movq 0x20(%rsp), %rdi
movl $0x2, %esi
callq 0x6760
movl %eax, 0x10(%rsp)
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd38b
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x10(%rsp), %edx
movl 0x18(%rsp), %ecx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd33f
jmp 0xd38d
jmp 0xd8b0
movq 0x20(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x6250
movq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd408
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x1, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd3bb
jmp 0xd40a
jmp 0xd40c
movq 0x8(%rsp), %rdi
movl $0x2, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd474
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x2, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd427
jmp 0xd476
jmp 0xd478
movq 0x8(%rsp), %rdi
movl $0x3, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd4e0
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x3, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd493
jmp 0xd4e2
jmp 0xd4e4
movq 0x8(%rsp), %rdi
movl $0x4, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd54c
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x4, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd4ff
jmp 0xd54e
jmp 0xd550
movq 0x8(%rsp), %rdi
movl $0x5, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd5b8
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x5, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd56b
jmp 0xd5ba
jmp 0xd5bc
movq 0x8(%rsp), %rdi
movl $0x6, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd624
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x6, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd5d7
jmp 0xd626
jmp 0xd628
movq 0x8(%rsp), %rdi
movl $0x7, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd690
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x7, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd643
jmp 0xd692
jmp 0xd694
movq 0x8(%rsp), %rdi
movl $0x8, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd6fc
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x8, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd6af
jmp 0xd6fe
jmp 0xd700
movq 0x8(%rsp), %rdi
movl $0x9, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd768
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x9, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd71b
jmp 0xd76a
jmp 0xd76c
movq 0x8(%rsp), %rdi
movl $0xa, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd7d4
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0xa, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd787
jmp 0xd7d6
jmp 0xd7d8
movq 0x8(%rsp), %rdi
movl $0xb, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd840
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0xb, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd7f3
jmp 0xd842
jmp 0xd844
movq 0x8(%rsp), %rdi
movl $0x12, %esi
callq 0x67c0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xd8ac
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x18(%rsp), %ecx
movl $0x12, %edx
callq 0xdb60
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl %eax, %eax
movl %eax, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6470
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xd85f
jmp 0xd8ae
jmp 0xd8b0
movl $0x1, %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)