#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 *);
void binler(int a) {
  int bin = a / 1000;
  switch (bin) {
  case 1:
    printf("bin ");
    break;
  case 2:
    printf("iki bin ");
    break;
  case 3:
    printf("uc bin ");
    break;
  case 4:
    printf("dort bin ");
    break;
  case 5:
    printf("bes bin ");
    break;
  case 6:
    printf("alti bin ");
    break;
  case 7:
    printf("yedi bin ");
    break;
  case 8:
    printf("sekiz bin ");
    break;
  case 9:
    printf("dokuz bin ");
    break;
  }
}


x86 assembly (clang, -O0):
<binler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x8,%eax
ja     11f3 <binler+0xe3>
mov    -0x10(%rbp),%rax
lea    0xeaa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <binler+0xe3>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <binler+0xe3>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <binler+0xe3>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <binler+0xe3>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <binler+0xe3>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <binler+0xe3>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <binler+0xe3>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <binler+0xe3>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binler>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
sar    $0x26,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xffffffff,%eax
cmp    $0x8,%eax
ja     1144 <binler+0x34>
cltq
lea    0xf18(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"bin \00"
@.str.1 = [9 x i8] c"iki bin \00"
@.str.2 = [8 x i8] c"uc bin \00"
@.str.3 = [10 x i8] c"dort bin \00"
@.str.4 = [9 x i8] c"bes bin \00"
@.str.5 = [10 x i8] c"alti bin \00"
@.str.6 = [10 x i8] c"yedi bin \00"
@.str.7 = [11 x i8] c"sekiz bin \00"
@.str.8 = [11 x i8] c"dokuz bin \00"
define void @binler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
store i32 %5, i32* %3
%6 = load i32, i32* %3
switch i32 %6, label %25 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 7, label %19
i32 8, label %21
i32 9, label %23
]
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %25
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %25
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %25
13: ; preds = %1
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %25
15: ; preds = %1
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %25
17: ; preds = %1
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %25
19: ; preds = %1
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %25
21: ; preds = %1
%22 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %25
23: ; preds = %1
%24 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %25
25: ; preds = %1, %23, %21, %19, %17, %15, %13, %11, %9, %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"bin \00"
@.str.1 = [9 x i8] c"iki bin \00"
@.str.2 = [8 x i8] c"uc bin \00"
@.str.3 = [10 x i8] c"dort bin \00"
@.str.4 = [9 x i8] c"bes bin \00"
@.str.5 = [10 x i8] c"alti bin \00"
@.str.6 = [10 x i8] c"yedi bin \00"
@.str.7 = [11 x i8] c"sekiz bin \00"
@.str.8 = [11 x i8] c"dokuz bin \00"
@reltable.binler = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.3 to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.5 to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.6 to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.7 to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.8 to i64), i64 ptrtoint ([9 x i32]* @reltable.binler to i64)) to i32)]
define void @binler(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = add nsw i32 %2, -1
%4 = icmp ult i32 %3, 9
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.binler to i8*), i64 %7)
%9 = tail call i32 @printf(i8* dereferenceable(1) %8)
br label %10
10: ; preds = %1, %5
ret void
}