#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 */
char const *gettext(char const *);
const char *yperr_string(const int error) {
  const char *str;
  switch (error) {
  case 0:
    str = "Success";
    break;
  case 1:
    str = "Request arguments bad";
    break;
  case 2:
    str = "RPC failure on NIS operation";
    break;
  case 3:
    str = "Can't bind to server which serves this domain";
    break;
  case 4:
    str = "No such map in server's domain";
    break;
  case 5:
    str = "No such key in map";
    break;
  case 6:
    str = "Internal NIS error";
    break;
  case 7:
    str = "Local resource allocation failure";
    break;
  case 8:
    str = "No more records in map database";
    break;
  case 9:
    str = "Can't communicate with portmapper";
    break;
  case 10:
    str = "Can't communicate with ypbind";
    break;
  case 11:
    str = "Can't communicate with ypserv";
    break;
  case 12:
    str = "Local domain name not set";
    break;
  case 13:
    str = "NIS map database is bad";
    break;
  case 14:
    str = "NIS client/server version mismatch - can't supply service";
    break;
  case 15:
    str = "Permission denied";
    break;
  case 16:
    str = "Database is busy";
    break;
  default:
    str = "Unknown NIS error code";
    break;
  }
  return gettext(str);
}


x86 assembly (clang, -O0):
<yperr_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x10,%rax
ja     1250 <yperr_string+0x140>
mov    -0x18(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xefd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xefb(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf08(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf26(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf35(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf38(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf3b(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf4d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf5d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf6f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf7d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf8b(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf95(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xf9d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xfc7(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xfc9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    125b <yperr_string+0x14b>
lea    0xfca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <gettext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yperr_string>:
cmp    $0x10,%edi
ja     112b <yperr_string+0x1b>
movslq %edi,%rax
lea    0x10d5(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <gettext@plt>
lea    0x10ab(%rip),%rdi
jmp    1030 <gettext@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Success\00"
@.str.1 = [22 x i8] c"Request arguments bad\00"
@.str.2 = [29 x i8] c"RPC failure on NIS operation\00"
@.str.3 = [46 x i8] c"Can't bind to server which serves this domain\00"
@.str.4 = [31 x i8] c"No such map in server's domain\00"
@.str.5 = [19 x i8] c"No such key in map\00"
@.str.6 = [19 x i8] c"Internal NIS error\00"
@.str.7 = [34 x i8] c"Local resource allocation failure\00"
@.str.8 = [32 x i8] c"No more records in map database\00"
@.str.9 = [34 x i8] c"Can't communicate with portmapper\00"
@.str.10 = [30 x i8] c"Can't communicate with ypbind\00"
@.str.11 = [30 x i8] c"Can't communicate with ypserv\00"
@.str.12 = [26 x i8] c"Local domain name not set\00"
@.str.13 = [24 x i8] c"NIS map database is bad\00"
@.str.14 = [58 x i8] c"NIS client/server version mismatch - can't supply service\00"
@.str.15 = [18 x i8] c"Permission denied\00"
@.str.16 = [17 x i8] c"Database is busy\00"
@.str.17 = [23 x i8] c"Unknown NIS error code\00"
define i8* @yperr_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %22 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
i32 10, label %15
i32 11, label %16
i32 12, label %17
i32 13, label %18
i32 14, label %19
i32 15, label %20
i32 16, label %21
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
br label %23
6: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %23
7: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %23
8: ; preds = %1
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %23
9: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %23
10: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %23
11: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %23
12: ; preds = %1
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %23
13: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %23
14: ; preds = %1
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %23
15: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %23
16: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %23
17: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %23
18: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %23
19: ; preds = %1
store i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %23
20: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %23
21: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i8** %3
br label %23
22: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0), i8** %3
br label %23
23: ; preds = %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%24 = load i8*, i8** %3
%25 = call i8* @gettext(i8* %24)
ret i8* %25
}

LLVM IR (-O2):
@.str = [8 x i8] c"Success\00"
@.str.1 = [22 x i8] c"Request arguments bad\00"
@.str.2 = [29 x i8] c"RPC failure on NIS operation\00"
@.str.3 = [46 x i8] c"Can't bind to server which serves this domain\00"
@.str.4 = [31 x i8] c"No such map in server's domain\00"
@.str.5 = [19 x i8] c"No such key in map\00"
@.str.6 = [19 x i8] c"Internal NIS error\00"
@.str.7 = [34 x i8] c"Local resource allocation failure\00"
@.str.8 = [32 x i8] c"No more records in map database\00"
@.str.9 = [34 x i8] c"Can't communicate with portmapper\00"
@.str.10 = [30 x i8] c"Can't communicate with ypbind\00"
@.str.11 = [30 x i8] c"Can't communicate with ypserv\00"
@.str.12 = [26 x i8] c"Local domain name not set\00"
@.str.13 = [24 x i8] c"NIS map database is bad\00"
@.str.14 = [58 x i8] c"NIS client/server version mismatch - can't supply service\00"
@.str.15 = [18 x i8] c"Permission denied\00"
@.str.16 = [17 x i8] c"Database is busy\00"
@.str.17 = [23 x i8] c"Unknown NIS error code\00"
@reltable.yperr_string = [17 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.1 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @.str.2 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([46 x i8]* @.str.3 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.4 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.5 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.6 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @.str.7 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @.str.8 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @.str.9 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.10 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.11 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.12 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.13 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([58 x i8]* @.str.14 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.15 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.16 to i64), i64 ptrtoint ([17 x i32]* @reltable.yperr_string to i64)) to i32)]
define i8* @yperr_string(i32 %0) {
%2 = icmp ult i32 %0, 17
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([17 x i32]* @reltable.yperr_string to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0), %1 ]
%9 = tail call i8* @gettext(i8* %8)
ret i8* %9
}