#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 */
typedef int uint32_t;

/* Variables and functions */
uint32_t toFreeListIndex(size_t size) {
  uint32_t s = size;
  if (s <= 32)
    return 0;
  if (s <= 64)
    return 1;
  if (s <= 128)
    return 2;
  if (s <= 256)
    return 3;
  if (s <= 512)
    return 4;
  return 5;
}


x86 assembly (clang, -O0):
<toFreeListIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jg     1125 <toFreeListIndex+0x25>
movl   $0x0,-0x4(%rbp)
jmp    118d <toFreeListIndex+0x8d>
cmpl   $0x40,-0x14(%rbp)
jg     113b <toFreeListIndex+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    118d <toFreeListIndex+0x8d>
cmpl   $0x80,-0x14(%rbp)
jg     1154 <toFreeListIndex+0x54>
movl   $0x2,-0x4(%rbp)
jmp    118d <toFreeListIndex+0x8d>
cmpl   $0x100,-0x14(%rbp)
jg     116d <toFreeListIndex+0x6d>
movl   $0x3,-0x4(%rbp)
jmp    118d <toFreeListIndex+0x8d>
cmpl   $0x200,-0x14(%rbp)
jg     1186 <toFreeListIndex+0x86>
movl   $0x4,-0x4(%rbp)
jmp    118d <toFreeListIndex+0x8d>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toFreeListIndex>:
xor    %eax,%eax
cmp    $0x21,%edi
jl     1139 <toFreeListIndex+0x39>
mov    $0x1,%eax
cmp    $0x41,%edi
jb     1139 <toFreeListIndex+0x39>
mov    $0x2,%eax
cmp    $0x81,%edi
jb     1139 <toFreeListIndex+0x39>
mov    $0x3,%eax
cmp    $0x101,%edi
jb     1139 <toFreeListIndex+0x39>
cmp    $0x201,%edi
mov    $0x5,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @toFreeListIndex(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 32
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %27
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 64
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 1, i32* %2
br label %27
14: ; preds = %10
%15 = load i32, i32* %4
%16 = icmp sle i32 %15, 128
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 2, i32* %2
br label %27
18: ; preds = %14
%19 = load i32, i32* %4
%20 = icmp sle i32 %19, 256
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 3, i32* %2
br label %27
22: ; preds = %18
%23 = load i32, i32* %4
%24 = icmp sle i32 %23, 512
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 4, i32* %2
br label %27
26: ; preds = %22
store i32 5, i32* %2
br label %27
27: ; preds = %26, %25, %21, %17, %13, %9
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @toFreeListIndex(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = icmp slt i32 %2, 33
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = icmp ult i32 %2, 65
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = icmp ult i32 %2, 129
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = icmp ult i32 %2, 257
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = icmp ult i32 %2, 513
%12 = select i1 %11, i32 4, i32 5
br label %13
13: ; preds = %10, %8, %6, %4, %1
%14 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 2, %6 ], [ 3, %8 ], [ %12, %10 ]
ret i32 %14
}