#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 130
#define NO_DATA 129
#define TRY_AGAIN 128
const char *hstrerror(int e) {
  switch (e) {
  case 0:
    return "OK";
  case NO_DATA:
    return "No data of requested type.";
  case TRY_AGAIN:
    return "Temporary failure.";
  case HOST_NOT_FOUND:
  default:
    return "Unknown host.";
  }
}


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     1153 <hstrerror+0x53>
jmp    111a <hstrerror+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     1173 <hstrerror+0x73>
jmp    112d <hstrerror+0x2d>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     1163 <hstrerror+0x63>
jmp    1140 <hstrerror+0x40>
mov    -0x10(%rbp),%eax
sub    $0x82,%eax
je     1183 <hstrerror+0x83>
jmp    1188 <hstrerror+0x88>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1193 <hstrerror+0x93>
lea    0xe99(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1193 <hstrerror+0x93>
lea    0xea4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1193 <hstrerror+0x93>
jmp    1188 <hstrerror+0x88>
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hstrerror>:
test   %edi,%edi
je     111c <hstrerror+0x1c>
cmp    $0x80,%edi
je     1124 <hstrerror+0x24>
cmp    $0x81,%edi
jne    112c <hstrerror+0x2c>
lea    0xee8(%rip),%rax
ret
lea    0xedd(%rip),%rax
ret
lea    0xef3(%rip),%rax
ret
lea    0xefe(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [27 x i8] c"No data of requested type.\00"
@.str.2 = [19 x i8] c"Temporary failure.\00"
@.str.3 = [14 x i8] c"Unknown host.\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 %9 [
i32 0, label %5
i32 129, label %6
i32 128, label %7
i32 130, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
br label %9
9: ; preds = %1, %8
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [27 x i8] c"No data of requested type.\00"
@.str.2 = [19 x i8] c"Temporary failure.\00"
@.str.3 = [14 x i8] c"Unknown host.\00"
define i8* @hstrerror(i32 %0) {
switch i32 %0, label %4 [
i32 0, label %5
i32 129, label %2
i32 128, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}