#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 nombreMystere = 0, nombreEntre = 0;
  const int MAX = 100, MIN = 1;
  srand(time(NULL));
  nombreMystere = (rand() % (MAX - MIN + 1)) + MIN;
  do {
    printf("Quel est le nombre ? ");
    scanf("%d", &nombreEntre);
    if (nombreMystere > nombreEntre)
      printf("C'est plus !\n\n");
    else if (nombreMystere < nombreEntre)
      printf("C'est moins !\n\n");
    else
      printf("Bravo, vous avez trouve le nombre mystere !!!\n\n");
  } while (nombreEntre != nombreMystere);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x64,-0x1c(%rbp)
movl   $0x1,-0x20(%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,-0x14(%rbp)
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5c(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11e0 <main+0x90>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
jmp    120e <main+0xbe>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11fd <main+0xad>
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    1209 <main+0xb9>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    120e <main+0xbe>
jmp    1213 <main+0xc3>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11a7 <main+0x57>
mov    -0x4(%rbp),%eax
add    $0x20,%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)
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,%ebp
sub    %ecx,%ebp
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
lea    0x4(%rsp),%r12
lea    0xe8f(%rip),%r13
lea    0xe59(%rip),%r14
lea    0xe90(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0xe29(%rip),%rdi
call   1040 <printf@plt>
lea    0xe33(%rip),%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
mov    %r14,%rdi
cmovl  %r13,%rdi
cmp    %eax,%ebp
cmovge %r15,%rdi
call   1030 <puts@plt>
cmp    %ebx,0x4(%rsp)
jne    11d0 <main+0x70>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Quel est le nombre ? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"C'est plus !\0A\0A\00"
@.str.3 = [16 x i8] c"C'est moins !\0A\0A\00"
@.str.4 = [48 x i8] c"Bravo, vous avez trouve le nombre mystere !!!\0A\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 100, i32* %8
store i32 1, i32* %9
%10 = call i32 @time(i32* null)
%11 = call i32 @srand(i32 %10)
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 100
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %15
15: ; preds = %33, %2
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = icmp sgt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %32
23: ; preds = %15
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %31
29: ; preds = %23
%30 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
br label %32
32: ; preds = %31, %21
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = load i32, i32* %6
%36 = icmp ne i32 %34, %35
br i1 %36, label %15, label %37
37: ; preds = %33
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@.str = [22 x i8] c"Quel est le nombre ? \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [47 x i8] c"Bravo, vous avez trouve le nombre mystere !!!\0A\00"
@str.5 = [15 x i8] c"C'est moins !\0A\00"
@str.6 = [14 x i8] c"C'est plus !\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 100
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %10, %2
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %3
%14 = icmp slt i32 %8, %13
%15 = icmp slt i32 %9, %13
%16 = select i1 %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0)
%17 = select i1 %14, i8* %16, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0)
%18 = call i32 @puts(i8* dereferenceable(1) %17)
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, %9
br i1 %20, label %21, label %10
21: ; preds = %10
ret i32 0
}