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

/* Type definitions */
typedef int /*<<< orphan*/ xdrproc_t;
typedef int /*<<< orphan*/ u_int;
struct pmaplist {
  struct pmaplist *pml_next;
};
typedef int /*<<< orphan*/ caddr_t;
typedef scalar_t__ bool_t;
struct TYPE_5__ {
  scalar_t__ x_op;
};
typedef TYPE_1__ XDR;

/* Variables and functions */
scalar_t__ FALSE;
scalar_t__ TRUE;
scalar_t__ XDR_FREE;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ xdr_bool(TYPE_1__ *, scalar_t__ *);
scalar_t__ xdr_pmap;
int /*<<< orphan*/ xdr_reference(TYPE_1__ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
bool_t xdr_pmaplist(XDR *xdrs, struct pmaplist **rp) {
  bool_t more_elements;
  int freeing;
  struct pmaplist **next = NULL;
  assert(xdrs != NULL);
  assert(rp != NULL);
  freeing = (xdrs->x_op == XDR_FREE);
  for (;;) {
    more_elements = (bool_t)(*rp != NULL);
    if (!xdr_bool(xdrs, &more_elements))
      return (FALSE);
    if (!more_elements)
      return (TRUE);
    if (freeing)
      next = &((*rp)->pml_next);
    if (!xdr_reference(xdrs, (caddr_t *)rp, (u_int)sizeof(struct pmaplist),
                       (xdrproc_t)xdr_pmap))
      return (FALSE);
    rp = (freeing) ? next : &((*rp)->pml_next);
  }
}


x86 assembly (clang, -O0):
<xdr_pmaplist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x30(%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    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2e5e(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <xdr_bool@plt>
cmp    $0x0,%eax
jne    11c7 <xdr_pmaplist+0x97>
mov    0x2e0d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1263 <xdr_pmaplist+0x133>
cmpq   $0x0,-0x20(%rbp)
jne    11e5 <xdr_pmaplist+0xb5>
mov    0x2e0f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1263 <xdr_pmaplist+0x133>
cmpl   $0x0,-0x24(%rbp)
je     11fa <xdr_pmaplist+0xca>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2dc7(%rip),%rax
mov    (%rax),%rax
mov    %eax,%ecx
mov    $0x8,%edx
call   1030 <xdr_reference@plt>
cmp    $0x0,%eax
jne    1234 <xdr_pmaplist+0x104>
mov    0x2da0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1263 <xdr_pmaplist+0x133>
cmpl   $0x0,-0x24(%rbp)
je     124b <xdr_pmaplist+0x11b>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1256 <xdr_pmaplist+0x126>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1188 <xdr_pmaplist+0x58>
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_pmaplist>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
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),%r12
mov    0x2e71(%rip),%rax
mov    (%rax),%r13
xor    %eax,%eax
cmpq   $0x0,(%rbx)
setne  %al
mov    %rax,(%rsp)
mov    %rsp,%rsi
mov    %r14,%rdi
call   1040 <xdr_bool@plt>
mov    0x2e3f(%rip),%rcx
test   %eax,%eax
je     121d <xdr_pmaplist+0xed>
mov    %rsp,%r15
jmp    11df <xdr_pmaplist+0xaf>
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%rbp
mov    0x2e26(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <xdr_reference@plt>
mov    %rbp,%rbx
test   %eax,%eax
je     120d <xdr_pmaplist+0xdd>
xor    %eax,%eax
cmpq   $0x0,(%rbx)
setne  %al
mov    %rax,(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <xdr_bool@plt>
test   %eax,%eax
je     120d <xdr_pmaplist+0xdd>
cmpq   $0x0,(%rsp)
je     1216 <xdr_pmaplist+0xe6>
cmp    %r13,%r12
je     11a0 <xdr_pmaplist+0x70>
mov    0x2dde(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <xdr_reference@plt>
test   %eax,%eax
je     120d <xdr_pmaplist+0xdd>
mov    (%rbx),%rbx
jmp    11c3 <xdr_pmaplist+0x93>
mov    0x2db4(%rip),%rcx
jmp    121d <xdr_pmaplist+0xed>
mov    0x2dcb(%rip),%rcx
mov    (%rcx),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i64 }
%struct.pmaplist = type { %struct.pmaplist* }
@XDR_FREE = global i64 0
@FALSE = global i64 0
@TRUE = global i64 0
@xdr_pmap = global i64 0
define i64 @xdr_pmaplist(%struct.TYPE_5__* %0, %struct.pmaplist** %1) {
%3 = alloca i64
%4 = alloca %struct.TYPE_5__*
%5 = alloca %struct.pmaplist**
%6 = alloca i64
%7 = alloca i32
%8 = alloca %struct.pmaplist**
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store %struct.pmaplist** %1, %struct.pmaplist*** %5
store %struct.pmaplist** null, %struct.pmaplist*** %8
%9 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%10 = icmp ne %struct.TYPE_5__* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load %struct.pmaplist**, %struct.pmaplist*** %5
%14 = icmp ne %struct.pmaplist** %13, null
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%18 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %17, i32 0, i32 0
%19 = load i64, i64* %18
%20 = load i64, i64* @XDR_FREE
%21 = icmp eq i64 %19, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %7
br label %23
23: ; preds = %65, %2
%24 = load %struct.pmaplist**, %struct.pmaplist*** %5
%25 = load %struct.pmaplist*, %struct.pmaplist** %24
%26 = icmp ne %struct.pmaplist* %25, null
%27 = zext i1 %26 to i32
%28 = sext i32 %27 to i64
store i64 %28, i64* %6
%29 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%30 = call i32 @xdr_bool(%struct.TYPE_5__* %29, i64* %6)
%31 = icmp ne i32 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %23
%33 = load i64, i64* @FALSE
store i64 %33, i64* %3
br label %67
34: ; preds = %23
%35 = load i64, i64* %6
%36 = icmp ne i64 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %34
%38 = load i64, i64* @TRUE
store i64 %38, i64* %3
br label %67
39: ; preds = %34
%40 = load i32, i32* %7
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = load %struct.pmaplist**, %struct.pmaplist*** %5
%44 = load %struct.pmaplist*, %struct.pmaplist** %43
%45 = getelementptr inbounds %struct.pmaplist, %struct.pmaplist* %44, i32 0, i32 0
store %struct.pmaplist** %45, %struct.pmaplist*** %8
br label %46
46: ; preds = %42, %39
%47 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%48 = load %struct.pmaplist**, %struct.pmaplist*** %5
%49 = bitcast %struct.pmaplist** %48 to i32*
%50 = load i64, i64* @xdr_pmap
%51 = trunc i64 %50 to i32
%52 = call i32 @xdr_reference(%struct.TYPE_5__* %47, i32* %49, i32 8, i32 %51)
%53 = icmp ne i32 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %46
%55 = load i64, i64* @FALSE
store i64 %55, i64* %3
br label %67
56: ; preds = %46
%57 = load i32, i32* %7
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = load %struct.pmaplist**, %struct.pmaplist*** %8
br label %65
61: ; preds = %56
%62 = load %struct.pmaplist**, %struct.pmaplist*** %5
%63 = load %struct.pmaplist*, %struct.pmaplist** %62
%64 = getelementptr inbounds %struct.pmaplist, %struct.pmaplist* %63, i32 0, i32 0
br label %65
65: ; preds = %61, %59
%66 = phi %struct.pmaplist** [ %60, %59 ], [ %64, %61 ]
store %struct.pmaplist** %66, %struct.pmaplist*** %5
br label %23
67: ; preds = %54, %37, %32
%68 = load i64, i64* %3
ret i64 %68
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64 }
%struct.pmaplist = type { %struct.pmaplist* }
@XDR_FREE = global i64 0
@FALSE = global i64 0
@TRUE = global i64 0
@xdr_pmap = global i64 0
define i64 @xdr_pmaplist(%struct.TYPE_5__* %0, %struct.pmaplist** %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = icmp ne %struct.TYPE_5__* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ne %struct.pmaplist** %1, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0
%12 = load i64, i64* %11
%13 = load i64, i64* @XDR_FREE
%14 = icmp eq i64 %12, %13
%15 = load %struct.pmaplist*, %struct.pmaplist** %1
%16 = icmp ne %struct.pmaplist* %15, null
%17 = zext i1 %16 to i64
store i64 %17, i64* %3
%18 = call i32 @xdr_bool(%struct.TYPE_5__* %0, i64* %3)
%19 = icmp eq i32 %18, 0
br i1 %19, label %48, label %20
20: ; preds = %2, %40
%21 = phi %struct.pmaplist** [ %42, %40 ], [ %1, %2 ]
%22 = load i64, i64* %3
%23 = icmp eq i64 %22, 0
br i1 %23, label %48, label %24
24: ; preds = %20
br i1 %14, label %25, label %32
25: ; preds = %24
%26 = load %struct.pmaplist*, %struct.pmaplist** %21
%27 = bitcast %struct.pmaplist** %21 to i32*
%28 = load i64, i64* @xdr_pmap
%29 = trunc i64 %28 to i32
%30 = call i32 @xdr_reference(%struct.TYPE_5__* %0, i32* %27, i32 8, i32 %29)
%31 = icmp eq i32 %30, 0
br i1 %31, label %48, label %40
32: ; preds = %24
%33 = bitcast %struct.pmaplist** %21 to i32*
%34 = load i64, i64* @xdr_pmap
%35 = trunc i64 %34 to i32
%36 = call i32 @xdr_reference(%struct.TYPE_5__* %0, i32* %33, i32 8, i32 %35)
%37 = icmp eq i32 %36, 0
br i1 %37, label %48, label %38
38: ; preds = %32
%39 = load %struct.pmaplist*, %struct.pmaplist** %21
br label %40
40: ; preds = %25, %38
%41 = phi %struct.pmaplist* [ %39, %38 ], [ %26, %25 ]
%42 = getelementptr inbounds %struct.pmaplist, %struct.pmaplist* %41, i64 0, i32 0
%43 = load %struct.pmaplist*, %struct.pmaplist** %42
%44 = icmp ne %struct.pmaplist* %43, null
%45 = zext i1 %44 to i64
store i64 %45, i64* %3
%46 = call i32 @xdr_bool(%struct.TYPE_5__* %0, i64* %3)
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %20
48: ; preds = %40, %20, %25, %32, %2
%49 = phi i64* [ @FALSE, %2 ], [ @FALSE, %32 ], [ @FALSE, %25 ], [ @TRUE, %20 ], [ @FALSE, %40 ]
%50 = load i64, i64* %49
ret i64 %50
}