#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glTranslatef(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ render_scene();
void keyboard_callback(unsigned char key, int x, int y) {
  switch (key) {
  case 'q':
    exit(EXIT_SUCCESS);
  case '+':
    glTranslatef(0, 0, 1);
    break;
  case '-':
    glTranslatef(0, 0, -1);
    break;
  }
  render_scene();
}


x86 assembly (clang, -O0):
<keyboard_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x2b,%eax
je     1189 <keyboard_callback+0x59>
jmp    1159 <keyboard_callback+0x29>
mov    -0x10(%rbp),%eax
sub    $0x2d,%eax
je     119c <keyboard_callback+0x6c>
jmp    116a <keyboard_callback+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x71,%eax
jne    11aa <keyboard_callback+0x7a>
jmp    117b <keyboard_callback+0x4b>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1040 <glTranslatef@plt>
jmp    11aa <keyboard_callback+0x7a>
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    %esi,%edi
call   1040 <glTranslatef@plt>
mov    $0x0,%al
call   1030 <render_scene@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_callback>:
push   %rax
cmp    $0x2b,%dil
je     1151 <keyboard_callback+0x21>
cmp    $0x2d,%dil
je     1158 <keyboard_callback+0x28>
cmp    $0x71,%dil
jne    1166 <keyboard_callback+0x36>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    $0x1,%edx
jmp    115d <keyboard_callback+0x2d>
mov    $0xffffffff,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <glTranslatef@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <render_scene@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @keyboard_callback(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %16 [
i32 113, label %9
i32 43, label %12
i32 45, label %14
]
9: ; preds = %3
%10 = load i32, i32* @EXIT_SUCCESS
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %3
%13 = call i32 @glTranslatef(i32 0, i32 0, i32 1)
br label %16
14: ; preds = %3
%15 = call i32 @glTranslatef(i32 0, i32 0, i32 -1)
br label %16
16: ; preds = %3, %14, %12
%17 = call i32 (...) @render_scene()
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @keyboard_callback(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %11 [
i8 113, label %4
i8 43, label %8
i8 45, label %7
]
4: ; preds = %3
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %3
br label %8
8: ; preds = %3, %7
%9 = phi i32 [ -1, %7 ], [ 1, %3 ]
%10 = tail call i32 @glTranslatef(i32 0, i32 0, i32 %9)
br label %11
11: ; preds = %8, %3
%12 = tail call i32 (...) @render_scene()
ret void
}