#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 size_parse(size_t size) {
  switch (size) {
  case 8:
    return 0;
  case 16:
    return 1;
  case 32:
    return 2;
  case 64:
    return 3;
  case 128:
    return 4;
  case 256:
    return 5;
  case 512:
    return 6;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<size_parse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x8,%rax
je     1197 <size_parse+0x97>
jmp    111f <size_parse+0x1f>
mov    -0x18(%rbp),%rax
sub    $0x10,%rax
je     11a3 <size_parse+0xa3>
jmp    1132 <size_parse+0x32>
mov    -0x18(%rbp),%rax
sub    $0x20,%rax
je     11af <size_parse+0xaf>
jmp    1145 <size_parse+0x45>
mov    -0x18(%rbp),%rax
sub    $0x40,%rax
je     11bb <size_parse+0xbb>
jmp    1158 <size_parse+0x58>
mov    -0x18(%rbp),%rax
sub    $0x80,%rax
je     11c7 <size_parse+0xc7>
jmp    116d <size_parse+0x6d>
mov    -0x18(%rbp),%rax
sub    $0x100,%rax
je     11d3 <size_parse+0xd3>
jmp    1182 <size_parse+0x82>
mov    -0x18(%rbp),%rax
sub    $0x200,%rax
je     11df <size_parse+0xdf>
jmp    11eb <size_parse+0xeb>
movl   $0x0,-0x4(%rbp)
jmp    11f2 <size_parse+0xf2>
movl   $0x1,-0x4(%rbp)
jmp    11f2 <size_parse+0xf2>
movl   $0x2,-0x4(%rbp)
jmp    11f2 <size_parse+0xf2>
movl   $0x3,-0x4(%rbp)
jmp    11f2 <size_parse+0xf2>
movl   $0x4,-0x4(%rbp)
jmp    11f2 <size_parse+0xf2>
movl   $0x5,-0x4(%rbp)
jmp    11f2 <size_parse+0xf2>
movl   $0x6,-0x4(%rbp)
jmp    11f2 <size_parse+0xf2>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_parse>:
cmp    $0x3f,%rdi
jle    1124 <size_parse+0x24>
cmp    $0xff,%rdi
jg     113c <size_parse+0x3c>
cmp    $0x40,%rdi
je     1154 <size_parse+0x54>
cmp    $0x80,%rdi
jne    1163 <size_parse+0x63>
mov    $0x4,%eax
ret
cmp    $0x8,%rdi
je     115a <size_parse+0x5a>
cmp    $0x10,%rdi
je     1169 <size_parse+0x69>
cmp    $0x20,%rdi
jne    1163 <size_parse+0x63>
mov    $0x2,%eax
ret
cmp    $0x100,%rdi
je     115d <size_parse+0x5d>
cmp    $0x200,%rdi
jne    1163 <size_parse+0x63>
mov    $0x6,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret
mov    $0x5,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @size_parse(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %12 [
i64 8, label %5
i64 16, label %6
i64 32, label %7
i64 64, label %8
i64 128, label %9
i64 256, label %10
i64 512, label %11
]
5: ; preds = %1
store i32 0, i32* %2
br label %13
6: ; preds = %1
store i32 1, i32* %2
br label %13
7: ; preds = %1
store i32 2, i32* %2
br label %13
8: ; preds = %1
store i32 3, i32* %2
br label %13
9: ; preds = %1
store i32 4, i32* %2
br label %13
10: ; preds = %1
store i32 5, i32* %2
br label %13
11: ; preds = %1
store i32 6, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @size_parse(i64 %0) {
switch i64 %0, label %8 [
i64 8, label %9
i64 16, label %2
i64 32, label %3
i64 64, label %4
i64 128, label %5
i64 256, label %6
i64 512, label %7
]
2: ; preds = %1
br label %9
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3, %2
%10 = phi i32 [ -1, %8 ], [ 6, %7 ], [ 5, %6 ], [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %2 ], [ 0, %1 ]
ret i32 %10
}