#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 *);
int main() {
  int poeni, ocena = 0;
  printf("Vnesi poeni: \n");
  scanf("%d", &poeni);
  if (poeni < 0 || poeni > 100)
    printf("Nevalidna vrednost za poeni!\n");
  else {
    if (poeni > 90)
      ocena = 10;
    else if (poeni > 80)
      ocena = 9;
    else if (poeni > 70)
      ocena = 8;
    else if (poeni > 60)
      ocena = 7;
    else if (poeni > 50)
      ocena = 6;
    else
      ocena = 5;
    printf("Ocena %d\n", ocena);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     1168 <main+0x48>
cmpl   $0x64,-0x8(%rbp)
jle    117b <main+0x5b>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1215 <main+0xf5>
cmpl   $0x5a,-0x8(%rbp)
jle    1191 <main+0x71>
movl   $0xa,-0xc(%rbp)
jmp    1204 <main+0xe4>
cmpl   $0x50,-0x8(%rbp)
jle    11a7 <main+0x87>
movl   $0x9,-0xc(%rbp)
jmp    11ff <main+0xdf>
cmpl   $0x46,-0x8(%rbp)
jle    11bd <main+0x9d>
movl   $0x8,-0xc(%rbp)
jmp    11fa <main+0xda>
cmpl   $0x3c,-0x8(%rbp)
jle    11d3 <main+0xb3>
movl   $0x7,-0xc(%rbp)
jmp    11f5 <main+0xd5>
cmpl   $0x32,-0x8(%rbp)
jle    11e9 <main+0xc9>
movl   $0x6,-0xc(%rbp)
jmp    11f0 <main+0xd0>
movl   $0x5,-0xc(%rbp)
jmp    11f5 <main+0xd5>
jmp    11fa <main+0xda>
jmp    11ff <main+0xdf>
jmp    1204 <main+0xe4>
mov    -0xc(%rbp),%esi
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x65,%eax
jb     1165 <main+0x35>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
jmp    11a6 <main+0x76>
mov    $0xa,%esi
cmp    $0x5a,%eax
ja     1198 <main+0x68>
mov    $0x9,%esi
cmp    $0x50,%eax
ja     1198 <main+0x68>
mov    $0x8,%esi
cmp    $0x46,%eax
ja     1198 <main+0x68>
mov    $0x7,%esi
cmp    $0x3c,%eax
ja     1198 <main+0x68>
cmp    $0x33,%eax
mov    $0x5,%esi
sbb    $0xffffffff,%esi
lea    0xe64(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Vnesi poeni: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"Nevalidna vrednost za poeni!\0A\00"
@.str.3 = [10 x i8] c"Ocena %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 100
br i1 %10, label %11, label %13
11: ; preds = %8, %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %41
13: ; preds = %8
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 90
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 10, i32* %3
br label %38
17: ; preds = %13
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 80
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 9, i32* %3
br label %37
21: ; preds = %17
%22 = load i32, i32* %2
%23 = icmp sgt i32 %22, 70
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 8, i32* %3
br label %36
25: ; preds = %21
%26 = load i32, i32* %2
%27 = icmp sgt i32 %26, 60
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 7, i32* %3
br label %35
29: ; preds = %25
%30 = load i32, i32* %2
%31 = icmp sgt i32 %30, 50
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 6, i32* %3
br label %34
33: ; preds = %29
store i32 5, i32* %3
br label %34
34: ; preds = %33, %32
br label %35
35: ; preds = %34, %28
br label %36
36: ; preds = %35, %24
br label %37
37: ; preds = %36, %20
br label %38
38: ; preds = %37, %16
%39 = load i32, i32* %3
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38, %11
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"Ocena %d\0A\00"
@str = [14 x i8] c"Vnesi poeni: \00"
@str.4 = [29 x i8] c"Nevalidna vrednost za poeni!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp ugt i32 %5, 100
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
br label %23
9: ; preds = %0
%10 = icmp ugt i32 %5, 90
br i1 %10, label %20, label %11
11: ; preds = %9
%12 = icmp ugt i32 %5, 80
br i1 %12, label %20, label %13
13: ; preds = %11
%14 = icmp ugt i32 %5, 70
br i1 %14, label %20, label %15
15: ; preds = %13
%16 = icmp ugt i32 %5, 60
br i1 %16, label %20, label %17
17: ; preds = %15
%18 = icmp ugt i32 %5, 50
%19 = select i1 %18, i32 6, i32 5
br label %20
20: ; preds = %17, %15, %13, %11, %9
%21 = phi i32 [ 10, %9 ], [ 9, %11 ], [ 8, %13 ], [ 7, %15 ], [ %19, %17 ]
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %7
ret i32 0
}