#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 -12:
    return "option does not take an argument";
  case -11:
    return "unknown option";
  case -19:
    return "mutually exclusive logical operations requested";
  case -20:
    return "opt->arg should not be NULL";
  case -13:
    return "aliases nested too deeply";
  case -15:
    return "error in parameter quoting";
  case -17:
    return "invalid numeric value";
  case -18:
    return "number too large or too small";
  case -21:
    return "memory allocation failed";
  case -22:
    return "config file failed sanity test";
  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    $0x16,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xc,%eax
ja     120b <poptStrerror+0xfb>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xeea(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xefb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xefa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xf1a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xf26(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xf30(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xf3b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xf41(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xf4f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xf58(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
mov    0x2de5(%rip),%rax
mov    (%rax),%edi
call   1030 <strerror@plt>
mov    %rax,-0x8(%rbp)
jmp    1216 <poptStrerror+0x106>
lea    0xf50(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poptStrerror>:
add    $0x16,%edi
cmp    $0xc,%edi
ja     1175 <poptStrerror+0x65>
lea    0xf15(%rip),%rax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0x100d(%rip),%rax
ret
lea    0xfec(%rip),%rax
ret
lea    0xf5f(%rip),%rax
ret
lea    0xf27(%rip),%rax
ret
lea    0xfb6(%rip),%rax
ret
lea    0xf98(%rip),%rax
ret
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
jmp    1030 <strerror@plt>
lea    0xf67(%rip),%rax
ret
lea    0xfe6(%rip),%rax
ret
lea    0xf3d(%rip),%rax
ret
lea    0xeb9(%rip),%rax
ret
lea    0xed2(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"missing argument\00"
@.str.1 = [33 x i8] c"option does not take an argument\00"
@.str.2 = [15 x i8] c"unknown option\00"
@.str.3 = [48 x i8] c"mutually exclusive logical operations requested\00"
@.str.4 = [28 x i8] c"opt->arg should not be NULL\00"
@.str.5 = [26 x i8] c"aliases nested too deeply\00"
@.str.6 = [27 x i8] c"error in parameter quoting\00"
@.str.7 = [22 x i8] c"invalid numeric value\00"
@.str.8 = [30 x i8] c"number too large or too small\00"
@.str.9 = [25 x i8] c"memory allocation failed\00"
@.str.10 = [31 x i8] c"config file failed sanity test\00"
@errno = global i32 0
@.str.11 = [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 %19 [
i32 -10, label %5
i32 -12, label %6
i32 -11, label %7
i32 -19, label %8
i32 -20, label %9
i32 -13, label %10
i32 -15, label %11
i32 -17, label %12
i32 -18, label %13
i32 -21, label %14
i32 -22, label %15
i32 -16, label %16
]
5: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %2
br label %20
6: ; preds = %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %20
7: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %20
8: ; preds = %1
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %20
9: ; preds = %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %20
10: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %20
11: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %20
12: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %20
13: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %20
14: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %20
15: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %20
16: ; preds = %1
%17 = load i32, i32* @errno
%18 = call i8* @strerror(i32 %17)
store i8* %18, i8** %2
br label %20
19: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %20
20: ; preds = %19, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@.str = [17 x i8] c"missing argument\00"
@.str.1 = [33 x i8] c"option does not take an argument\00"
@.str.2 = [15 x i8] c"unknown option\00"
@.str.3 = [48 x i8] c"mutually exclusive logical operations requested\00"
@.str.4 = [28 x i8] c"opt->arg should not be NULL\00"
@.str.5 = [26 x i8] c"aliases nested too deeply\00"
@.str.6 = [27 x i8] c"error in parameter quoting\00"
@.str.7 = [22 x i8] c"invalid numeric value\00"
@.str.8 = [30 x i8] c"number too large or too small\00"
@.str.9 = [25 x i8] c"memory allocation failed\00"
@.str.10 = [31 x i8] c"config file failed sanity test\00"
@errno = global i32 0
@.str.11 = [14 x i8] c"unknown error\00"
define i8* @poptStrerror(i32 %0) {
switch i32 %0, label %15 [
i32 -10, label %16
i32 -12, label %2
i32 -11, label %3
i32 -19, label %4
i32 -20, label %5
i32 -13, label %6
i32 -15, label %7
i32 -17, label %8
i32 -18, label %9
i32 -21, label %10
i32 -22, label %11
i32 -16, label %12
]
2: ; preds = %1
br label %16
3: ; preds = %1
br label %16
4: ; preds = %1
br label %16
5: ; preds = %1
br label %16
6: ; preds = %1
br label %16
7: ; preds = %1
br label %16
8: ; preds = %1
br label %16
9: ; preds = %1
br label %16
10: ; preds = %1
br label %16
11: ; preds = %1
br label %16
12: ; preds = %1
%13 = load i32, i32* @errno
%14 = tail call i8* @strerror(i32 %13)
br label %16
15: ; preds = %1
br label %16
16: ; preds = %1, %15, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%17 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), %15 ], [ %14, %12 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([33 x i8], [33 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* %17
}