#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*/ printf(char *, ...);
void clavier(unsigned char key, int x, int y) {
  switch (key) {
  case 'z':
    printf("Vous avez appuyé sur la touche z!\n");
    break;
  case 'x':
    printf("Vous avez appuyé sur la touche x!\n");
    break;
  case 'y':
    printf("Vous avez appuyé sur la touche y!\n");
    break;
  default:
    printf("Touche appuyé est %c\n", key);
  }
}


x86 assembly (clang, -O0):
<clavier>:
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    $0x78,%eax
je     116e <clavier+0x5e>
jmp    1139 <clavier+0x29>
mov    -0x10(%rbp),%eax
sub    $0x79,%eax
je     1181 <clavier+0x71>
jmp    114a <clavier+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x7a,%eax
jne    1194 <clavier+0x84>
jmp    115b <clavier+0x4b>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a6 <clavier+0x96>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a6 <clavier+0x96>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a6 <clavier+0x96>
movzbl -0x1(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clavier>:
cmp    $0x78,%dil
je     113e <clavier+0x1e>
cmp    $0x79,%dil
je     114a <clavier+0x2a>
cmp    $0x7a,%dil
jne    1156 <clavier+0x36>
lea    0xf24(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xef5(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xec6(%rip),%rdi
jmp    1030 <puts@plt>
movzbl %dil,%esi
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Vous avez appuy\C3\A9 sur la touche z!\0A\00"
@.str.1 = [36 x i8] c"Vous avez appuy\C3\A9 sur la touche x!\0A\00"
@.str.2 = [36 x i8] c"Vous avez appuy\C3\A9 sur la touche y!\0A\00"
@.str.3 = [23 x i8] c"Touche appuy\C3\A9 est %c\0A\00"
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 %15 [
i32 122, label %9
i32 120, label %11
i32 121, label %13
]
9: ; preds = %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %19
11: ; preds = %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %19
13: ; preds = %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
br label %19
15: ; preds = %3
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %15, %13, %11, %9
ret void
}

LLVM IR (-O2):
@.str.3 = [23 x i8] c"Touche appuy\C3\A9 est %c\0A\00"
@str = [35 x i8] c"Vous avez appuy\C3\A9 sur la touche y!\00"
@str.4 = [35 x i8] c"Vous avez appuy\C3\A9 sur la touche x!\00"
@str.5 = [35 x i8] c"Vous avez appuy\C3\A9 sur la touche z!\00"
define void @clavier(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %10 [
i8 122, label %4
i8 120, label %6
i8 121, label %8
]
4: ; preds = %3
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.5, i64 0, i64 0))
br label %13
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
br label %13
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %13
10: ; preds = %3
%11 = zext i8 %0 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %8, %6, %4
ret void
}