// File: /workspace/github_cpp_makefile_star2_O3/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 $0x2a8, %rsp            # imm = 0x2A8
movl %edx, %r15d
movl %esi, %ebp
movl 0x13d94d(%rip), %r12d   # 0x1669e0
cmpl $0x66, %edi
je 0x29328
cmpl $0x64, %edi
je 0x29328
cmpl $0x1, %edi
jne 0x293c2
cmpl $0x0, 0x14280f(%rip)    # 0x16b8c4
je 0x2931e
movl %r12d, 0x8(%rsp)
movl %r15d, 0xc(%rsp)
leaq 0xd4b74(%rip), %rsi     # 0xfdc40
leaq 0x40(%rsp), %rdi
callq 0x883ba
cmpl $0x0, 0x1427e7(%rip)    # 0x16b8c4
jle 0x29127
xorl %r12d, %r12d
leaq 0xd4b9f(%rip), %rbx     # 0xfdc88
leaq 0x70(%rsp), %r14
leaq 0x40(%rsp), %r15
movq 0x1427be(%rip), %rax    # 0x16b8b8
movq (%rax,%r12,8), %rsi
addq $0x38, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x86296
movq %r15, %rdi
movq %r14, %rsi
callq 0x88d68
incq %r12
movslq 0x1427a2(%rip), %rax    # 0x16b8c4
cmpq %rax, %r12
jl 0x290f3
leaq 0x145dd2(%rip), %rsi    # 0x16ef00
leaq 0x28(%rsp), %rdi
callq 0x87926
leaq 0xd4b01(%rip), %rsi     # 0xfdc40
leaq 0x10(%rsp), %rdi
callq 0x883ba
cmpl $0x0, 0x142774(%rip)    # 0x16b8c4
jle 0x29314
movl %ebp, 0x4(%rsp)
xorl %r12d, %r12d
leaq 0x70(%rsp), %rdi
leaq 0x1e0(%rsp), %r15
movl $0x0, (%rsp)
movq 0x142740(%rip), %rax    # 0x16b8b8
movq (%rax,%r12,8), %rbp
movl 0x28(%rbp), %eax
movl 0x2c(%rbp), %ecx
movl %eax, %r13d
shrl $0x1f, %r13d
addl %eax, %r13d
sarl %r13d
movl %ecx, %ebx
shrl $0x1f, %ebx
addl %ecx, %ebx
sarl %ebx
movq %rdi, %r14
callq 0x87914
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
movq %r15, %rdi
callq 0xa1036
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x2b21f
testl %eax, %eax
je 0x29211
movq %r15, %r14
leaq 0x180(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x326fc
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %r15
callq 0x88fe4
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x88d68
leaq 0x28(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x88250
incl (%rsp)
incq %r12
movslq 0x1426a9(%rip), %rax    # 0x16b8c4
cmpq %rax, %r12
leaq 0x70(%rsp), %rdi
jl 0x29171
movl (%rsp), %eax
testl %eax, %eax
movl 0x4(%rsp), %ebp
jle 0x29314
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x882ce
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x886c0
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x886c0
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x88cde
movq %r12, %rdi
callq 0x886c0
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x88cde
movq %r15, %rdi
movq %r13, %rsi
callq 0x88b36
movq %r15, %rdi
callq 0x886c0
leaq 0x260(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x82aec
leaq 0x180(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x8267c
leaq 0x1e0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8272a
leaq 0x70(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x81f2e
leaq 0x1425ae(%rip), %rdi    # 0x16b8b0
movq %r14, %rsi
callq 0x2b770
leaq 0x70(%rsp), %rdi
callq 0x81f7c
movl 0xc(%rsp), %r15d
movl 0x8(%rsp), %r12d
callq 0x29409
jmp 0x293c2
movl 0x142596(%rip), %eax    # 0x16b8c4
testl %eax, %eax
jle 0x293c2
xorl %ecx, %ecx
cmpl $0x66, %edi
sete %cl
movl 0x13d6a8(%rip), %edx    # 0x1669ec
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, 0x13d689(%rip)    # 0x1669ec
movq 0x14254e(%rip), %rax    # 0x16b8b8
movq (%rax,%rsi,8), %r14
movq 0x142543(%rip), %rax    # 0x16b8b8
movq (%rax,%rbx,8), %rdi
movl 0x24(%rdi), %ecx
cmpq %r14, %rdi
je 0x29398
cmpl $0x4, %ecx
jl 0x293b3
movq 0x18(%rdi), %rcx
movl $0x148, %eax            # imm = 0x148
cmpq $0x0, 0x18(%rcx)
jne 0x293ad
jmp 0x293b3
movl $0xf8, %eax
cmpl $0x4, %ecx
jl 0x293ad
movq 0x18(%rdi), %rcx
cmpq $0x0, 0x18(%rcx)
jne 0x293b3
movq (%rdi), %rcx
callq *(%rcx,%rax)
incq %rbx
movslq 0x142507(%rip), %rax    # 0x16b8c4
cmpq %rax, %rbx
jl 0x2936e
subl %r15d, %r12d
movl %ebp, 0x1426d9(%rip)    # 0x16baa4
movl %r12d, 0x1426d6(%rip)   # 0x16baa8
callq 0xf1aa9
movl %eax, 0x1426d3(%rip)    # 0x16bab0
callq 0xecbf0
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x81f7c
movq %rbx, %rdi
callq 0x240f0