#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 choixNombreMysterePlusOuMoins(int, int *);
int /*<<< orphan*/ coloration(char *, char *);
int /*<<< orphan*/ menuPlusOuMoins(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ revenirMenuMulti();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ systemeDePointsPlusOuMoinsEtPendu(int, int, int);
int /*<<< orphan*/ viderBuffer();
void plusOuMoins(int modeDeJeux) {
  int nombreMystere, nombreEntree;
  int choixNiveauDifficulte;
  int vie, coups;
  vie = 10;
  menuPlusOuMoins(modeDeJeux);
  nombreMystere =
      choixNombreMysterePlusOuMoins(modeDeJeux, &choixNiveauDifficulte);
  do {
    if (modeDeJeux == 1)
      printf("Joueur 2 :\n");
    printf("Vous avez %d vie(s) !\n", vie);
    printf("Entrez un nombre : ");
    scanf("%d", &nombreEntree);
    viderBuffer();
    if (nombreEntree > nombreMystere) {
      coloration("C'est moins !\n", "31");
      vie--;
    } else if (nombreEntree < nombreMystere) {
      coloration("C'est plus !\n", "32");
      vie--;
    } else {
      coups = 10 - vie;
      printf("\nBravo ! Vous avez trouve le nombre mystere en %d coup(s).\n",
             coups);
    }
    printf("\n");
  } while (nombreEntree != nombreMystere && vie > 0);
  if (vie == 0) {
    coups = 10;
    printf("Dommage vous avez perdu, le nombre mystere etait : %d\n",
           nombreMystere);
  }
  if (modeDeJeux == 0)
    systemeDePointsPlusOuMoinsEtPendu(coups, modeDeJeux, choixNiveauDifficulte);
  else if (modeDeJeux == 1)
    revenirMenuMulti();
}


x86 assembly (clang, -O0):
<plusOuMoins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <menuPlusOuMoins@plt>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   10a0 <choixNombreMysterePlusOuMoins@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    11c1 <plusOuMoins+0x41>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe50(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1090 <scanf@plt>
mov    $0x0,%al
call   1070 <viderBuffer@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1224 <plusOuMoins+0xa4>
lea    0xe30(%rip),%rdi
lea    0xe38(%rip),%rsi
call   1050 <coloration@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1272 <plusOuMoins+0xf2>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1251 <plusOuMoins+0xd1>
lea    0xe15(%rip),%rdi
lea    0xe1c(%rip),%rsi
call   1050 <coloration@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    126d <plusOuMoins+0xed>
mov    $0xa,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1272 <plusOuMoins+0xf2>
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x19(%rbp)
je     129b <plusOuMoins+0x11b>
cmpl   $0x0,-0x14(%rbp)
setg   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    11a9 <plusOuMoins+0x29>
cmpl   $0x0,-0x14(%rbp)
jne    12c8 <plusOuMoins+0x148>
movl   $0xa,-0x18(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    12e5 <plusOuMoins+0x165>
mov    -0x18(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1060 <systemeDePointsPlusOuMoinsEtPendu@plt>
jmp    12fb <plusOuMoins+0x17b>
cmpl   $0x1,-0x4(%rbp)
jne    12f6 <plusOuMoins+0x176>
mov    $0x0,%al
call   1080 <revenirMenuMulti@plt>
jmp    12fb <plusOuMoins+0x17b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plusOuMoins>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
call   1050 <menuPlusOuMoins@plt>
lea    0x4(%rsp),%rsi
mov    %r14d,%edi
call   10c0 <choixNombreMysterePlusOuMoins@plt>
mov    %eax,%ebp
mov    $0xa,%ebx
lea    0xe5d(%rip),%r13
mov    %rsp,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%r14d
jne    11f2 <plusOuMoins+0x52>
lea    0xed7(%rip),%rdi
call   1040 <puts@plt>
lea    0xe07(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe0e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   10b0 <scanf@plt>
xor    %eax,%eax
call   1090 <viderBuffer@plt>
cmp    %ebp,(%rsp)
jle    1240 <plusOuMoins+0xa0>
lea    0xe00(%rip),%rdi
lea    0xe08(%rip),%rsi
jmp    1250 <plusOuMoins+0xb0>
nopw   0x0(%rax,%rax,1)
jge    1260 <plusOuMoins+0xc0>
lea    0xdf7(%rip),%rdi
lea    0xdfe(%rip),%rsi
call   1070 <coloration@plt>
add    $0xffffffff,%ebx
jmp    127a <plusOuMoins+0xda>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%r15d
sub    %ebx,%r15d
lea    0xde1(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    %ebp,(%rsp)
je     1291 <plusOuMoins+0xf1>
test   %ebx,%ebx
jg     11e0 <plusOuMoins+0x40>
test   %ebx,%ebx
je     12a9 <plusOuMoins+0x109>
test   %r14d,%r14d
je     12c4 <plusOuMoins+0x124>
cmp    $0x1,%r14d
jne    12d2 <plusOuMoins+0x132>
xor    %eax,%eax
call   10a0 <revenirMenuMulti@plt>
jmp    12d2 <plusOuMoins+0x132>
lea    0xddd(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%r15d
test   %r14d,%r14d
jne    129a <plusOuMoins+0xfa>
mov    0x4(%rsp),%edx
mov    %r15d,%edi
xor    %esi,%esi
call   1080 <systemeDePointsPlusOuMoinsEtPendu@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Joueur 2 :\0A\00"
@.str.1 = [23 x i8] c"Vous avez %d vie(s) !\0A\00"
@.str.2 = [20 x i8] c"Entrez un nombre : \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [15 x i8] c"C'est moins !\0A\00"
@.str.5 = [3 x i8] c"31\00"
@.str.6 = [14 x i8] c"C'est plus !\0A\00"
@.str.7 = [3 x i8] c"32\00"
@.str.8 = [60 x i8] c"\0ABravo ! Vous avez trouve le nombre mystere en %d coup(s).\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [55 x i8] c"Dommage vous avez perdu, le nombre mystere etait : %d\0A\00"
define void @plusOuMoins(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
store i32 10, i32* %6
%8 = load i32, i32* %2
%9 = call i32 @menuPlusOuMoins(i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @choixNombreMysterePlusOuMoins(i32 %10, i32* %5)
store i32 %11, i32* %3
br label %12
12: ; preds = %53, %1
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%22 = call i32 (...) @viderBuffer()
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = icmp sgt i32 %23, %24
br i1 %25, label %26, label %30
26: ; preds = %17
%27 = call i32 @coloration(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%28 = load i32, i32* %6
%29 = add nsw i32 %28, -1
store i32 %29, i32* %6
br label %44
30: ; preds = %17
%31 = load i32, i32* %4
%32 = load i32, i32* %3
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = call i32 @coloration(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%36 = load i32, i32* %6
%37 = add nsw i32 %36, -1
store i32 %37, i32* %6
br label %43
38: ; preds = %30
%39 = load i32, i32* %6
%40 = sub nsw i32 10, %39
store i32 %40, i32* %7
%41 = load i32, i32* %7
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %38, %34
br label %44
44: ; preds = %43, %26
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %4
%48 = load i32, i32* %3
%49 = icmp ne i32 %47, %48
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = load i32, i32* %6
%52 = icmp sgt i32 %51, 0
br label %53
53: ; preds = %50, %46
%54 = phi i1 [ false, %46 ], [ %52, %50 ]
br i1 %54, label %12, label %55
55: ; preds = %53
%56 = load i32, i32* %6
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
store i32 10, i32* %7
%59 = load i32, i32* %3
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %58, %55
%62 = load i32, i32* %2
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %69
64: ; preds = %61
%65 = load i32, i32* %7
%66 = load i32, i32* %2
%67 = load i32, i32* %5
%68 = call i32 @systemeDePointsPlusOuMoinsEtPendu(i32 %65, i32 %66, i32 %67)
br label %75
69: ; preds = %61
%70 = load i32, i32* %2
%71 = icmp eq i32 %70, 1
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 (...) @revenirMenuMulti()
br label %74
74: ; preds = %72, %69
br label %75
75: ; preds = %74, %64
ret void
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Vous avez %d vie(s) !\0A\00"
@.str.2 = [20 x i8] c"Entrez un nombre : \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [15 x i8] c"C'est moins !\0A\00"
@.str.5 = [3 x i8] c"31\00"
@.str.6 = [14 x i8] c"C'est plus !\0A\00"
@.str.7 = [3 x i8] c"32\00"
@.str.8 = [60 x i8] c"\0ABravo ! Vous avez trouve le nombre mystere en %d coup(s).\0A\00"
@.str.10 = [55 x i8] c"Dommage vous avez perdu, le nombre mystere etait : %d\0A\00"
@str = [11 x i8] c"Joueur 2 :\00"
define void @plusOuMoins(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @menuPlusOuMoins(i32 %0)
%7 = call i32 @choixNombreMysterePlusOuMoins(i32 %0, i32* %3)
%8 = icmp eq i32 %0, 1
br label %9
9: ; preds = %32, %1
%10 = phi i32 [ 10, %1 ], [ %33, %32 ]
%11 = phi i32 [ undef, %1 ], [ %34, %32 ]
br i1 %8, label %12, label %14
12: ; preds = %9
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%18 = call i32 (...) @viderBuffer()
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, %7
br i1 %20, label %21, label %24
21: ; preds = %14
%22 = call i32 @coloration(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%23 = add nsw i32 %10, -1
br label %32
24: ; preds = %14
%25 = icmp slt i32 %19, %7
br i1 %25, label %26, label %29
26: ; preds = %24
%27 = call i32 @coloration(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%28 = add nsw i32 %10, -1
br label %32
29: ; preds = %24
%30 = sub nsw i32 10, %10
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %26, %29, %21
%33 = phi i32 [ %23, %21 ], [ %28, %26 ], [ %10, %29 ]
%34 = phi i32 [ %11, %21 ], [ %11, %26 ], [ %30, %29 ]
%35 = call i32 @putchar(i32 10)
%36 = load i32, i32* %2
%37 = icmp ne i32 %36, %7
%38 = icmp sgt i32 %33, 0
%39 = select i1 %37, i1 %38, i1 false
br i1 %39, label %9, label %40
40: ; preds = %32
%41 = icmp eq i32 %33, 0
br i1 %41, label %42, label %44
42: ; preds = %40
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0), i32 %7)
br label %44
44: ; preds = %42, %40
%45 = phi i32 [ 10, %42 ], [ %34, %40 ]
%46 = icmp eq i32 %0, 0
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = load i32, i32* %3
%49 = call i32 @systemeDePointsPlusOuMoinsEtPendu(i32 %45, i32 0, i32 %48)
br label %53
50: ; preds = %44
br i1 %8, label %51, label %53
51: ; preds = %50
%52 = call i32 (...) @revenirMenuMulti()
br label %53
53: ; preds = %50, %51, %47
ret void
}