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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
const char *list_001c_element(unsigned int element) {
  static const char *table[] = {
      "\x00\x00",
      "one\x00\x00",
      "one\x00two\x00\x00",
      "one\x00two\x00three\x00\x00",
  };
  assert(element < (sizeof(table) / sizeof(table[0])));
  return table[element];
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x4,%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0x2ef5(%rip),%rax
mov    (%rax,%rcx,8),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
mov    %eax,%edi
call   1030 <assert@plt>
lea    0xed7(%rip),%rcx
movslq (%rcx,%rbx,4),%rax
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@list_001c_element.table = internal global [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i32 0, i32 0)]
@.str = [3 x i8] zeroinitializer
@.str.1 = [6 x i8] c"one\00\00\00"
@.str.2 = [10 x i8] c"one\00two\00\00\00"
@.str.3 = [16 x i8] c"one\00two\00three\00\00\00"
define i8* @list_001c_element(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = icmp ult i64 %4, 4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [4 x i8*], [4 x i8*]* @list_001c_element.table, i64 0, i64 %9
%11 = load i8*, i8** %10
ret i8* %11
}

LLVM IR (-O2):
@reltable.list_001c_element = internal unnamed_addr constant [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.list_001c_element to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.list_001c_element to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.list_001c_element to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.list_001c_element to i64)) to i32)]
@.str = [3 x i8] zeroinitializer
@.str.1 = [6 x i8] c"one\00\00\00"
@.str.2 = [10 x i8] c"one\00two\00\00\00"
@.str.3 = [16 x i8] c"one\00two\00three\00\00\00"
define i8* @list_001c_element(i32 %0) {
%2 = zext i32 %0 to i64
%3 = icmp ult i32 %0, 4
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = shl i64 %2, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.list_001c_element to i8*), i64 %6)
ret i8* %7
}