#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*/ clearScreen();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int izborFilma() {
  int o;
  while (1) {
    clearScreen();
    printf("\b1) Odabir filma po imenu\n");
    printf("\b2) Odabir filma zanru\n");
    printf("\b3) Odabir filma po popularnosti\n");
    printf("\b0) Prekinite biranje\n");
    printf("Unesite vas izbor: ");
    scanf("%i", &o);
    if (o > 0 && o < 4)
      break;
  }
  return o;
}


x86 assembly (clang, -O0):
<izborFilma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clearScreen@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    11a4 <izborFilma+0x74>
cmpl   $0x4,-0x4(%rbp)
jge    11a4 <izborFilma+0x74>
jmp    11a9 <izborFilma+0x79>
jmp    1138 <izborFilma+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<izborFilma>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xedf(%rip),%r15
lea    0xeef(%rip),%r12
lea    0xf09(%rip),%r13
lea    0xe99(%rip),%rbx
lea    0xea6(%rip),%rbp
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <clearScreen@plt>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x2,%ecx
ja     1180 <izborFilma+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\081) Odabir filma po imenu\0A\00"
@.str.1 = [24 x i8] c"\082) Odabir filma zanru\0A\00"
@.str.2 = [34 x i8] c"\083) Odabir filma po popularnosti\0A\00"
@.str.3 = [23 x i8] c"\080) Prekinite biranje\0A\00"
@.str.4 = [20 x i8] c"Unesite vas izbor: \00"
@.str.5 = [3 x i8] c"%i\00"
define i32 @izborFilma() {
%1 = alloca i32
br label %2
2: ; preds = %0, %16
%3 = call i32 (...) @clearScreen()
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 4
br i1 %14, label %15, label %16
15: ; preds = %12
br label %17
16: ; preds = %12, %2
br label %2
17: ; preds = %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str.4 = [20 x i8] c"Unesite vas izbor: \00"
@.str.5 = [3 x i8] c"%i\00"
@str = [26 x i8] c"\081) Odabir filma po imenu\00"
@str.6 = [23 x i8] c"\082) Odabir filma zanru\00"
@str.7 = [33 x i8] c"\083) Odabir filma po popularnosti\00"
@str.8 = [22 x i8] c"\080) Prekinite biranje\00"
define i32 @izborFilma() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @clearScreen()
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.7, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0))
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = add i32 %11, -1
%13 = icmp ult i32 %12, 3
br i1 %13, label %14, label %3
14: ; preds = %3
ret i32 %11
}