#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 /*<<< orphan*/ coloration(char *, char *);
int /*<<< orphan*/ multi();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void afficherGagnantPacmanMulti(int joueurActuel, int score, int vie[2]) {
  int gagnant;
  gagnant = -1;
  system("clear");
  if (vie[0] != 0 && vie[1] == 0)
    gagnant = 0;
  else if (vie[0] == 0 && vie[1] != 0)
    gagnant = 1;
  else if (score == 224)
    gagnant = joueurActuel;
  switch (gagnant) {
  case -1:
    printf("Match nul !\n");
    break;
  case 0:
    coloration("Le joueur 1 a gagne !\n", "32");
    break;
  case 1:
    coloration("Le joueur 2 a gagne !\n", "32");
    break;
  }
  appuyezEntree("Appuyez sur ENTREE pour revenir au menu : ");
  multi();
}


x86 assembly (clang, -O0):
<afficherGagnantPacmanMulti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    0xe90(%rip),%rdi
call   1030 <system@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     119c <afficherGagnantPacmanMulti+0x4c>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jne    119c <afficherGagnantPacmanMulti+0x4c>
movl   $0x0,-0x14(%rbp)
jmp    11e0 <afficherGagnantPacmanMulti+0x90>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    11c3 <afficherGagnantPacmanMulti+0x73>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     11c3 <afficherGagnantPacmanMulti+0x73>
movl   $0x1,-0x14(%rbp)
jmp    11db <afficherGagnantPacmanMulti+0x8b>
cmpl   $0xe0,-0x8(%rbp)
jne    11d6 <afficherGagnantPacmanMulti+0x86>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11db <afficherGagnantPacmanMulti+0x8b>
jmp    11e0 <afficherGagnantPacmanMulti+0x90>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xffffffff,%eax
je     1215 <afficherGagnantPacmanMulti+0xc5>
jmp    11f4 <afficherGagnantPacmanMulti+0xa4>
mov    -0x18(%rbp),%eax
test   %eax,%eax
je     1226 <afficherGagnantPacmanMulti+0xd6>
jmp    1204 <afficherGagnantPacmanMulti+0xb4>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     123e <afficherGagnantPacmanMulti+0xee>
jmp    1251 <afficherGagnantPacmanMulti+0x101>
lea    0xdea(%rip),%rdi
call   1040 <printf@plt>
jmp    1251 <afficherGagnantPacmanMulti+0x101>
lea    0xde6(%rip),%rdi
lea    0xdf6(%rip),%rsi
call   1060 <coloration@plt>
jmp    1251 <afficherGagnantPacmanMulti+0x101>
lea    0xde8(%rip),%rdi
lea    0xdde(%rip),%rsi
call   1060 <coloration@plt>
lea    0xdec(%rip),%rdi
call   1070 <appuyezEntree@plt>
mov    $0x0,%al
call   1050 <multi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficherGagnantPacmanMulti>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%r14d
lea    0xe9d(%rip),%rdi
call   1040 <system@plt>
cmpl   $0x0,(%rbx)
mov    0x4(%rbx),%eax
je     1176 <afficherGagnantPacmanMulti+0x26>
test   %eax,%eax
jne    117a <afficherGagnantPacmanMulti+0x2a>
jmp    11aa <afficherGagnantPacmanMulti+0x5a>
test   %eax,%eax
jne    11a1 <afficherGagnantPacmanMulti+0x51>
cmp    $0xe0,%ebp
jne    1193 <afficherGagnantPacmanMulti+0x43>
cmp    $0x1,%r14d
je     11a1 <afficherGagnantPacmanMulti+0x51>
test   %r14d,%r14d
je     11aa <afficherGagnantPacmanMulti+0x5a>
cmp    $0xffffffff,%r14d
jne    11bd <afficherGagnantPacmanMulti+0x6d>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
jmp    11bd <afficherGagnantPacmanMulti+0x6d>
lea    0xe78(%rip),%rdi
jmp    11b1 <afficherGagnantPacmanMulti+0x61>
lea    0xe55(%rip),%rdi
lea    0xe65(%rip),%rsi
call   1060 <coloration@plt>
lea    0xe73(%rip),%rdi
call   1070 <appuyezEntree@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <multi@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [13 x i8] c"Match nul !\0A\00"
@.str.2 = [23 x i8] c"Le joueur 1 a gagne !\0A\00"
@.str.3 = [3 x i8] c"32\00"
@.str.4 = [23 x i8] c"Le joueur 2 a gagne !\0A\00"
@.str.5 = [43 x i8] c"Appuyez sur ENTREE pour revenir au menu : \00"
define void @afficherGagnantPacmanMulti(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 -1, i32* %7
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %6
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i32*, i32** %6
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %7
br label %37
19: ; preds = %13, %3
%20 = load i32*, i32** %6
%21 = getelementptr inbounds i32, i32* %20, i64 0
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %19
%25 = load i32*, i32** %6
%26 = getelementptr inbounds i32, i32* %25, i64 1
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %24
store i32 1, i32* %7
br label %36
30: ; preds = %24, %19
%31 = load i32, i32* %5
%32 = icmp eq i32 %31, 224
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = load i32, i32* %4
store i32 %34, i32* %7
br label %35
35: ; preds = %33, %30
br label %36
36: ; preds = %35, %29
br label %37
37: ; preds = %36, %18
%38 = load i32, i32* %7
switch i32 %38, label %45 [
i32 -1, label %39
i32 0, label %41
i32 1, label %43
]
39: ; preds = %37
%40 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %45
41: ; preds = %37
%42 = call i32 @coloration(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %45
43: ; preds = %37
%44 = call i32 @coloration(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %45
45: ; preds = %37, %43, %41, %39
%46 = call i32 @appuyezEntree(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%47 = call i32 (...) @multi()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.2 = [23 x i8] c"Le joueur 1 a gagne !\0A\00"
@.str.3 = [3 x i8] c"32\00"
@.str.4 = [23 x i8] c"Le joueur 2 a gagne !\0A\00"
@.str.5 = [43 x i8] c"Appuyez sur ENTREE pour revenir au menu : \00"
@str = [12 x i8] c"Match nul !\00"
define void @afficherGagnantPacmanMulti(i32 %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds i32, i32* %2, i64 1
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %6, label %11, label %10
10: ; preds = %3
br i1 %9, label %17, label %12
11: ; preds = %3
br i1 %9, label %12, label %19
12: ; preds = %10, %11
%13 = icmp eq i32 %1, 224
br i1 %13, label %14, label %15
14: ; preds = %12
switch i32 %0, label %21 [
i32 -1, label %15
i32 0, label %17
i32 1, label %19
]
15: ; preds = %12, %14
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %21
17: ; preds = %10, %14
%18 = tail call i32 @coloration(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %21
19: ; preds = %11, %14
%20 = tail call i32 @coloration(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %21
21: ; preds = %14, %19, %17, %15
%22 = tail call i32 @appuyezEntree(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%23 = tail call i32 (...) @multi()
ret void
}