#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 rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int nb, x;
  srand(time(NULL));
  nb = rand() % 100;
  printf("Entrez un nombre : ");
  scanf("%d", &x);
  while (x != nb) {
    if (x > nb) {
      printf("<");
      scanf("%d", &x);
    } else if (x < nb) {
      printf(">");
      scanf("%d", &x);
    } else {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%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
mov    %edx,-0x8(%rbp)
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1212 <main+0xc2>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11d6 <main+0x86>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe4c(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
jmp    120d <main+0xbd>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1203 <main+0xb3>
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
lea    0xe1f(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
jmp    1208 <main+0xb8>
jmp    1212 <main+0xc2>
jmp    120d <main+0xbd>
jmp    119d <main+0x4d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
movslq %eax,%rbx
imul   $0x51eb851f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ebx
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe67(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebx,%eax
je     11f8 <main+0x98>
lea    0xe4e(%rip),%r14
lea    0xc(%rsp),%r15
jmp    11e8 <main+0x88>
nopl   (%rax)
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebx,%eax
je     11f8 <main+0x98>
mov    $0x3c,%edi
cmp    %ebx,%eax
jg     11d0 <main+0x70>
mov    $0x3e,%edi
jl     11d0 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Entrez un nombre : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"<\00"
@.str.3 = [2 x i8] c">\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 100
store i32 %7, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %10
10: ; preds = %30, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %31
14: ; preds = %10
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %30
21: ; preds = %14
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %29
28: ; preds = %21
br label %31
29: ; preds = %25
br label %30
30: ; preds = %29, %18
br label %10
31: ; preds = %28, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Entrez un nombre : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 100
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, %6
br i1 %10, label %22, label %11
11: ; preds = %0, %16
%12 = phi i32 [ %20, %16 ], [ %9, %0 ]
%13 = icmp sgt i32 %12, %6
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = icmp slt i32 %12, %6
br i1 %15, label %16, label %22
16: ; preds = %14, %11
%17 = phi i32 [ 60, %11 ], [ 62, %14 ]
%18 = call i32 @putchar(i32 %17)
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%20 = load i32, i32* %1
%21 = icmp eq i32 %20, %6
br i1 %21, label %22, label %11
22: ; preds = %16, %14, %0
ret i32 0
}