#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*/ errno;
char const *strerror(int /*<<< orphan*/);
const char *poptStrerror(const int error) {
  switch (error) {
  case -10:
    return ("missing argument");
  case -11:
    return ("unknown option");
  case -13:
    return ("aliases nested too deeply");
  case -15:
    return ("error in paramter quoting");
  case -17:
    return ("invalid numeric value");
  case -18:
    return ("number too large or too small");
  case -16:
    return strerror(errno);
  default:
    return ("unknown error");
  }
}


x86 assembly (clang, -O0):
<poptStrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x12,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x8,%eax
ja     11bb <poptStrerror+0xab>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <poptStrerror+0xb6>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <poptStrerror+0xb6>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <poptStrerror+0xb6>
lea    0xee3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <poptStrerror+0xb6>
lea    0xeed(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <poptStrerror+0xb6>
lea    0xef3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <poptStrerror+0xb6>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
call   1030 <strerror@plt>
mov    %rax,-0x8(%rbp)
jmp    11c6 <poptStrerror+0xb6>
lea    0xeea(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poptStrerror>:
add    $0x12,%edi
cmp    $0x8,%edi
ja     114d <poptStrerror+0x3d>
lea    0xf05(%rip),%rax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0xf58(%rip),%rax
ret
lea    0xf3a(%rip),%rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
jmp    1030 <strerror@plt>
lea    0xf58(%rip),%rax
ret
lea    0xee8(%rip),%rax
ret
lea    0xed1(%rip),%rax
ret
lea    0xef2(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"missing argument\00"
@.str.1 = [15 x i8] c"unknown option\00"
@.str.2 = [26 x i8] c"aliases nested too deeply\00"
@.str.3 = [26 x i8] c"error in paramter quoting\00"
@.str.4 = [22 x i8] c"invalid numeric value\00"
@.str.5 = [30 x i8] c"number too large or too small\00"
@errno = global i32 0
@.str.6 = [14 x i8] c"unknown error\00"
define i8* @poptStrerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 -10, label %5
i32 -11, label %6
i32 -13, label %7
i32 -15, label %8
i32 -17, label %9
i32 -18, label %10
i32 -16, label %11
]
5: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
6: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %1
%12 = load i32, i32* @errno
%13 = call i8* @strerror(i32 %12)
store i8* %13, i8** %2
br label %15
14: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %15
15: ; preds = %14, %11, %10, %9, %8, %7, %6, %5
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"missing argument\00"
@.str.1 = [15 x i8] c"unknown option\00"
@.str.2 = [26 x i8] c"aliases nested too deeply\00"
@.str.3 = [26 x i8] c"error in paramter quoting\00"
@.str.4 = [22 x i8] c"invalid numeric value\00"
@.str.5 = [30 x i8] c"number too large or too small\00"
@errno = global i32 0
@.str.6 = [14 x i8] c"unknown error\00"
define i8* @poptStrerror(i32 %0) {
switch i32 %0, label %10 [
i32 -10, label %11
i32 -11, label %2
i32 -13, label %3
i32 -15, label %4
i32 -17, label %5
i32 -18, label %6
i32 -16, label %7
]
2: ; preds = %1
br label %11
3: ; preds = %1
br label %11
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %7, %6, %5, %4, %3, %2
%12 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), %10 ], [ %9, %7 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}