// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonassimp/src/scene.c
// Function: moonassimp_newscene
int newscene(lua_State *L, scene_t *scene)
/* recursively creates the userdata for the scene,
 * the root node and its children, and all other nested objects */
    {
    unsigned int i;
    TRACE_CREATE(scene, "scene");
    if(scene->mRootNode)
        {
        newnode(L, scene, scene->mRootNode);
        lua_pop(L, 1);
        }
#define New(what, newfunc) do {                     \
    for(i=0; i< scene->mNum##what; i++)             \
        { newfunc(L, scene, scene->m##what[i]); lua_pop(L, 1);  } } while(0)
    New(Meshes, newmesh);
    New(Materials, newmaterial);
    New(Lights, newlight);
    New(Textures, newtexture);
    New(Cameras, newcamera);
    New(Animations, newanimation);
#undef New
    newuserdata(L, (void*)scene, SCENE_MT);
    return 1;   
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rsp), %rsi
leaq 0x6a16(%rip), %rdi      # 0x174f0
movb $0x0, %al
callq 0x6720
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x10b14
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdx
callq 0x6480
movq 0x10(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
jmp 0x10b16
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x10b68
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x4(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
callq 0x6140
movq 0x10(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x10b1e
jmp 0x10b6a
jmp 0x10b6c
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jae 0x10bbe
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movl 0x4(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
callq 0x6710
movq 0x10(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x10b74
jmp 0x10bc0
jmp 0x10bc2
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x50(%rcx), %eax
jae 0x10c14
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x8(%rsp), %rax
movq 0x58(%rax), %rax
movl 0x4(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
callq 0x6220
movq 0x10(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x10bca
jmp 0x10c16
jmp 0x10c18
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x40(%rcx), %eax
jae 0x10c6a
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movl 0x4(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
callq 0x6150
movq 0x10(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x10c20
jmp 0x10c6c
jmp 0x10c6e
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x60(%rcx), %eax
jae 0x10cc0
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x8(%rsp), %rax
movq 0x68(%rax), %rax
movl 0x4(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
callq 0x68f0
movq 0x10(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x10c76
jmp 0x10cc2
jmp 0x10cc4
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x30(%rcx), %eax
jae 0x10d16
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x4(%rsp), %ecx
movq (%rax,%rcx,8), %rdx
callq 0x68a0
movq 0x10(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x60c0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x10ccc
jmp 0x10d18
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x5bc5(%rip), %rdx      # 0x168ee
callq 0x68d0
movl $0x1, %eax
addq $0x18, %rsp
retq
nopl (%rax,%rax)