#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 uint32_t;

/* Variables and functions */
uint32_t __channel_to_freq(uint8_t ch) {
  switch (ch) {
  case 37:
    return 2;
  case 38:
    return 26;
  case 39:
    return 80;
  default:
    if (ch <= 10)
      return 4 + ch * 2;
    return 6 + ch * 2;
  }
}


x86 assembly (clang, -O0):
<__channel_to_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x25,%eax
je     113d <__channel_to_freq+0x3d>
jmp    111b <__channel_to_freq+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x26,%eax
je     1149 <__channel_to_freq+0x49>
jmp    112c <__channel_to_freq+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x27,%eax
je     1155 <__channel_to_freq+0x55>
jmp    1161 <__channel_to_freq+0x61>
movl   $0x2,-0x4(%rbp)
jmp    1188 <__channel_to_freq+0x88>
movl   $0x1a,-0x4(%rbp)
jmp    1188 <__channel_to_freq+0x88>
movl   $0x50,-0x4(%rbp)
jmp    1188 <__channel_to_freq+0x88>
cmpl   $0xa,-0x8(%rbp)
jg     117c <__channel_to_freq+0x7c>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <__channel_to_freq+0x88>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__channel_to_freq>:
lea    -0x25(%rdi),%eax
cmp    $0x3,%eax
jae    1115 <__channel_to_freq+0x15>
cltq
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret
lea    (%rdi,%rdi,1),%eax
cmp    $0xa,%edi
jg     1121 <__channel_to_freq+0x21>
add    $0x4,%eax
ret
add    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @__channel_to_freq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 37, label %5
i32 38, label %6
i32 39, label %7
]
5: ; preds = %1
store i32 2, i32* %2
br label %19
6: ; preds = %1
store i32 26, i32* %2
br label %19
7: ; preds = %1
store i32 80, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 10
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 2
%14 = add nsw i32 4, %13
store i32 %14, i32* %2
br label %19
15: ; preds = %8
%16 = load i32, i32* %3
%17 = mul nsw i32 %16, 2
%18 = add nsw i32 6, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %15, %11, %7, %6, %5
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@switch.table.__channel_to_freq = [3 x i32] [i32 2, i32 26, i32 80]
define i32 @__channel_to_freq(i32 %0) {
%2 = add i32 %0, -37
%3 = icmp ult i32 %2, 3
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = icmp slt i32 %0, 11
%6 = shl nsw i32 %0, 1
br i1 %5, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %6, 4
br label %15
9: ; preds = %4
%10 = add nsw i32 %6, 6
br label %15
11: ; preds = %1
%12 = sext i32 %2 to i64
%13 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.__channel_to_freq, i64 0, i64 %12
%14 = load i32, i32* %13
br label %15
15: ; preds = %11, %9, %7
%16 = phi i32 [ %8, %7 ], [ %10, %9 ], [ %14, %11 ]
ret i32 %16
}