#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *Get_Location_Symbol(int location) {
  char *my_string;
  my_string = (char *)calloc(64, sizeof(char));
  if (!my_string)
    return NULL;
  switch (location) {
  case 0:
    free(my_string);
    my_string = NULL;
    break;
  case 1:
    strcpy(my_string, "helipad_lax");
    break;
  case 2:
    strcpy(my_string, "helipad_smo");
    break;
  case 3:
    strcpy(my_string, "helipad_ucla");
    break;
  case 4:
    strcpy(my_string, "helipad_cat");
    break;
  case 5:
    strcpy(my_string, "helipad_uscg");
    break;
  default:
    my_string[0] = '\0';
    break;
  }
  return my_string;
}


x86 assembly (clang, -O0):
<Get_Location_Symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x40,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1166 <Get_Location_Symbol+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1219 <Get_Location_Symbol+0xe9>
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x5,%rax
ja     120a <Get_Location_Symbol+0xda>
mov    -0x20(%rbp),%rax
lea    0xe7e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
jmp    1211 <Get_Location_Symbol+0xe1>
mov    -0x18(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1211 <Get_Location_Symbol+0xe1>
mov    -0x18(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1211 <Get_Location_Symbol+0xe1>
mov    -0x18(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1211 <Get_Location_Symbol+0xe1>
mov    -0x18(%rbp),%rdi
lea    0xe52(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1211 <Get_Location_Symbol+0xe1>
mov    -0x18(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1211 <Get_Location_Symbol+0xe1>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Location_Symbol>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x40,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     116b <Get_Location_Symbol+0x3b>
mov    %rax,%rbx
cmp    $0x5,%ebp
ja     11ac <Get_Location_Symbol+0x7c>
mov    %ebp,%eax
lea    0xea6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
jmp    11a2 <Get_Location_Symbol+0x72>
lea    0xea2(%rip),%rsi
jmp    119a <Get_Location_Symbol+0x6a>
lea    0xea5(%rip),%rsi
jmp    119a <Get_Location_Symbol+0x6a>
lea    0xea8(%rip),%rsi
jmp    119a <Get_Location_Symbol+0x6a>
lea    0xeac(%rip),%rsi
jmp    119a <Get_Location_Symbol+0x6a>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
movb   $0x0,(%rbx)
jmp    11a2 <Get_Location_Symbol+0x72>

LLVM IR (-O0):
@.str = [12 x i8] c"helipad_lax\00"
@.str.1 = [12 x i8] c"helipad_smo\00"
@.str.2 = [13 x i8] c"helipad_ucla\00"
@.str.3 = [12 x i8] c"helipad_cat\00"
@.str.4 = [13 x i8] c"helipad_uscg\00"
define i8* @Get_Location_Symbol(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = call i64 @calloc(i32 64, i32 1)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %35
10: ; preds = %1
%11 = load i32, i32* %3
switch i32 %11, label %30 [
i32 0, label %12
i32 1, label %15
i32 2, label %18
i32 3, label %21
i32 4, label %24
i32 5, label %27
]
12: ; preds = %10
%13 = load i8*, i8** %4
%14 = call i32 @free(i8* %13)
store i8* null, i8** %4
br label %33
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %33
18: ; preds = %10
%19 = load i8*, i8** %4
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %33
21: ; preds = %10
%22 = load i8*, i8** %4
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %33
24: ; preds = %10
%25 = load i8*, i8** %4
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %33
27: ; preds = %10
%28 = load i8*, i8** %4
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %33
30: ; preds = %10
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i64 0
store i8 0, i8* %32
br label %33
33: ; preds = %30, %27, %24, %21, %18, %15, %12
%34 = load i8*, i8** %4
store i8* %34, i8** %2
br label %35
35: ; preds = %33, %9
%36 = load i8*, i8** %2
ret i8* %36
}

LLVM IR (-O2):
@.str = [12 x i8] c"helipad_lax\00"
@.str.1 = [12 x i8] c"helipad_smo\00"
@.str.2 = [13 x i8] c"helipad_ucla\00"
@.str.3 = [12 x i8] c"helipad_cat\00"
@.str.4 = [13 x i8] c"helipad_uscg\00"
define i8* @Get_Location_Symbol(i32 %0) {
%2 = tail call i64 @calloc(i32 64, i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %19, label %5
5: ; preds = %1
switch i32 %0, label %18 [
i32 0, label %6
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
i32 5, label %16
]
6: ; preds = %5
%7 = tail call i32 @free(i8* %3)
br label %19
8: ; preds = %5
%9 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %19
10: ; preds = %5
%11 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %19
12: ; preds = %5
%13 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %19
14: ; preds = %5
%15 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %19
16: ; preds = %5
%17 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %19
18: ; preds = %5
store i8 0, i8* %3
br label %19
19: ; preds = %6, %8, %10, %12, %14, %16, %18, %1
%20 = phi i8* [ null, %1 ], [ %3, %18 ], [ %3, %16 ], [ %3, %14 ], [ %3, %12 ], [ %3, %10 ], [ %3, %8 ], [ null, %6 ]
ret i8* %20
}