// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::UpdateBBox()
void R3SceneNode::
UpdateBBox(void)
{
  // Initialize bounding box
  bbox = R3null_box;

  // Add bounding box of elements
  for (int i = 0; i < elements.NEntries(); i++) {
    R3SceneElement *element = elements.Kth(i);
    R3Box element_bbox = element->BBox();
    element_bbox.Transform(transformation);
    bbox.Union(element_bbox);
  }
    
  // Add bounding box of references
  for (int i = 0; i < references.NEntries(); i++) {
    R3SceneReference *reference = references.Kth(i);
    R3Scene *referenced_scene = reference->ReferencedScene();
    if (!referenced_scene) continue;
    R3Box reference_bbox = referenced_scene->BBox();
    reference_bbox.Transform(transformation);
    bbox.Union(reference_bbox);
  }
    
  // Add bounding box of children nodes
  for (int i = 0; i < children.NEntries(); i++) {
    R3SceneNode *child = children.Kth(i);
    R3Box child_bbox = child->BBox();
    child_bbox.Transform(transformation);
    bbox.Union(child_bbox);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x168(%rdi), %r14
addq $0x170, %rdi            # imm = 0x170
leaq 0x10ad28(%rip), %r15    # 0x147518
leaq 0x8(%r15), %rsi
callq 0x76628
leaq 0x188(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0x76628
cmpl $0x0, 0x3c(%rbx)
jle 0x3c876
leaq 0x58(%rbx), %r15
xorl %ebp, %ebp
movq %rsp, %r12
movq 0x30(%rbx), %rax
movq (%rax,%rbp,8), %r13
movsd 0x30(%r13), %xmm0
ucomisd 0xa136f(%rip), %xmm0    # 0xddba0
jne 0x3c83d
jp 0x3c83d
movq %r13, %rdi
callq 0x3e114
addq $0x28, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x6daec
movq %r12, %rdi
movq %r15, %rsi
callq 0x6e810
movq %r14, %rdi
movq %r12, %rsi
callq 0x6e5d4
movq %r12, %rdi
callq 0x6e944
incq %rbp
movslq 0x3c(%rbx), %rax
cmpq %rax, %rbp
jl 0x3c81b
cmpl $0x0, 0x4c(%rbx)
jle 0x3c8f1
leaq 0x58(%rbx), %r15
xorl %ebp, %ebp
movq %rsp, %r12
movq 0x40(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x3c8e5
movq (%rax), %r13
movsd 0x170(%r13), %xmm0
ucomisd 0xa12f7(%rip), %xmm0    # 0xddba0
jne 0x3c8b5
jp 0x3c8b5
movq %r13, %rdi
callq 0x3c7ca
addq $0x168, %r13            # imm = 0x168
movq %r12, %rdi
movq %r13, %rsi
callq 0x6daec
movq %r12, %rdi
movq %r15, %rsi
callq 0x6e810
movq %r14, %rdi
movq %r12, %rsi
callq 0x6e5d4
movq %r12, %rdi
callq 0x6e944
incq %rbp
movslq 0x4c(%rbx), %rax
cmpq %rax, %rbp
jl 0x3c885
cmpl $0x0, 0x2c(%rbx)
jle 0x3c961
leaq 0x58(%rbx), %r15
xorl %ebp, %ebp
movq %rsp, %r12
movq 0x20(%rbx), %rax
movq (%rax,%rbp,8), %r13
movsd 0x170(%r13), %xmm0
ucomisd 0xa1287(%rip), %xmm0    # 0xddba0
jne 0x3c925
jp 0x3c925
movq %r13, %rdi
callq 0x3c7ca
addq $0x168, %r13            # imm = 0x168
movq %r12, %rdi
movq %r13, %rsi
callq 0x6daec
movq %r12, %rdi
movq %r15, %rsi
callq 0x6e810
movq %r14, %rdi
movq %r12, %rsi
callq 0x6e5d4
movq %r12, %rdi
callq 0x6e944
incq %rbp
movslq 0x2c(%rbx), %rax
cmpq %rax, %rbp
jl 0x3c900
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3c974
jmp 0x3c974
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6e944
movq %rbx, %rdi
callq 0x220d0
nop