// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonassimp/src/scene.c
// Function: Delete
static int Delete(lua_State *L)
    {
    unsigned int i;
    scene_t *scene = testscene(L, 1);
    if(!scene) return 0; /* already deleted */
    /* first, release all userdata */
#define Free(what, freefunc) do {                   \
    if(scene->mNum##what > 0)                       \
        {                                           \
        for(i=0; i < scene->mNum##what; i++)        \
            freefunc(L, scene->m##what[i]);         \
        }                                           \
} while(0)
    Free(Meshes, freemesh);
    Free(Materials, freematerial);
    Free(Lights, freelight);
    Free(Textures, freetexture);
    Free(Cameras, freecamera);
    Free(Animations, freeanimation);
#undef Free
    if(scene->mRootNode)
        freenode(L, scene->mRootNode);
    TRACE_DELETE(scene, "scene");
    freeuserdata(L, scene);
    /* finally, release the scene */
    aiReleaseImport(scene);
    return 0;
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
leaq 0x4f14(%rip), %rdx      # 0x168ee
callq 0x65c0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x119f9
movl $0x0, 0x24(%rsp)
jmp 0x11c28
jmp 0x119fb
movq 0x8(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jbe 0x11a46
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x11a44
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x6510
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x11a0e
jmp 0x11a46
jmp 0x11a48
jmp 0x11a4a
movq 0x8(%rsp), %rax
cmpl $0x0, 0x20(%rax)
jbe 0x11a95
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x11a93
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x66a0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x11a5d
jmp 0x11a95
jmp 0x11a97
jmp 0x11a99
movq 0x8(%rsp), %rax
cmpl $0x0, 0x50(%rax)
jbe 0x11ae4
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x50(%rcx), %eax
jae 0x11ae2
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x58(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x6890
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x11aac
jmp 0x11ae4
jmp 0x11ae6
jmp 0x11ae8
movq 0x8(%rsp), %rax
cmpl $0x0, 0x40(%rax)
jbe 0x11b33
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x40(%rcx), %eax
jae 0x11b31
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x6800
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x11afb
jmp 0x11b33
jmp 0x11b35
jmp 0x11b37
movq 0x8(%rsp), %rax
cmpl $0x0, 0x60(%rax)
jbe 0x11b82
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x60(%rcx), %eax
jae 0x11b80
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x66e0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x11b4a
jmp 0x11b82
jmp 0x11b84
jmp 0x11b86
movq 0x8(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jbe 0x11bd1
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x30(%rcx), %eax
jae 0x11bcf
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x60d0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x11b99
jmp 0x11bd1
jmp 0x11bd3
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x11bf2
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x63c0
jmp 0x11bf4
movq 0x8(%rsp), %rsi
leaq 0x599f(%rip), %rdi      # 0x1759f
movb $0x0, %al
callq 0x6720
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x6400
movq 0x8(%rsp), %rdi
callq 0x6060
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)