#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 /*<<< orphan*/ bind_name;

/* Variables and functions */
#define STB_GLOBAL 130
#define STB_LOCAL 129
#define STB_WEAK 128
const char *sym_bind(unsigned bind) {
  static const char *bind_name[] = {
      [STB_LOCAL] = "STB_LOCAL",
      [STB_GLOBAL] = "STB_GLOBAL",
      [STB_WEAK] = "STB_WEAK",
  };
  const char *name = "unknown sym bind name";
  if (bind < (sizeof(bind_name) / sizeof((bind_name)[0]))) {
    name = bind_name[bind];
  }
  return name;
}


x86 assembly (clang, -O0):
<sym_bind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xf10(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x83,%rax
jae    1135 <sym_bind+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0x2f03(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sym_bind>:
cmp    $0x82,%edi
ja     1116 <sym_bind+0x16>
mov    %edi,%eax
lea    0x291f(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
lea    0xf01(%rip),%rax
ret

LLVM IR (-O0):
@sym_bind.bind_name = internal global [131 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0)]
@.str = [9 x i8] c"STB_WEAK\00"
@.str.1 = [10 x i8] c"STB_LOCAL\00"
@.str.2 = [11 x i8] c"STB_GLOBAL\00"
@.str.3 = [22 x i8] c"unknown sym bind name\00"
define i8* @sym_bind(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = icmp ult i64 %5, 131
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [131 x i8*], [131 x i8*]* @sym_bind.bind_name, i64 0, i64 %9
%11 = load i8*, i8** %10
store i8* %11, i8** %3
br label %12
12: ; preds = %7, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@sym_bind.bind_name = internal unnamed_addr constant [131 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0)]
@.str = [9 x i8] c"STB_WEAK\00"
@.str.1 = [10 x i8] c"STB_LOCAL\00"
@.str.2 = [11 x i8] c"STB_GLOBAL\00"
@.str.3 = [22 x i8] c"unknown sym bind name\00"
define i8* @sym_bind(i32 %0) {
%2 = icmp ult i32 %0, 131
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = getelementptr inbounds [131 x i8*], [131 x i8*]* @sym_bind.bind_name, i64 0, i64 %4
%6 = load i8*, i8** %5
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}