#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 rtp_3551_get_clock_rate(uint8_t i_type) {
  switch (i_type) {
  case 0:
  case 3:
  case 4:
  case 5:
  case 7:
  case 8:
  case 9:
  case 12:
  case 13:
  case 15:
  case 18:
    return 8000;
  case 6:
    return 16000;
  case 10:
  case 11:
    return 44100;
  case 16:
    return 11025;
  case 17:
    return 22050;
  case 14:
  case 25:
  case 26:
  case 28:
  case 31:
  case 32:
  case 33:
  case 34:
    return 90000;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rtp_3551_get_clock_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x22,%rax
ja     1174 <rtp_3551_get_clock_rate+0x74>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1f40,-0x4(%rbp)
jmp    117b <rtp_3551_get_clock_rate+0x7b>
movl   $0x3e80,-0x4(%rbp)
jmp    117b <rtp_3551_get_clock_rate+0x7b>
movl   $0xac44,-0x4(%rbp)
jmp    117b <rtp_3551_get_clock_rate+0x7b>
movl   $0x2b11,-0x4(%rbp)
jmp    117b <rtp_3551_get_clock_rate+0x7b>
movl   $0x5622,-0x4(%rbp)
jmp    117b <rtp_3551_get_clock_rate+0x7b>
movl   $0x15f90,-0x4(%rbp)
jmp    117b <rtp_3551_get_clock_rate+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_3551_get_clock_rate>:
xor    %eax,%eax
cmp    $0x22,%edi
ja     1114 <rtp_3551_get_clock_rate+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @rtp_3551_get_clock_rate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 0, label %5
i32 3, label %5
i32 4, label %5
i32 5, label %5
i32 7, label %5
i32 8, label %5
i32 9, label %5
i32 12, label %5
i32 13, label %5
i32 15, label %5
i32 18, label %5
i32 6, label %6
i32 10, label %7
i32 11, label %7
i32 16, label %8
i32 17, label %9
i32 14, label %10
i32 25, label %10
i32 26, label %10
i32 28, label %10
i32 31, label %10
i32 32, label %10
i32 33, label %10
i32 34, label %10
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 8000, i32* %2
br label %12
6: ; preds = %1
store i32 16000, i32* %2
br label %12
7: ; preds = %1, %1
store i32 44100, i32* %2
br label %12
8: ; preds = %1
store i32 11025, i32* %2
br label %12
9: ; preds = %1
store i32 22050, i32* %2
br label %12
10: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 90000, 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):
@switch.table.rtp_3551_get_clock_rate = [35 x i32] [i32 8000, i32 0, i32 0, i32 8000, i32 8000, i32 8000, i32 16000, i32 8000, i32 8000, i32 8000, i32 44100, i32 44100, i32 8000, i32 8000, i32 90000, i32 8000, i32 11025, i32 22050, i32 8000, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 90000, i32 90000, i32 0, i32 90000, i32 0, i32 0, i32 90000, i32 90000, i32 90000, i32 90000]
define i32 @rtp_3551_get_clock_rate(i32 %0) {
%2 = icmp ult i32 %0, 35
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [35 x i32], [35 x i32]* @switch.table.rtp_3551_get_clock_rate, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}