int Cilk_internal_malloc_bucket_to_size(int b) {
  if (0 == b)
    return 16;
  ;
  if (1 == b)
    return 32;
  ;
  if (2 == b)
    return 64;
  ;
  if (3 == b)
    return 128;
  ;
  if (4 == b)
    return 256;
  ;
  if (5 == b)
    return 512;
  ;
  if (6 == b)
    return 1024;
  ;
  if (7 == b)
    return 2048;
  ;
  if (8 == b)
    return 4096;
  ;
  return -1;
}


x86 assembly (clang, -O0):
<Cilk_internal_malloc_bucket_to_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    111e <Cilk_internal_malloc_bucket_to_size+0x1e>
movl   $0x10,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1138 <Cilk_internal_malloc_bucket_to_size+0x38>
movl   $0x20,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jne    1152 <Cilk_internal_malloc_bucket_to_size+0x52>
movl   $0x40,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    116c <Cilk_internal_malloc_bucket_to_size+0x6c>
movl   $0x80,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jne    1186 <Cilk_internal_malloc_bucket_to_size+0x86>
movl   $0x100,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
mov    $0x5,%eax
cmp    -0x8(%rbp),%eax
jne    11a0 <Cilk_internal_malloc_bucket_to_size+0xa0>
movl   $0x200,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
mov    $0x6,%eax
cmp    -0x8(%rbp),%eax
jne    11ba <Cilk_internal_malloc_bucket_to_size+0xba>
movl   $0x400,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
mov    $0x7,%eax
cmp    -0x8(%rbp),%eax
jne    11d4 <Cilk_internal_malloc_bucket_to_size+0xd4>
movl   $0x800,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
mov    $0x8,%eax
cmp    -0x8(%rbp),%eax
jne    11ee <Cilk_internal_malloc_bucket_to_size+0xee>
movl   $0x1000,-0x4(%rbp)
jmp    11f5 <Cilk_internal_malloc_bucket_to_size+0xf5>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cilk_internal_malloc_bucket_to_size>:
mov    $0xffffffff,%eax
cmp    $0x8,%edi
ja     1117 <Cilk_internal_malloc_bucket_to_size+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @Cilk_internal_malloc_bucket_to_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 0, %4
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 16, i32* %2
br label %40
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 1, %8
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 32, i32* %2
br label %40
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 2, %12
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 64, i32* %2
br label %40
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 3, %16
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 128, i32* %2
br label %40
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 4, %20
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 256, i32* %2
br label %40
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 5, %24
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 512, i32* %2
br label %40
27: ; preds = %23
%28 = load i32, i32* %3
%29 = icmp eq i32 6, %28
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 1024, i32* %2
br label %40
31: ; preds = %27
%32 = load i32, i32* %3
%33 = icmp eq i32 7, %32
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 2048, i32* %2
br label %40
35: ; preds = %31
%36 = load i32, i32* %3
%37 = icmp eq i32 8, %36
br i1 %37, label %38, label %39
38: ; preds = %35
store i32 4096, i32* %2
br label %40
39: ; preds = %35
store i32 -1, i32* %2
br label %40
40: ; preds = %39, %38, %34, %30, %26, %22, %18, %14, %10, %6
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
@switch.table.Cilk_internal_malloc_bucket_to_size = [9 x i32] [i32 16, i32 32, i32 64, i32 128, i32 256, i32 512, i32 1024, i32 2048, i32 4096]
define i32 @Cilk_internal_malloc_bucket_to_size(i32 %0) {
%2 = icmp ult i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.Cilk_internal_malloc_bucket_to_size, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}