#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*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_FILL;
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LINE;
int /*<<< orphan*/ GL_POINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glPolygonMode(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void clavier(unsigned char touche, int x, int y) {
  switch (touche) {
  case 'p':
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    glutPostRedisplay();
    break;
  case 'f':
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
    glutPostRedisplay();
    break;
  case 's':
    glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
    glutPostRedisplay();
    break;
  case 'd':
    glEnable(GL_DEPTH_TEST);
    glutPostRedisplay();
    break;
  case 'D':
    glDisable(GL_DEPTH_TEST);
    glutPostRedisplay();
    break;
  case 'q':
    exit(0);
  }
}


x86 assembly (clang, -O0):
<clavier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x2f,%eax
ja     1232 <clavier+0xe2>
mov    -0x18(%rbp),%rax
lea    0xe7b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
mov    0x2e22(%rip),%rax
mov    (%rax),%esi
call   1050 <glPolygonMode@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1232 <clavier+0xe2>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
mov    0x2e1f(%rip),%rax
mov    (%rax),%esi
call   1050 <glPolygonMode@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1232 <clavier+0xe2>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
mov    0x2dec(%rip),%rax
mov    (%rax),%esi
call   1050 <glPolygonMode@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1232 <clavier+0xe2>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1232 <clavier+0xe2>
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
call   1070 <glDisable@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1232 <clavier+0xe2>
xor    %edi,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clavier>:
push   %rax
add    $0xbc,%dil
cmp    $0x2f,%dil
ja     117f <clavier+0x2f>
movzbl %dil,%eax
lea    0xe9a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1070 <glDisable@plt>
jmp    11cc <clavier+0x7c>
pop    %rax
ret
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    11cc <clavier+0x7c>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
mov    0x2e3f(%rip),%rax
jmp    11c5 <clavier+0x75>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
mov    0x2e0d(%rip),%rax
jmp    11c5 <clavier+0x75>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
mov    0x2e0b(%rip),%rax
mov    (%rax),%esi
call   1050 <glPolygonMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@GL_FRONT_AND_BACK = global i32 0
@GL_FILL = global i32 0
@GL_LINE = global i32 0
@GL_POINT = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @clavier(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 %34 [
i32 112, label %9
i32 102, label %14
i32 115, label %19
i32 100, label %24
i32 68, label %28
i32 113, label %32
]
9: ; preds = %3
%10 = load i32, i32* @GL_FRONT_AND_BACK
%11 = load i32, i32* @GL_FILL
%12 = call i32 @glPolygonMode(i32 %10, i32 %11)
%13 = call i32 (...) @glutPostRedisplay()
br label %34
14: ; preds = %3
%15 = load i32, i32* @GL_FRONT_AND_BACK
%16 = load i32, i32* @GL_LINE
%17 = call i32 @glPolygonMode(i32 %15, i32 %16)
%18 = call i32 (...) @glutPostRedisplay()
br label %34
19: ; preds = %3
%20 = load i32, i32* @GL_FRONT_AND_BACK
%21 = load i32, i32* @GL_POINT
%22 = call i32 @glPolygonMode(i32 %20, i32 %21)
%23 = call i32 (...) @glutPostRedisplay()
br label %34
24: ; preds = %3
%25 = load i32, i32* @GL_DEPTH_TEST
%26 = call i32 @glEnable(i32 %25)
%27 = call i32 (...) @glutPostRedisplay()
br label %34
28: ; preds = %3
%29 = load i32, i32* @GL_DEPTH_TEST
%30 = call i32 @glDisable(i32 %29)
%31 = call i32 (...) @glutPostRedisplay()
br label %34
32: ; preds = %3
%33 = call i32 @exit(i32 0)
unreachable
34: ; preds = %3, %28, %24, %19, %14, %9
ret void
}

LLVM IR (-O2):
@GL_FRONT_AND_BACK = global i32 0
@GL_FILL = global i32 0
@GL_LINE = global i32 0
@GL_POINT = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @clavier(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %26 [
i8 112, label %4
i8 102, label %8
i8 115, label %12
i8 100, label %16
i8 68, label %19
i8 113, label %22
]
4: ; preds = %3
%5 = load i32, i32* @GL_FRONT_AND_BACK
%6 = load i32, i32* @GL_FILL
%7 = tail call i32 @glPolygonMode(i32 %5, i32 %6)
br label %24
8: ; preds = %3
%9 = load i32, i32* @GL_FRONT_AND_BACK
%10 = load i32, i32* @GL_LINE
%11 = tail call i32 @glPolygonMode(i32 %9, i32 %10)
br label %24
12: ; preds = %3
%13 = load i32, i32* @GL_FRONT_AND_BACK
%14 = load i32, i32* @GL_POINT
%15 = tail call i32 @glPolygonMode(i32 %13, i32 %14)
br label %24
16: ; preds = %3
%17 = load i32, i32* @GL_DEPTH_TEST
%18 = tail call i32 @glEnable(i32 %17)
br label %24
19: ; preds = %3
%20 = load i32, i32* @GL_DEPTH_TEST
%21 = tail call i32 @glDisable(i32 %20)
br label %24
22: ; preds = %3
%23 = tail call i32 @exit(i32 0)
unreachable
24: ; preds = %4, %8, %12, %16, %19
%25 = tail call i32 (...) @glutPostRedisplay()
br label %26
26: ; preds = %24, %3
ret void
}