#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 */
int /*<<< orphan*/ assert(void *);
const char *keyzen_list_keys_name(void *list, int index) {
  int *ints;
  assert(list);
  ints = list;
  if (index < 1 || index > *ints)
    return 0;
  return ((const char *)list) + ints[index];
}


x86 assembly (clang, -O0):
<keyzen_list_keys_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1149 <keyzen_list_keys_name+0x39>
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jle    1156 <keyzen_list_keys_name+0x46>
movq   $0x0,-0x8(%rbp)
jmp    116d <keyzen_list_keys_name+0x5d>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyzen_list_keys_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <assert@plt>
test   %ebp,%ebp
jle    1125 <keyzen_list_keys_name+0x15>
cmp    %ebp,(%rbx)
jge    1129 <keyzen_list_keys_name+0x19>
xor    %eax,%eax
jmp    1132 <keyzen_list_keys_name+0x22>
mov    %ebp,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @keyzen_list_keys_name(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 1
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i32, i32* %5
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = icmp sgt i32 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %13, %2
store i8* null, i8** %3
br label %28
19: ; preds = %13
%20 = load i8*, i8** %4
%21 = load i32*, i32** %6
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %20, i64 %26
store i8* %27, i8** %3
br label %28
28: ; preds = %19, %18
%29 = load i8*, i8** %3
ret i8* %29
}

LLVM IR (-O2):
define i8* @keyzen_list_keys_name(i8* %0, i32 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = bitcast i8* %0 to i32*
%5 = icmp slt i32 %1, 1
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, %1
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = zext i32 %1 to i64
%11 = getelementptr inbounds i32, i32* %4, i64 %10
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
br label %15
15: ; preds = %2, %6, %9
%16 = phi i8* [ %14, %9 ], [ null, %6 ], [ null, %2 ]
ret i8* %16
}