#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 /*<<< orphan*/ rj_why;
  TYPE_1__ rj_vers;
};
typedef int /*<<< orphan*/ enum_t;
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*/ xdr_enum(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ xdr_u_int32_t(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr) {
  if (!xdr_enum(xdrs, (enum_t *)(void *)&(rr->rj_stat)))
    return (FALSE);
  switch (rr->rj_stat) {
  case RPC_MISMATCH:
    if (!xdr_u_int32_t(xdrs, &(rr->rj_vers.low)))
      return (FALSE);
    return (xdr_u_int32_t(xdrs, &(rr->rj_vers.high)));
  case AUTH_ERROR:
    return (xdr_enum(xdrs, (enum_t *)(void *)&(rr->rj_why)));
  }
  return (FALSE);
}


x86 assembly (clang, -O0):
<xdr_rejected_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <xdr_enum@plt>
cmp    $0x0,%eax
jne    1157 <xdr_rejected_reply+0x37>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11f0 <xdr_rejected_reply+0xd0>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x80,%eax
je     1183 <xdr_rejected_reply+0x63>
jmp    1170 <xdr_rejected_reply+0x50>
mov    -0x1c(%rbp),%eax
sub    $0x81,%eax
je     11cb <xdr_rejected_reply+0xab>
jmp    11e4 <xdr_rejected_reply+0xc4>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
add    $0x4,%rsi
call   1040 <xdr_u_int32_t@plt>
cmp    $0x0,%eax
jne    11b2 <xdr_rejected_reply+0x92>
mov    0x2e38(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11f0 <xdr_rejected_reply+0xd0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
call   1040 <xdr_u_int32_t@plt>
mov    %eax,-0x4(%rbp)
jmp    11f0 <xdr_rejected_reply+0xd0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x4,%rsi
call   1030 <xdr_enum@plt>
mov    %eax,-0x4(%rbp)
jmp    11f0 <xdr_rejected_reply+0xd0>
mov    0x2df5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_rejected_reply>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <xdr_enum@plt>
test   %eax,%eax
je     1169 <xdr_rejected_reply+0x49>
mov    (%rbx),%eax
cmp    $0x81,%eax
je     117a <xdr_rejected_reply+0x5a>
cmp    $0x80,%eax
jne    1169 <xdr_rejected_reply+0x49>
lea    0xc(%rbx),%rsi
mov    %r14,%rdi
call   1040 <xdr_u_int32_t@plt>
test   %eax,%eax
je     1169 <xdr_rejected_reply+0x49>
add    $0x8,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <xdr_u_int32_t@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
add    $0x4,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xdr_enum@plt>

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*
store i32* %0, i32** %4
store %struct.rejected_reply* %1, %struct.rejected_reply** %5
%6 = load i32*, i32** %4
%7 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%8 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %7, i32 0, i32 0
%9 = bitcast i32* %8 to i8*
%10 = bitcast i8* %9 to i32*
%11 = call i32 @xdr_enum(i32* %6, i32* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = load i32, i32* @FALSE
store i32 %14, i32* %3
br label %43
15: ; preds = %2
%16 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%17 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %16, i32 0, i32 0
%18 = load i32, i32* %17
switch i32 %18, label %41 [
i32 128, label %19
i32 129, label %34
]
19: ; preds = %15
%20 = load i32*, i32** %4
%21 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%22 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %21, i32 0, i32 2
%23 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %22, i32 0, i32 1
%24 = call i32 @xdr_u_int32_t(i32* %20, i32* %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %19
%27 = load i32, i32* @FALSE
store i32 %27, i32* %3
br label %43
28: ; preds = %19
%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 0
%33 = call i32 @xdr_u_int32_t(i32* %29, i32* %32)
store i32 %33, i32* %3
br label %43
34: ; preds = %15
%35 = load i32*, i32** %4
%36 = load %struct.rejected_reply*, %struct.rejected_reply** %5
%37 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %36, i32 0, i32 1
%38 = bitcast i32* %37 to i8*
%39 = bitcast i8* %38 to i32*
%40 = call i32 @xdr_enum(i32* %35, i32* %39)
store i32 %40, i32* %3
br label %43
41: ; preds = %15
%42 = load i32, i32* @FALSE
store i32 %42, i32* %3
br label %43
43: ; preds = %41, %34, %28, %26, %13
%44 = load i32, i32* %3
ret i32 %44
}

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 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %1, i64 0, i32 0
%4 = tail call i32 @xdr_enum(i32* %0, i32* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load i32, i32* @FALSE
br label %24
8: ; preds = %2
%9 = load i32, i32* %3
switch i32 %9, label %22 [
i32 128, label %10
i32 129, label %19
]
10: ; preds = %8
%11 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %1, i64 0, i32 2, i32 1
%12 = tail call i32 @xdr_u_int32_t(i32* %0, i32* %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* @FALSE
br label %24
16: ; preds = %10
%17 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %1, i64 0, i32 2, i32 0
%18 = tail call i32 @xdr_u_int32_t(i32* %0, i32* %17)
br label %24
19: ; preds = %8
%20 = getelementptr inbounds %struct.rejected_reply, %struct.rejected_reply* %1, i64 0, i32 1
%21 = tail call i32 @xdr_enum(i32* %0, i32* %20)
br label %24
22: ; preds = %8
%23 = load i32, i32* @FALSE
br label %24
24: ; preds = %22, %19, %16, %14, %6
%25 = phi i32 [ %23, %22 ], [ %21, %19 ], [ %18, %16 ], [ %15, %14 ], [ %7, %6 ]
ret i32 %25
}