#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*/ Envoyermessage(char *);
int /*<<< orphan*/ Initialisation(char *);
int /*<<< orphan*/ Terminaison();
int /*<<< orphan*/ afficher_menu();
int /*<<< orphan*/ afficher_menu1();
int /*<<< orphan*/ afficher_menu2();
int authentification(char *);
int /*<<< orphan*/ check();
int /*<<< orphan*/ deconnexion();
int /*<<< orphan*/ exit(int);
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ inscription();
int /*<<< orphan*/ lire();
int /*<<< orphan*/ list(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ supprimer();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ viderBuffer();
int main() {
  char principal = 'a';
  char login[20];
  char machine[30];
  int ret;
  char continuer = 'y';
  char choix = 'b';
  printf("            @ DU SERVEUR :\n");
  fgets(machine, 16, stdin);
  machine[15] = '\0';
  system("clear");
  if (!Initialisation(machine)) {
    printf("erreur de connexion au serveur \n   ");
    exit(9);
  }
  while (principal != '3') {
    afficher_menu();
    principal = getchar();
    viderBuffer();
    system("clear");
    if (principal == '1') {
      do {
        if (continuer == 'n')
          exit(1);
        ret = authentification(login);
        if (ret != 5) {
          printf("\033[%sm", "46");
          printf("                        *********erreur d'authentification "
                 "*********\n");
          printf("                        voulez vous continuer ??? y/yes n/no "
                 "\n ");
          continuer = fgetc(stdin);
          viderBuffer();
          printf("\033[%sm", "0");
        }
      } while ((ret == 1) && continuer == 'y');
      if (ret != 5) {
        printf("++++++++++++++++a bientot!!+++++++++++++++++\n");
        Terminaison();
        exit(1);
      }
      system("clear");
      afficher_menu1();
      choix = fgetc(stdin);
      viderBuffer();
      while (choix != 'a') {
        system("clear");
        if (choix == 'b') {
          Envoyermessage(login);
          afficher_menu1();
          choix = fgetc(stdin);
        } else if (choix == 'c') {
          afficher_menu2();
          choix = fgetc(stdin);
        } else if (choix == 'd') {
          check();
          afficher_menu2();
          choix = fgetc(stdin);
        } else if (choix == 'e') {
          list("new");
          afficher_menu2();
          choix = fgetc(stdin);
        } else if (choix == 'f') {
          lire();
          afficher_menu2();
          choix = fgetc(stdin);
        } else if (choix == 'g') {
          list("all");
          afficher_menu2();
          choix = fgetc(stdin);
        } else if (choix == 'h') {
          supprimer();
          afficher_menu2();
          choix = getchar();
        } else if (choix == 'i') {
          afficher_menu1();
          choix = fgetc(stdin);
        } else {
          printf("Attention vous avez choisis une option n'existe pas "
                 ",veuillez recommencer\n");
          afficher_menu1();
          choix = fgetc(stdin);
        }
        viderBuffer();
        system("clear");
      }
      deconnexion();
    } else if (principal == '2') {
      system("clear");
      inscription();
    } else if (principal == '3') {
      Terminaison();
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x79,-0x45(%rbp)
movb   $0x62,-0x46(%rbp)
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    0x2d74(%rip),%rax
mov    (%rax),%edx
mov    $0x10,%esi
call   10b0 <fgets@plt>
movb   $0x0,-0x31(%rbp)
lea    0xd91(%rip),%rdi
call   1050 <system@plt>
lea    -0x40(%rbp),%rdi
call   10f0 <Initialisation@plt>
cmp    $0x0,%eax
jne    12ba <main+0x7a>
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x9,%edi
call   1160 <exit@plt>
jmp    12bf <main+0x7f>
movsbl -0x5(%rbp),%eax
cmp    $0x33,%eax
je     1666 <main+0x426>
mov    $0x0,%al
call   10e0 <afficher_menu@plt>
mov    $0x0,%al
call   10d0 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   10c0 <viderBuffer@plt>
lea    0xd31(%rip),%rdi
call   1050 <system@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    1612 <main+0x3d2>
jmp    1302 <main+0xc2>
movsbl -0x45(%rbp),%eax
cmp    $0x6e,%eax
jne    1319 <main+0xd9>
mov    $0x1,%edi
call   1160 <exit@plt>
lea    -0x20(%rbp),%rdi
call   1090 <authentification@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
je     138d <main+0x14d>
lea    0xd10(%rip),%rdi
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd3c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2c81(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x45(%rbp)
mov    $0x0,%al
call   10c0 <viderBuffer@plt>
lea    0xcc7(%rip),%rdi
lea    0xd4f(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1392 <main+0x152>
xor    %eax,%eax
cmpl   $0x1,-0x44(%rbp)
mov    %al,-0x47(%rbp)
jne    13ae <main+0x16e>
movsbl -0x45(%rbp),%eax
cmp    $0x79,%eax
sete   %al
mov    %al,-0x47(%rbp)
mov    -0x47(%rbp),%al
test   $0x1,%al
jne    1302 <main+0xc2>
cmpl   $0x5,-0x44(%rbp)
je     13e2 <main+0x1a2>
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <Terminaison@plt>
mov    $0x1,%edi
call   1160 <exit@plt>
lea    0xc33(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1030 <afficher_menu1@plt>
mov    0x2bec(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
mov    $0x0,%al
call   10c0 <viderBuffer@plt>
movsbl -0x46(%rbp),%eax
cmp    $0x61,%eax
je     1606 <main+0x3c6>
lea    0xbfb(%rip),%rdi
call   1050 <system@plt>
movsbl -0x46(%rbp),%eax
cmp    $0x62,%eax
jne    1459 <main+0x219>
lea    -0x20(%rbp),%rdi
call   1110 <Envoyermessage@plt>
mov    $0x0,%al
call   1030 <afficher_menu1@plt>
mov    0x2b9e(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
jmp    15ee <main+0x3ae>
movsbl -0x46(%rbp),%eax
cmp    $0x63,%eax
jne    1483 <main+0x243>
mov    $0x0,%al
call   1120 <afficher_menu2@plt>
mov    0x2b74(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
jmp    15e9 <main+0x3a9>
movsbl -0x46(%rbp),%eax
cmp    $0x64,%eax
jne    14b4 <main+0x274>
mov    $0x0,%al
call   1150 <check@plt>
mov    $0x0,%al
call   1120 <afficher_menu2@plt>
mov    0x2b43(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
jmp    15e4 <main+0x3a4>
movsbl -0x46(%rbp),%eax
cmp    $0x65,%eax
jne    14ea <main+0x2aa>
lea    0xc3d(%rip),%rdi
call   1100 <list@plt>
mov    $0x0,%al
call   1120 <afficher_menu2@plt>
mov    0x2b0d(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
jmp    15df <main+0x39f>
movsbl -0x46(%rbp),%eax
cmp    $0x66,%eax
jne    151b <main+0x2db>
mov    $0x0,%al
call   1070 <lire@plt>
mov    $0x0,%al
call   1120 <afficher_menu2@plt>
mov    0x2adc(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
jmp    15da <main+0x39a>
movsbl -0x46(%rbp),%eax
cmp    $0x67,%eax
jne    1551 <main+0x311>
lea    0xbda(%rip),%rdi
call   1100 <list@plt>
mov    $0x0,%al
call   1120 <afficher_menu2@plt>
mov    0x2aa6(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
jmp    15d5 <main+0x395>
movsbl -0x46(%rbp),%eax
cmp    $0x68,%eax
jne    157b <main+0x33b>
mov    $0x0,%al
call   10a0 <supprimer@plt>
mov    $0x0,%al
call   1120 <afficher_menu2@plt>
mov    $0x0,%al
call   10d0 <getchar@plt>
mov    %al,-0x46(%rbp)
jmp    15d0 <main+0x390>
movsbl -0x46(%rbp),%eax
cmp    $0x69,%eax
jne    15a5 <main+0x365>
mov    $0x0,%al
call   1030 <afficher_menu1@plt>
mov    0x2a52(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
jmp    15cb <main+0x38b>
lea    0xb61(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <afficher_menu1@plt>
mov    0x2a27(%rip),%rax
mov    (%rax),%edi
call   1080 <fgetc@plt>
mov    %al,-0x46(%rbp)
jmp    15d0 <main+0x390>
jmp    15d5 <main+0x395>
jmp    15da <main+0x39a>
jmp    15df <main+0x39f>
jmp    15e4 <main+0x3a4>
jmp    15e9 <main+0x3a9>
jmp    15ee <main+0x3ae>
mov    $0x0,%al
call   10c0 <viderBuffer@plt>
lea    0xa20(%rip),%rdi
call   1050 <system@plt>
jmp    140d <main+0x1cd>
mov    $0x0,%al
call   1140 <deconnexion@plt>
jmp    1661 <main+0x421>
movsbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jne    1637 <main+0x3f7>
lea    0x9f6(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1130 <inscription@plt>
jmp    165c <main+0x41c>
movsbl -0x5(%rbp),%eax
cmp    $0x33,%eax
jne    1657 <main+0x417>
mov    $0x0,%al
call   1040 <Terminaison@plt>
movl   $0x1,-0x4(%rbp)
jmp    166d <main+0x42d>
jmp    165c <main+0x41c>
jmp    1661 <main+0x421>
jmp    12bf <main+0x7f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xe38(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d77(%rip),%r14
mov    (%r14),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   10c0 <fgets@plt>
movb   $0x0,0x1f(%rsp)
lea    0xd8e(%rip),%rdi
call   1060 <system@plt>
mov    %rbx,%rdi
call   1100 <Initialisation@plt>
test   %eax,%eax
je     14c0 <main+0x270>
lea    0xd72(%rip),%r13
lea    0x30(%rsp),%r12
lea    0xd90(%rip),%r15
jmp    12cf <main+0x7f>
nopl   0x0(%rax)
mov    %r13,%rdi
call   1060 <system@plt>
xor    %eax,%eax
call   1140 <inscription@plt>
xor    %eax,%eax
call   10f0 <afficher_menu@plt>
xor    %eax,%eax
call   10e0 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10d0 <viderBuffer@plt>
mov    %r13,%rdi
call   1060 <system@plt>
cmp    $0x31,%bl
je     1310 <main+0xc0>
cmp    $0x32,%bl
je     12c0 <main+0x70>
cmp    $0x33,%bl
jne    12cf <main+0x7f>
jmp    1486 <main+0x236>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %bl,0xf(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
call   10a0 <authentification@plt>
cmp    $0x5,%eax
je     1390 <main+0x140>
mov    %eax,%ebp
mov    %r15,%rdi
lea    0xd17(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xde8(%rip),%rdi
call   1040 <puts@plt>
lea    0xd00(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r14),%edi
call   1090 <fgetc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10d0 <viderBuffer@plt>
mov    %r15,%rdi
lea    0xd1e(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
cmp    $0x1,%ebp
jne    14a3 <main+0x253>
cmp    $0x79,%bl
je     1320 <main+0xd0>
jmp    14a3 <main+0x253>
nop
mov    %r12,%rbp
mov    %r13,%rdi
call   1060 <system@plt>
xor    %eax,%eax
call   1030 <afficher_menu1@plt>
mov    (%r14),%edi
call   1090 <fgetc@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   10d0 <viderBuffer@plt>
cmp    $0x61,%r12b
lea    0xc41(%rip),%rbx
jne    1410 <main+0x1c0>
xor    %ebx,%ebx
xor    %eax,%eax
call   1150 <deconnexion@plt>
cmpb   $0x33,0xf(%rsp)
mov    %rbp,%r12
jne    12cf <main+0x7f>
jmp    1492 <main+0x242>
lea    0xcb1(%rip),%rdi
call   1110 <list@plt>
xor    %eax,%eax
call   1130 <afficher_menu2@plt>
mov    (%r14),%edi
call   1090 <fgetc@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   10d0 <viderBuffer@plt>
mov    %r13,%rdi
call   1060 <system@plt>
cmp    $0x61,%r12b
je     13c1 <main+0x171>
mov    %r13,%rdi
call   1060 <system@plt>
add    $0x9e,%r12b
cmp    $0x7,%r12b
ja     1439 <main+0x1e9>
movzbl %r12b,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
mov    %rbp,%rdi
call   1120 <Envoyermessage@plt>
jmp    1445 <main+0x1f5>
lea    0xc78(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <afficher_menu1@plt>
jmp    13f0 <main+0x1a0>
xor    %eax,%eax
call   1160 <check@plt>
jmp    13e9 <main+0x199>
xor    %eax,%eax
call   1080 <lire@plt>
jmp    13e9 <main+0x199>
lea    0xc32(%rip),%rdi
jmp    13e4 <main+0x194>
xor    %eax,%eax
call   10b0 <supprimer@plt>
xor    %eax,%eax
call   1130 <afficher_menu2@plt>
xor    %eax,%eax
call   10e0 <getchar@plt>
jmp    13f8 <main+0x1a8>
xor    %eax,%eax
call   1050 <Terminaison@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc58(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <Terminaison@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
lea    0xb5f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x9,%edi
call   1170 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c" @ DU SERVEUR :\0A\00"
@stdin = global i32 0
@.str.1 = [6 x i8] c"clear\00"
@.str.2 = [36 x i8] c"erreur de connexion au serveur \0A \00"
@.str.3 = [6 x i8] c"\1B[%sm\00"
@.str.4 = [3 x i8] c"46\00"
@.str.5 = [70 x i8] c" *********erreur d'authentification *********\0A\00"
@.str.6 = [64 x i8] c" voulez vous continuer ??? y/yes n/no \0A \00"
@.str.7 = [2 x i8] c"0\00"
@.str.8 = [46 x i8] c"++++++++++++++++a bientot!!+++++++++++++++++\0A\00"
@.str.9 = [4 x i8] c"new\00"
@.str.10 = [4 x i8] c"all\00"
@.str.11 = [75 x i8] c"Attention vous avez choisis une option n'existe pas ,veuillez recommencer\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [20 x i8]
%4 = alloca [30 x i8]
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
store i8 121, i8* %6
store i8 98, i8* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 16, i32 %10)
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 15
store i8 0, i8* %12
%13 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%15 = call i32 @Initialisation(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @exit(i32 9)
unreachable
20: ; preds = %0
br label %21
21: ; preds = %183, %20
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 51
br i1 %24, label %25, label %184
25: ; preds = %21
%26 = call i32 (...) @afficher_menu()
%27 = call signext i8 (...) @getchar()
store i8 %27, i8* %2
%28 = call i32 (...) @viderBuffer()
%29 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 49
br i1 %32, label %33, label %168
33: ; preds = %25
br label %34
34: ; preds = %61, %33
%35 = load i8, i8* %6
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 110
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %34
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%42 = call i32 @authentification(i8* %41)
store i32 %42, i32* %5
%43 = load i32, i32* %5
%44 = icmp ne i32 %43, 5
br i1 %44, label %45, label %53
45: ; preds = %40
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.5, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0))
%49 = load i32, i32* @stdin
%50 = call signext i8 @fgetc(i32 %49)
store i8 %50, i8* %6
%51 = call i32 (...) @viderBuffer()
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %53
53: ; preds = %45, %40
br label %54
54: ; preds = %53
%55 = load i32, i32* %5
%56 = icmp eq i32 %55, 1
br i1 %56, label %57, label %61
57: ; preds = %54
%58 = load i8, i8* %6
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 121
br label %61
61: ; preds = %57, %54
%62 = phi i1 [ false, %54 ], [ %60, %57 ]
br i1 %62, label %34, label %63
63: ; preds = %61
%64 = load i32, i32* %5
%65 = icmp ne i32 %64, 5
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
%68 = call i32 (...) @Terminaison()
%69 = call i32 @exit(i32 1)
unreachable
70: ; preds = %63
%71 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%72 = call i32 (...) @afficher_menu1()
%73 = load i32, i32* @stdin
%74 = call signext i8 @fgetc(i32 %73)
store i8 %74, i8* %7
%75 = call i32 (...) @viderBuffer()
br label %76
76: ; preds = %163, %70
%77 = load i8, i8* %7
%78 = sext i8 %77 to i32
%79 = icmp ne i32 %78, 97
br i1 %79, label %80, label %166
80: ; preds = %76
%81 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%82 = load i8, i8* %7
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 98
br i1 %84, label %85, label %91
85: ; preds = %80
%86 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%87 = call i32 @Envoyermessage(i8* %86)
%88 = call i32 (...) @afficher_menu1()
%89 = load i32, i32* @stdin
%90 = call signext i8 @fgetc(i32 %89)
store i8 %90, i8* %7
br label %163
91: ; preds = %80
%92 = load i8, i8* %7
%93 = sext i8 %92 to i32
%94 = icmp eq i32 %93, 99
br i1 %94, label %95, label %99
95: ; preds = %91
%96 = call i32 (...) @afficher_menu2()
%97 = load i32, i32* @stdin
%98 = call signext i8 @fgetc(i32 %97)
store i8 %98, i8* %7
br label %162
99: ; preds = %91
%100 = load i8, i8* %7
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 100
br i1 %102, label %103, label %108
103: ; preds = %99
%104 = call i32 (...) @check()
%105 = call i32 (...) @afficher_menu2()
%106 = load i32, i32* @stdin
%107 = call signext i8 @fgetc(i32 %106)
store i8 %107, i8* %7
br label %161
108: ; preds = %99
%109 = load i8, i8* %7
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 101
br i1 %111, label %112, label %117
112: ; preds = %108
%113 = call i32 @list(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%114 = call i32 (...) @afficher_menu2()
%115 = load i32, i32* @stdin
%116 = call signext i8 @fgetc(i32 %115)
store i8 %116, i8* %7
br label %160
117: ; preds = %108
%118 = load i8, i8* %7
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %119, 102
br i1 %120, label %121, label %126
121: ; preds = %117
%122 = call i32 (...) @lire()
%123 = call i32 (...) @afficher_menu2()
%124 = load i32, i32* @stdin
%125 = call signext i8 @fgetc(i32 %124)
store i8 %125, i8* %7
br label %159
126: ; preds = %117
%127 = load i8, i8* %7
%128 = sext i8 %127 to i32
%129 = icmp eq i32 %128, 103
br i1 %129, label %130, label %135
130: ; preds = %126
%131 = call i32 @list(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%132 = call i32 (...) @afficher_menu2()
%133 = load i32, i32* @stdin
%134 = call signext i8 @fgetc(i32 %133)
store i8 %134, i8* %7
br label %158
135: ; preds = %126
%136 = load i8, i8* %7
%137 = sext i8 %136 to i32
%138 = icmp eq i32 %137, 104
br i1 %138, label %139, label %143
139: ; preds = %135
%140 = call i32 (...) @supprimer()
%141 = call i32 (...) @afficher_menu2()
%142 = call signext i8 (...) @getchar()
store i8 %142, i8* %7
br label %157
143: ; preds = %135
%144 = load i8, i8* %7
%145 = sext i8 %144 to i32
%146 = icmp eq i32 %145, 105
br i1 %146, label %147, label %151
147: ; preds = %143
%148 = call i32 (...) @afficher_menu1()
%149 = load i32, i32* @stdin
%150 = call signext i8 @fgetc(i32 %149)
store i8 %150, i8* %7
br label %156
151: ; preds = %143
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.11, i64 0, i64 0))
%153 = call i32 (...) @afficher_menu1()
%154 = load i32, i32* @stdin
%155 = call signext i8 @fgetc(i32 %154)
store i8 %155, i8* %7
br label %156
156: ; preds = %151, %147
br label %157
157: ; preds = %156, %139
br label %158
158: ; preds = %157, %130
br label %159
159: ; preds = %158, %121
br label %160
160: ; preds = %159, %112
br label %161
161: ; preds = %160, %103
br label %162
162: ; preds = %161, %95
br label %163
163: ; preds = %162, %85
%164 = call i32 (...) @viderBuffer()
%165 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %76
166: ; preds = %76
%167 = call i32 (...) @deconnexion()
br label %183
168: ; preds = %25
%169 = load i8, i8* %2
%170 = sext i8 %169 to i32
%171 = icmp eq i32 %170, 50
br i1 %171, label %172, label %175
172: ; preds = %168
%173 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%174 = call i32 (...) @inscription()
br label %182
175: ; preds = %168
%176 = load i8, i8* %2
%177 = sext i8 %176 to i32
%178 = icmp eq i32 %177, 51
br i1 %178, label %179, label %181
179: ; preds = %175
%180 = call i32 (...) @Terminaison()
store i32 1, i32* %1
br label %185
181: ; preds = %175
br label %182
182: ; preds = %181, %172
br label %183
183: ; preds = %182, %166
br label %21
184: ; preds = %21
store i32 0, i32* %1
br label %185
185: ; preds = %184, %179
%186 = load i32, i32* %1
ret i32 %186
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [6 x i8] c"clear\00"
@.str.2 = [36 x i8] c"erreur de connexion au serveur \0A \00"
@.str.3 = [6 x i8] c"\1B[%sm\00"
@.str.4 = [3 x i8] c"46\00"
@.str.6 = [64 x i8] c" voulez vous continuer ??? y/yes n/no \0A \00"
@.str.7 = [2 x i8] c"0\00"
@.str.9 = [4 x i8] c"new\00"
@.str.10 = [4 x i8] c"all\00"
@str = [27 x i8] c" @ DU SERVEUR :\00"
@str.12 = [74 x i8] c"Attention vous avez choisis une option n'existe pas ,veuillez recommencer\00"
@str.13 = [45 x i8] c"++++++++++++++++a bientot!!+++++++++++++++++\00"
@str.14 = [69 x i8] c" *********erreur d'authentification *********\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 16, i32 %6)
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 15
store i8 0, i8* %8
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @Initialisation(i8* %4)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @exit(i32 9)
unreachable
15: ; preds = %0, %98
%16 = call i32 (...) @afficher_menu()
%17 = call signext i8 (...) @getchar()
%18 = call i32 (...) @viderBuffer()
%19 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
switch i8 %17, label %98 [
i8 49, label %20
i8 50, label %95
i8 51, label %99
]
20: ; preds = %15, %23
%21 = call i32 @authentification(i8* %3)
%22 = icmp eq i32 %21, 5
br i1 %22, label %38, label %23
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.14, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0))
%27 = load i32, i32* @stdin
%28 = call signext i8 @fgetc(i32 %27)
%29 = call i32 (...) @viderBuffer()
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp eq i32 %21, 1
%32 = icmp eq i8 %28, 121
%33 = select i1 %31, i1 %32, i1 false
br i1 %33, label %20, label %34
34: ; preds = %23
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.13, i64 0, i64 0))
%36 = call i32 (...) @Terminaison()
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %20
%39 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%40 = call i32 (...) @afficher_menu1()
%41 = load i32, i32* @stdin
%42 = call signext i8 @fgetc(i32 %41)
%43 = call i32 (...) @viderBuffer()
%44 = icmp eq i8 %42, 97
br i1 %44, label %101, label %45
45: ; preds = %38, %90
%46 = phi i8 [ %91, %90 ], [ %42, %38 ]
%47 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
switch i8 %46, label %85 [
i8 98, label %48
i8 99, label %53
i8 100, label %57
i8 101, label %62
i8 102, label %67
i8 103, label %72
i8 104, label %77
i8 105, label %81
]
48: ; preds = %45
%49 = call i32 @Envoyermessage(i8* %3)
%50 = call i32 (...) @afficher_menu1()
%51 = load i32, i32* @stdin
%52 = call signext i8 @fgetc(i32 %51)
br label %90
53: ; preds = %45
%54 = call i32 (...) @afficher_menu2()
%55 = load i32, i32* @stdin
%56 = call signext i8 @fgetc(i32 %55)
br label %90
57: ; preds = %45
%58 = call i32 (...) @check()
%59 = call i32 (...) @afficher_menu2()
%60 = load i32, i32* @stdin
%61 = call signext i8 @fgetc(i32 %60)
br label %90
62: ; preds = %45
%63 = call i32 @list(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%64 = call i32 (...) @afficher_menu2()
%65 = load i32, i32* @stdin
%66 = call signext i8 @fgetc(i32 %65)
br label %90
67: ; preds = %45
%68 = call i32 (...) @lire()
%69 = call i32 (...) @afficher_menu2()
%70 = load i32, i32* @stdin
%71 = call signext i8 @fgetc(i32 %70)
br label %90
72: ; preds = %45
%73 = call i32 @list(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%74 = call i32 (...) @afficher_menu2()
%75 = load i32, i32* @stdin
%76 = call signext i8 @fgetc(i32 %75)
br label %90
77: ; preds = %45
%78 = call i32 (...) @supprimer()
%79 = call i32 (...) @afficher_menu2()
%80 = call signext i8 (...) @getchar()
br label %90
81: ; preds = %45
%82 = call i32 (...) @afficher_menu1()
%83 = load i32, i32* @stdin
%84 = call signext i8 @fgetc(i32 %83)
br label %90
85: ; preds = %45
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.12, i64 0, i64 0))
%87 = call i32 (...) @afficher_menu1()
%88 = load i32, i32* @stdin
%89 = call signext i8 @fgetc(i32 %88)
br label %90
90: ; preds = %53, %62, %72, %81, %85, %77, %67, %57, %48
%91 = phi i8 [ %52, %48 ], [ %56, %53 ], [ %61, %57 ], [ %66, %62 ], [ %71, %67 ], [ %76, %72 ], [ %80, %77 ], [ %84, %81 ], [ %89, %85 ]
%92 = call i32 (...) @viderBuffer()
%93 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%94 = icmp eq i8 %91, 97
br i1 %94, label %101, label %45
95: ; preds = %15
%96 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%97 = call i32 (...) @inscription()
br label %98
98: ; preds = %95, %101, %15
br label %15
99: ; preds = %15
%100 = call i32 (...) @Terminaison()
br label %104
101: ; preds = %90, %38
%102 = call i32 (...) @deconnexion()
%103 = icmp eq i8 %17, 51
br i1 %103, label %104, label %98
104: ; preds = %101, %99
%105 = phi i32 [ 1, %99 ], [ 0, %101 ]
ret i32 %105
}