#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*/ ChooseWordInDic(char *);
int /*<<< orphan*/ FindInTheWord(char *, char *, char, char *);
char GetCaractere();
int /*<<< orphan*/ InitTab(char *, int);
int IsItDiscovered(char *, char *);
int /*<<< orphan*/ PrintSecretWordHided(char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(int argc, char *argv[]) {
  char Letter = 0;
  char Choix = 0;
  char MotSecret[100] = "";
  char Essai = 0;
  char *pntEssai = NULL;
  char *Discover = NULL;
  pntEssai = &Essai;
  while (Choix != 'N') {
    Essai = 10;
    InitTab(MotSecret, 100);
    ChooseWordInDic(MotSecret);
    Discover = NULL;
    Discover = malloc(strlen(MotSecret) * sizeof(char));
    if (Discover == NULL) {
      exit(0);
    }
    InitTab(Discover, strlen(MotSecret));
    while (((IsItDiscovered(Discover, MotSecret) == 1) || (Essai <= 0)) != 1) {
      printf("Vous avez %ld Chances\nEntrez une Lettre: ", Essai);
      Letter = GetCaractere();
      FindInTheWord(MotSecret, Discover, Letter, pntEssai);
      PrintSecretWordHided(MotSecret, Discover);
      printf("\n\n");
    }
    free(Discover);
    if (Essai == 0) {
      printf("Vous avez Perdu!\nLe mot secret etait : %s", MotSecret);
    } else {
      printf("Vous avez Gagne!");
    }
    printf("\nRejouer (O)ui ou (N)on ?: ");
    Choix = GetCaractere();
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1090 <memset@plt>
movb   $0x0,-0x81(%rbp)
movq   $0x0,-0x90(%rbp)
movq   $0x0,-0x98(%rbp)
lea    -0x81(%rbp),%rax
mov    %rax,-0x90(%rbp)
movsbl -0x12(%rbp),%eax
cmp    $0x4e,%eax
je     13be <main+0x1fe>
movb   $0xa,-0x81(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   10b0 <InitTab@plt>
lea    -0x80(%rbp),%rdi
call   1040 <ChooseWordInDic@plt>
movq   $0x0,-0x98(%rbp)
lea    -0x80(%rbp),%rdi
call   1070 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
jne    1284 <main+0xc4>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x98(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x80(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%esi
call   10b0 <InitTab@plt>
mov    -0x98(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1060 <IsItDiscovered@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0xa1(%rbp)
je     12df <main+0x11f>
movsbl -0x81(%rbp),%eax
cmp    $0x0,%eax
setle  %al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
je     1352 <main+0x192>
movsbl -0x81(%rbp),%esi
lea    0xcff(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1050 <GetCaractere@plt>
mov    %al,-0x11(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x98(%rbp),%rsi
mov    -0x11(%rbp),%al
mov    -0x90(%rbp),%rcx
movsbl %al,%edx
call   10c0 <FindInTheWord@plt>
lea    -0x80(%rbp),%rdi
mov    -0x98(%rbp),%rsi
call   10d0 <PrintSecretWordHided@plt>
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    12a9 <main+0xe9>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x81(%rbp),%eax
cmp    $0x0,%eax
jne    1385 <main+0x1c5>
lea    -0x80(%rbp),%rsi
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1393 <main+0x1d3>
lea    0xccb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xcce(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1050 <GetCaractere@plt>
mov    %al,-0x12(%rbp)
lea    0xc79(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    121c <main+0x5c>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
lea    0x10(%rsp),%rbx
lea    0xded(%rip),%r13
lea    0xf(%rsp),%rbp
lea    0xe62(%rip),%r14
jmp    127b <main+0xab>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <free@plt>
test   %r15b,%r15b
je     1330 <main+0x160>
lea    0xe0c(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xe0f(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
xor    %eax,%eax
call   1070 <GetCaractere@plt>
mov    %eax,%r12d
mov    $0xa,%edi
call   1050 <putchar@plt>
cmp    $0x4e,%r12b
je     1346 <main+0x176>
movb   $0xa,0xf(%rsp)
mov    %rbx,%rdi
mov    $0x64,%esi
call   10c0 <InitTab@plt>
mov    %rbx,%rdi
call   1040 <ChooseWordInDic@plt>
mov    %rbx,%rdi
call   1090 <strlen@plt>
mov    %eax,%edi
call   10b0 <malloc@plt>
test   %rax,%rax
je     1357 <main+0x187>
mov    %rax,%r12
mov    %rbx,%rdi
call   1090 <strlen@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   10c0 <InitTab@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <IsItDiscovered@plt>
movzbl 0xf(%rsp),%r15d
cmp    $0x1,%eax
je     1230 <main+0x60>
test   %r15b,%r15b
jle    1230 <main+0x60>
movzbl %r15b,%esi
mov    %r13,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
xor    %eax,%eax
call   1070 <GetCaractere@plt>
movsbl %al,%edx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbp,%rcx
call   10d0 <FindInTheWord@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10e0 <PrintSecretWordHided@plt>
mov    %r14,%rdi
call   1060 <puts@plt>
jmp    12d0 <main+0x100>
xchg   %ax,%ax
lea    0xcf3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    124f <main+0x7f>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Vous avez %ld Chances\0AEntrez une Lettre: \00"
@.str.1 = [3 x i8] c"\0A\0A\00"
@.str.2 = [42 x i8] c"Vous avez Perdu!\0ALe mot secret etait : %s\00"
@.str.3 = [17 x i8] c"Vous avez Gagne!\00"
@.str.4 = [28 x i8] c"\0ARejouer (O)ui ou (N)on ?: \00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca [100 x i8]
%9 = alloca i8
%10 = alloca i8*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %6
store i8 0, i8* %7
%12 = bitcast [100 x i8]* %8 to i8*
store i8 0, i8* %9
store i8* null, i8** %10
store i8* null, i8** %11
store i8* %9, i8** %10
br label %13
13: ; preds = %75, %2
%14 = load i8, i8* %7
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 78
br i1 %16, label %17, label %79
17: ; preds = %13
store i8 10, i8* %9
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%19 = call i32 @InitTab(i8* %18, i32 100)
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%21 = call i32 @ChooseWordInDic(i8* %20)
store i8* null, i8** %11
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%23 = call i32 @strlen(i8* %22)
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 1
%26 = trunc i64 %25 to i32
%27 = call i8* @malloc(i32 %26)
store i8* %27, i8** %11
%28 = load i8*, i8** %11
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %32
30: ; preds = %17
%31 = call i32 @exit(i32 0)
unreachable
32: ; preds = %17
%33 = load i8*, i8** %11
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
%36 = call i32 @InitTab(i8* %33, i32 %35)
br label %37
37: ; preds = %50, %32
%38 = load i8*, i8** %11
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%40 = call i32 @IsItDiscovered(i8* %38, i8* %39)
%41 = icmp eq i32 %40, 1
br i1 %41, label %46, label %42
42: ; preds = %37
%43 = load i8, i8* %9
%44 = sext i8 %43 to i32
%45 = icmp sle i32 %44, 0
br label %46
46: ; preds = %42, %37
%47 = phi i1 [ true, %37 ], [ %45, %42 ]
%48 = zext i1 %47 to i32
%49 = icmp ne i32 %48, 1
br i1 %49, label %50, label %64
50: ; preds = %46
%51 = load i8, i8* %9
%52 = sext i8 %51 to i32
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %52)
%54 = call signext i8 (...) @GetCaractere()
store i8 %54, i8* %6
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%56 = load i8*, i8** %11
%57 = load i8, i8* %6
%58 = load i8*, i8** %10
%59 = call i32 @FindInTheWord(i8* %55, i8* %56, i8 signext %57, i8* %58)
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%61 = load i8*, i8** %11
%62 = call i32 @PrintSecretWordHided(i8* %60, i8* %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %37
64: ; preds = %46
%65 = load i8*, i8** %11
%66 = call i32 @free(i8* %65)
%67 = load i8, i8* %9
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %64
%71 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %71)
br label %75
73: ; preds = %64
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %75
75: ; preds = %73, %70
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%77 = call signext i8 (...) @GetCaractere()
store i8 %77, i8* %7
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %13
79: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"Vous avez %ld Chances\0AEntrez une Lettre: \00"
@.str.2 = [42 x i8] c"Vous avez Perdu!\0ALe mot secret etait : %s\00"
@.str.3 = [17 x i8] c"Vous avez Gagne!\00"
@.str.4 = [28 x i8] c"\0ARejouer (O)ui ou (N)on ?: \00"
@str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca i8
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
br label %6
6: ; preds = %2, %43
store i8 10, i8* %4
%7 = call i32 @InitTab(i8* %5, i32 100)
%8 = call i32 @ChooseWordInDic(i8* %5)
%9 = call i32 @strlen(i8* %5)
%10 = call i8* @malloc(i32 %9)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %6
%15 = call i32 @strlen(i8* %5)
%16 = call i32 @InitTab(i8* %10, i32 %15)
%17 = call i32 @IsItDiscovered(i8* %10, i8* %5)
%18 = icmp eq i32 %17, 1
%19 = load i8, i8* %4
%20 = icmp slt i8 %19, 1
%21 = select i1 %18, i1 true, i1 %20
br i1 %21, label %35, label %22
22: ; preds = %14, %22
%23 = phi i8 [ %32, %22 ], [ %19, %14 ]
%24 = zext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = call signext i8 (...) @GetCaractere()
%27 = call i32 @FindInTheWord(i8* %5, i8* %10, i8 signext %26, i8* %4)
%28 = call i32 @PrintSecretWordHided(i8* %5, i8* %10)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%30 = call i32 @IsItDiscovered(i8* %10, i8* %5)
%31 = icmp eq i32 %30, 1
%32 = load i8, i8* %4
%33 = icmp slt i8 %32, 1
%34 = select i1 %31, i1 true, i1 %33
br i1 %34, label %35, label %22
35: ; preds = %22, %14
%36 = phi i8 [ %19, %14 ], [ %32, %22 ]
%37 = call i32 @free(i8* %10)
%38 = icmp eq i8 %36, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %5)
br label %43
41: ; preds = %35
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%45 = call signext i8 (...) @GetCaractere()
%46 = call i32 @putchar(i32 10)
%47 = icmp eq i8 %45, 78
br i1 %47, label %48, label %6
48: ; preds = %43
ret i32 0
}