// File: /workspace/github_c_makefile_star2_O0/AlexCharlton[P]Hyperscene/src/scene.c
// Function: hpsAddNode
HPSnode *hpsAddNode(HPSnode *parent, void *data,
                    HPSpipeline *pipeline,
                    void (*deleteFunc)(void *)){
    HPSscene *scene = hpsGetScene(parent);
    HPSnode *node = hpsAllocateFrom(scene->nodePool);
    node->transform = hpsAllocateFrom(scene->transformPool);
    node->partitionData.data = node;
    node->partitionData.boundingSphere = hpsAllocateFrom(scene->boundingSpherePool);
    hpmIdentityMat4(node->transform);
    initBoundingSphere(node->partitionData.boundingSphere);
    node->position.x = 0.0; node->position.y = 0.0; node->position.z = 0.0;
    node->rotation.x = 0.0; node->rotation.y = 0.0; node->rotation.z = 0.0; 
    node->rotation.w = 1.0;
    node->data = data;
    node->pipeline = pipeline;
    node->extension = NULL;
    node->parent = parent;
    node->delete = deleteFunc;
    node->needsUpdate = true;
    hpsInitVector(&node->children, 0);
    scene->partitionInterface->addNode(&node->partitionData, scene->partitionStruct);
    if ((HPSscene *) parent == scene)
        hpsPush(&scene->topLevelNodes, node);
    else
        hpsPush(&parent->children, node);
    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4250
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x4510
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x4510
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x4510
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x42f0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xd940
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x48(%rax)
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x4c(%rax)
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x50(%rax)
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x54(%rax)
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x58(%rax)
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x5c(%rax)
movq -0x30(%rbp), %rax
movss 0x17b0(%rip), %xmm0     # 0xf030
movss %xmm0, 0x60(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x78(%rax)
movq -0x8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x30(%rbp), %rax
movb $0x1, 0x90(%rax)
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4090
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rsi
callq *%rax
movq -0x8(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0xd91d
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rsi
callq 0x4320
jmp 0xd92e
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
movq -0x30(%rbp), %rsi
callq 0x4320
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)