#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 enice(int stevilo) {
  switch (stevilo) {
  case 0:
    return 0;
    break;
  case 1:
    return 3;
    break;
  case 2:
    return 3;
    break;
  case 3:
    return 5;
    break;
  case 4:
    return 4;
    break;
  case 5:
    return 4;
    break;
  case 6:
    return 3;
    break;
  case 7:
    return 5;
    break;
  case 8:
    return 5;
    break;
  case 9:
    return 4;
  }
  printf("ERROR\n");
  return 0;
}


x86 assembly (clang, -O0):
<enice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x9,%rax
ja     11b8 <enice+0xa8>
mov    -0x10(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x3,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x3,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x5,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x4,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x4,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x3,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x5,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x5,-0x4(%rbp)
jmp    11cb <enice+0xbb>
movl   $0x4,-0x4(%rbp)
jmp    11cb <enice+0xbb>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enice>:
push   %rax
cmp    $0xa,%edi
jae    1125 <enice+0x15>
movslq %edi,%rax
lea    0xee8(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ERROR\0A\00"
define i32 @enice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
]
5: ; preds = %1
store i32 0, i32* %2
br label %17
6: ; preds = %1
store i32 3, i32* %2
br label %17
7: ; preds = %1
store i32 3, i32* %2
br label %17
8: ; preds = %1
store i32 5, i32* %2
br label %17
9: ; preds = %1
store i32 4, i32* %2
br label %17
10: ; preds = %1
store i32 4, i32* %2
br label %17
11: ; preds = %1
store i32 3, i32* %2
br label %17
12: ; preds = %1
store i32 5, i32* %2
br label %17
13: ; preds = %1
store i32 5, i32* %2
br label %17
14: ; preds = %1
store i32 4, i32* %2
br label %17
15: ; preds = %1
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %17
17: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@str = [6 x i8] c"ERROR\00"
@switch.table.enice = [10 x i32] [i32 0, i32 3, i32 3, i32 5, i32 4, i32 4, i32 3, i32 5, i32 5, i32 4]
define i32 @enice(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.enice, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ 0, %3 ], [ %8, %5 ]
ret i32 %10
}