#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 /*<<< orphan*/ scanf(char *, int *);
void main() {
  int number;
  int printing = 0;
  int random_number = 5;
  for (;;) {
    scanf("%d", &number);
    printing = 0;
    if (number == random_number) {
      break;
    } else if (number < random_number) {
      printing = 1;
    } else {
      printing = 2;
    }
    if (printing == 1) {
      printf("Smaller");
    } else {
      printf("Bigger");
    }
  }
  printf("Winner");
  printing++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    115e <main+0x3e>
jmp    11ae <main+0x8e>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <main+0x56>
movl   $0x1,-0x8(%rbp)
jmp    117d <main+0x5d>
movl   $0x2,-0x8(%rbp)
jmp    1182 <main+0x62>
cmpl   $0x1,-0x8(%rbp)
jne    119d <main+0x7d>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
jne    115a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xea2(%rip),%r15
lea    0xea3(%rip),%r12
lea    0xe91(%rip),%r14
lea    0x4(%rsp),%rbx
jmp    1199 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%eax
je     1142 <main+0x22>
mov    %r15,%rdi
cmp    $0x5,%eax
jl     1180 <main+0x60>
mov    %r12,%rdi
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Smaller\00"
@.str.2 = [7 x i8] c"Bigger\00"
@.str.3 = [7 x i8] c"Winner\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 5, i32* %3
br label %4
4: ; preds = %24, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
store i32 0, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %4
br label %25
10: ; preds = %4
%11 = load i32, i32* %1
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %2
br label %16
15: ; preds = %10
store i32 2, i32* %2
br label %16
16: ; preds = %15, %14
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %24
22: ; preds = %17
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
br label %4
25: ; preds = %9
%26 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Smaller\00"
@.str.2 = [7 x i8] c"Bigger\00"
@.str.3 = [7 x i8] c"Winner\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 5
br i1 %5, label %14, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %12, %6 ], [ %4, %0 ]
%8 = icmp slt i32 %7, 5
%9 = select i1 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* dereferenceable(1) %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 5
br i1 %13, label %14, label %6
14: ; preds = %6, %0
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret void
}