// File: /workspace/github_cpp_makefile_star2_O1/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, 0x20(%rsp)
movl %edi, 0xc(%rsp)
callq 0x62a4c
testl %eax, %eax
je 0x2c93b
callq 0x34ed0
testl %eax, %eax
je 0x2c93b
movl 0xc(%rsp), %ebp
cmpl $0x2, %ebp
jl 0x2c38c
leaq 0x10f19a(%rip), %r14    # 0x13b186
movq 0x20(%rsp), %r12
leal -0x1(%rbp), %r15d
leaq 0x8(%r12), %r13
movq 0x8(%r12), %rbx
cmpb $0x2d, (%rbx)
jne 0x2c1f8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x27d70
testl %eax, %eax
je 0x2c226
movq %rbx, %rdi
leaq 0x10f164(%rip), %rsi    # 0x13b189
callq 0x27d70
testl %eax, %eax
je 0x2c23e
movq %rbx, %rdi
leaq 0x10f15d(%rip), %rsi    # 0x13b199
callq 0x27d70
testl %eax, %eax
je 0x2c262
movq %rbx, %rdi
leaq 0x10f157(%rip), %rsi    # 0x13b1aa
callq 0x27d70
testl %eax, %eax
je 0x2c27a
movq %rbx, %rdi
leaq 0x10f14d(%rip), %rsi    # 0x13b1b7
callq 0x27d70
testl %eax, %eax
je 0x2c298
movq %rbx, %rdi
leaq 0x10f146(%rip), %rsi    # 0x13b1c7
callq 0x27d70
testl %eax, %eax
je 0x2c2b6
movq %rbx, %rdi
leaq 0x10f137(%rip), %rsi    # 0x13b1cf
callq 0x27d70
testl %eax, %eax
je 0x2c2e2
movq %rbx, %rdi
leaq 0x10f12c(%rip), %rsi    # 0x13b1db
callq 0x27d70
testl %eax, %eax
je 0x2c321
movq %rbx, %rdi
leaq 0x10f11d(%rip), %rsi    # 0x13b1e3
callq 0x27d70
testl %eax, %eax
jne 0x2c912
movq 0x10(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x18(%rsp)
movq 0x18(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x10(%rsp)
movq 0x20(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x68(%rsp)
movq 0x28(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x70(%rsp)
movq 0x30(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x60(%rsp)
movq 0x38(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x58(%rsp)
movq 0x40(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x50(%rsp)
movq 0x48(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x48(%rsp)
addl $-0xa, %ebp
movq 0x50(%r12), %rdi
addq $0x50, %r12
callq 0x27bf0
movsd %xmm0, 0x40(%rsp)
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x68(%rsp), %xmm2
callq 0xc531e
leaq 0x198790(%rip), %rdi    # 0x1c4920
movq %rbx, %rsi
callq 0xc568c
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x198792(%rip)   # 0x1c4938
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x19878c(%rip)   # 0x1c4940
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x198786(%rip)   # 0x1c4948
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x198780(%rip)   # 0x1c4950
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x19877a(%rip)   # 0x1c4958
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x198774(%rip)   # 0x1c4960
movb $0x1, 0x1987a1(%rip)    # 0x1c4994
jmp 0x2c376
cmpq $0x0, 0x198798(%rip)    # 0x1c4998
je 0x2c232
cmpq $0x0, 0x198796(%rip)    # 0x1c49a0
je 0x2c256
cmpq $0x0, 0x198794(%rip)    # 0x1c49a8
jne 0x2c912
movq %rbx, 0x198787(%rip)    # 0x1c49a8
jmp 0x2c37c
movb $0x1, 0x19879b(%rip)    # 0x1c49c8
jmp 0x2c37c
movq %rbx, 0x19875f(%rip)    # 0x1c4998
jmp 0x2c37c
addl $-0x2, %ebp
movq 0x10(%r12), %rax
addq $0x10, %r12
movq %rax, 0x198767(%rip)    # 0x1c49b8
jmp 0x2c376
movq %rbx, 0x198743(%rip)    # 0x1c49a0
jmp 0x2c37c
addl $-0x2, %ebp
movq 0x10(%r12), %rax
addq $0x10, %r12
movq %rax, 0x19874b(%rip)    # 0x1c49c0
jmp 0x2c376
addl $-0x2, %ebp
movq 0x10(%r12), %rdi
addq $0x10, %r12
callq 0x27bf0
movsd %xmm0, 0x19375d(%rip)   # 0x1bf9f0
jmp 0x2c376
addl $-0x2, %ebp
movq 0x10(%r12), %rdi
addq $0x10, %r12
callq 0x27bf0
movsd %xmm0, 0x193747(%rip)   # 0x1bf9f8
jmp 0x2c376
movq 0x10(%r12), %rdi
callq 0x27f60
movl %eax, 0x19371a(%rip)    # 0x1bf9e0
addl $-0x3, %ebp
movq 0x18(%r12), %rdi
addq $0x18, %r12
callq 0x27f60
movl %eax, 0x193707(%rip)    # 0x1bf9e4
jmp 0x2c376
movq 0x10(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x198614(%rip)   # 0x1c4908
movq 0x18(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x19860a(%rip)   # 0x1c4910
addl $-0x4, %ebp
movq 0x20(%r12), %rdi
addq $0x20, %r12
callq 0x27bf0
movsd %xmm0, 0x1985f9(%rip)   # 0x1c4918
jmp 0x2c376
movq 0x10(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x18(%rsp)
movq 0x18(%r12), %rdi
callq 0x27bf0
movsd %xmm0, 0x10(%rsp)
addl $-0x4, %ebp
movq 0x20(%r12), %rdi
addq $0x20, %r12
callq 0x27bf0
movsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x198608(%rip)   # 0x1c4968
movsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x198602(%rip)   # 0x1c4970
movsd %xmm0, 0x198602(%rip)   # 0x1c4978
movq %r12, %r13
movl %ebp, %r15d
movl %r15d, %ebp
movq %r13, %r12
cmpl $0x1, %r15d
jg 0x2bff1
cmpq $0x0, 0x198604(%rip)    # 0x1c4998
je 0x2c92d
cmpq $0x0, 0x1985fe(%rip)    # 0x1c49a0
je 0x2c92d
movq 0x1985e9(%rip), %rbx    # 0x1c4998
movq 0x1985ea(%rip), %r15    # 0x1c49a0
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0xe692c
movq %r14, %rdi
xorl %esi, %esi
callq 0x28030
movl $0x1f0, %edi            # imm = 0x1F0
callq 0x27910
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
callq 0x483a8
movq (%r14), %rax
leaq 0x11d545(%rip), %rcx    # 0x149933
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %rcx, %r8
callq *0xe8(%rax)
testl %eax, %eax
je 0x2c5af
cmpb $0x1, 0x1985b9(%rip)    # 0x1c49c8
jne 0x2c5bb
leaq 0x10ef08(%rip), %rdi    # 0x13b324
callq 0x27f20
leaq 0x28(%rsp), %rdi
callq 0xe698e
leaq 0x10ec9b(%rip), %rdi    # 0x13b0cd
movb $0x1, %al
callq 0x27080
movl 0x1c(%r14), %esi
leaq 0x10eca0(%rip), %rdi    # 0x13b0e4
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x27080
movl 0x2c(%r14), %esi
leaq 0x10ec9d(%rip), %rdi    # 0x13b0f6
xorl %eax, %eax
callq 0x27080
movl 0x3c(%r14), %esi
leaq 0x10edce(%rip), %rdi    # 0x13b239
xorl %eax, %eax
callq 0x27080
movl 0x4c(%r14), %esi
leaq 0x10edd8(%rip), %rdi    # 0x13b255
xorl %eax, %eax
callq 0x27080
movl 0x5c(%r14), %esi
leaq 0x10ede1(%rip), %rdi    # 0x13b270
xorl %eax, %eax
callq 0x27080
movl 0x6c(%r14), %esi
leaq 0x10edee(%rip), %rdi    # 0x13b28f
xorl %eax, %eax
callq 0x27080
movl 0x7c(%r14), %esi
leaq 0x10ec54(%rip), %rdi    # 0x13b107
xorl %eax, %eax
callq 0x27080
movl 0xac(%r14), %esi
leaq 0x10ec55(%rip), %rdi    # 0x13b11d
xorl %eax, %eax
callq 0x27080
movl 0x8c(%r14), %esi
leaq 0x10ec53(%rip), %rdi    # 0x13b130
xorl %eax, %eax
callq 0x27080
movl 0x9c(%r14), %esi
leaq 0x10ec4e(%rip), %rdi    # 0x13b140
xorl %eax, %eax
callq 0x27080
movq 0x8(%r14), %rax
movl 0x24(%rax), %esi
leaq 0x10ec4a(%rip), %rdi    # 0x13b151
xorl %eax, %eax
callq 0x27080
movq 0x8(%r14), %rcx
movslq 0x24(%rcx), %rax
testq %rax, %rax
jle 0x2c536
movq 0x18(%rcx), %rcx
xorl %edx, %edx
xorl %r15d, %r15d
movq (%rcx,%rdx,8), %rsi
movl 0x4c(%rsi), %esi
addq %rsi, %r15
incq %rdx
cmpq %rdx, %rax
jne 0x2c524
leaq 0x10ec24(%rip), %rdi    # 0x13b161
xorl %ebx, %ebx
movl %r15d, %esi
xorl %eax, %eax
callq 0x27080
movq 0x8(%r14), %rcx
movslq 0x24(%rcx), %rax
testq %rax, %rax
jle 0x2c58d
movq 0x18(%rcx), %rcx
xorl %edx, %edx
xorl %ebx, %ebx
movq (%rcx,%rdx,8), %rdi
movslq 0x4c(%rdi), %rsi
testq %rsi, %rsi
jle 0x2c585
movq 0x40(%rdi), %rdi
xorl %r8d, %r8d
movq (%rdi,%r8,8), %r9
movslq 0x8(%r9), %r9
addq %r9, %rbx
incq %r8
cmpq %r8, %rsi
jne 0x2c572
incq %rdx
cmpq %rax, %rdx
jne 0x2c55e
leaq 0x10ebde(%rip), %rdi    # 0x13b172
movq %rbx, %rsi
xorl %eax, %eax
callq 0x27080
movq 0x1928fb(%rip), %rax    # 0x1beea0
movq (%rax), %rdi
callq 0x27b00
jmp 0x2c5bb
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
xorl %r14d, %r14d
movq %r14, 0x1983c6(%rip)    # 0x1c4988
testq %r14, %r14
je 0x2c93b
movq 0x1983d6(%rip), %r14    # 0x1c49a8
testq %r14, %r14
je 0x2c693
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0xe692c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x28030
movl $0x160, %edi            # imm = 0x160
callq 0x27910
movq %rax, %rbx
movq %rax, %rdi
callq 0x62ab0
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x63e3e
testl %eax, %eax
je 0x2c66c
cmpb $0x1, 0x1983a9(%rip)    # 0x1c49c8
jne 0x2c683
leaq 0x10ec85(%rip), %rdi    # 0x13b2ad
movq %r14, %rsi
xorl %eax, %eax
callq 0x27080
leaq 0x28(%rsp), %rdi
callq 0xe698e
leaq 0x10ea8a(%rip), %rdi    # 0x13b0cd
movb $0x1, %al
callq 0x27080
movl 0x14(%rbx), %esi
leaq 0x10eafd(%rip), %rdi    # 0x13b151
xorl %eax, %eax
callq 0x27080
movq 0x19283e(%rip), %rax    # 0x1beea0
movq (%rax), %rdi
callq 0x27b00
jmp 0x2c683
movq %rbx, %rdi
callq 0x62c84
movl $0x160, %esi            # imm = 0x160
movq %rbx, %rdi
callq 0x27930
xorl %ebx, %ebx
movq %rbx, 0x198326(%rip)    # 0x1c49b0
testq %rbx, %rbx
je 0x2c93b
movq 0x19831e(%rip), %r14    # 0x1c49b8
testq %r14, %r14
je 0x2c750
movq 0x1982de(%rip), %rbx    # 0x1c4988
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xe692c
movq %r15, %rdi
xorl %esi, %esi
callq 0x28030
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x54d89
testl %eax, %eax
je 0x2c93b
movl %eax, %ebp
cmpb $0x1, 0x1982e9(%rip)    # 0x1c49c8
jne 0x2c8c6
movslq 0x9c(%rbx), %rax
testq %rax, %rax
jle 0x2c81a
movq 0x90(%rbx), %rcx
xorl %edx, %edx
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rcx,%rdx,8), %rdi
movl 0x2c(%rdi), %r8d
movl $0x0, %esi
testl %r8d, %r8d
jle 0x2c724
movq 0x20(%rdi), %r9
xorl %esi, %esi
cmpq $0x0, (%r9)
setne %sil
xorl %r9d, %r9d
cmpl $0x4, %r8d
jl 0x2c73d
movq 0x20(%rdi), %rdi
xorl %r9d, %r9d
cmpq $0x0, 0x18(%rdi)
setne %r9b
addl %r9d, %r15d
addl %esi, %r12d
incq %rdx
cmpq %rdx, %rax
jne 0x2c704
jmp 0x2c820
movq 0x198269(%rip), %rbx    # 0x1c49c0
testq %rbx, %rbx
je 0x2c8ca
movq 0x198221(%rip), %r14    # 0x1c4988
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xe692c
movq %r15, %rdi
xorl %esi, %esi
callq 0x28030
movsd 0x19326a(%rip), %xmm0   # 0x1bf9f0
movsd 0x19326a(%rip), %xmm1   # 0x1bf9f8
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x549fc
testl %eax, %eax
je 0x2c93b
movl %eax, %ebp
cmpb $0x1, 0x19821c(%rip)    # 0x1c49c8
jne 0x2c8c6
movslq 0x9c(%r14), %rax
testq %rax, %rax
jle 0x2c851
movq 0x90(%r14), %rcx
xorl %edx, %edx
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rcx,%rdx,8), %rdi
movl 0x2c(%rdi), %r8d
movl $0x0, %esi
testl %r8d, %r8d
jle 0x2c7f1
movq 0x20(%rdi), %r9
xorl %esi, %esi
cmpq $0x0, (%r9)
setne %sil
xorl %r9d, %r9d
cmpl $0x4, %r8d
jl 0x2c80a
movq 0x20(%rdi), %rdi
xorl %r9d, %r9d
cmpq $0x0, 0x18(%rdi)
setne %r9b
addl %r9d, %r15d
addl %esi, %r12d
incq %rdx
cmpq %rdx, %rax
jne 0x2c7d1
jmp 0x2c857
xorl %r12d, %r12d
xorl %r15d, %r15d
leaq 0x10ea9e(%rip), %rdi    # 0x13b2c5
movq %r14, %rsi
xorl %eax, %eax
callq 0x27080
leaq 0x28(%rsp), %rdi
callq 0xe698e
leaq 0x10e88b(%rip), %rdi    # 0x13b0cd
movb $0x1, %al
callq 0x27080
movl 0x9c(%rbx), %esi
jmp 0x2c887
xorl %r12d, %r12d
xorl %r15d, %r15d
leaq 0x10ea67(%rip), %rdi    # 0x13b2c5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x27080
leaq 0x28(%rsp), %rdi
callq 0xe698e
leaq 0x10e854(%rip), %rdi    # 0x13b0cd
movb $0x1, %al
callq 0x27080
movl 0x9c(%r14), %esi
leaq 0x10e8b2(%rip), %rdi    # 0x13b140
xorl %eax, %eax
callq 0x27080
leaq 0x10ea4a(%rip), %rdi    # 0x13b2e6
movl %r12d, %esi
xorl %eax, %eax
callq 0x27080
leaq 0x10ea4f(%rip), %rdi    # 0x13b2fc
movl %r15d, %esi
xorl %eax, %eax
callq 0x27080
movq 0x1925e2(%rip), %rax    # 0x1beea0
movq (%rax), %rdi
callq 0x27b00
testl %ebp, %ebp
je 0x2c93b
movl $0x618, %edi            # imm = 0x618
callq 0x27910
movq %rax, %rbx
movq 0x1980aa(%rip), %rsi    # 0x1c4988
movq %rax, %rdi
callq 0x2c974
movq %rbx, 0x198093(%rip)    # 0x1c4980
leaq 0xc(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x2be40
callq 0x2bee3
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10e8d2(%rip), %rdi    # 0x13b1eb
movq %rbx, %rsi
xorl %eax, %eax
callq 0xea082
movl $0x1, %edi
callq 0x27b60
leaq 0x10e8d4(%rip), %rdi    # 0x13b208
xorl %eax, %eax
callq 0xea082
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x27b60
movq %rax, %r15
movl $0x160, %esi            # imm = 0x160
jmp 0x2c957
movq %rax, %r15
movl $0x618, %esi            # imm = 0x618
movq %rbx, %rdi
jmp 0x2c967
movq %rax, %r15
movl $0x1f0, %esi            # imm = 0x1F0
movq %r14, %rdi
callq 0x27930
movq %r15, %rdi
callq 0x28130