// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonassimp/src/mesh.c
// Function: moonassimp_newmesh
int newmesh(lua_State *L, scene_t *scene, mesh_t *mesh)
    {
    unsigned int i;
    ud_t *ud;
    TRACE_CREATE(mesh, "mesh");
    if(mesh->mFaces != NULL && mesh->mNumFaces > 0)
        {
        for(i = 0; i < mesh->mNumFaces; i++)
            { newface(L, scene, mesh, &(mesh->mFaces[i])); lua_pop(L, 1); }
        TRACE_CREATE_N(i, "faces");
        }
    if(mesh->mBones != NULL && mesh->mNumBones > 0)
        {
        for(i = 0; i < mesh->mNumBones; i++)
            { newbone(L, scene, mesh, mesh->mBones[i]); lua_pop(L, 1); }
        TRACE_CREATE_N(i, "bones");
        }
    if(mesh->mAnimMeshes != NULL && mesh->mNumAnimMeshes > 0)
        {
        for(i = 0; i < mesh->mNumAnimMeshes; i++)
            { newanimmesh(L, scene, mesh, mesh->mAnimMeshes[i]); lua_pop(L, 1); }
        TRACE_CREATE_N(i, "animmeshes");
        }
    ud = newuserdata(L, (void*)mesh, MESH_MT);
    ud->scene = scene;
    return 1;   
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x10(%rsp), %rsi
leaq 0x9211(%rip), %rdi      # 0x17190
movb $0x0, %al
callq 0x6720
movq 0x10(%rsp), %rax
cmpq $0x0, 0xd0(%rax)
je 0xe013
movq 0x10(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jbe 0xe013
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jae 0xdffd
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x10(%rsp), %rax
movq 0xd0(%rax), %rcx
movl 0xc(%rsp), %eax
shlq $0x4, %rax
addq %rax, %rcx
callq 0x6080
movq 0x20(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xdfa8
jmp 0xdfff
movl 0xc(%rsp), %esi
leaq 0x9198(%rip), %rdi      # 0x171a2
movb $0x0, %al
callq 0x6720
jmp 0xe013
movq 0x10(%rsp), %rax
cmpq $0x0, 0xe0(%rax)
je 0xe0a7
movq 0x10(%rsp), %rax
cmpl $0x0, 0xd8(%rax)
jbe 0xe0a7
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0xd8(%rcx), %eax
jae 0xe091
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x10(%rsp), %rax
movq 0xe0(%rax), %rax
movl 0xc(%rsp), %ecx
movq (%rax,%rcx,8), %rcx
callq 0x6230
movq 0x20(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xe03c
jmp 0xe093
movl 0xc(%rsp), %esi
leaq 0x9115(%rip), %rdi      # 0x171b3
movb $0x0, %al
callq 0x6720
jmp 0xe0a7
movq 0x10(%rsp), %rax
cmpq $0x0, 0x4f8(%rax)
je 0xe13b
movq 0x10(%rsp), %rax
cmpl $0x0, 0x4f0(%rax)
jbe 0xe13b
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x4f0(%rcx), %eax
jae 0xe125
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x10(%rsp), %rax
movq 0x4f8(%rax), %rax
movl 0xc(%rsp), %ecx
movq (%rax,%rcx,8), %rcx
callq 0x6160
movq 0x20(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xe0d0
jmp 0xe127
movl 0xc(%rsp), %esi
leaq 0x9092(%rip), %rdi      # 0x171c4
movb $0x0, %al
callq 0x6720
jmp 0xe13b
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
leaq 0x908e(%rip), %rdx      # 0x171da
callq 0x68d0
movq %rax, (%rsp)
movq 0x18(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movl $0x1, %eax
addq $0x28, %rsp
retq
nopl (%rax)