#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*/ addWord(char **);
int /*<<< orphan*/ compareWords(char **);
int myMenu();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ removeWord(char **);
int /*<<< orphan*/ sortAnArr();
int /*<<< orphan*/ sortMyArr();
int /*<<< orphan*/ wordIhm();
int afficheMenu(char *dic[]) {
  switch (myMenu()) {
  case 1:
    printf("\nComparaison de 2 mots :\n\n");
    wordIhm();
    break;
  case 2:
    printf("Comparaison et tri\n\n");
    sortMyArr();
  case 3:
    printf("Rechercher un mot dans le dictionnaire\n\n");
    compareWords(dic);
    break;
  case 4:
    printf("Ajouter un mot dans le dictionnaire\n\n");
    addWord(dic);
    break;
  case 5:
    printf("Supprimer un mot\n\n");
    removeWord(dic);
    break;
  case 6:
    printf("Trier un tableau\n\n");
    sortAnArr();
  case 7:
    printf("Quitter");
    return 1;
  default:
    printf("Quitter");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<afficheMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
call   1070 <myMenu@plt>
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x6,%eax
ja     125d <afficheMenu+0xdd>
mov    -0x18(%rbp),%rax
lea    0xe50(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1090 <wordIhm@plt>
jmp    1275 <afficheMenu+0xf5>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <sortMyArr@plt>
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <compareWords@plt>
jmp    1275 <afficheMenu+0xf5>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1080 <addWord@plt>
jmp    1275 <afficheMenu+0xf5>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <removeWord@plt>
jmp    1275 <afficheMenu+0xf5>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <sortAnArr@plt>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    127c <afficheMenu+0xfc>
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    127c <afficheMenu+0xfc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficheMenu>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1080 <myMenu@plt>
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     123c <afficheMenu+0xac>
lea    0xe52(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeeb(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   10a0 <wordIhm@plt>
jmp    124d <afficheMenu+0xbd>
lea    0xec0(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <sortMyArr@plt>
lea    0xe85(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <compareWords@plt>
xor    %ebx,%ebx
jmp    124d <afficheMenu+0xbd>
lea    0xe48(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1090 <addWord@plt>
xor    %ebx,%ebx
jmp    124d <afficheMenu+0xbd>
lea    0xe1e(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   10b0 <removeWord@plt>
xor    %ebx,%ebx
jmp    124d <afficheMenu+0xbd>
lea    0xdf4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <sortAnArr@plt>
lea    0xdd9(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0AComparaison de 2 mots :\0A\0A\00"
@.str.1 = [21 x i8] c"Comparaison et tri\0A\0A\00"
@.str.2 = [41 x i8] c"Rechercher un mot dans le dictionnaire\0A\0A\00"
@.str.3 = [38 x i8] c"Ajouter un mot dans le dictionnaire\0A\0A\00"
@.str.4 = [19 x i8] c"Supprimer un mot\0A\0A\00"
@.str.5 = [19 x i8] c"Trier un tableau\0A\0A\00"
@.str.6 = [8 x i8] c"Quitter\00"
define i32 @afficheMenu(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = call i32 (...) @myMenu()
switch i32 %4, label %28 [
i32 1, label %5
i32 2, label %8
i32 3, label %11
i32 4, label %15
i32 5, label %19
i32 6, label %23
i32 7, label %26
]
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @wordIhm()
br label %30
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @sortMyArr()
br label %11
11: ; preds = %1, %8
%12 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%13 = load i8**, i8*** %3
%14 = call i32 @compareWords(i8** %13)
br label %30
15: ; preds = %1
%16 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%17 = load i8**, i8*** %3
%18 = call i32 @addWord(i8** %17)
br label %30
19: ; preds = %1
%20 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%21 = load i8**, i8*** %3
%22 = call i32 @removeWord(i8** %21)
br label %30
23: ; preds = %1
%24 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 (...) @sortAnArr()
br label %26
26: ; preds = %1, %23
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %2
br label %31
28: ; preds = %1
%29 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %2
br label %31
30: ; preds = %19, %15, %11, %5
store i32 0, i32* %2
br label %31
31: ; preds = %30, %28, %26
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
@.str.6 = [8 x i8] c"Quitter\00"
@str = [18 x i8] c"Trier un tableau\0A\00"
@str.7 = [18 x i8] c"Supprimer un mot\0A\00"
@str.8 = [37 x i8] c"Ajouter un mot dans le dictionnaire\0A\00"
@str.9 = [40 x i8] c"Rechercher un mot dans le dictionnaire\0A\00"
@str.10 = [20 x i8] c"Comparaison et tri\0A\00"
@str.11 = [26 x i8] c"\0AComparaison de 2 mots :\0A\00"
define i32 @afficheMenu(i8** %0) {
%2 = tail call i32 (...) @myMenu()
switch i32 %2, label %23 [
i32 1, label %3
i32 2, label %6
i32 3, label %9
i32 4, label %12
i32 5, label %15
i32 6, label %18
i32 7, label %21
]
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.11, i64 0, i64 0))
%5 = tail call i32 (...) @wordIhm()
br label %25
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0))
%8 = tail call i32 (...) @sortMyArr()
br label %9
9: ; preds = %1, %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.9, i64 0, i64 0))
%11 = tail call i32 @compareWords(i8** %0)
br label %25
12: ; preds = %1
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.8, i64 0, i64 0))
%14 = tail call i32 @addWord(i8** %0)
br label %25
15: ; preds = %1
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
%17 = tail call i32 @removeWord(i8** %0)
br label %25
18: ; preds = %1
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%20 = tail call i32 (...) @sortAnArr()
br label %21
21: ; preds = %1, %18
%22 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %25
23: ; preds = %1
%24 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %25
25: ; preds = %3, %9, %12, %15, %23, %21
%26 = phi i32 [ 1, %23 ], [ 1, %21 ], [ 0, %15 ], [ 0, %12 ], [ 0, %9 ], [ 0, %3 ]
ret i32 %26
}