#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*/ appuyezEntree(char *);
int choisirDifficulte();
int /*<<< orphan*/ coloration(char *, char *);
int /*<<< orphan*/ lireEtAfficherFichier(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ titre(char *);
void menuPuissance4(int modeDeJeux, int *niveauDifficulte) {
  int choixDifficulte;
  titre("Puissance 4");
  if (modeDeJeux == 0)
    lireEtAfficherFichier(
        "Texte de presentation/Puissance 4/puissance4Solo.txt");
  else if (modeDeJeux == 1)
    lireEtAfficherFichier(
        "Texte de presentation/Puissance 4/puissance4Multi.txt");
  printf("\n\n");
  printf("  1 2 3 4 5 6 7\n");
  printf("1 - - - - - - -\n");
  printf("2 - - - - - - -\n");
  printf("3 - - - - - - -\n");
  printf("4 - - - - - - -\n");
  printf("5 - - - - - - -\n");
  printf("6 - - - - - - -\n\n");
  if (modeDeJeux == 0)
    printf("Vous = '");
  else if (modeDeJeux == 1)
    printf("Joueur 1 = '");
  coloration("O", "31");
  if (modeDeJeux == 0)
    printf("'\nOrdinateur = '");
  else if (modeDeJeux == 1)
    printf("'\nJoueur 2 = '");
  coloration("O", "33");
  printf("'\n\n");
  appuyezEntree("Appuyez sur ENTREE pour commencer : ");
  if (modeDeJeux == 0) {
    choixDifficulte = choisirDifficulte();
    *niveauDifficulte = choixDifficulte;
  }
}


x86 assembly (clang, -O0):
<menuPuissance4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe8a(%rip),%rdi
call   1070 <titre@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1196 <menuPuissance4+0x36>
lea    0xe80(%rip),%rdi
call   1030 <lireEtAfficherFichier@plt>
jmp    11b1 <menuPuissance4+0x51>
cmpl   $0x1,-0x4(%rbp)
jne    11ac <menuPuissance4+0x4c>
lea    0xe9a(%rip),%rdi
call   1030 <lireEtAfficherFichier@plt>
jmp    11b1 <menuPuissance4+0x51>
lea    0xf76(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
call   1050 <printf@plt>
lea    0xec7(%rip),%rdi
call   1050 <printf@plt>
lea    0xecc(%rip),%rdi
call   1050 <printf@plt>
lea    0xed1(%rip),%rdi
call   1050 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    122c <menuPuissance4+0xcc>
lea    0xecd(%rip),%rdi
call   1050 <printf@plt>
jmp    1247 <menuPuissance4+0xe7>
cmpl   $0x1,-0x4(%rbp)
jne    1242 <menuPuissance4+0xe2>
lea    0xebb(%rip),%rdi
call   1050 <printf@plt>
jmp    1247 <menuPuissance4+0xe7>
lea    0xeb7(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <coloration@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1275 <menuPuissance4+0x115>
lea    0xe9f(%rip),%rdi
call   1050 <printf@plt>
jmp    1290 <menuPuissance4+0x130>
cmpl   $0x1,-0x4(%rbp)
jne    128b <menuPuissance4+0x12b>
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
jmp    1290 <menuPuissance4+0x130>
lea    0xe6e(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   1060 <coloration@plt>
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1080 <appuyezEntree@plt>
cmpl   $0x0,-0x4(%rbp)
jne    12d8 <menuPuissance4+0x178>
mov    $0x0,%al
call   1040 <choisirDifficulte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuPuissance4>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe81(%rip),%rdi
call   1080 <titre@plt>
test   %ebp,%ebp
je     1196 <menuPuissance4+0x26>
cmp    $0x1,%ebp
jne    11a2 <menuPuissance4+0x32>
lea    0xead(%rip),%rdi
jmp    119d <menuPuissance4+0x2d>
lea    0xe6f(%rip),%rdi
call   1030 <lireEtAfficherFichier@plt>
lea    0xfa3(%rip),%rdi
call   1050 <puts@plt>
lea    0xf25(%rip),%rdi
call   1050 <puts@plt>
lea    0xf29(%rip),%rdi
call   1050 <puts@plt>
lea    0xf2d(%rip),%rdi
call   1050 <puts@plt>
lea    0xf31(%rip),%rdi
call   1050 <puts@plt>
lea    0xf35(%rip),%rdi
call   1050 <puts@plt>
lea    0xf39(%rip),%rdi
call   1050 <puts@plt>
lea    0xf3d(%rip),%rdi
call   1050 <puts@plt>
test   %ebp,%ebp
je     1233 <menuPuissance4+0xc3>
cmp    $0x1,%ebp
jne    1260 <menuPuissance4+0xf0>
lea    0xe6e(%rip),%rdi
call   1060 <printf@plt>
lea    0xe6f(%rip),%rdi
lea    0xe6a(%rip),%rsi
call   1070 <coloration@plt>
lea    0xe72(%rip),%rdi
jmp    1259 <menuPuissance4+0xe9>
lea    0xe3d(%rip),%rdi
call   1060 <printf@plt>
lea    0xe47(%rip),%rdi
lea    0xe42(%rip),%rsi
call   1070 <coloration@plt>
lea    0xe39(%rip),%rdi
call   1060 <printf@plt>
jmp    1273 <menuPuissance4+0x103>
lea    0xe26(%rip),%rdi
lea    0xe21(%rip),%rsi
call   1070 <coloration@plt>
lea    0xe13(%rip),%rdi
lea    0xe31(%rip),%rsi
call   1070 <coloration@plt>
lea    0xebe(%rip),%rdi
call   1050 <puts@plt>
lea    0xe1c(%rip),%rdi
call   1090 <appuyezEntree@plt>
test   %ebp,%ebp
jne    12ab <menuPuissance4+0x13b>
xor    %eax,%eax
call   1040 <choisirDifficulte@plt>
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Puissance 4\00"
@.str.1 = [53 x i8] c"Texte de presentation/Puissance 4/puissance4Solo.txt\00"
@.str.2 = [54 x i8] c"Texte de presentation/Puissance 4/puissance4Multi.txt\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
@.str.4 = [17 x i8] c" 1 2 3 4 5 6 7\0A\00"
@.str.5 = [17 x i8] c"1 - - - - - - -\0A\00"
@.str.6 = [17 x i8] c"2 - - - - - - -\0A\00"
@.str.7 = [17 x i8] c"3 - - - - - - -\0A\00"
@.str.8 = [17 x i8] c"4 - - - - - - -\0A\00"
@.str.9 = [17 x i8] c"5 - - - - - - -\0A\00"
@.str.10 = [18 x i8] c"6 - - - - - - -\0A\0A\00"
@.str.11 = [9 x i8] c"Vous = '\00"
@.str.12 = [13 x i8] c"Joueur 1 = '\00"
@.str.13 = [2 x i8] c"O\00"
@.str.14 = [3 x i8] c"31\00"
@.str.15 = [17 x i8] c"'\0AOrdinateur = '\00"
@.str.16 = [15 x i8] c"'\0AJoueur 2 = '\00"
@.str.17 = [3 x i8] c"33\00"
@.str.18 = [4 x i8] c"'\0A\0A\00"
@.str.19 = [37 x i8] c"Appuyez sur ENTREE pour commencer : \00"
define void @menuPuissance4(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = call i32 @titre(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @lireEtAfficherFichier(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
br label %17
11: ; preds = %2
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @lireEtAfficherFichier(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
br label %17
17: ; preds = %16, %9
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %17
%29 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
br label %36
30: ; preds = %17
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
br label %36
36: ; preds = %35, %28
%37 = call i32 @coloration(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%38 = load i32, i32* %3
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
br label %48
42: ; preds = %36
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
br label %48
48: ; preds = %47, %40
%49 = call i32 @coloration(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%51 = call i32 @appuyezEntree(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.19, i64 0, i64 0))
%52 = load i32, i32* %3
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %48
%55 = call i32 (...) @choisirDifficulte()
store i32 %55, i32* %5
%56 = load i32, i32* %5
%57 = load i32*, i32** %4
store i32 %56, i32* %57
br label %58
58: ; preds = %54, %48
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Puissance 4\00"
@.str.1 = [53 x i8] c"Texte de presentation/Puissance 4/puissance4Solo.txt\00"
@.str.2 = [54 x i8] c"Texte de presentation/Puissance 4/puissance4Multi.txt\00"
@.str.11 = [9 x i8] c"Vous = '\00"
@.str.12 = [13 x i8] c"Joueur 1 = '\00"
@.str.13 = [2 x i8] c"O\00"
@.str.14 = [3 x i8] c"31\00"
@.str.15 = [17 x i8] c"'\0AOrdinateur = '\00"
@.str.16 = [15 x i8] c"'\0AJoueur 2 = '\00"
@.str.17 = [3 x i8] c"33\00"
@.str.19 = [37 x i8] c"Appuyez sur ENTREE pour commencer : \00"
@str = [2 x i8] c"\0A\00"
@str.20 = [16 x i8] c" 1 2 3 4 5 6 7\00"
@str.21 = [16 x i8] c"1 - - - - - - -\00"
@str.22 = [16 x i8] c"2 - - - - - - -\00"
@str.23 = [16 x i8] c"3 - - - - - - -\00"
@str.24 = [16 x i8] c"4 - - - - - - -\00"
@str.25 = [16 x i8] c"5 - - - - - - -\00"
@str.26 = [17 x i8] c"6 - - - - - - -\0A\00"
@str.27 = [3 x i8] c"'\0A\00"
define void @menuPuissance4(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @titre(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = icmp eq i32 %0, 1
br i1 %6, label %7, label %10
7: ; preds = %5, %2
%8 = phi i8* [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), %5 ]
%9 = tail call i32 @lireEtAfficherFichier(i8* %8)
br label %10
10: ; preds = %7, %5
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.20, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.21, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.22, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.23, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.24, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.25, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.26, i64 0, i64 0))
br i1 %4, label %21, label %19
19: ; preds = %10
%20 = icmp eq i32 %0, 1
br i1 %20, label %27, label %25
21: ; preds = %10
%22 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%23 = tail call i32 @coloration(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%24 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
br label %31
25: ; preds = %19
%26 = tail call i32 @coloration(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
br label %31
27: ; preds = %19
%28 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
%29 = tail call i32 @coloration(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%30 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0))
br label %31
31: ; preds = %25, %27, %21
%32 = tail call i32 @coloration(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.27, i64 0, i64 0))
%34 = tail call i32 @appuyezEntree(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.19, i64 0, i64 0))
br i1 %4, label %35, label %37
35: ; preds = %31
%36 = tail call i32 (...) @choisirDifficulte()
store i32 %36, i32* %1
br label %37
37: ; preds = %35, %31
ret void
}