// File: /workspace/github_cpp_makefile_star2_O3/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, %ebp
movl %edi, 0x1c(%rsp)
callq 0x626c8
testl %eax, %eax
je 0x2c864
callq 0x34e68
testl %eax, %eax
je 0x2c864
cmpl $0x2, %ebp
jl 0x2c32c
leaq 0x10c1de(%rip), %r14    # 0x138186
leaq 0x10c1e7(%rip), %r15    # 0x138196
leaq 0x10c1f1(%rip), %r12    # 0x1381a7
movq 0x20(%rsp), %r13
leal -0x1(%rbp), %ecx
leaq 0x8(%r13), %rax
movq 0x8(%r13), %rbx
cmpb $0x2d, (%rbx)
jne 0x2c1a7
cmpb $0x76, 0x1(%rbx)
jne 0x2bfdf
cmpb $0x0, 0x2(%rbx)
je 0x2c21b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x27d60
testl %eax, %eax
je 0x2c1e1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27d60
testl %eax, %eax
je 0x2c204
movq %rbx, %rdi
movq %r12, %rsi
callq 0x27d60
testl %eax, %eax
je 0x2c227
movq %rbx, %rdi
leaq 0x10c192(%rip), %rsi    # 0x1381b4
callq 0x27d60
testl %eax, %eax
je 0x2c244
movq %rbx, %rdi
leaq 0x10c18b(%rip), %rsi    # 0x1381c4
callq 0x27d60
testl %eax, %eax
je 0x2c261
movq %rbx, %rdi
leaq 0x10c17c(%rip), %rsi    # 0x1381cc
callq 0x27d60
testl %eax, %eax
je 0x2c28b
movq %rbx, %rdi
leaq 0x10c171(%rip), %rsi    # 0x1381d8
callq 0x27d60
testl %eax, %eax
je 0x2c2c7
movq %rbx, %rdi
leaq 0x10c162(%rip), %rsi    # 0x1381e0
callq 0x27d60
testl %eax, %eax
jne 0x2c803
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, 0x68(%rsp)
movq 0x28(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x70(%rsp)
movq 0x30(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x60(%rsp)
movq 0x38(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x58(%rsp)
movq 0x40(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x50(%rsp)
movq 0x48(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x48(%rsp)
addl $-0xa, %ebp
movq 0x50(%r13), %rdi
addq $0x50, %r13
callq 0x27be0
movsd %xmm0, 0x40(%rsp)
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x68(%rsp), %xmm2
callq 0xc3d32
leaq 0x1957e1(%rip), %rdi    # 0x1c1920
movq %rbx, %rsi
callq 0xc409a
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x1957e3(%rip)   # 0x1c1938
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x1957dd(%rip)   # 0x1c1940
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x1957d7(%rip)   # 0x1c1948
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x1957d1(%rip)   # 0x1c1950
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x1957cb(%rip)   # 0x1c1958
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x1957c5(%rip)   # 0x1c1960
movb $0x1, 0x1957f2(%rip)    # 0x1c1994
jmp 0x2c319
cmpq $0x0, 0x1957e9(%rip)    # 0x1c1998
je 0x2c1d5
cmpq $0x0, 0x1957e7(%rip)    # 0x1c19a0
je 0x2c1f8
cmpq $0x0, 0x1957e5(%rip)    # 0x1c19a8
jne 0x2c803
movq %rbx, 0x1957d8(%rip)    # 0x1c19a8
jmp 0x2c31e
movq %rbx, 0x1957bc(%rip)    # 0x1c1998
jmp 0x2c31e
addl $-0x2, %ebp
movq 0x10(%r13), %rax
addq $0x10, %r13
movq %rax, 0x1957c5(%rip)    # 0x1c19b8
jmp 0x2c319
movq %rbx, 0x1957a1(%rip)    # 0x1c19a0
jmp 0x2c31e
addl $-0x2, %ebp
movq 0x10(%r13), %rax
addq $0x10, %r13
movq %rax, 0x1957aa(%rip)    # 0x1c19c0
jmp 0x2c319
movb $0x1, 0x1957a6(%rip)    # 0x1c19c8
jmp 0x2c31e
addl $-0x2, %ebp
movq 0x10(%r13), %rdi
addq $0x10, %r13
callq 0x27be0
movsd %xmm0, 0x1907b1(%rip)   # 0x1bc9f0
jmp 0x2c319
addl $-0x2, %ebp
movq 0x10(%r13), %rdi
addq $0x10, %r13
callq 0x27be0
movsd %xmm0, 0x19079c(%rip)   # 0x1bc9f8
jmp 0x2c319
movq 0x10(%r13), %rdi
callq 0x27f50
movl %eax, 0x190770(%rip)    # 0x1bc9e0
addl $-0x3, %ebp
movq 0x18(%r13), %rdi
addq $0x18, %r13
callq 0x27f50
movl %eax, 0x19075e(%rip)    # 0x1bc9e4
jmp 0x2c319
movq 0x10(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x19566c(%rip)   # 0x1c1908
movq 0x18(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x195663(%rip)   # 0x1c1910
addl $-0x4, %ebp
movq 0x20(%r13), %rdi
addq $0x20, %r13
callq 0x27be0
movsd %xmm0, 0x195653(%rip)   # 0x1c1918
jmp 0x2c319
movq 0x10(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x10(%rsp)
movq 0x18(%r13), %rdi
callq 0x27be0
movsd %xmm0, 0x8(%rsp)
addl $-0x4, %ebp
movq 0x20(%r13), %rdi
addq $0x20, %r13
callq 0x27be0
movsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x195665(%rip)   # 0x1c1968
movsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x19565f(%rip)   # 0x1c1970
movsd %xmm0, 0x19565f(%rip)   # 0x1c1978
movq %r13, %rax
movl %ebp, %ecx
movl %ecx, %ebp
movq %rax, %r13
cmpl $0x1, %ecx
jg 0x2bfbb
movq 0x195665(%rip), %rbx    # 0x1c1998
testq %rbx, %rbx
je 0x2c81e
movq 0x19565d(%rip), %r15    # 0x1c19a0
testq %r15, %r15
je 0x2c81e
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0xe50e8
movq %r14, %rdi
xorl %esi, %esi
callq 0x28020
movl $0x1f0, %edi            # imm = 0x1F0
callq 0x27910
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
callq 0x4833c
movq (%r14), %rax
leaq 0x11a5ef(%rip), %rcx    # 0x146973
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %rcx, %r8
callq *0xe8(%rax)
testl %eax, %eax
je 0x2c82e
cmpb $0x1, 0x195623(%rip)    # 0x1c19c8
jne 0x2c53f
leaq 0x10bf6f(%rip), %rdi    # 0x138321
callq 0x27f10
leaq 0x28(%rsp), %rdi
callq 0xe514a
leaq 0x10bd05(%rip), %rdi    # 0x1380cd
movb $0x1, %al
callq 0x27080
movl 0x1c(%r14), %esi
leaq 0x10bd0a(%rip), %rdi    # 0x1380e4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x27080
movl 0x2c(%r14), %esi
leaq 0x10bd08(%rip), %rdi    # 0x1380f6
xorl %eax, %eax
callq 0x27080
movl 0x3c(%r14), %esi
leaq 0x10be36(%rip), %rdi    # 0x138236
xorl %eax, %eax
callq 0x27080
movl 0x4c(%r14), %esi
leaq 0x10be40(%rip), %rdi    # 0x138252
xorl %eax, %eax
callq 0x27080
movl 0x5c(%r14), %esi
leaq 0x10be49(%rip), %rdi    # 0x13826d
xorl %eax, %eax
callq 0x27080
movl 0x6c(%r14), %esi
leaq 0x10be56(%rip), %rdi    # 0x13828c
xorl %eax, %eax
callq 0x27080
movl 0x7c(%r14), %esi
leaq 0x10bcbf(%rip), %rdi    # 0x138107
xorl %eax, %eax
callq 0x27080
movl 0xac(%r14), %esi
leaq 0x10bcc0(%rip), %rdi    # 0x13811d
xorl %eax, %eax
callq 0x27080
movl 0x8c(%r14), %esi
leaq 0x10bcbe(%rip), %rdi    # 0x138130
xorl %eax, %eax
callq 0x27080
movl 0x9c(%r14), %esi
leaq 0x10bcb9(%rip), %rdi    # 0x138140
xorl %eax, %eax
callq 0x27080
movq 0x8(%r14), %rax
movl 0x24(%rax), %esi
leaq 0x10bcb5(%rip), %rdi    # 0x138151
xorl %eax, %eax
callq 0x27080
movq 0x8(%r14), %rcx
movslq 0x24(%rcx), %rax
testq %rax, %rax
jle 0x2c4c7
movq 0x18(%rcx), %rcx
xorl %edx, %edx
xorl %ebx, %ebx
movq (%rcx,%rdx,8), %rsi
addl 0x4c(%rsi), %ebx
incq %rdx
cmpq %rdx, %rax
jne 0x2c4b8
leaq 0x10bc93(%rip), %rdi    # 0x138161
xorl %r15d, %r15d
movl %ebx, %esi
xorl %eax, %eax
callq 0x27080
movq 0x8(%r14), %rcx
movslq 0x24(%rcx), %rax
testq %rax, %rax
jle 0x2c51f
movq 0x18(%rcx), %rcx
xorl %edx, %edx
xorl %r15d, %r15d
movq (%rcx,%rdx,8), %rdi
movslq 0x4c(%rdi), %rsi
testq %rsi, %rsi
jle 0x2c517
movq 0x40(%rdi), %rdi
xorl %r8d, %r8d
movq (%rdi,%r8,8), %r9
movslq 0x8(%r9), %r9
addq %r9, %r15
incq %r8
cmpq %r8, %rsi
jne 0x2c504
incq %rdx
cmpq %rax, %rdx
jne 0x2c4f0
leaq 0x10bc4c(%rip), %rdi    # 0x138172
movq %r15, %rsi
xorl %eax, %eax
callq 0x27080
movq 0x18f969(%rip), %rax    # 0x1bbea0
movq (%rax), %rdi
callq 0x27af0
movq %r14, 0x195442(%rip)    # 0x1c1988
movq 0x19545b(%rip), %r14    # 0x1c19a8
testq %r14, %r14
je 0x2c5f0
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0xe50e8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x28020
movl $0x160, %edi            # imm = 0x160
callq 0x27910
movq %rax, %rbx
movq %rax, %rdi
callq 0x6272c
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x63a1c
testl %eax, %eax
je 0x2c844
cmpb $0x1, 0x19542a(%rip)    # 0x1c19c8
jne 0x2c5e9
leaq 0x10bd03(%rip), %rdi    # 0x1382aa
movq %r14, %rsi
xorl %eax, %eax
callq 0x27080
leaq 0x28(%rsp), %rdi
callq 0xe514a
leaq 0x10bb0b(%rip), %rdi    # 0x1380cd
movb $0x1, %al
callq 0x27080
movl 0x14(%rbx), %esi
leaq 0x10bb7e(%rip), %rdi    # 0x138151
xorl %eax, %eax
callq 0x27080
movq 0x18f8bf(%rip), %rax    # 0x1bbea0
movq (%rax), %rdi
callq 0x27af0
movq %rbx, 0x1953c0(%rip)    # 0x1c19b0
movq 0x1953c1(%rip), %r14    # 0x1c19b8
testq %r14, %r14
je 0x2c698
movq 0x195381(%rip), %rbx    # 0x1c1988
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xe50e8
movq %r15, %rdi
xorl %esi, %esi
callq 0x28020
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x54b5b
testl %eax, %eax
je 0x2c864
cmpb $0x1, 0x19538e(%rip)    # 0x1c19c8
jne 0x2c7bb
movslq 0x9c(%rbx), %rax
testq %rax, %rax
jle 0x2c749
movq 0x90(%rbx), %rcx
xorl %edx, %edx
xorl %ebp, %ebp
xorl %r15d, %r15d
movq (%rcx,%rdx,8), %rdi
movl 0x2c(%rdi), %esi
testl %esi, %esi
jle 0x2c687
movq 0x20(%rdi), %rdi
cmpq $0x1, (%rdi)
sbbl $-0x1, %r15d
cmpl $0x4, %esi
jb 0x2c687
xorl %esi, %esi
cmpq $0x0, 0x18(%rdi)
setne %sil
jmp 0x2c689
xorl %esi, %esi
addl %esi, %ebp
incq %rdx
cmpq %rdx, %rax
jne 0x2c65e
jmp 0x2c74e
movq 0x195321(%rip), %r14    # 0x1c19c0
testq %r14, %r14
je 0x2c7bb
movq 0x1952d9(%rip), %rbx    # 0x1c1988
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xe50e8
movq %r15, %rdi
xorl %esi, %esi
callq 0x28020
movsd 0x190322(%rip), %xmm0   # 0x1bc9f0
movsd 0x190322(%rip), %xmm1   # 0x1bc9f8
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x547d7
testl %eax, %eax
je 0x2c864
cmpb $0x1, 0x1952d6(%rip)    # 0x1c19c8
jne 0x2c7bb
movslq 0x9c(%rbx), %rax
testq %rax, %rax
jle 0x2c749
movq 0x90(%rbx), %rcx
xorl %edx, %edx
xorl %ebp, %ebp
xorl %r15d, %r15d
movq (%rcx,%rdx,8), %rdi
movl 0x2c(%rdi), %esi
testl %esi, %esi
jle 0x2c73b
movq 0x20(%rdi), %rdi
cmpq $0x1, (%rdi)
sbbl $-0x1, %r15d
cmpl $0x4, %esi
jb 0x2c73b
xorl %esi, %esi
cmpq $0x0, 0x18(%rdi)
setne %sil
jmp 0x2c73d
xorl %esi, %esi
addl %esi, %ebp
incq %rdx
cmpq %rdx, %rax
jne 0x2c712
jmp 0x2c74e
xorl %r15d, %r15d
xorl %ebp, %ebp
leaq 0x10bb6d(%rip), %rdi    # 0x1382c2
movq %r14, %rsi
xorl %eax, %eax
callq 0x27080
leaq 0x28(%rsp), %rdi
callq 0xe514a
leaq 0x10b95d(%rip), %rdi    # 0x1380cd
movb $0x1, %al
callq 0x27080
movl 0x9c(%rbx), %esi
leaq 0x10b9bc(%rip), %rdi    # 0x138140
xorl %eax, %eax
callq 0x27080
leaq 0x10bb51(%rip), %rdi    # 0x1382e3
movl %r15d, %esi
xorl %eax, %eax
callq 0x27080
leaq 0x10bb56(%rip), %rdi    # 0x1382f9
movl %ebp, %esi
xorl %eax, %eax
callq 0x27080
movq 0x18f6ed(%rip), %rax    # 0x1bbea0
movq (%rax), %rdi
callq 0x27af0
movl $0x618, %edi            # imm = 0x618
callq 0x27910
movq %rax, %rbx
movq 0x1951b9(%rip), %rsi    # 0x1c1988
movq %rax, %rdi
callq 0x2c8a0
movq %rbx, 0x1951a2(%rip)    # 0x1c1980
leaq 0x1c(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x2bdfe
callq 0x2bea1
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10b9de(%rip), %rdi    # 0x1381e8
movq %rbx, %rsi
xorl %eax, %eax
callq 0xe853a
movl $0x1, %edi
callq 0x27b50
leaq 0x10b9e0(%rip), %rdi    # 0x138205
xorl %eax, %eax
callq 0xe853a
jmp 0x2c864
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq $0x0, 0x195146(%rip) # 0x1c1988
jmp 0x2c864
movq %rbx, %rdi
callq 0x628fa
movl $0x160, %esi            # imm = 0x160
movq %rbx, %rdi
callq 0x27930
movq $0x0, 0x19514c(%rip) # 0x1c19b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x27b50
movq %rax, %r15
movl $0x160, %esi            # imm = 0x160
jmp 0x2c880
movq %rax, %r15
movl $0x618, %esi            # imm = 0x618
movq %rbx, %rdi
jmp 0x2c890
movq %rax, %r15
movl $0x1f0, %esi            # imm = 0x1F0
movq %r14, %rdi
callq 0x27930
movq %r15, %rdi
callq 0x28120
nopl (%rax)