#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_3__ {
  int /*<<< orphan*/ high;
  int /*<<< orphan*/ low;
};
struct TYPE_4__ {
  int /*<<< orphan*/ where;
  int /*<<< orphan*/ (*proc)(int /*<<< orphan*/ *, int /*<<< orphan*/);
};
struct accepted_reply {
  int ar_stat;
  TYPE_1__ ar_vers;
  TYPE_2__ ar_results;
  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->ar_results.proc))(xdrs, ar->ar_results.where));
  case PROG_MISMATCH:
    if (!xdr_u_long(xdrs, &(ar->ar_vers.low)))
      return FALSE;
    return (xdr_u_long(xdrs, &(ar->ar_vers.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    $0x4,%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    $0x4,%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    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1050 <xdr_u_long@plt>
test   %eax,%eax
je     119f <xdr_accepted_reply+0x6f>
add    $0x4,%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_3__, %struct.TYPE_4__, i32 }
%struct.TYPE_3__ = type { i32, i32 }
%struct.TYPE_4__ = 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 3
%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 %53
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 %53
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 %51 [
i32 128, label %25
i32 129, label %36
]
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 2
%28 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %27, i32 0, i32 1
%29 = load i32 (i32*, i32)*, i32 (i32*, i32)** %28
%30 = load i32*, i32** %4
%31 = load %struct.accepted_reply*, %struct.accepted_reply** %5
%32 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %31, i32 0, i32 2
%33 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %32, i32 0, i32 0
%34 = load i32, i32* %33
%35 = call i32 %29(i32* %30, i32 %34)
store i32 %35, i32* %3
br label %53
36: ; preds = %21
%37 = load i32*, i32** %4
%38 = load %struct.accepted_reply*, %struct.accepted_reply** %5
%39 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %38, i32 0, i32 1
%40 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %39, i32 0, i32 1
%41 = call i32 @xdr_u_long(i32* %37, i32* %40)
%42 = icmp ne i32 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %36
%44 = load i32, i32* @FALSE
store i32 %44, i32* %3
br label %53
45: ; preds = %36
%46 = load i32*, i32** %4
%47 = load %struct.accepted_reply*, %struct.accepted_reply** %5
%48 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %47, i32 0, i32 1
%49 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %48, i32 0, i32 0
%50 = call i32 @xdr_u_long(i32* %46, i32* %49)
store i32 %50, i32* %3
br label %53
51: ; preds = %21
%52 = load i32, i32* @TRUE
store i32 %52, i32* %3
br label %53
53: ; preds = %51, %45, %43, %25, %19, %11
%54 = load i32, i32* %3
ret i32 %54
}

LLVM IR (-O2):
%struct.accepted_reply = type { i32, %struct.TYPE_3__, %struct.TYPE_4__, i32 }
%struct.TYPE_3__ = type { i32, i32 }
%struct.TYPE_4__ = 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 3
%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 2, i32 1
%18 = load i32 (i32*, i32)*, i32 (i32*, i32)** %17
%19 = getelementptr inbounds %struct.accepted_reply, %struct.accepted_reply* %1, i64 0, i32 2, 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 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
%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
}