// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/sflview/sflview.cpp
// Function: main
int main(int argc, char **argv)
{
  // Initialize packages
  if (!R3InitGraphics()) exit(-1);
  if (!R3InitSurfels()) exit(-1);

  // Parse program arguments
  if (!ParseArgs(argc, argv)) exit(-1);

  // Open scene
  scene = OpenScene(scene_name, database_name);
  if (!scene) exit(-1);

  // Read model
  if (model_name) {
    model = ReadModel(model_name);
    if (!model) exit(-1);
  }

  // Read images
  if (pixel_database) {
    if (!ReadImagesFromPixelDatabase(scene, pixel_database)) exit(-1);
  }
  else if (image_directory) {
    if (!ReadImagesFromDirectory(scene, image_directory)) exit(-1);
  }
  
  // Create viewer
  viewer = new R3SurfelViewer(scene);
  if (!viewer) exit(-1);

  // Initialize GLUT
  GLUTInit(&argc, argv);

  // Run GLUT interface
  GLUTMainLoop();

  // Return success 
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r13
movl %edi, %ebx
movl %edi, 0x1c(%rsp)
callq 0x5be74
testl %eax, %eax
je 0x2ba70
callq 0x337b0
testl %eax, %eax
je 0x2ba70
leaq 0xeef47(%rip), %r14     # 0x11a186
leaq 0xeef50(%rip), %r15     # 0x11a196
leaq 0xeef5a(%rip), %r12     # 0x11a1a7
movq %r13, 0x70(%rsp)
cmpl $0x2, %ebx
jl 0x2b5bd
leal -0x1(%rbx), %eax
leaq 0x8(%r13), %rcx
movq (%rcx), %rbp
cmpb $0x2d, (%rbp)
jne 0x2b447
cmpb $0x76, 0x1(%rbp)
jne 0x2b27f
cmpb $0x0, 0x2(%rbp)
je 0x2b4b2
movq %rbp, %rdi
movq %r14, %rsi
callq 0x27d90
testl %eax, %eax
je 0x2b47b
movq %rbp, %rdi
movq %r15, %rsi
callq 0x27d90
testl %eax, %eax
je 0x2b49b
movq %rbp, %rdi
movq %r12, %rsi
callq 0x27d90
testl %eax, %eax
je 0x2b4c3
movq %rbp, %rdi
leaq 0xeeef2(%rip), %rsi     # 0x11a1b4
callq 0x27d90
testl %eax, %eax
je 0x2b4e0
movq %rbp, %rdi
leaq 0xeeeeb(%rip), %rsi     # 0x11a1c4
callq 0x27d90
testl %eax, %eax
je 0x2b4fd
movq %rbp, %rdi
leaq 0xeeedc(%rip), %rsi     # 0x11a1cc
callq 0x27d90
testl %eax, %eax
je 0x2b527
movq %rbp, %rdi
leaq 0xeeed1(%rip), %rsi     # 0x11a1d8
callq 0x27d90
testl %eax, %eax
je 0x2b566
movq %rbp, %rdi
leaq 0xeeec2(%rip), %rsi     # 0x11a1e0
callq 0x27d90
testl %eax, %eax
jne 0x2ba1b
movq 0x10(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x10(%rsp)
movq 0x18(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x60(%rsp)
movq 0x28(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x68(%rsp)
movq 0x30(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x58(%rsp)
movq 0x38(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x50(%rsp)
movq 0x40(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x48(%rsp)
movq 0x48(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x40(%rsp)
addl $-0xa, %ebx
movq 0x50(%r13), %rdi
addq $0x50, %r13
callq 0x27be0
movsd %xmm0, 0x38(%rsp)
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x60(%rsp), %xmm2
callq 0xb2320
leaq 0x181561(%rip), %rdi    # 0x1ac940
movq %rbp, %rsi
callq 0xb260a
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x181563(%rip)   # 0x1ac958
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x18155d(%rip)   # 0x1ac960
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x181557(%rip)   # 0x1ac968
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x181551(%rip)   # 0x1ac970
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x18154b(%rip)   # 0x1ac978
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x181545(%rip)   # 0x1ac980
movb $0x1, 0x181572(%rip)    # 0x1ac9b4
jmp 0x2b252
cmpq $0x0, 0x181569(%rip)    # 0x1ac9b8
je 0x2b472
cmpq $0x0, 0x181567(%rip)    # 0x1ac9c0
je 0x2b492
cmpq $0x0, 0x181565(%rip)    # 0x1ac9c8
jne 0x2ba1b
movq %rbp, 0x181558(%rip)    # 0x1ac9c8
jmp 0x2b4b9
movq %rbp, 0x18153f(%rip)    # 0x1ac9b8
jmp 0x2b4b9
addl $-0x2, %ebx
movq 0x10(%r13), %rax
addq $0x10, %r13
movq %rax, 0x18154b(%rip)    # 0x1ac9d8
jmp 0x2b252
movq %rbp, 0x181527(%rip)    # 0x1ac9c0
jmp 0x2b4b9
addl $-0x2, %ebx
movq 0x10(%r13), %rax
addq $0x10, %r13
movq %rax, 0x181533(%rip)    # 0x1ac9e0
jmp 0x2b252
movb $0x1, 0x18152f(%rip)    # 0x1ac9e8
movq %rcx, %r13
movl %eax, %ebx
jmp 0x2b252
addl $-0x2, %ebx
movq 0x10(%r13), %rdi
addq $0x10, %r13
callq 0x27be0
movsd %xmm0, 0x17c535(%rip)   # 0x1a7a10
jmp 0x2b252
addl $-0x2, %ebx
movq 0x10(%r13), %rdi
addq $0x10, %r13
callq 0x27be0
movsd %xmm0, 0x17c520(%rip)   # 0x1a7a18
jmp 0x2b252
movq 0x10(%r13), %rdi
callq 0x27f60
movl %eax, 0x17c4f4(%rip)    # 0x1a7a00
addl $-0x3, %ebx
movq 0x18(%r13), %rdi
addq $0x18, %r13
callq 0x27f60
movl %eax, 0x17c4e2(%rip)    # 0x1a7a04
jmp 0x2b252
movq 0x10(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x1813f0(%rip)   # 0x1ac928
movq 0x18(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x1813e7(%rip)   # 0x1ac930
addl $-0x4, %ebx
movq 0x20(%r13), %rdi
addq $0x20, %r13
callq 0x27be0
movsd %xmm0, 0x1813d7(%rip)   # 0x1ac938
jmp 0x2b252
movq 0x10(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x10(%rsp)
movq 0x18(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x8(%rsp)
addl $-0x4, %ebx
movq 0x20(%r13), %rdi
addq $0x20, %r13
callq 0x27be0
movsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x1813e6(%rip)   # 0x1ac988
movsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x1813e0(%rip)   # 0x1ac990
movsd %xmm0, 0x1813e0(%rip)   # 0x1ac998
jmp 0x2b252
movq 0x1813f4(%rip), %r14    # 0x1ac9b8
testq %r14, %r14
je 0x2ba30
movq 0x1813ec(%rip), %r15    # 0x1ac9c0
testq %r15, %r15
je 0x2ba30
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xd051a
movq %rbx, %rdi
callq 0x2baa4
movl $0x1f0, %edi            # imm = 0x1F0
callq 0x27920
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x44388
movq 0x70(%rsp), %r12
movq (%rbx), %rax
leaq 0xfd04b(%rip), %rcx     # 0x128663
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rcx, %r8
callq *0xe8(%rax)
testl %eax, %eax
je 0x2ba40
cmpb $0x1, 0x1813af(%rip)    # 0x1ac9e8
jne 0x2b76f
leaq 0xeecdb(%rip), %rdi     # 0x11a321
callq 0x27f30
leaq 0x20(%rsp), %rdi
callq 0xd0554
leaq 0xeea71(%rip), %rdi     # 0x11a0cd
movb $0x1, %al
callq 0x27080
movl 0x1c(%rbx), %esi
leaq 0xeea77(%rip), %rdi     # 0x11a0e4
xorl %eax, %eax
callq 0x27080
movl 0x2c(%rbx), %esi
leaq 0xeea78(%rip), %rdi     # 0x11a0f6
xorl %eax, %eax
callq 0x27080
movl 0x3c(%rbx), %esi
leaq 0xeeba7(%rip), %rdi     # 0x11a236
xorl %eax, %eax
callq 0x27080
movl 0x4c(%rbx), %esi
leaq 0xeebb2(%rip), %rdi     # 0x11a252
xorl %eax, %eax
callq 0x27080
movl 0x5c(%rbx), %esi
leaq 0xeebbc(%rip), %rdi     # 0x11a26d
xorl %eax, %eax
callq 0x27080
movl 0x6c(%rbx), %esi
leaq 0xeebca(%rip), %rdi     # 0x11a28c
xorl %eax, %eax
callq 0x27080
movl 0x7c(%rbx), %esi
leaq 0xeea34(%rip), %rdi     # 0x11a107
xorl %eax, %eax
callq 0x27080
movl 0xac(%rbx), %esi
leaq 0xeea36(%rip), %rdi     # 0x11a11d
xorl %eax, %eax
callq 0x27080
movl 0x8c(%rbx), %esi
leaq 0xeea35(%rip), %rdi     # 0x11a130
xorl %eax, %eax
callq 0x27080
movl 0x9c(%rbx), %esi
leaq 0xeea31(%rip), %rdi     # 0x11a140
xorl %eax, %eax
callq 0x27080
movq 0x8(%rbx), %rax
movl 0x24(%rax), %esi
leaq 0xeea2d(%rip), %rdi     # 0x11a151
xorl %eax, %eax
callq 0x27080
movq 0x8(%rbx), %rdi
callq 0x2baac
leaq 0xeea26(%rip), %rdi     # 0x11a161
movl %eax, %esi
xorl %eax, %eax
callq 0x27080
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x2bace
leaq 0xeea1c(%rip), %rdi     # 0x11a172
movq %rax, %rsi
xorl %eax, %eax
callq 0x27080
movq 0x17b759(%rip), %rax    # 0x1a6ec0
movq (%rax), %rdi
callq 0x27af0
movq %rbx, 0x181232(%rip)    # 0x1ac9a8
movq 0x18124b(%rip), %r14    # 0x1ac9c8
testq %r14, %r14
je 0x2b81e
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xd051a
movq %rbx, %rdi
callq 0x2baa4
movl $0x160, %edi            # imm = 0x160
callq 0x27920
movq %rax, %rbx
movq %rax, %rdi
callq 0x5bed6
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5cf2c
testl %eax, %eax
je 0x2ba53
cmpb $0x1, 0x18121c(%rip)    # 0x1ac9e8
jne 0x2b817
leaq 0xeead5(%rip), %rdi     # 0x11a2aa
movq %r14, %rsi
xorl %eax, %eax
callq 0x27080
leaq 0x20(%rsp), %rdi
callq 0xd0554
leaq 0xee8dd(%rip), %rdi     # 0x11a0cd
movb $0x1, %al
callq 0x27080
movl 0x14(%rbx), %esi
leaq 0xee950(%rip), %rdi     # 0x11a151
xorl %eax, %eax
callq 0x27080
movq 0x17b6b1(%rip), %rax    # 0x1a6ec0
movq (%rax), %rdi
callq 0x27af0
movq %rbx, 0x1811b2(%rip)    # 0x1ac9d0
movq 0x1811b3(%rip), %r14    # 0x1ac9d8
testq %r14, %r14
je 0x2b8bd
movq 0x181173(%rip), %rbx    # 0x1ac9a8
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0xd051a
movq %r15, %rdi
callq 0x2baa4
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4ff1d
testl %eax, %eax
je 0x2ba70
cmpb $0x1, 0x181182(%rip)    # 0x1ac9e8
jne 0x2b9d5
movl 0x9c(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq %rcx, %rax
je 0x2b968
movq 0x90(%rbx), %rdx
movq (%rdx,%rcx,8), %rdi
movl 0x2c(%rdi), %esi
xorl %edx, %edx
testl %esi, %esi
jle 0x2b8b6
movq 0x20(%rdi), %rdi
cmpq $0x1, (%rdi)
sbbl $-0x1, %r15d
cmpl $0x4, %esi
jb 0x2b8b6
xorl %edx, %edx
cmpq $0x0, 0x18(%rdi)
setne %dl
addl %edx, %ebp
incq %rcx
jmp 0x2b87e
movq 0x18111c(%rip), %r14    # 0x1ac9e0
testq %r14, %r14
je 0x2b9d5
movq 0x1810d4(%rip), %rbx    # 0x1ac9a8
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0xd051a
movq %r15, %rdi
callq 0x2baa4
movsd 0x17c11f(%rip), %xmm0   # 0x1a7a10
movsd 0x17c11f(%rip), %xmm1   # 0x1a7a18
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4fb9f
testl %eax, %eax
je 0x2ba70
cmpb $0x1, 0x1810d3(%rip)    # 0x1ac9e8
jne 0x2b9d5
movl 0x9c(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq %rcx, %rax
je 0x2b968
movq 0x90(%rbx), %rdx
movq (%rdx,%rcx,8), %rdi
movl 0x2c(%rdi), %esi
xorl %edx, %edx
testl %esi, %esi
jle 0x2b961
movq 0x20(%rdi), %rdi
cmpq $0x1, (%rdi)
sbbl $-0x1, %r15d
cmpl $0x4, %esi
jb 0x2b961
xorl %edx, %edx
cmpq $0x0, 0x18(%rdi)
setne %dl
addl %edx, %ebp
incq %rcx
jmp 0x2b92d
leaq 0xee953(%rip), %rdi     # 0x11a2c2
movq %r14, %rsi
xorl %eax, %eax
callq 0x27080
leaq 0x20(%rsp), %rdi
callq 0xd0554
leaq 0xee743(%rip), %rdi     # 0x11a0cd
movb $0x1, %al
callq 0x27080
movl 0x9c(%rbx), %esi
leaq 0xee7a2(%rip), %rdi     # 0x11a140
xorl %eax, %eax
callq 0x27080
leaq 0xee937(%rip), %rdi     # 0x11a2e3
movl %r15d, %esi
xorl %eax, %eax
callq 0x27080
leaq 0xee93c(%rip), %rdi     # 0x11a2f9
movl %ebp, %esi
xorl %eax, %eax
callq 0x27080
movq 0x17b4f3(%rip), %rax    # 0x1a6ec0
movq (%rax), %rdi
callq 0x27af0
movl $0x618, %edi            # imm = 0x618
callq 0x27920
movq %rax, %rbx
movq 0x180fbf(%rip), %rsi    # 0x1ac9a8
movq %rax, %rdi
callq 0x2bba0
movq %rbx, 0x180fa8(%rip)    # 0x1ac9a0
leaq 0x1c(%rsp), %rdi
movq %r12, %rsi
callq 0x2b0a7
callq 0x2b143
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xee7c6(%rip), %rdi     # 0x11a1e8
movq %rbp, %rsi
xorl %eax, %eax
callq 0xd3412
pushq $0x1
jmp 0x2ba72
leaq 0xee7ce(%rip), %rdi     # 0x11a205
xorl %eax, %eax
callq 0xd3412
jmp 0x2ba70
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
andq $0x0, 0x180f57(%rip)    # 0x1ac9a8
jmp 0x2ba70
movq %rbx, %rdi
callq 0x5c06e
movl $0x160, %esi            # imm = 0x160
movq %rbx, %rdi
callq 0x27940
andq $0x0, 0x180f60(%rip)    # 0x1ac9d0
pushq $-0x1
popq %rdi
callq 0x27b50
movq %rax, %r14
movl $0x160, %esi            # imm = 0x160
jmp 0x2ba94
movq %rax, %r14
movl $0x618, %esi            # imm = 0x618
jmp 0x2ba94
movq %rax, %r14
movl $0x1f0, %esi            # imm = 0x1F0
movq %rbx, %rdi
callq 0x27940
movq %r14, %rdi
callq 0x28140