#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 */
#define HOST_NOT_FOUND 131
#define NO_ADDRESS 130
#define NO_RECOVERY 129
#define TRY_AGAIN 128
const char *hstrerror(int error_code) {
  switch (error_code) {
  default:
    return "unknown error";
  case 0:
    return "no error";
  case HOST_NOT_FOUND:
    return "unknown host";
  case NO_ADDRESS:
    return "no address associated with name";
  case NO_RECOVERY:
    return "unknown server error";
  case TRY_AGAIN:
    return "host name lookup failure";
  }
}


x86 assembly (clang, -O0):
<hstrerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1176 <hstrerror+0x76>
jmp    111a <hstrerror+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     11b6 <hstrerror+0xb6>
jmp    112d <hstrerror+0x2d>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     11a6 <hstrerror+0xa6>
jmp    1140 <hstrerror+0x40>
mov    -0x10(%rbp),%eax
sub    $0x82,%eax
je     1196 <hstrerror+0x96>
jmp    1153 <hstrerror+0x53>
mov    -0x10(%rbp),%eax
sub    $0x83,%eax
je     1186 <hstrerror+0x86>
jmp    1166 <hstrerror+0x66>
lea    0xe93(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c1 <hstrerror+0xc1>
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c1 <hstrerror+0xc1>
lea    0xe8a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c1 <hstrerror+0xc1>
lea    0xe87(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c1 <hstrerror+0xc1>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c1 <hstrerror+0xc1>
lea    0xe9c(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hstrerror>:
lea    -0x80(%rdi),%eax
cmp    $0x3,%eax
ja     1120 <hstrerror+0x20>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf4a(%rip),%rax
ret
test   %edi,%edi
jne    1144 <hstrerror+0x44>
lea    0xef3(%rip),%rax
ret
lea    0xf21(%rip),%rax
ret
lea    0xef9(%rip),%rax
ret
lea    0xee4(%rip),%rax
ret
lea    0xec5(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unknown error\00"
@.str.1 = [9 x i8] c"no error\00"
@.str.2 = [13 x i8] c"unknown host\00"
@.str.3 = [32 x i8] c"no address associated with name\00"
@.str.4 = [21 x i8] c"unknown server error\00"
@.str.5 = [25 x i8] c"host name lookup failure\00"
define i8* @hstrerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
i32 0, label %6
i32 131, label %7
i32 130, label %8
i32 129, label %9
i32 128, label %10
]
5: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %11
7: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %11
8: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %11
10: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"unknown error\00"
@.str.1 = [9 x i8] c"no error\00"
@.str.2 = [13 x i8] c"unknown host\00"
@.str.3 = [32 x i8] c"no address associated with name\00"
@.str.4 = [21 x i8] c"unknown server error\00"
@.str.5 = [25 x i8] c"host name lookup failure\00"
define i8* @hstrerror(i32 %0) {
switch i32 %0, label %7 [
i32 0, label %2
i32 131, label %3
i32 130, label %4
i32 129, label %5
i32 128, label %6
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}