#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 */
extern const char *lcrp_strerror(int err) {
  static const char nomsg[] = "unimplemented message";
  struct {
    int err;
    const char *msg;
  } * m, mtab[] = {{0, "Success"},
                   {1, "Argument out of domain"},
                   {2, "Newton-Raphson zero derivative"},
                   {3, "Newton-Raphson escape"},
                   {4, "Newton-Raphson did not converge"},
                   {-1, NULL}};
  for (m = mtab; m->msg; m++)
    if (m->err == err)
      return m->msg;
  return nomsg;
}


x86 assembly (clang, -O0):
<lcrp_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0xc(%rbp)
lea    -0x80(%rbp),%rdi
lea    0x2c97(%rip),%rsi
mov    $0x60,%edx
call   1030 <memcpy@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1180 <lcrp_strerror+0x70>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    116a <lcrp_strerror+0x5a>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    118b <lcrp_strerror+0x7b>
jmp    116f <lcrp_strerror+0x5f>
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <lcrp_strerror+0x2b>
lea    0xe79(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcrp_strerror>:
movaps 0x2ce9(%rip),%xmm0
movaps %xmm0,-0x68(%rsp)
movaps 0x2d2d(%rip),%xmm0
movaps %xmm0,-0x18(%rsp)
movaps 0x2d11(%rip),%xmm0
movaps %xmm0,-0x28(%rsp)
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,-0x38(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,-0x48(%rsp)
movaps 0x2cbd(%rip),%xmm0
movaps %xmm0,-0x58(%rsp)
cmp    %edi,-0x68(%rsp)
jne    1156 <lcrp_strerror+0x56>
lea    0xec1(%rip),%rax
ret
lea    -0x50(%rsp),%rdx
lea    0xe9e(%rip),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdx),%rax
test   %rax,%rax
je     1185 <lcrp_strerror+0x85>
lea    0x10(%rdx),%rsi
cmp    %edi,-0x8(%rdx)
mov    %rsi,%rdx
jne    1170 <lcrp_strerror+0x70>
ret
mov    %rcx,%rax
ret

LLVM IR (-O0):
%struct.anon = type { i32, i8* }
@lcrp_strerror.nomsg = internal constant [22 x i8] c"unimplemented message\00"
@.str = [8 x i8] c"Success\00"
@.str.1 = [23 x i8] c"Argument out of domain\00"
@.str.2 = [31 x i8] c"Newton-Raphson zero derivative\00"
@.str.3 = [22 x i8] c"Newton-Raphson escape\00"
@.str.4 = [32 x i8] c"Newton-Raphson did not converge\00"
@__const.lcrp_strerror.mtab = [6 x %struct.anon] [%struct.anon { i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0) }, %struct.anon { i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i32 0, i32 0) }, %struct.anon { i32 2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i32 0, i32 0) }, %struct.anon { i32 3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i32 0, i32 0) }, %struct.anon { i32 4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i32 0, i32 0) }, %struct.anon { i32 -1, i8* null }]
define i8* @lcrp_strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.anon*
%5 = alloca [6 x %struct.anon]
store i32 %0, i32* %3
%6 = bitcast [6 x %struct.anon]* %5 to i8*
%7 = getelementptr inbounds [6 x %struct.anon], [6 x %struct.anon]* %5, i64 0, i64 0
store %struct.anon* %7, %struct.anon** %4
br label %8
8: ; preds = %24, %1
%9 = load %struct.anon*, %struct.anon** %4
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 1
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %27
13: ; preds = %8
%14 = load %struct.anon*, %struct.anon** %4
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = load i32, i32* %3
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = load %struct.anon*, %struct.anon** %4
%21 = getelementptr inbounds %struct.anon, %struct.anon* %20, i32 0, i32 1
%22 = load i8*, i8** %21
store i8* %22, i8** %2
br label %28
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load %struct.anon*, %struct.anon** %4
%26 = getelementptr inbounds %struct.anon, %struct.anon* %25, i32 1
store %struct.anon* %26, %struct.anon** %4
br label %8
27: ; preds = %8
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @lcrp_strerror.nomsg, i64 0, i64 0), i8** %2
br label %28
28: ; preds = %27, %19
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
%struct.anon = type { i32, i8* }
@lcrp_strerror.nomsg = internal constant [22 x i8] c"unimplemented message\00"
@.str = [8 x i8] c"Success\00"
@.str.1 = [23 x i8] c"Argument out of domain\00"
@.str.2 = [31 x i8] c"Newton-Raphson zero derivative\00"
@.str.3 = [22 x i8] c"Newton-Raphson escape\00"
@.str.4 = [32 x i8] c"Newton-Raphson did not converge\00"
@__const.lcrp_strerror.mtab = [6 x %struct.anon] [%struct.anon { i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0) }, %struct.anon { i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i32 0, i32 0) }, %struct.anon { i32 2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i32 0, i32 0) }, %struct.anon { i32 3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i32 0, i32 0) }, %struct.anon { i32 4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i32 0, i32 0) }, %struct.anon { i32 -1, i8* null }]
define i8* @lcrp_strerror(i32 %0) {
%2 = alloca [6 x %struct.anon]
%3 = bitcast [6 x %struct.anon]* %2 to i8*
%4 = getelementptr inbounds [6 x %struct.anon], [6 x %struct.anon]* %2, i64 0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %0
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = getelementptr inbounds [6 x %struct.anon], [6 x %struct.anon]* %2, i64 0, i64 0
br label %9
9: ; preds = %7, %15
%10 = phi %struct.anon* [ %8, %7 ], [ %11, %15 ]
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i64 1
%12 = getelementptr inbounds %struct.anon, %struct.anon* %10, i64 1, i32 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %19, label %15
15: ; preds = %9
%16 = getelementptr inbounds %struct.anon, %struct.anon* %11, i64 0, i32 0
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, %0
br i1 %18, label %19, label %9
19: ; preds = %9, %15, %1
%20 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @lcrp_strerror.nomsg, i64 0, i64 0), %9 ], [ %13, %15 ]
ret i8* %20
}