// File: /workspace/github_cpp_makefile_star2_O3/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 0x10923a(%rip), %r15    # 0x145518
leaq 0x8(%r15), %rsi
callq 0x75732
leaq 0x188(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0x75732
cmpl $0x0, 0x3c(%rbx)
jle 0x3c364
leaq 0x58(%rbx), %r15
xorl %ebp, %ebp
movq %rsp, %r12
movq 0x30(%rbx), %rax
movq (%rax,%rbp,8), %r13
movsd 0x30(%r13), %xmm0
ucomisd 0x9f891(%rip), %xmm0    # 0xdbbb0
jne 0x3c32b
jp 0x3c32b
movq %r13, %rdi
callq 0x3dc5e
addq $0x28, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x6ccdc
movq %r12, %rdi
movq %r15, %rsi
callq 0x6d9c8
movq %r14, %rdi
movq %r12, %rsi
callq 0x6d794
movq %r12, %rdi
callq 0x6dafc
incq %rbp
movslq 0x3c(%rbx), %rax
cmpq %rax, %rbp
jl 0x3c309
movl 0x4c(%rbx), %eax
testl %eax, %eax
jle 0x3c3e2
leaq 0x58(%rbx), %r15
xorl %ebp, %ebp
movq %rsp, %r12
movq 0x40(%rbx), %rcx
movq (%rcx,%rbp,8), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x3c3d7
movq (%rcx), %r13
movsd 0x170(%r13), %xmm0
ucomisd 0x9f818(%rip), %xmm0    # 0xdbbb0
jne 0x3c3a4
jp 0x3c3a4
movq %r13, %rdi
callq 0x3c2b8
addq $0x168, %r13            # imm = 0x168
movq %r12, %rdi
movq %r13, %rsi
callq 0x6ccdc
movq %r12, %rdi
movq %r15, %rsi
callq 0x6d9c8
movq %r14, %rdi
movq %r12, %rsi
callq 0x6d794
movq %r12, %rdi
callq 0x6dafc
movl 0x4c(%rbx), %eax
incq %rbp
movslq %eax, %rcx
cmpq %rcx, %rbp
jl 0x3c374
cmpl $0x0, 0x2c(%rbx)
jle 0x3c452
leaq 0x58(%rbx), %r15
xorl %ebp, %ebp
movq %rsp, %r12
movq 0x20(%rbx), %rax
movq (%rax,%rbp,8), %r13
movsd 0x170(%r13), %xmm0
ucomisd 0x9f7a6(%rip), %xmm0    # 0xdbbb0
jne 0x3c416
jp 0x3c416
movq %r13, %rdi
callq 0x3c2b8
addq $0x168, %r13            # imm = 0x168
movq %r12, %rdi
movq %r13, %rsi
callq 0x6ccdc
movq %r12, %rdi
movq %r15, %rsi
callq 0x6d9c8
movq %r14, %rdi
movq %r12, %rsi
callq 0x6d794
movq %r12, %rdi
callq 0x6dafc
incq %rbp
movslq 0x2c(%rbx), %rax
cmpq %rax, %rbp
jl 0x3c3f1
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3c465
jmp 0x3c465
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6dafc
movq %rbx, %rdi
callq 0x220c0