// File: tomfunkhouser[P]gaps/apps/gapsview/gapsview.cpp
// Function: GLUTMainLoop()
void GLUTMainLoop(void)
{
 // Set world bbbox
  world_bbox = R3null_box;
  for (int i = 0; i < scenes.NEntries(); i++) world_bbox.Union(scenes[i]->BBox());
  for (int i = 0; i < meshes.NEntries(); i++) world_bbox.Union(meshes[i]->BBox());
  for (int i = 0; i < pointsets.NEntries(); i++) world_bbox.Union(pointsets[i]->BBox());
  for (int i = 0; i < grids.NEntries(); i++) world_bbox.Union(grids[i]->WorldBox());
  for (int i = 0; i < sfls.NEntries(); i++) world_bbox.Union(sfls[i]->BBox());
  for (int i = 0; i < gsvs.NEntries(); i++) world_bbox.Union(gsvs[i]->BBox());

  // Set world origin
  world_origin = world_bbox.Centroid();

  // Set slice coords to middle of grid
  if (grids.NEntries() > 0) {
    grid_slice_coords[RN_X] = grids[0]->XResolution()/2;
    grid_slice_coords[RN_Y] = grids[0]->YResolution()/2;
    grid_slice_coords[RN_Z] = grids[0]->ZResolution()/2;
  }

  // Create viewer
  viewer = CreateViewer();
  if (!viewer) exit(-1);

   // Run main loop -- never returns 
  glutMainLoop();
}

// Assembly:
subq $0x98, %rsp
leaq 0x2d02fa(%rip), %rdi    # 0x2fe838
leaq 0x2d3fb3(%rip), %rsi    # 0x3024f8
callq 0x386d0
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
movl %eax, 0x1c(%rsp)
leaq 0x2d0271(%rip), %rdi    # 0x2fe7d8
callq 0x38730
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2e5b3
movl 0x94(%rsp), %esi
leaq 0x2d0254(%rip), %rdi    # 0x2fe7d8
callq 0x38740
movq (%rax), %rdi
callq 0x38760
movq %rax, %rsi
leaq 0x2d029d(%rip), %rdi    # 0x2fe838
callq 0x1538e0
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x2e555
movl $0x0, 0x90(%rsp)
movl 0x90(%rsp), %eax
movl %eax, 0x18(%rsp)
leaq 0x2d0218(%rip), %rdi    # 0x2fe7e8
callq 0x38730
movl %eax, %ecx
movl 0x18(%rsp), %eax
cmpl %ecx, %eax
jge 0x2e61c
movl 0x90(%rsp), %esi
leaq 0x2d01fb(%rip), %rdi    # 0x2fe7e8
callq 0x38780
movq (%rax), %rdi
callq 0x387a0
movq %rax, %rsi
leaq 0x2d0234(%rip), %rdi    # 0x2fe838
callq 0x1538e0
movl 0x90(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x90(%rsp)
jmp 0x2e5be
movl $0x0, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
movl %eax, 0x14(%rsp)
leaq 0x2d01bf(%rip), %rdi    # 0x2fe7f8
callq 0x38730
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x2e685
movl 0x8c(%rsp), %esi
leaq 0x2d01a2(%rip), %rdi    # 0x2fe7f8
callq 0x387c0
movq (%rax), %rdi
callq 0x387e0
movq %rax, %rsi
leaq 0x2d01cb(%rip), %rdi    # 0x2fe838
callq 0x1538e0
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x2e627
movl $0x0, 0x88(%rsp)
movl 0x88(%rsp), %eax
movl %eax, 0x10(%rsp)
leaq 0x2d0166(%rip), %rdi    # 0x2fe808
callq 0x38730
movl %eax, %ecx
movl 0x10(%rsp), %eax
cmpl %ecx, %eax
jge 0x2e723
movl 0x88(%rsp), %esi
leaq 0x2d0149(%rip), %rdi    # 0x2fe808
callq 0x38800
movq (%rax), %rsi
leaq 0x50(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x38820
movq 0x8(%rsp), %rsi
leaq 0x2d0156(%rip), %rdi    # 0x2fe838
callq 0x1538e0
jmp 0x2e6e9
leaq 0x50(%rsp), %rdi
callq 0x386c0
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
jmp 0x2e690
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x386c0
jmp 0x2e8a1
movl $0x0, 0x40(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x2d00de(%rip), %rdi    # 0x2fe818
callq 0x38730
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2e77d
movl 0x40(%rsp), %esi
leaq 0x2d00c4(%rip), %rdi    # 0x2fe818
callq 0x388e0
movq (%rax), %rdi
callq 0x38900
movq %rax, %rsi
leaq 0x2d00cd(%rip), %rdi    # 0x2fe838
callq 0x1538e0
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x2e72b
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, (%rsp)
leaq 0x2d0095(%rip), %rdi    # 0x2fe828
callq 0x38730
movl %eax, %ecx
movl (%rsp), %eax
cmpl %ecx, %eax
jge 0x2e7d5
movl 0x3c(%rsp), %esi
leaq 0x2d007c(%rip), %rdi    # 0x2fe828
callq 0x38920
movq (%rax), %rdi
callq 0x38940
movq %rax, %rsi
leaq 0x2d0075(%rip), %rdi    # 0x2fe838
callq 0x1538e0
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x2e785
leaq 0x20(%rsp), %rdi
leaq 0x2d0057(%rip), %rsi    # 0x2fe838
callq 0x153430
leaq 0x2d0083(%rip), %rdi    # 0x2fe870
leaq 0x20(%rsp), %rsi
callq 0x180420
leaq 0x2d000a(%rip), %rdi    # 0x2fe808
callq 0x38730
cmpl $0x0, %eax
jle 0x2e874
leaq 0x2cfff9(%rip), %rdi    # 0x2fe808
xorl %esi, %esi
callq 0x38800
movq (%rax), %rdi
callq 0x38990
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x2d0474(%rip)    # 0x2feca0
leaq 0x2cffd5(%rip), %rdi    # 0x2fe808
xorl %esi, %esi
callq 0x38800
movq (%rax), %rdi
callq 0x389b0
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x2d0454(%rip)    # 0x2feca4
leaq 0x2cffb1(%rip), %rdi    # 0x2fe808
xorl %esi, %esi
callq 0x38800
movq (%rax), %rdi
callq 0x389d0
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x2d0434(%rip)    # 0x2feca8
callq 0x2e8b0
movq %rax, 0x2d0430(%rip)    # 0x2fecb0
cmpq $0x0, 0x2d0428(%rip)    # 0x2fecb0
jne 0x2e894
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x29c60
callq 0x1f9200
addq $0x98, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0x29c10
nopl (%rax,%rax)