#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 */
char *libamg_sip_get_codec_name(int codec_code) {
  switch (codec_code) {
  case 0x100:
    return "alaw";
    break;
  case 0x80:
    return "ulaw";
    break;
  case 0x40:
    return "g723";
    break;
  case 0x20:
    return "g726-16";
    break;
  case 0x10:
    return "g726-24";
    break;
  case 0x8:
    return "g726";
    break;
  case 0x4:
    return "g726-40";
    break;
  case 0x2:
    return "g729";
    break;
  case 0x1:
    return "gsm";
    break;
  default:
    return NULL;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<libamg_sip_get_codec_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1227 <libamg_sip_get_codec_name+0x127>
jmp    111b <libamg_sip_get_codec_name+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1217 <libamg_sip_get_codec_name+0x117>
jmp    112c <libamg_sip_get_codec_name+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     1207 <libamg_sip_get_codec_name+0x107>
jmp    113d <libamg_sip_get_codec_name+0x3d>
mov    -0x10(%rbp),%eax
sub    $0x8,%eax
je     11f7 <libamg_sip_get_codec_name+0xf7>
jmp    114e <libamg_sip_get_codec_name+0x4e>
mov    -0x10(%rbp),%eax
sub    $0x10,%eax
je     11e7 <libamg_sip_get_codec_name+0xe7>
jmp    115f <libamg_sip_get_codec_name+0x5f>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
je     11d7 <libamg_sip_get_codec_name+0xd7>
jmp    1170 <libamg_sip_get_codec_name+0x70>
mov    -0x10(%rbp),%eax
sub    $0x40,%eax
je     11c7 <libamg_sip_get_codec_name+0xc7>
jmp    1181 <libamg_sip_get_codec_name+0x81>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     11b7 <libamg_sip_get_codec_name+0xb7>
jmp    1194 <libamg_sip_get_codec_name+0x94>
mov    -0x10(%rbp),%eax
sub    $0x100,%eax
jne    1237 <libamg_sip_get_codec_name+0x137>
jmp    11a7 <libamg_sip_get_codec_name+0xa7>
lea    0xe52(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
lea    0xe47(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
lea    0xe3c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
lea    0xe31(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
lea    0xe29(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
lea    0xe21(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
lea    0xe16(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
lea    0xe0e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
lea    0xe03(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123f <libamg_sip_get_codec_name+0x13f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libamg_sip_get_codec_name>:
lea    -0x1(%rdi),%eax
cmp    $0x3f,%eax
ja     1120 <libamg_sip_get_codec_name+0x20>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1012(%rip),%rax
ret
cmp    $0x100,%edi
je     116b <libamg_sip_get_codec_name+0x6b>
cmp    $0x80,%edi
jne    1138 <libamg_sip_get_codec_name+0x38>
lea    0xfce(%rip),%rax
ret
xor    %eax,%eax
ret
lea    0xfea(%rip),%rax
ret
lea    0xfda(%rip),%rax
ret
lea    0xfcd(%rip),%rax
ret
lea    0xfbd(%rip),%rax
ret
lea    0xfad(%rip),%rax
ret
lea    0xfa0(%rip),%rax
ret
lea    0xf8e(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"alaw\00"
@.str.1 = [5 x i8] c"ulaw\00"
@.str.2 = [5 x i8] c"g723\00"
@.str.3 = [8 x i8] c"g726-16\00"
@.str.4 = [8 x i8] c"g726-24\00"
@.str.5 = [5 x i8] c"g726\00"
@.str.6 = [8 x i8] c"g726-40\00"
@.str.7 = [5 x i8] c"g729\00"
@.str.8 = [4 x i8] c"gsm\00"
define i8* @libamg_sip_get_codec_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 256, label %5
i32 128, label %6
i32 64, label %7
i32 32, label %8
i32 16, label %9
i32 8, label %10
i32 4, label %11
i32 2, label %12
i32 1, label %13
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %15
12: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %15
13: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %15
14: ; preds = %1
store i8* null, i8** %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"alaw\00"
@.str.1 = [5 x i8] c"ulaw\00"
@.str.2 = [5 x i8] c"g723\00"
@.str.3 = [8 x i8] c"g726-16\00"
@.str.4 = [8 x i8] c"g726-24\00"
@.str.5 = [5 x i8] c"g726\00"
@.str.6 = [8 x i8] c"g726-40\00"
@.str.7 = [5 x i8] c"g729\00"
@.str.8 = [4 x i8] c"gsm\00"
define i8* @libamg_sip_get_codec_name(i32 %0) {
switch i32 %0, label %10 [
i32 256, label %11
i32 128, label %2
i32 64, label %3
i32 32, label %4
i32 16, label %5
i32 8, label %6
i32 4, label %7
i32 2, label %8
i32 1, label %9
]
2: ; preds = %1
br label %11
3: ; preds = %1
br label %11
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i8* [ null, %10 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}