#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 */
typedef int /*<<< orphan*/ errstr;

/* Variables and functions */
#define YPPUSH_AGE 143
#define YPPUSH_BADARGS 142
#define YPPUSH_CLEAR 141
#define YPPUSH_DBM 140
#define YPPUSH_FILE 139
#define YPPUSH_FORCE 138
#define YPPUSH_MADDR 137
#define YPPUSH_NODOM 136
#define YPPUSH_NOMAP 135
#define YPPUSH_REFUSED 134
#define YPPUSH_RPC 133
#define YPPUSH_RSRC 132
#define YPPUSH_SKEW 131
#define YPPUSH_SUCC 130
#define YPPUSH_XFRERR 129
#define YPPUSH_YPERR 128
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
const char *yppush_err_string(int y) {
  static char errstr[64];
  switch (y) {
  case YPPUSH_SUCC:
    return "Success";
  case YPPUSH_AGE:
    return "Master's version not newer";
  case YPPUSH_NOMAP:
    return "Can't find server for map";
  case YPPUSH_NODOM:
    return "Domain not supported";
  case YPPUSH_RSRC:
    return "Local resource alloc failure";
  case YPPUSH_RPC:
    return "RPC failure talking to server";
  case YPPUSH_MADDR:
    return "Can't get master address";
  case YPPUSH_YPERR:
    return "YP server/map db error";
  case YPPUSH_BADARGS:
    return "Request arguments bad";
  case YPPUSH_DBM:
    return "Local dbm operation failed";
  case YPPUSH_FILE:
    return "Local file I/O operation failed";
  case YPPUSH_SKEW:
    return "Map version skew during transfer";
  case YPPUSH_CLEAR:
    return "Can't send \"Clear\" req to local ypserv";
  case YPPUSH_FORCE:
    return "No local order number in map use -f flag.";
  case YPPUSH_XFRERR:
    return "ypxfr error";
  case YPPUSH_REFUSED:
    return "Transfer request refused by ypserv";
  default:
    memset(errstr, 0, sizeof(errstr));
    snprintf(errstr, sizeof(errstr), "unknown error code: %d", y);
    return errstr;
  }
}


x86 assembly (clang, -O0):
<yppush_err_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xf,%eax
ja     1254 <yppush_err_string+0x134>
mov    -0x18(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xef7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf04(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf12(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf1b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf22(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf28(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf33(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf43(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf54(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf6b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf85(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0xf81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    128d <yppush_err_string+0x16d>
lea    0x2de5(%rip),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
mov    -0xc(%rbp),%ecx
lea    0x2dcf(%rip),%rdi
mov    $0x40,%esi
lea    0xf72(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2db7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yppush_err_string>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
lea    -0x80(%r14),%eax
cmp    $0x10,%eax
jae    1142 <yppush_err_string+0x22>
cltq
lea    0x108f(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
jmp    116f <yppush_err_string+0x4f>
lea    0x2ef7(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
lea    0x1050(%rip),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r14d,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@yppush_err_string.errstr = internal global [64 x i8] zeroinitializer
@.str = [8 x i8] c"Success\00"
@.str.1 = [27 x i8] c"Master's version not newer\00"
@.str.2 = [26 x i8] c"Can't find server for map\00"
@.str.3 = [21 x i8] c"Domain not supported\00"
@.str.4 = [29 x i8] c"Local resource alloc failure\00"
@.str.5 = [30 x i8] c"RPC failure talking to server\00"
@.str.6 = [25 x i8] c"Can't get master address\00"
@.str.7 = [23 x i8] c"YP server/map db error\00"
@.str.8 = [22 x i8] c"Request arguments bad\00"
@.str.9 = [27 x i8] c"Local dbm operation failed\00"
@.str.10 = [32 x i8] c"Local file I/O operation failed\00"
@.str.11 = [33 x i8] c"Map version skew during transfer\00"
@.str.12 = [39 x i8] c"Can't send \22Clear\22 req to local ypserv\00"
@.str.13 = [42 x i8] c"No local order number in map use -f flag.\00"
@.str.14 = [12 x i8] c"ypxfr error\00"
@.str.15 = [35 x i8] c"Transfer request refused by ypserv\00"
@.str.16 = [23 x i8] c"unknown error code: %d\00"
define i8* @yppush_err_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %21 [
i32 130, label %5
i32 143, label %6
i32 135, label %7
i32 136, label %8
i32 132, label %9
i32 133, label %10
i32 137, label %11
i32 128, label %12
i32 142, label %13
i32 140, label %14
i32 139, label %15
i32 131, label %16
i32 141, label %17
i32 138, label %18
i32 129, label %19
i32 134, label %20
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %25
6: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %25
7: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %25
8: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %25
9: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %25
10: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %25
11: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %25
12: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %25
13: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %25
14: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %25
15: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %25
16: ; preds = %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %25
17: ; preds = %1
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %25
18: ; preds = %1
store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %25
19: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %25
20: ; preds = %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %25
21: ; preds = %1
%22 = call i32 @memset(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @yppush_err_string.errstr, i64 0, i64 0), i32 0, i32 64)
%23 = load i32, i32* %3
%24 = call i32 @snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @yppush_err_string.errstr, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0), i32 %23)
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @yppush_err_string.errstr, i64 0, i64 0), i8** %2
br label %25
25: ; preds = %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
@yppush_err_string.errstr = internal global [64 x i8] zeroinitializer
@.str = [8 x i8] c"Success\00"
@.str.1 = [27 x i8] c"Master's version not newer\00"
@.str.2 = [26 x i8] c"Can't find server for map\00"
@.str.3 = [21 x i8] c"Domain not supported\00"
@.str.4 = [29 x i8] c"Local resource alloc failure\00"
@.str.5 = [30 x i8] c"RPC failure talking to server\00"
@.str.6 = [25 x i8] c"Can't get master address\00"
@.str.7 = [23 x i8] c"YP server/map db error\00"
@.str.8 = [22 x i8] c"Request arguments bad\00"
@.str.9 = [27 x i8] c"Local dbm operation failed\00"
@.str.10 = [32 x i8] c"Local file I/O operation failed\00"
@.str.11 = [33 x i8] c"Map version skew during transfer\00"
@.str.12 = [39 x i8] c"Can't send \22Clear\22 req to local ypserv\00"
@.str.13 = [42 x i8] c"No local order number in map use -f flag.\00"
@.str.14 = [12 x i8] c"ypxfr error\00"
@.str.15 = [35 x i8] c"Transfer request refused by ypserv\00"
@.str.16 = [23 x i8] c"unknown error code: %d\00"
@reltable.yppush_err_string = [16 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.7 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.14 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([33 x i8]* @.str.11 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @.str.4 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.5 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([35 x i8]* @.str.15 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.2 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.3 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.6 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @.str.10 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.9 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([39 x i8]* @.str.12 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.8 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @.str.1 to i64), i64 ptrtoint ([16 x i32]* @reltable.yppush_err_string to i64)) to i32)]
define i8* @yppush_err_string(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 16
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @yppush_err_string.errstr, i64 0, i64 0), i32 0, i32 64)
%6 = tail call i32 @snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @yppush_err_string.errstr, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0), i32 %0)
br label %11
7: ; preds = %1
%8 = sext i32 %2 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([16 x i32]* @reltable.yppush_err_string to i8*), i64 %9)
br label %11
11: ; preds = %7, %4
%12 = phi i8* [ getelementptr inbounds ([64 x i8], [64 x i8]* @yppush_err_string.errstr, i64 0, i64 0), %4 ], [ %10, %7 ]
ret i8* %12
}