// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonassimp/src/material.c
// Function: PushTexture
static int PushTexture(lua_State *L, material_t *material, unsigned int type, unsigned int index)
/* Pushes a table with all the texture properties */
    {
    int val;
    float floatval;
    vector3_t vec;
    struct aiUVTransform trafo;
    unsigned int max = sizeof(vector3_t);

    lua_newtable(L);
    pushtexturetype(L, type);
    lua_setfield(L, -2, "type");

    if(aiGetMaterialIntegerArray(material, _AI_MATKEY_TEXFLAGS_BASE, type, index, &val, NULL)
        != AI_SUCCESS) val = 0;
    pushtextureflags(L, val, 1);
    lua_setfield(L, -2, "flags");

    if(GetString(L, material, _AI_MATKEY_TEXTURE_BASE, type, index)==1)
        lua_setfield(L, -2, "path");

    if(aiGetMaterialIntegerArray(material, _AI_MATKEY_UVWSRC_BASE, type, index, &val, NULL)
        == AI_SUCCESS)
        {
        pushindex(L, val);
        lua_setfield(L, -2, "channel");
        }

    if(aiGetMaterialIntegerArray(material, _AI_MATKEY_TEXOP_BASE, type, index, &val, NULL)
        == AI_SUCCESS)
        {
        pushtextureop(L, val);
        lua_setfield(L, -2, "op");
        }

    if(aiGetMaterialIntegerArray(material, _AI_MATKEY_MAPPING_BASE, type, index, &val, NULL)
        == AI_SUCCESS)
        {
        pushtexturemapping(L, val);
        lua_setfield(L, -2, "mapping");
        }

    if(aiGetMaterialFloatArray(material, _AI_MATKEY_TEXBLEND_BASE, type, index, &floatval, NULL)
        == AI_SUCCESS)
        {
        lua_pushnumber(L, floatval);
        lua_setfield(L, -2, "blend");
        }

    if(aiGetMaterialIntegerArray(material, _AI_MATKEY_MAPPINGMODE_U_BASE, type, index, &val, NULL)
        == AI_SUCCESS)
        {
        pushtexturemapmode(L, val);
        lua_setfield(L, -2, "mapmode_u");
        }
    if(aiGetMaterialIntegerArray(material, _AI_MATKEY_MAPPINGMODE_V_BASE, type, index, &val, NULL)
        == AI_SUCCESS)
        {
        pushtexturemapmode(L, val);
        lua_setfield(L, -2, "mapmode_v");
        }

    max = sizeof(vector3_t);
    if(AI_SUCCESS == aiGetMaterialFloatArray(material, _AI_MATKEY_TEXMAP_AXIS_BASE, type, index,
        (float*)&vec, &max) && sizeof(vector3_t) == max)
        {
        pushvector3(L, &vec, 1);
        lua_setfield(L, -2, "axis");
        }

    max = sizeof(struct aiUVTransform);
    if(AI_SUCCESS ==
        aiGetMaterialFloatArray(material, _AI_MATKEY_UVTRANSFORM_BASE, type, index,
        (float*)&trafo, &max) && sizeof(struct aiUVTransform) == max)
        {
        pushvector2(L, &(trafo.mTranslation), 1);
        lua_setfield(L, -2, "translation");
        pushvector2(L, &(trafo.mScaling), 1);
        lua_setfield(L, -2, "scaling");
        lua_pushnumber(L, trafo.mRotation);
        lua_setfield(L, -2, "rotation");
        }

    return 1;
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl %edx, 0x34(%rsp)
movl %ecx, 0x30(%rsp)
movl $0xc, 0x4(%rsp)
movq 0x40(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x6250
movq 0x40(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x64c0
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x8816(%rip), %rdx      # 0x163c1
callq 0x62e0
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x9583(%rip), %rsi      # 0x17147
leaq 0x2c(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x6290
cmpl $0x0, %eax
je 0xdbe0
movl $0x0, 0x2c(%rsp)
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %esi
movl $0x1, %edx
callq 0x6200
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x8699(%rip), %rdx      # 0x1629d
callq 0x62e0
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x34(%rsp), %ecx
movl 0x30(%rsp), %r8d
leaq 0x94b8(%rip), %rdx      # 0x170db
callq 0xd8c0
cmpl $0x1, %eax
jne 0xdc43
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x92df(%rip), %rdx      # 0x16f1d
callq 0x62e0
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x948e(%rip), %rsi      # 0x170e5
leaq 0x2c(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x6290
cmpl $0x0, %eax
jne 0xdc8f
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x64e0
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x92a0(%rip), %rdx      # 0x16f2a
callq 0x62e0
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x944e(%rip), %rsi      # 0x170f1
leaq 0x2c(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x6290
cmpl $0x0, %eax
jne 0xdcdb
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x6370
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x9420(%rip), %rdx      # 0x170f6
callq 0x62e0
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x940a(%rip), %rsi      # 0x170f9
leaq 0x2c(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x6290
cmpl $0x0, %eax
jne 0xdd27
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x6940
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x93dc(%rip), %rdx      # 0x170fe
callq 0x62e0
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x93cb(%rip), %rsi      # 0x17106
leaq 0x28(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x67d0
cmpl $0x0, %eax
jne 0xdd79
movq 0x40(%rsp), %rdi
movss 0x28(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x6500
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x92a1(%rip), %rdx      # 0x17015
callq 0x62e0
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x9384(%rip), %rsi      # 0x17111
leaq 0x2c(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x6290
cmpl $0x0, %eax
jne 0xddc5
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x66c0
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x9392(%rip), %rdx      # 0x17152
callq 0x62e0
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x9346(%rip), %rsi      # 0x1711f
leaq 0x2c(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x6290
cmpl $0x0, %eax
jne 0xde11
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x66c0
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x9350(%rip), %rdx      # 0x1715c
callq 0x62e0
movl $0xc, 0x4(%rsp)
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x9300(%rip), %rsi      # 0x1712d
leaq 0x1c(%rsp), %r8
leaq 0x4(%rsp), %r9
callq 0x67d0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xde7e
movl 0x4(%rsp), %eax
movl %eax, %ecx
movl $0xc, %eax
cmpq %rcx, %rax
jne 0xde7e
movq 0x40(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
movl $0x1, %edx
callq 0x6610
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x90fa(%rip), %rdx      # 0x16f73
callq 0x62e0
movl $0x14, 0x4(%rsp)
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %edx
movl 0x30(%rsp), %ecx
leaq 0x92a0(%rip), %rsi      # 0x1713a
leaq 0x8(%rsp), %r8
leaq 0x4(%rsp), %r9
callq 0x67d0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xdf4b
movl 0x4(%rsp), %eax
movl %eax, %ecx
movl $0x14, %eax
cmpq %rcx, %rax
jne 0xdf4b
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x1, %edx
callq 0x6170
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x9092(%rip), %rdx      # 0x16f80
callq 0x62e0
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
addq $0x8, %rsi
movl $0x1, %edx
callq 0x6170
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x9078(%rip), %rdx      # 0x16f94
callq 0x62e0
movq 0x40(%rsp), %rdi
movss 0x18(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x6500
movq 0x40(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x905e(%rip), %rdx      # 0x16fa4
callq 0x62e0
movl $0x1, %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nop