#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*/ printf(char *);
int const rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  int restart = 0;
  const int MAX = 100, MIN = 1;
  do {
    srand(time(NULL));
    int random = (rand() % (MAX - MIN + 1) + MIN), nombreEntree = 0;
    printf("\n\n----------- NOUVELLE PARTIE ------------\n\n\n");
    do {
      printf("Quelle est le nombre?????   : ");
      scanf("%d", &nombreEntree);
      if (random > nombreEntree) {
        printf("Ce nombre est plus grand \n");
      } else if (random < nombreEntree) {
        printf("Ce nombre est plus petit \n");
      } else {
        printf("Bravo vous avez finalement dévinezz!!!!!!!!!!!!\n");
      }
    } while (nombreEntree != random);
    printf("Voulez vous recommencez la partie??\n");
    printf("1) pour oui et 2) pour non\n");
    scanf("%d", &restart);
  } while (restart);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x64,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    11ec <main+0x9c>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    121a <main+0xca>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1209 <main+0xb9>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
jmp    1215 <main+0xc5>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    121a <main+0xca>
jmp    121f <main+0xcf>
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    11b3 <main+0x63>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe03(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    117b <main+0x2b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xea5(%rip),%r12
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
mov    %eax,%r15d
sub    %ecx,%r15d
neg    %ecx
lea    (%rax,%rcx,1),%r13d
add    $0x1,%r13d
movl   $0x0,(%rsp)
lea    0xe56(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rbp
lea    0xe70(%rip),%rbx
lea    0xef3(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%eax
cmp    %eax,%r13d
mov    %rbx,%rdi
cmovl  %rbp,%rdi
cmp    %eax,%r15d
cmovge %r14,%rdi
call   1030 <puts@plt>
cmp    %r13d,(%rsp)
jne    11f0 <main+0x90>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6b(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jne    1180 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"\0A\0A----------- NOUVELLE PARTIE ------------\0A\0A\0A\00"
@.str.1 = [31 x i8] c"Quelle est le nombre????? : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [27 x i8] c"Ce nombre est plus grand \0A\00"
@.str.4 = [27 x i8] c"Ce nombre est plus petit \0A\00"
@.str.5 = [50 x i8] c"Bravo vous avez finalement d\C3\A9vinezz!!!!!!!!!!!!\0A\00"
@.str.6 = [37 x i8] c"Voulez vous recommencez la partie??\0A\00"
@.str.7 = [28 x i8] c"1) pour oui et 2) pour non\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 100, i32* %7
store i32 1, i32* %8
br label %11
11: ; preds = %44, %2
%12 = call i32 @time(i32* null)
%13 = call i32 @srand(i32 %12)
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 100
%16 = add nsw i32 %15, 1
store i32 %16, i32* %9
store i32 0, i32* %10
%17 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %36, %11
%19 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %35
26: ; preds = %18
%27 = load i32, i32* %9
%28 = load i32, i32* %10
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %34
32: ; preds = %26
%33 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
br label %35
35: ; preds = %34, %24
br label %36
36: ; preds = %35
%37 = load i32, i32* %10
%38 = load i32, i32* %9
%39 = icmp ne i32 %37, %38
br i1 %39, label %18, label %40
40: ; preds = %36
%41 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%42 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
br label %44
44: ; preds = %40
%45 = load i32, i32* %6
%46 = icmp ne i32 %45, 0
br i1 %46, label %11, label %47
47: ; preds = %44
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [31 x i8] c"Quelle est le nombre????? : \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [45 x i8] c"\0A\0A----------- NOUVELLE PARTIE ------------\0A\0A\00"
@str.8 = [49 x i8] c"Bravo vous avez finalement d\C3\A9vinezz!!!!!!!!!!!!\00"
@str.9 = [36 x i8] c"Voulez vous recommencez la partie??\00"
@str.10 = [27 x i8] c"1) pour oui et 2) pour non\00"
@str.11 = [26 x i8] c"Ce nombre est plus petit \00"
@str.12 = [26 x i8] c"Ce nombre est plus grand \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
br label %7
7: ; preds = %25, %2
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = add nsw i32 %11, 1
store i32 0, i32* %4
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %14, %7
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %4
%18 = icmp slt i32 %11, %17
%19 = icmp slt i32 %12, %17
%20 = select i1 %19, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @str.8, i64 0, i64 0)
%21 = select i1 %18, i8* %20, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0)
%22 = call i32 @puts(i8* dereferenceable(1) %21)
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, %12
br i1 %24, label %25, label %14
25: ; preds = %14
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.9, i64 0, i64 0))
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.10, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %7
31: ; preds = %25
ret i32 0
}