#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_insecure_name(int insecure_code) {
  switch (insecure_code) {
  case 0x8:
    return "very";
    break;
  case 0x4:
    return "port";
    break;
  case 0x2:
    return "invite";
    break;
  case 0x1:
    return "port,invite";
    break;
  case 0x0:
    return "no";
    break;
  default:
    return NULL;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<libamg_sip_get_insecure_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x8,%rax
ja     117c <libamg_sip_get_insecure_name+0x7c>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <libamg_sip_get_insecure_name+0x84>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <libamg_sip_get_insecure_name+0x84>
lea    0xee0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <libamg_sip_get_insecure_name+0x84>
lea    0xecb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <libamg_sip_get_insecure_name+0x84>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <libamg_sip_get_insecure_name+0x84>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libamg_sip_get_insecure_name>:
cmp    $0x8,%edi
ja     1114 <libamg_sip_get_insecure_name+0x14>
movslq %edi,%rax
lea    0x2cf9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"very\00"
@.str.1 = [5 x i8] c"port\00"
@.str.2 = [7 x i8] c"invite\00"
@.str.3 = [12 x i8] c"port,invite\00"
@.str.4 = [3 x i8] c"no\00"
define i8* @libamg_sip_get_insecure_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 8, label %5
i32 4, label %6
i32 2, label %7
i32 1, label %8
i32 0, label %9
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %11
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %11
8: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %11
10: ; preds = %1
store i8* null, i8** %2
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"very\00"
@.str.1 = [5 x i8] c"port\00"
@.str.2 = [7 x i8] c"invite\00"
@.str.3 = [12 x i8] c"port,invite\00"
@.str.4 = [3 x i8] c"no\00"
@switch.table.libamg_sip_get_insecure_name = [9 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* null, i8* null, i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)]
define i8* @libamg_sip_get_insecure_name(i32 %0) {
%2 = icmp ult i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [9 x i8*], [9 x i8*]* @switch.table.libamg_sip_get_insecure_name, i64 0, i64 %4
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}