#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 */
*llib_led_file_msgs(int n) {
  static char *msgs[] = {
      "No error",
      "New File",
      "Error reading file",
      "Error seeking file",
      "Error opening file",
      "Error writing file",
      "File on disk is newer",
      "File is read-only",
      "Bad directory in path",
  };
  if ((n < 0) || (n > 8))
    return ("Unknown file error");
  else
    return (msgs[n]);
}


x86 assembly (clang, -O0):
<llib_led_file_msgs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     111b <llib_led_file_msgs+0x1b>
cmpl   $0x8,-0xc(%rbp)
jle    112b <llib_led_file_msgs+0x2b>
lea    0xf7a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    113e <llib_led_file_msgs+0x3e>
movslq -0xc(%rbp),%rcx
lea    0x2efa(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llib_led_file_msgs>:
cmp    $0x8,%edi
jbe    110d <llib_led_file_msgs+0xd>
lea    0xf90(%rip),%rax
ret
mov    %edi,%eax
lea    0x2cea(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@llib_led_file_msgs.msgs = internal global [9 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i32 0, i32 0)]
@.str = [9 x i8] c"No error\00"
@.str.1 = [9 x i8] c"New File\00"
@.str.2 = [19 x i8] c"Error reading file\00"
@.str.3 = [19 x i8] c"Error seeking file\00"
@.str.4 = [19 x i8] c"Error opening file\00"
@.str.5 = [19 x i8] c"Error writing file\00"
@.str.6 = [22 x i8] c"File on disk is newer\00"
@.str.7 = [18 x i8] c"File is read-only\00"
@.str.8 = [22 x i8] c"Bad directory in path\00"
@.str.9 = [19 x i8] c"Unknown file error\00"
define i32* @llib_led_file_msgs(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 8
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32* bitcast ([19 x i8]* @.str.9 to i32*), i32** %2
br label %16
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [9 x i8*], [9 x i8*]* @llib_led_file_msgs.msgs, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = bitcast i8* %14 to i32*
store i32* %15, i32** %2
br label %16
16: ; preds = %10, %9
%17 = load i32*, i32** %2
ret i32* %17
}

LLVM IR (-O2):
@llib_led_file_msgs.msgs = internal unnamed_addr constant [9 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i32 0, i32 0)]
@.str = [9 x i8] c"No error\00"
@.str.1 = [9 x i8] c"New File\00"
@.str.2 = [19 x i8] c"Error reading file\00"
@.str.3 = [19 x i8] c"Error seeking file\00"
@.str.4 = [19 x i8] c"Error opening file\00"
@.str.5 = [19 x i8] c"Error writing file\00"
@.str.6 = [22 x i8] c"File on disk is newer\00"
@.str.7 = [18 x i8] c"File is read-only\00"
@.str.8 = [22 x i8] c"Bad directory in path\00"
@.str.9 = [19 x i8] c"Unknown file error\00"
define i32* @llib_led_file_msgs(i32 %0) {
%2 = icmp ugt i32 %0, 8
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = getelementptr inbounds [9 x i8*], [9 x i8*]* @llib_led_file_msgs.msgs, i64 0, i64 %4
%6 = bitcast i8** %5 to i32**
%7 = load i32*, i32** %6
br label %8
8: ; preds = %1, %3
%9 = phi i32* [ %7, %3 ], [ bitcast ([19 x i8]* @.str.9 to i32*), %1 ]
ret i32* %9
}