#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 uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t analyze_datatype_size(uint16_t datatype) {
  switch (datatype) {
  case 2:
    return 1;
  case 4:
    return 2;
  case 8:
    return 4;
  case 16:
    return 4;
  case 32:
    return 8;
  case 64:
    return 8;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<analyze_datatype_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     1170 <analyze_datatype_size+0x70>
jmp    111b <analyze_datatype_size+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     117c <analyze_datatype_size+0x7c>
jmp    112c <analyze_datatype_size+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     1188 <analyze_datatype_size+0x88>
jmp    113d <analyze_datatype_size+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
je     1194 <analyze_datatype_size+0x94>
jmp    114e <analyze_datatype_size+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     11a0 <analyze_datatype_size+0xa0>
jmp    115f <analyze_datatype_size+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
je     11ac <analyze_datatype_size+0xac>
jmp    11b8 <analyze_datatype_size+0xb8>
movl   $0x1,-0x4(%rbp)
jmp    11bf <analyze_datatype_size+0xbf>
movl   $0x2,-0x4(%rbp)
jmp    11bf <analyze_datatype_size+0xbf>
movl   $0x4,-0x4(%rbp)
jmp    11bf <analyze_datatype_size+0xbf>
movl   $0x4,-0x4(%rbp)
jmp    11bf <analyze_datatype_size+0xbf>
movl   $0x8,-0x4(%rbp)
jmp    11bf <analyze_datatype_size+0xbf>
movl   $0x8,-0x4(%rbp)
jmp    11bf <analyze_datatype_size+0xbf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<analyze_datatype_size>:
lea    -0x2(%rdi),%ecx
cmp    $0x1e,%ecx
ja     1123 <analyze_datatype_size+0x23>
mov    $0x1,%eax
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x4,%eax
ret
cmp    $0x40,%edi
jne    112e <analyze_datatype_size+0x2e>
mov    $0x8,%eax
ret
xor    %eax,%eax
ret
mov    $0x2,%eax
ret

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

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