#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int s1;
  int s2;
};
struct TYPE_3__ {
  int low;
  int high;
};
struct rpc_err {
  int re_status;
  TYPE_2__ re_lb;
  TYPE_1__ re_vers;
  scalar_t__ re_why;
  int /*<<< orphan*/ re_errno;
};
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int /*<<< orphan*/ CLNT_GETERR(int /*<<< orphan*/ *, struct rpc_err *);
#define RPC_AUTHERROR 145
#define RPC_CANTDECODEARGS 144
#define RPC_CANTDECODERES 143
#define RPC_CANTENCODEARGS 142
#define RPC_CANTRECV 141
#define RPC_CANTSEND 140
#define RPC_FAILED 139
#define RPC_PMAPFAILURE 138
#define RPC_PROCUNAVAIL 137
#define RPC_PROGNOTREGISTERED 136
#define RPC_PROGUNAVAIL 135
#define RPC_PROGVERSMISMATCH 134
#define RPC_SUCCESS 133
#define RPC_SYSTEMERROR 132
#define RPC_TIMEDOUT 131
#define RPC_UNKNOWNHOST 130
#define RPC_UNKNOWNPROTO 129
#define RPC_VERSMISMATCH 128
char *_buf();
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *auth_errmsg(scalar_t__);
int /*<<< orphan*/ clnt_sperrno(int);
size_t snprintf(char *, size_t, char *, ...);
char *strerror(int /*<<< orphan*/);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, size_t);
char *clnt_sperror(CLIENT *rpch, const char *s) {
  struct rpc_err e;
  char *err;
  char *str;
  char *strstart;
  size_t len, i;
  assert(rpch != NULL);
  assert(s != NULL);
  str = _buf();
  if (str == NULL)
    return (0);
  len = 256;
  strstart = str;
  CLNT_GETERR(rpch, &e);
  if ((i = snprintf(str, len, "%s: ", s)) > 0) {
    str += i;
    len -= i;
  }
  (void)strncpy(str, clnt_sperrno(e.re_status), len - 1);
  i = strlen(str);
  str += i;
  len -= i;
  switch (e.re_status) {
  case RPC_SUCCESS:
  case RPC_CANTENCODEARGS:
  case RPC_CANTDECODERES:
  case RPC_TIMEDOUT:
  case RPC_PROGUNAVAIL:
  case RPC_PROCUNAVAIL:
  case RPC_CANTDECODEARGS:
  case RPC_SYSTEMERROR:
  case RPC_UNKNOWNHOST:
  case RPC_UNKNOWNPROTO:
  case RPC_PMAPFAILURE:
  case RPC_PROGNOTREGISTERED:
  case RPC_FAILED:
    break;
  case RPC_CANTSEND:
  case RPC_CANTRECV:
    i = snprintf(str, len, "; errno = %s", strerror(e.re_errno));
    if (i > 0) {
      str += i;
      len -= i;
    }
    break;
  case RPC_VERSMISMATCH:
    i = snprintf(str, len, "; low version = %u, high version = %u",
                 e.re_vers.low, e.re_vers.high);
    if (i > 0) {
      str += i;
      len -= i;
    }
    break;
  case RPC_AUTHERROR:
    err = auth_errmsg(e.re_why);
    i = snprintf(str, len, "; why = ");
    if (i > 0) {
      str += i;
      len -= i;
    }
    if (err != NULL) {
      i = snprintf(str, len, "%s", err);
    } else {
      i = snprintf(str, len, "(unknown authentication error - %d)",
                   (int)e.re_why);
    }
    if (i > 0) {
      str += i;
      len -= i;
    }
    break;
  case RPC_PROGVERSMISMATCH:
    i = snprintf(str, len, "; low version = %u, high version = %u",
                 e.re_vers.low, e.re_vers.high);
    if (i > 0) {
      str += i;
      len -= i;
    }
    break;
  default:
    i = snprintf(str, len, "; s1 = %u, s2 = %u", e.re_lb.s1, e.re_lb.s2);
    if (i > 0) {
      str += i;
      len -= i;
    }
    break;
  }
  strstart[256 - 1] = '\0';
  return (strstart);
}


x86 assembly (clang, -O0):
<clnt_sperror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    $0x0,%al
call   10a0 <_buf@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    11ea <clnt_sperror+0x5a>
movq   $0x0,-0x8(%rbp)
jmp    14e9 <clnt_sperror+0x359>
movq   $0x100,-0x60(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <CLNT_GETERR@plt>
mov    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xe2e(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    %rax,-0x68(%rbp)
cmp    $0x0,%rax
jbe    124a <clnt_sperror+0xba>
mov    -0x68(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x40(%rbp),%edi
call   1090 <clnt_sperrno@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%esi
mov    -0x60(%rbp),%rdx
add    $0xffffffffffffffff,%rdx
call   1030 <strncpy@plt>
mov    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x70(%rbp)
sub    $0x11,%eax
ja     148a <clnt_sperror+0x2fa>
mov    -0x70(%rbp),%rax
lea    0xd48(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    14d6 <clnt_sperror+0x346>
mov    -0x50(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x20(%rbp),%edi
call   10b0 <strerror@plt>
mov    -0x88(%rbp),%rdi
mov    -0x80(%rbp),%rsi
mov    %rax,%rcx
lea    0xd57(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jbe    1327 <clnt_sperror+0x197>
mov    -0x68(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
jmp    14d6 <clnt_sperror+0x346>
mov    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%r8d
lea    0xd18(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jbe    1373 <clnt_sperror+0x1e3>
mov    -0x68(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
jmp    14d6 <clnt_sperror+0x346>
mov    -0x28(%rbp),%rdi
call   1080 <auth_errmsg@plt>
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%rsi
lea    0xcec(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jbe    13c5 <clnt_sperror+0x235>
mov    -0x68(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     13f3 <clnt_sperror+0x263>
mov    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x48(%rbp),%rcx
lea    0xc74(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    %rax,-0x68(%rbp)
jmp    1413 <clnt_sperror+0x283>
mov    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
lea    0xc81(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jbe    1439 <clnt_sperror+0x2a9>
mov    -0x68(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
jmp    14d6 <clnt_sperror+0x346>
mov    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%r8d
lea    0xc06(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jbe    1485 <clnt_sperror+0x2f5>
mov    -0x68(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
jmp    14d6 <clnt_sperror+0x346>
mov    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x3c(%rbp),%ecx
mov    -0x38(%rbp),%r8d
lea    0xc0d(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jbe    14d1 <clnt_sperror+0x341>
mov    -0x68(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x60(%rbp)
jmp    14d6 <clnt_sperror+0x346>
mov    -0x58(%rbp),%rax
movb   $0x0,0xff(%rax)
mov    -0x58(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clnt_sperror>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1070 <assert@plt>
xor    %edi,%edi
test   %r12,%r12
setne  %dil
call   1070 <assert@plt>
xor    %eax,%eax
call   10a0 <_buf@plt>
mov    %rax,%r15
test   %rax,%rax
je     1257 <clnt_sperror+0xc7>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <CLNT_GETERR@plt>
lea    0xe62(%rip),%rdx
mov    $0x100,%r14d
mov    $0x100,%esi
mov    %r15,%rdi
mov    %r12,%rcx
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    %rax,%rbx
mov    %r15,%r13
add    %rax,%r13
mov    0x8(%rsp),%edi
call   1090 <clnt_sperrno@plt>
mov    $0xff,%edx
sub    %rbx,%rdx
mov    %r13,%rdi
mov    %eax,%esi
call   1030 <strncpy@plt>
mov    %r13,%rdi
call   1040 <strlen@plt>
add    %rax,%r13
add    %rax,%rbx
sub    %rbx,%r14
mov    0x8(%rsp),%eax
add    $0xffffff80,%eax
cmp    $0x11,%eax
ja     1295 <clnt_sperror+0x105>
lea    0xdba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,0xff(%r15)
mov    %r15,%rax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    0x14(%rsp),%ecx
mov    0x18(%rsp),%r8d
lea    0xde2(%rip),%rdx
jmp    12a5 <clnt_sperror+0x115>
mov    0x28(%rsp),%edi
call   10b0 <strerror@plt>
lea    0xdc3(%rip),%rdx
mov    %r13,%rdi
mov    %r14,%rsi
mov    %rax,%rcx
jmp    12f0 <clnt_sperror+0x160>
mov    0xc(%rsp),%ecx
mov    0x10(%rsp),%r8d
lea    0xe08(%rip),%rdx
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <snprintf@plt>
jmp    124f <clnt_sperror+0xbf>
mov    0x20(%rsp),%rdi
call   1080 <auth_errmsg@plt>
mov    %rax,%r12
lea    0xdb8(%rip),%rdx
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <snprintf@plt>
add    %rax,%r13
sub    %rax,%r14
test   %r12,%r12
je     12fc <clnt_sperror+0x16c>
lea    0xd70(%rip),%rdx
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r12,%rcx
xor    %eax,%eax
call   1060 <snprintf@plt>
jmp    124f <clnt_sperror+0xbf>
mov    0x20(%rsp),%ecx
lea    0xd82(%rip),%rdx
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <snprintf@plt>
jmp    124f <clnt_sperror+0xbf>

LLVM IR (-O0):
%struct.rpc_err = type { i32, %struct.TYPE_4__, %struct.TYPE_3__, i64, i32 }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
@.str = [5 x i8] c"%s: \00"
@.str.1 = [13 x i8] c"; errno = %s\00"
@.str.2 = [38 x i8] c"; low version = %u, high version = %u\00"
@.str.3 = [9 x i8] c"; why = \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [36 x i8] c"(unknown authentication error - %d)\00"
@.str.6 = [19 x i8] c"; s1 = %u, s2 = %u\00"
define i8* @clnt_sperror(i32* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca %struct.rpc_err
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
%12 = load i32*, i32** %4
%13 = icmp ne i32* %12, null
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %5
%17 = icmp ne i8* %16, null
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i8* (...) @_buf()
store i8* %20, i8** %8
%21 = load i8*, i8** %8
%22 = icmp eq i8* %21, null
br i1 %22, label %23, label %24
23: ; preds = %2
store i8* null, i8** %3
br label %182
24: ; preds = %2
store i64 256, i64* %10
%25 = load i8*, i8** %8
store i8* %25, i8** %9
%26 = load i32*, i32** %4
%27 = call i32 @CLNT_GETERR(i32* %26, %struct.rpc_err* %6)
%28 = load i8*, i8** %8
%29 = load i64, i64* %10
%30 = load i8*, i8** %5
%31 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %28, i64 %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %30)
store i64 %31, i64* %11
%32 = icmp ugt i64 %31, 0
br i1 %32, label %33, label %40
33: ; preds = %24
%34 = load i64, i64* %11
%35 = load i8*, i8** %8
%36 = getelementptr inbounds i8, i8* %35, i64 %34
store i8* %36, i8** %8
%37 = load i64, i64* %11
%38 = load i64, i64* %10
%39 = sub i64 %38, %37
store i64 %39, i64* %10
br label %40
40: ; preds = %33, %24
%41 = load i8*, i8** %8
%42 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 0
%43 = load i32, i32* %42
%44 = call i32 @clnt_sperrno(i32 %43)
%45 = load i64, i64* %10
%46 = sub i64 %45, 1
%47 = call i32 @strncpy(i8* %41, i32 %44, i64 %46)
%48 = load i8*, i8** %8
%49 = call i64 @strlen(i8* %48)
store i64 %49, i64* %11
%50 = load i64, i64* %11
%51 = load i8*, i8** %8
%52 = getelementptr inbounds i8, i8* %51, i64 %50
store i8* %52, i8** %8
%53 = load i64, i64* %11
%54 = load i64, i64* %10
%55 = sub i64 %54, %53
store i64 %55, i64* %10
%56 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 0
%57 = load i32, i32* %56
switch i32 %57, label %158 [
i32 133, label %58
i32 142, label %58
i32 143, label %58
i32 131, label %58
i32 135, label %58
i32 137, label %58
i32 144, label %58
i32 132, label %58
i32 130, label %58
i32 129, label %58
i32 138, label %58
i32 136, label %58
i32 139, label %58
i32 140, label %59
i32 141, label %59
i32 128, label %76
i32 145, label %96
i32 134, label %138
]
58: ; preds = %40, %40, %40, %40, %40, %40, %40, %40, %40, %40, %40, %40, %40
br label %178
59: ; preds = %40, %40
%60 = load i8*, i8** %8
%61 = load i64, i64* %10
%62 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 4
%63 = load i32, i32* %62
%64 = call i8* @strerror(i32 %63)
%65 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %60, i64 %61, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %64)
store i64 %65, i64* %11
%66 = load i64, i64* %11
%67 = icmp ugt i64 %66, 0
br i1 %67, label %68, label %75
68: ; preds = %59
%69 = load i64, i64* %11
%70 = load i8*, i8** %8
%71 = getelementptr inbounds i8, i8* %70, i64 %69
store i8* %71, i8** %8
%72 = load i64, i64* %11
%73 = load i64, i64* %10
%74 = sub i64 %73, %72
store i64 %74, i64* %10
br label %75
75: ; preds = %68, %59
br label %178
76: ; preds = %40
%77 = load i8*, i8** %8
%78 = load i64, i64* %10
%79 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 2
%80 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %79, i32 0, i32 0
%81 = load i32, i32* %80
%82 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 2
%83 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %82, i32 0, i32 1
%84 = load i32, i32* %83
%85 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %77, i64 %78, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %81, i32 %84)
store i64 %85, i64* %11
%86 = load i64, i64* %11
%87 = icmp ugt i64 %86, 0
br i1 %87, label %88, label %95
88: ; preds = %76
%89 = load i64, i64* %11
%90 = load i8*, i8** %8
%91 = getelementptr inbounds i8, i8* %90, i64 %89
store i8* %91, i8** %8
%92 = load i64, i64* %11
%93 = load i64, i64* %10
%94 = sub i64 %93, %92
store i64 %94, i64* %10
br label %95
95: ; preds = %88, %76
br label %178
96: ; preds = %40
%97 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 3
%98 = load i64, i64* %97
%99 = call i8* @auth_errmsg(i64 %98)
store i8* %99, i8** %7
%100 = load i8*, i8** %8
%101 = load i64, i64* %10
%102 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %100, i64 %101, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i64 %102, i64* %11
%103 = load i64, i64* %11
%104 = icmp ugt i64 %103, 0
br i1 %104, label %105, label %112
105: ; preds = %96
%106 = load i64, i64* %11
%107 = load i8*, i8** %8
%108 = getelementptr inbounds i8, i8* %107, i64 %106
store i8* %108, i8** %8
%109 = load i64, i64* %11
%110 = load i64, i64* %10
%111 = sub i64 %110, %109
store i64 %111, i64* %10
br label %112
112: ; preds = %105, %96
%113 = load i8*, i8** %7
%114 = icmp ne i8* %113, null
br i1 %114, label %115, label %120
115: ; preds = %112
%116 = load i8*, i8** %8
%117 = load i64, i64* %10
%118 = load i8*, i8** %7
%119 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %116, i64 %117, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %118)
store i64 %119, i64* %11
br label %127
120: ; preds = %112
%121 = load i8*, i8** %8
%122 = load i64, i64* %10
%123 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 3
%124 = load i64, i64* %123
%125 = trunc i64 %124 to i32
%126 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %121, i64 %122, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %125)
store i64 %126, i64* %11
br label %127
127: ; preds = %120, %115
%128 = load i64, i64* %11
%129 = icmp ugt i64 %128, 0
br i1 %129, label %130, label %137
130: ; preds = %127
%131 = load i64, i64* %11
%132 = load i8*, i8** %8
%133 = getelementptr inbounds i8, i8* %132, i64 %131
store i8* %133, i8** %8
%134 = load i64, i64* %11
%135 = load i64, i64* %10
%136 = sub i64 %135, %134
store i64 %136, i64* %10
br label %137
137: ; preds = %130, %127
br label %178
138: ; preds = %40
%139 = load i8*, i8** %8
%140 = load i64, i64* %10
%141 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 2
%142 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %141, i32 0, i32 0
%143 = load i32, i32* %142
%144 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 2
%145 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %144, i32 0, i32 1
%146 = load i32, i32* %145
%147 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %139, i64 %140, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %143, i32 %146)
store i64 %147, i64* %11
%148 = load i64, i64* %11
%149 = icmp ugt i64 %148, 0
br i1 %149, label %150, label %157
150: ; preds = %138
%151 = load i64, i64* %11
%152 = load i8*, i8** %8
%153 = getelementptr inbounds i8, i8* %152, i64 %151
store i8* %153, i8** %8
%154 = load i64, i64* %11
%155 = load i64, i64* %10
%156 = sub i64 %155, %154
store i64 %156, i64* %10
br label %157
157: ; preds = %150, %138
br label %178
158: ; preds = %40
%159 = load i8*, i8** %8
%160 = load i64, i64* %10
%161 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 1
%162 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %161, i32 0, i32 0
%163 = load i32, i32* %162
%164 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %6, i32 0, i32 1
%165 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %164, i32 0, i32 1
%166 = load i32, i32* %165
%167 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %159, i64 %160, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %163, i32 %166)
store i64 %167, i64* %11
%168 = load i64, i64* %11
%169 = icmp ugt i64 %168, 0
br i1 %169, label %170, label %177
170: ; preds = %158
%171 = load i64, i64* %11
%172 = load i8*, i8** %8
%173 = getelementptr inbounds i8, i8* %172, i64 %171
store i8* %173, i8** %8
%174 = load i64, i64* %11
%175 = load i64, i64* %10
%176 = sub i64 %175, %174
store i64 %176, i64* %10
br label %177
177: ; preds = %170, %158
br label %178
178: ; preds = %177, %157, %137, %95, %75, %58
%179 = load i8*, i8** %9
%180 = getelementptr inbounds i8, i8* %179, i64 255
store i8 0, i8* %180
%181 = load i8*, i8** %9
store i8* %181, i8** %3
br label %182
182: ; preds = %178, %23
%183 = load i8*, i8** %3
ret i8* %183
}

LLVM IR (-O2):
%struct.rpc_err = type { i32, %struct.TYPE_4__, %struct.TYPE_3__, i64, i32 }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
@.str = [5 x i8] c"%s: \00"
@.str.1 = [13 x i8] c"; errno = %s\00"
@.str.2 = [38 x i8] c"; low version = %u, high version = %u\00"
@.str.3 = [9 x i8] c"; why = \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [36 x i8] c"(unknown authentication error - %d)\00"
@.str.6 = [19 x i8] c"; s1 = %u, s2 = %u\00"
define i8* @clnt_sperror(i32* %0, i8* %1) {
%3 = alloca %struct.rpc_err
%4 = bitcast %struct.rpc_err* %3 to i8*
%5 = icmp ne i32* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ne i8* %1, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i8* (...) @_buf()
%12 = icmp eq i8* %11, null
br i1 %12, label %66, label %13
13: ; preds = %2
%14 = call i32 @CLNT_GETERR(i32* %0, %struct.rpc_err* %3)
%15 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %11, i64 256, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%16 = getelementptr i8, i8* %11, i64 %15
%17 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 0
%18 = load i32, i32* %17
%19 = call i32 @clnt_sperrno(i32 %18)
%20 = sub i64 255, %15
%21 = call i32 @strncpy(i8* %16, i32 %19, i64 %20)
%22 = call i64 @strlen(i8* dereferenceable(1) %16)
%23 = getelementptr inbounds i8, i8* %16, i64 %22
%24 = add i64 %15, %22
%25 = sub i64 256, %24
%26 = load i32, i32* %17
switch i32 %26, label %58 [
i32 133, label %64
i32 142, label %64
i32 143, label %64
i32 131, label %64
i32 135, label %64
i32 137, label %64
i32 144, label %64
i32 132, label %64
i32 130, label %64
i32 129, label %64
i32 138, label %64
i32 136, label %64
i32 139, label %64
i32 140, label %27
i32 141, label %27
i32 128, label %32
i32 145, label %38
i32 134, label %52
]
27: ; preds = %13, %13
%28 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 4
%29 = load i32, i32* %28
%30 = call i8* @strerror(i32 %29)
%31 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %23, i64 %25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %30)
br label %64
32: ; preds = %13
%33 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 2, i32 0
%34 = load i32, i32* %33
%35 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 2, i32 1
%36 = load i32, i32* %35
%37 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %23, i64 %25, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %36)
br label %64
38: ; preds = %13
%39 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 3
%40 = load i64, i64* %39
%41 = call i8* @auth_errmsg(i64 %40)
%42 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %23, i64 %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%43 = getelementptr i8, i8* %23, i64 %42
%44 = sub i64 %25, %42
%45 = icmp eq i8* %41, null
br i1 %45, label %48, label %46
46: ; preds = %38
%47 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %43, i64 %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %41)
br label %64
48: ; preds = %38
%49 = load i64, i64* %39
%50 = trunc i64 %49 to i32
%51 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %43, i64 %44, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %50)
br label %64
52: ; preds = %13
%53 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 2, i32 0
%54 = load i32, i32* %53
%55 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 2, i32 1
%56 = load i32, i32* %55
%57 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %23, i64 %25, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %54, i32 %56)
br label %64
58: ; preds = %13
%59 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 1, i32 0
%60 = load i32, i32* %59
%61 = getelementptr inbounds %struct.rpc_err, %struct.rpc_err* %3, i64 0, i32 1, i32 1
%62 = load i32, i32* %61
%63 = call i64 (i8*, i64, i8*, ...) @snprintf(i8* %23, i64 %25, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %60, i32 %62)
br label %64
64: ; preds = %58, %52, %46, %48, %32, %27, %13, %13, %13, %13, %13, %13, %13, %13, %13, %13, %13, %13, %13
%65 = getelementptr inbounds i8, i8* %11, i64 255
store i8 0, i8* %65
br label %66
66: ; preds = %2, %64
ret i8* %11
}