#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_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ high;
  int /*<<< orphan*/ low;
};
struct rejected_reply {
  int rj_stat;
  int rj_why;
  TYPE_1__ rj_vers;
};
typedef int /*<<< orphan*/ enum_t;
typedef enum reject_stat { ____Placeholder_reject_stat } reject_stat;
typedef enum auth_stat { ____Placeholder_auth_stat } auth_stat;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
#define AUTH_ERROR 129
int /*<<< orphan*/ FALSE;
#define RPC_MISMATCH 128
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ xdr_enum(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ xdr_rpcvers(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr) {
  enum reject_stat *prj_stat;
  enum auth_stat *prj_why;
  assert(xdrs != NULL);
  assert(rr != NULL);
  prj_stat = &rr->rj_stat;
  if (!xdr_enum(xdrs, (enum_t *)prj_stat))
    return (FALSE);
  switch (rr->rj_stat) {
  case RPC_MISMATCH:
    if (!xdr_rpcvers(xdrs, &(rr->rj_vers.low)))
      return (FALSE);
    return (xdr_rpcvers(xdrs, &(rr->rj_vers.high)));
  case AUTH_ERROR:
    prj_why = &rr->rj_why;
    return (xdr_enum(xdrs, (enum_t *)prj_why));
  }
  assert(0);
  return (FALSE);
}


x86 assembly (clang, -O0):
<xdr_rejected_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <xdr_enum@plt>
cmp    $0x0,%eax
jne    1193 <xdr_rejected_reply+0x63>
mov    0x2e57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    123b <xdr_rejected_reply+0x10b>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x80,%eax
je     11bf <xdr_rejected_reply+0x8f>
jmp    11ac <xdr_rejected_reply+0x7c>
mov    -0x2c(%rbp),%eax
sub    $0x81,%eax
je     1207 <xdr_rejected_reply+0xd7>
jmp    1228 <xdr_rejected_reply+0xf8>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
add    $0x4,%rsi
call   1030 <xdr_rpcvers@plt>
cmp    $0x0,%eax
jne    11ee <xdr_rejected_reply+0xbe>
mov    0x2dfc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    123b <xdr_rejected_reply+0x10b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
call   1030 <xdr_rpcvers@plt>
mov    %eax,-0x4(%rbp)
jmp    123b <xdr_rejected_reply+0x10b>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <xdr_enum@plt>
mov    %eax,-0x4(%rbp)
jmp    123b <xdr_rejected_reply+0x10b>
xor    %edi,%edi
call   1050 <assert@plt>
mov    0x2daa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_rejected_reply>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1050 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1050 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <xdr_enum@plt>
test   %eax,%eax
je     11b8 <xdr_rejected_reply+0x88>
mov    (%rbx),%eax
cmp    $0x81,%eax
je     119b <xdr_rejected_reply+0x6b>
cmp    $0x80,%eax
jne    11b1 <xdr_rejected_reply+0x81>
lea    0xc(%rbx),%rsi
mov    %r14,%rdi
call   1030 <xdr_rpcvers@plt>
test   %eax,%eax
je     11b8 <xdr_rejected_reply+0x88>
add    $0x8,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xdr_rpcvers@plt>
add    $0x4,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <xdr_enum@plt>
xor    %edi,%edi
call   1050 <assert@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rejected_reply = type { i32, i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32 }
@FALSE = global i32 0
define i32 @xdr_rejected_reply(i32* %0, %struct.rejected_reply* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.rejected_reply*
%6 = alloca i32*
%7 = alloca i32*
store i32* %0, i32** %4
store %struct.rejected_reply* %1, %struct.rejected_reply** %5
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%13 = icmp ne %struct.rejected_reply* %12, null
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%17 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %16, i32 0, i32 0
store i32* %17, i32** %6
%18 = load i32*, i32** %4
%19 = load i32*, i32** %6
%20 = call i32 @xdr_enum(i32* %18, i32* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %2
%23 = load i32, i32* @FALSE
store i32 %23, i32* %3
br label %52
24: ; preds = %2
%25 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%26 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %25, i32 0, i32 0
%27 = load i32, i32* %26
switch i32 %27, label %49 [
i32 128, label %28
i32 129, label %43
]
28: ; preds = %24
%29 = load i32*, i32** %4
%30 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%31 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %30, i32 0, i32 2
%32 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %31, i32 0, i32 1
%33 = call i32 @xdr_rpcvers(i32* %29, i32* %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %28
%36 = load i32, i32* @FALSE
store i32 %36, i32* %3
br label %52
37: ; preds = %28
%38 = load i32*, i32** %4
%39 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%40 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %39, i32 0, i32 2
%41 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %40, i32 0, i32 0
%42 = call i32 @xdr_rpcvers(i32* %38, i32* %41)
store i32 %42, i32* %3
br label %52
43: ; preds = %24
%44 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%45 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %44, i32 0, i32 1
store i32* %45, i32** %7
%46 = load i32*, i32** %4
%47 = load i32*, i32** %7
%48 = call i32 @xdr_enum(i32* %46, i32* %47)
store i32 %48, i32* %3
br label %52
49: ; preds = %24
%50 = call i32 @assert(i32 0)
%51 = load i32, i32* @FALSE
store i32 %51, i32* %3
br label %52
52: ; preds = %49, %43, %37, %35, %22
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
%struct.rejected_reply = type { i32, i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32 }
@FALSE = global i32 0
define i32 @xdr_rejected_reply(i32* %0, %struct.rejected_reply* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne %struct.rejected_reply* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %1, i64 0, i32 0
%10 = tail call i32 @xdr_enum(i32* %0, i32* %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* @FALSE
br label %31
14: ; preds = %2
%15 = load i32, i32* %9
switch i32 %15, label %28 [
i32 128, label %16
i32 129, label %25
]
16: ; preds = %14
%17 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %1, i64 0, i32 2, i32 1
%18 = tail call i32 @xdr_rpcvers(i32* %0, i32* %17)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* @FALSE
br label %31
22: ; preds = %16
%23 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %1, i64 0, i32 2, i32 0
%24 = tail call i32 @xdr_rpcvers(i32* %0, i32* %23)
br label %31
25: ; preds = %14
%26 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %1, i64 0, i32 1
%27 = tail call i32 @xdr_enum(i32* %0, i32* %26)
br label %31
28: ; preds = %14
%29 = tail call i32 @assert(i32 0)
%30 = load i32, i32* @FALSE
br label %31
31: ; preds = %28, %25, %22, %20, %12
%32 = phi i32 [ %30, %28 ], [ %27, %25 ], [ %24, %22 ], [ %21, %20 ], [ %13, %12 ]
ret i32 %32
}