#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 *, ...);
int AfficheErreur(char *fct, char *var, int type) {
  switch (type) {
  case 1:
    printf("Erreur lors de la location de méamoire dans la fonction %s var %s",
           fct, var);
    break;
  case 2:
    printf("Erreur lors de la liberation ");
    break;
  case 3:
    printf("");
    break;
  case 5:
    printf("can't find %s", var);
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<AfficheErreur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x4,%eax
ja     119f <AfficheErreur+0x8f>
mov    -0x20(%rbp),%rax
lea    0xebd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119f <AfficheErreur+0x8f>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119f <AfficheErreur+0x8f>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119f <AfficheErreur+0x8f>
mov    -0x10(%rbp),%rsi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AfficheErreur>:
push   %rax
mov    %rsi,%rax
cmp    $0x5,%edx
je     1139 <AfficheErreur+0x29>
cmp    $0x2,%edx
je     114c <AfficheErreur+0x3c>
cmp    $0x1,%edx
jne    115a <AfficheErreur+0x4a>
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    115a <AfficheErreur+0x4a>
lea    0xf21(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    115a <AfficheErreur+0x4a>
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [67 x i8] c"Erreur lors de la location de m\C3\A9amoire dans la fonction %s var %s\00"
@.str.1 = [30 x i8] c"Erreur lors de la liberation \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [14 x i8] c"can't find %s\00"
define i32 @AfficheErreur(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
switch i32 %7, label %19 [
i32 1, label %8
i32 2, label %12
i32 3, label %14
i32 5, label %16
]
8: ; preds = %3
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
br label %19
12: ; preds = %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %19
14: ; preds = %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %19
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %3, %16, %14, %12, %8
ret i32 -1
}

LLVM IR (-O2):
@.str = [67 x i8] c"Erreur lors de la location de m\C3\A9amoire dans la fonction %s var %s\00"
@.str.1 = [30 x i8] c"Erreur lors de la liberation \00"
@.str.3 = [14 x i8] c"can't find %s\00"
define i32 @AfficheErreur(i8* %0, i8* %1, i32 %2) {
switch i32 %2, label %10 [
i32 1, label %4
i32 2, label %6
i32 5, label %8
]
4: ; preds = %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %10
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %3, %8, %6, %4
ret i32 -1
}