// File: /workspace/github_cpp_makefile_star2_O1/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 0x13f86e(%rip), %r12d   # 0x1689e0
cmpl $0x66, %edi
je 0x2930d
cmpl $0x64, %edi
je 0x2930d
cmpl $0x1, %edi
jne 0x294bb
cmpl $0x0, 0x144730(%rip)    # 0x16d8c4
je 0x294b6
movl %r12d, 0x4(%rsp)
movl %r15d, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
leaq 0xd6aa1(%rip), %rsi     # 0xffc50
leaq 0x40(%rsp), %rdi
callq 0x89796
cmpl $0x0, 0x144704(%rip)    # 0x16d8c4
jle 0x2920a
xorl %r12d, %r12d
leaq 0xd6acc(%rip), %rbx     # 0xffc98
leaq 0x70(%rsp), %r14
leaq 0x40(%rsp), %r15
movq 0x1446db(%rip), %rax    # 0x16d8b8
movq (%rax,%r12,8), %rsi
addq $0x38, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x8766e
movq %r15, %rdi
movq %r14, %rsi
callq 0x8a178
incq %r12
movslq 0x1446bf(%rip), %rax    # 0x16d8c4
cmpq %rax, %r12
jl 0x291d6
leaq 0x147cef(%rip), %rsi    # 0x170f00
leaq 0x28(%rsp), %rdi
callq 0x88cfe
leaq 0xd6a2e(%rip), %rsi     # 0xffc50
leaq 0x10(%rsp), %rdi
callq 0x89796
cmpl $0x0, 0x144691(%rip)    # 0x16d8c4
jle 0x293ba
xorl %r14d, %r14d
leaq 0x70(%rsp), %rdi
leaq 0x1e0(%rsp), %r15
movl $0x0, (%rsp)
movq 0x144661(%rip), %rax    # 0x16d8b8
movq (%rax,%r14,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, %r12
callq 0x88cec
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
movq %r15, %rdi
callq 0xa25d6
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x2b49f
testl %eax, %eax
je 0x292f0
movq %r15, %r12
leaq 0x180(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x32b58
movq %r12, %rdi
movq %r15, %rsi
movq %r12, %r15
callq 0x8a41c
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x8a178
leaq 0x28(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x8962e
incl (%rsp)
incq %r14
movslq 0x1445ca(%rip), %rax    # 0x16d8c4
cmpq %rax, %r14
leaq 0x70(%rsp), %rdi
jl 0x29250
jmp 0x293c1
movl 0x1445b1(%rip), %eax    # 0x16d8c4
testl %eax, %eax
jle 0x294bb
xorl %ecx, %ecx
cmpl $0x66, %edi
sete %cl
movl 0x13f6c3(%rip), %edx    # 0x1689ec
leal (%rdx,%rcx,2), %edx
decl %edx
xorl %esi, %esi
testl %edx, %edx
cmovgl %edx, %esi
leal -0x1(%rax), %ecx
cmpl %eax, %edx
cmovll %esi, %ecx
movl %ecx, 0x13f6a9(%rip)    # 0x1689ec
cmpl $0x0, 0x14457a(%rip)    # 0x16d8c4
jle 0x294bb
movq 0x144561(%rip), %rax    # 0x16d8b8
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rbx
xorl %r14d, %r14d
movq 0x144550(%rip), %rax    # 0x16d8b8
movq (%rax,%r14,8), %rdi
movl 0x24(%rdi), %ecx
cmpq %rbx, %rdi
je 0x2938b
cmpl $0x4, %ecx
jl 0x293a6
movq 0x18(%rdi), %rcx
movl $0x148, %eax            # imm = 0x148
cmpq $0x0, 0x18(%rcx)
jne 0x293a0
jmp 0x293a6
movl $0xf8, %eax
cmpl $0x4, %ecx
jl 0x293a0
movq 0x18(%rdi), %rcx
cmpq $0x0, 0x18(%rcx)
jne 0x293a6
movq (%rdi), %rcx
callq *(%rcx,%rax)
incq %r14
movslq 0x144514(%rip), %rax    # 0x16d8c4
cmpq %rax, %r14
jl 0x29361
jmp 0x294bb
movl $0x0, (%rsp)
movl (%rsp), %eax
testl %eax, %eax
jle 0x294a8
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x896ac
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x89aa8
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x89aa8
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8a0da
movq %r12, %rdi
callq 0x89aa8
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x8a0da
movq %r15, %rdi
movq %r13, %rsi
callq 0x89f32
movq %r15, %rdi
callq 0x89aa8
leaq 0x260(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x83e10
leaq 0x180(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x839a0
leaq 0x1e0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x83a4e
leaq 0x70(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x8325e
leaq 0x14441a(%rip), %rdi    # 0x16d8b0
movq %r14, %rsi
callq 0x2b9ee
leaq 0x70(%rsp), %rdi
callq 0x832ac
movl 0xc(%rsp), %ebp
movl 0x8(%rsp), %r15d
movl 0x4(%rsp), %r12d
callq 0x29502
subl %r15d, %r12d
movl %ebp, 0x1445e0(%rip)    # 0x16daa4
movl %r12d, 0x1445dd(%rip)   # 0x16daa8
callq 0xf3e60
movl %eax, 0x1445da(%rip)    # 0x16dab0
callq 0xeef18
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 0x832ac
movq %rbx, %rdi
callq 0x24100