// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: GLUTSpecial(int, int, int)
void GLUTSpecial(int key, int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;

  // Process keyboard button event 
  switch (key) {
  case GLUT_KEY_F1:
    AlignWithAxes();
    ResetViewer();
    break;

  case GLUT_KEY_LEFT:
  case GLUT_KEY_RIGHT:
    // Select next image
    if (configuration.NImages() > 0) {
      snap_image_index += (key == GLUT_KEY_RIGHT) ? 1 : -1;
      if (snap_image_index < 0) snap_image_index = 0;
      if (snap_image_index >= configuration.NImages()) snap_image_index = configuration.NImages()-1;
      RGBDImage *snap_image = configuration.Image(snap_image_index);
      for (int i = 0; i < configuration.NImages(); i++) {
        RGBDImage *image = configuration.Image(i);
        if (image == snap_image) { if (!image->DepthChannel()) image->ReadChannels(); }
        else { if (image->DepthChannel()) image->ReleaseChannels(); }
      }
    }
    break;
  }

  // Remember mouse position 
  GLUTmouse[0] = x;
  GLUTmouse[1] = y;

  // Remember modifiers 
  GLUTmodifiers = glutGetModifiers();

  // Redraw
  glutPostRedisplay();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movl %edx, %r12d
movl %esi, %ebp
movl 0x12d6ce(%rip), %r13d   # 0x155a00
cmpl $0x66, %edi
je 0x283a4
cmpl $0x64, %edi
je 0x283a4
cmpl $0x1, %edi
jne 0x2864b
cmpl $0x0, 0x132598(%rip)    # 0x15a8e4
je 0x28646
leaq 0xbd7f7(%rip), %rsi     # 0xe5b50
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x7d084
xorl %r15d, %r15d
leaq 0x80(%rsp), %r14
movslq 0x13256c(%rip), %rax    # 0x15a8e4
cmpq %rax, %r15
jge 0x28445
movq 0x132550(%rip), %rax    # 0x15a8d8
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x29e72
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d78c
incq %r15
jmp 0x28371
movl 0x13253a(%rip), %eax    # 0x15a8e4
testl %eax, %eax
jle 0x2864b
xorl %ecx, %ecx
cmpl $0x66, %edi
sete %cl
movl 0x12d64c(%rip), %edx    # 0x155a0c
leal (%rdx,%rcx,2), %ecx
decl %ecx
xorl %ebx, %ebx
testl %ecx, %ecx
movl $0x0, %edx
cmovgl %ecx, %edx
leal -0x1(%rax), %esi
cmpl %eax, %ecx
cmovll %edx, %esi
movl %esi, 0x12d62d(%rip)    # 0x155a0c
movq 0x1324f2(%rip), %rcx    # 0x15a8d8
movq (%rcx,%rsi,8), %r14
cltq
cmpq %rax, %rbx
jge 0x2864b
movq 0x1324dc(%rip), %rax    # 0x15a8d8
movq (%rax,%rbx,8), %rdi
movl 0x24(%rdi), %ecx
cmpq %r14, %rdi
je 0x2841f
cmpl $0x4, %ecx
jl 0x2843a
movq 0x18(%rdi), %rcx
movl $0x148, %eax            # imm = 0x148
cmpq $0x0, 0x18(%rcx)
jne 0x28434
jmp 0x2843a
movl $0xf8, %eax
cmpl $0x4, %ecx
jl 0x28434
movq 0x18(%rdi), %rcx
cmpq $0x0, 0x18(%rcx)
jne 0x2843a
movq (%rdi), %rcx
callq *(%rcx,%rax)
incq %rbx
movl 0x1324a1(%rip), %eax    # 0x15a8e4
jmp 0x283ea
movl %r13d, 0xc(%rsp)
movl %r12d, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
leaq 0x135ac6(%rip), %rsi    # 0x15df20
leaq 0x38(%rsp), %rdi
callq 0x7c8c4
leaq 0xbd6e5(%rip), %rsi     # 0xe5b50
leaq 0x20(%rsp), %rdi
callq 0x7d084
xorl %ebx, %ebx
leaq 0x80(%rsp), %r13
leaq 0x1f0(%rsp), %r12
movl $0x0, 0x8(%rsp)
movslq 0x13244e(%rip), %rax    # 0x15a8e4
cmpq %rax, %rbx
jge 0x28547
movq 0x132432(%rip), %rax    # 0x15a8d8
movq (%rax,%rbx,8), %rbp
movl 0x28(%rbp), %eax
movl 0x2c(%rbp), %ecx
cltd
pushq $0x2
popq %rsi
idivl %esi
movl %eax, %r14d
movl %ecx, %eax
cltd
idivl %esi
movl %eax, %r15d
movq %r13, %rdi
callq 0x7c8b2
cvtsi2sd %r14d, %xmm0
cvtsi2sd %r15d, %xmm1
movq %r12, %rdi
callq 0x93cb8
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2a4f3
testl %eax, %eax
je 0x2853f
movq %rbx, 0x18(%rsp)
movq %r12, %rbx
leaq 0x190(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movl %r14d, %edx
movl %r15d, %ecx
callq 0x30c42
movq %rbx, %rdi
movq %r12, %rsi
movq %rbx, %r12
movq 0x18(%rsp), %rbx
callq 0x7d9da
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x7d78c
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0x7cf1e
incl 0x8(%rsp)
incq %rbx
jmp 0x2848f
movl 0x8(%rsp), %r12d
testl %r12d, %r12d
jle 0x28638
cvtsi2sd %r12d, %xmm0
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x7cf9c
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x7d376
leaq 0x50(%rsp), %r15
movq %r15, %rdi
callq 0x7d376
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x7d726
movq %r12, %rdi
callq 0x7d376
leaq 0x80(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x7d726
movq %r15, %rdi
movq %r13, %rsi
callq 0x7d5e4
movq %r15, %rdi
callq 0x7d376
leaq 0x270(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x78326
leaq 0x190(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x77f3e
leaq 0x1f0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x77fc8
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x77848
leaq 0x1322ad(%rip), %rdi    # 0x15a8d0
movq %r14, %rsi
callq 0x2a968
leaq 0x80(%rsp), %rdi
callq 0x77896
movl 0x14(%rsp), %ebp
movl 0x10(%rsp), %r12d
movl 0xc(%rsp), %r13d
callq 0x28695
subl %r12d, %r13d
movl %ebp, 0x132470(%rip)    # 0x15aac4
movl %r13d, 0x13246d(%rip)   # 0x15aac8
callq 0xda0ca
movl %eax, 0x13246a(%rip)    # 0x15aad0
callq 0xd562c
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x77896
movq %rbx, %rdi
callq 0x24110