#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 get_raw_tsize(int side_flags, int slower_rpm) {
  uint32_t size;
  switch (side_flags & 0x27) {
  case 0x22:
    size = slower_rpm ? 5314 : 5208;
    break;
  default:
  case 0x02:
  case 0x21:
    size = slower_rpm ? 6375 : 6250;
    break;
  case 0x01:
    size = slower_rpm ? 7650 : 7500;
    break;
  case 0x20:
    size = slower_rpm ? 10629 : 10416;
    break;
  case 0x00:
    size = slower_rpm ? 12750 : 12500;
    break;
  case 0x23:
    size = slower_rpm ? 21258 : 20833;
    break;
  case 0x03:
    size = slower_rpm ? 25500 : 25000;
    break;
  case 0x25:
    size = slower_rpm ? 42517 : 41666;
    break;
  case 0x05:
    size = slower_rpm ? 51000 : 50000;
    break;
  }
  return (size);
}


x86 assembly (clang, -O0):
<get_raw_tsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x27,%eax
mov    %rax,-0x18(%rbp)
sub    $0x25,%eax
ja     114c <get_raw_tsize+0x4c>
mov    -0x18(%rbp),%rax
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%edx
mov    $0x1458,%eax
mov    $0x14c2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <get_raw_tsize+0x124>
jmp    1151 <get_raw_tsize+0x51>
mov    -0x8(%rbp),%edx
mov    $0x186a,%eax
mov    $0x18e7,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <get_raw_tsize+0x124>
mov    -0x8(%rbp),%edx
mov    $0x1d4c,%eax
mov    $0x1de2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <get_raw_tsize+0x124>
mov    -0x8(%rbp),%edx
mov    $0x28b0,%eax
mov    $0x2985,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <get_raw_tsize+0x124>
mov    -0x8(%rbp),%edx
mov    $0x30d4,%eax
mov    $0x31ce,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <get_raw_tsize+0x124>
mov    -0x8(%rbp),%edx
mov    $0x5161,%eax
mov    $0x530a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <get_raw_tsize+0x124>
mov    -0x8(%rbp),%edx
mov    $0x61a8,%eax
mov    $0x639c,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <get_raw_tsize+0x124>
mov    -0x8(%rbp),%edx
mov    $0xa2c2,%eax
mov    $0xa615,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1224 <get_raw_tsize+0x124>
mov    -0x8(%rbp),%edx
mov    $0xc350,%eax
mov    $0xc738,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_raw_tsize>:
and    $0x27,%edi
cmp    $0x25,%edi
ja     1138 <get_raw_tsize+0x38>
lea    0xef1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
test   %esi,%esi
mov    $0x30d4,%ecx
mov    $0x31ce,%eax
cmove  %ecx,%eax
ret
test   %esi,%esi
mov    $0x1d4c,%ecx
mov    $0x1de2,%eax
cmove  %ecx,%eax
ret
test   %esi,%esi
mov    $0x186a,%ecx
mov    $0x18e7,%eax
cmove  %ecx,%eax
ret
test   %esi,%esi
mov    $0x61a8,%ecx
mov    $0x639c,%eax
cmove  %ecx,%eax
ret
test   %esi,%esi
mov    $0xc350,%ecx
mov    $0xc738,%eax
cmove  %ecx,%eax
ret
test   %esi,%esi
mov    $0x28b0,%ecx
mov    $0x2985,%eax
cmove  %ecx,%eax
ret
test   %esi,%esi
mov    $0x1458,%ecx
mov    $0x14c2,%eax
cmove  %ecx,%eax
ret
test   %esi,%esi
mov    $0x5161,%ecx
mov    $0x530a,%eax
cmove  %ecx,%eax
ret
test   %esi,%esi
mov    $0xa2c2,%ecx
mov    $0xa615,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_raw_tsize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = and i32 %6, 39
switch i32 %7, label %13 [
i32 34, label %8
i32 2, label %14
i32 33, label %14
i32 1, label %19
i32 32, label %24
i32 0, label %29
i32 35, label %34
i32 3, label %39
i32 37, label %44
i32 5, label %49
]
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 5314, i32 5208
store i32 %12, i32* %5
br label %54
13: ; preds = %2
br label %14
14: ; preds = %2, %2, %13
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 6375, i32 6250
store i32 %18, i32* %5
br label %54
19: ; preds = %2
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 7650, i32 7500
store i32 %23, i32* %5
br label %54
24: ; preds = %2
%25 = load i32, i32* %4
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 10629, i32 10416
store i32 %28, i32* %5
br label %54
29: ; preds = %2
%30 = load i32, i32* %4
%31 = icmp ne i32 %30, 0
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 12750, i32 12500
store i32 %33, i32* %5
br label %54
34: ; preds = %2
%35 = load i32, i32* %4
%36 = icmp ne i32 %35, 0
%37 = zext i1 %36 to i64
%38 = select i1 %36, i32 21258, i32 20833
store i32 %38, i32* %5
br label %54
39: ; preds = %2
%40 = load i32, i32* %4
%41 = icmp ne i32 %40, 0
%42 = zext i1 %41 to i64
%43 = select i1 %41, i32 25500, i32 25000
store i32 %43, i32* %5
br label %54
44: ; preds = %2
%45 = load i32, i32* %4
%46 = icmp ne i32 %45, 0
%47 = zext i1 %46 to i64
%48 = select i1 %46, i32 42517, i32 41666
store i32 %48, i32* %5
br label %54
49: ; preds = %2
%50 = load i32, i32* %4
%51 = icmp ne i32 %50, 0
%52 = zext i1 %51 to i64
%53 = select i1 %51, i32 51000, i32 50000
store i32 %53, i32* %5
br label %54
54: ; preds = %49, %44, %39, %34, %29, %24, %19, %14, %8
%55 = load i32, i32* %5
ret i32 %55
}

LLVM IR (-O2):
define i32 @get_raw_tsize(i32 %0, i32 %1) {
%3 = and i32 %0, 39
switch i32 %3, label %7 [
i32 34, label %4
i32 5, label %28
i32 37, label %25
i32 1, label %10
i32 32, label %13
i32 0, label %16
i32 35, label %19
i32 3, label %22
]
4: ; preds = %2
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i32 5208, i32 5314
br label %31
7: ; preds = %2
%8 = icmp eq i32 %1, 0
%9 = select i1 %8, i32 6250, i32 6375
br label %31
10: ; preds = %2
%11 = icmp eq i32 %1, 0
%12 = select i1 %11, i32 7500, i32 7650
br label %31
13: ; preds = %2
%14 = icmp eq i32 %1, 0
%15 = select i1 %14, i32 10416, i32 10629
br label %31
16: ; preds = %2
%17 = icmp eq i32 %1, 0
%18 = select i1 %17, i32 12500, i32 12750
br label %31
19: ; preds = %2
%20 = icmp eq i32 %1, 0
%21 = select i1 %20, i32 20833, i32 21258
br label %31
22: ; preds = %2
%23 = icmp eq i32 %1, 0
%24 = select i1 %23, i32 25000, i32 25500
br label %31
25: ; preds = %2
%26 = icmp eq i32 %1, 0
%27 = select i1 %26, i32 41666, i32 42517
br label %31
28: ; preds = %2
%29 = icmp eq i32 %1, 0
%30 = select i1 %29, i32 50000, i32 51000
br label %31
31: ; preds = %28, %25, %22, %19, %16, %13, %10, %7, %4
%32 = phi i32 [ %9, %7 ], [ %24, %22 ], [ %21, %19 ], [ %18, %16 ], [ %15, %13 ], [ %12, %10 ], [ %27, %25 ], [ %30, %28 ], [ %6, %4 ]
ret i32 %32
}