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

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ high;
  int /*<<< orphan*/ low;
};
struct TYPE_6__ {
  int /*<<< orphan*/ where;
  int /*<<< orphan*/ (*proc)(int /*<<< orphan*/ *, int /*<<< orphan*/);
};
struct TYPE_5__ {
  TYPE_1__ AR_versions;
  TYPE_3__ AR_results;
};
struct accepted_reply {
  int ar_stat;
  TYPE_2__ ru;
  int /*<<< orphan*/ ar_verf;
};
typedef int /*<<< orphan*/ enum_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
#define PROG_MISMATCH 129
#define SUCCESS 128
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ stub1(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ xdr_enum(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ xdr_opaque_auth(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ xdr_u_long(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar) {
  if (!xdr_opaque_auth(xdrs, &(ar->ar_verf)))
    return FALSE;
  if (!xdr_enum(xdrs, (enum_t *)&(ar->ar_stat)))
    return FALSE;
  switch (ar->ar_stat) {
  case SUCCESS:
    return ((*(ar->ru.AR_results.proc))(xdrs, ar->ru.AR_results.where));
  case PROG_MISMATCH:
    if (!xdr_u_long(xdrs, &(ar->ru.AR_versions.low)))
      return FALSE;
    return (xdr_u_long(xdrs, &(ar->ru.AR_versions.high)));
  default:
    return TRUE;
  }
  return TRUE;
}


x86 assembly (clang, -O0):
<xdr_accepted_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
add    $0x20,%rsi
call   1040 <xdr_opaque_auth@plt>
cmp    $0x0,%eax
jne    116b <xdr_accepted_reply+0x3b>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    122f <xdr_accepted_reply+0xff>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <xdr_enum@plt>
cmp    $0x0,%eax
jne    1192 <xdr_accepted_reply+0x62>
mov    0x2e50(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    122f <xdr_accepted_reply+0xff>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x80,%eax
je     11be <xdr_accepted_reply+0x8e>
jmp    11ab <xdr_accepted_reply+0x7b>
mov    -0x1c(%rbp),%eax
sub    $0x81,%eax
je     11db <xdr_accepted_reply+0xab>
jmp    1223 <xdr_accepted_reply+0xf3>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    0x10(%rcx),%esi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    122f <xdr_accepted_reply+0xff>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
add    $0x4,%rsi
call   1050 <xdr_u_long@plt>
cmp    $0x0,%eax
jne    120a <xdr_accepted_reply+0xda>
mov    0x2dd8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    122f <xdr_accepted_reply+0xff>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
call   1050 <xdr_u_long@plt>
mov    %eax,-0x4(%rbp)
jmp    122f <xdr_accepted_reply+0xff>
mov    0x2dbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_accepted_reply>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x20,%rsi
call   1040 <xdr_opaque_auth@plt>
test   %eax,%eax
je     119f <xdr_accepted_reply+0x6f>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <xdr_enum@plt>
test   %eax,%eax
je     119f <xdr_accepted_reply+0x6f>
mov    (%rbx),%eax
cmp    $0x81,%eax
je     1179 <xdr_accepted_reply+0x49>
cmp    $0x80,%eax
jne    11b0 <xdr_accepted_reply+0x80>
mov    0x18(%rbx),%rax
mov    0x10(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax
lea    0xc(%rbx),%rsi
mov    %r14,%rdi
call   1050 <xdr_u_long@plt>
test   %eax,%eax
je     119f <xdr_accepted_reply+0x6f>
add    $0x8,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <xdr_u_long@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e31(%rip),%rax
jmp    11a6 <xdr_accepted_reply+0x76>

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

LLVM IR (-O2):
%struct.accepted_reply = type { i32, %struct.TYPE_5__, i32 }
%struct.TYPE_5__ = type { %struct.TYPE_4__, %struct.TYPE_6__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_6__ = type { i32, i32 (i32*, i32)* }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_accepted_reply(i32* %0, %struct.accepted_reply* %1) {
%3 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %1, i64 0, i32 2
%4 = tail call i32 @xdr_opaque_auth(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 %33
8: ; preds = %2
%9 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_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 = %8
%13 = load i32, i32* @FALSE
br label %33
14: ; preds = %8
%15 = load i32, i32* %9
switch i32 %15, label %31 [
i32 128, label %16
i32 129, label %22
]
16: ; preds = %14
%17 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %1, i64 0, i32 1, i32 1, i32 1
%18 = load i32 (i32*, i32)*, i32 (i32*, i32)** %17
%19 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %1, i64 0, i32 1, i32 1, i32 0
%20 = load i32, i32* %19
%21 = tail call i32 %18(i32* %0, i32 %20)
br label %33
22: ; preds = %14
%23 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %1, i64 0, i32 1, i32 0, i32 1
%24 = tail call i32 @xdr_u_long(i32* %0, i32* %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load i32, i32* @FALSE
br label %33
28: ; preds = %22
%29 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %1, i64 0, i32 1, i32 0, i32 0
%30 = tail call i32 @xdr_u_long(i32* %0, i32* %29)
br label %33
31: ; preds = %14
%32 = load i32, i32* @TRUE
br label %33
33: ; preds = %31, %28, %26, %16, %12, %6
%34 = phi i32 [ %32, %31 ], [ %30, %28 ], [ %27, %26 ], [ %21, %16 ], [ %13, %12 ], [ %7, %6 ]
ret i32 %34
}