#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*/ 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;
  register int freeing = (xdrs->x_op == XDR_FREE);
  register struct pmaplist **next = NULL;
  while (TRUE) {
    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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
mov    0x2e8d(%rip),%rax
cmpq   $0x0,(%rax)
je     1240 <xdr_pmaplist+0x120>
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    11a4 <xdr_pmaplist+0x84>
mov    0x2e30(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1240 <xdr_pmaplist+0x120>
cmpq   $0x0,-0x20(%rbp)
jne    11c2 <xdr_pmaplist+0xa2>
mov    0x2e32(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1240 <xdr_pmaplist+0x120>
cmpl   $0x0,-0x24(%rbp)
je     11d7 <xdr_pmaplist+0xb7>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2dea(%rip),%rax
mov    (%rax),%rax
mov    %eax,%ecx
mov    $0x8,%edx
call   1030 <xdr_reference@plt>
cmp    $0x0,%eax
jne    1211 <xdr_pmaplist+0xf1>
mov    0x2dc3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1240 <xdr_pmaplist+0x120>
cmpl   $0x0,-0x24(%rbp)
je     1228 <xdr_pmaplist+0x108>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1233 <xdr_pmaplist+0x113>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1154 <xdr_pmaplist+0x34>
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
sub    $0x18,%rsp
mov    0x2eb3(%rip),%r15
cmpq   $0x0,(%r15)
je     11ec <xdr_pmaplist+0xcc>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%r13
mov    0x2e89(%rip),%rax
mov    (%rax),%r12
lea    0x8(%rsp),%rbp
mov    %r12,0x10(%rsp)
jmp    119a <xdr_pmaplist+0x7a>
xchg   %ax,%ax
mov    %r13,%r12
mov    %r15,%r13
mov    (%rbx),%r15
mov    0x2e60(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <xdr_reference@plt>
mov    %r15,%rbx
mov    %r13,%r15
mov    %r12,%r13
mov    0x10(%rsp),%r12
test   %eax,%eax
je     11ee <xdr_pmaplist+0xce>
cmpq   $0x0,(%r15)
je     11fd <xdr_pmaplist+0xdd>
xor    %eax,%eax
cmpq   $0x0,(%rbx)
setne  %al
mov    %rax,0x8(%rsp)
mov    %r14,%rdi
mov    %rbp,%rsi
call   1040 <xdr_bool@plt>
test   %eax,%eax
je     11ee <xdr_pmaplist+0xce>
cmpq   $0x0,0x8(%rsp)
je     11fa <xdr_pmaplist+0xda>
cmp    %r12,%r13
je     1160 <xdr_pmaplist+0x40>
mov    0x2e05(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <xdr_reference@plt>
test   %eax,%eax
je     11ee <xdr_pmaplist+0xce>
mov    (%rbx),%rbx
cmpq   $0x0,(%r15)
jne    119a <xdr_pmaplist+0x7a>
jmp    11fd <xdr_pmaplist+0xdd>
jmp    11fd <xdr_pmaplist+0xdd>
mov    0x2dd3(%rip),%rax
mov    (%rax),%rax
jmp    11fd <xdr_pmaplist+0xdd>
mov    (%r15),%rax
add    $0x18,%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
@TRUE = global i64 0
@FALSE = 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
%9 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%10 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = load i64, i64* @XDR_FREE
%13 = icmp eq i64 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %7
store %struct.pmaplist** null, %struct.pmaplist*** %8
br label %15
15: ; preds = %60, %2
%16 = load i64, i64* @TRUE
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %62
18: ; preds = %15
%19 = load %struct.pmaplist**, %struct.pmaplist*** %5
%20 = load %struct.pmaplist*, %struct.pmaplist** %19
%21 = icmp ne %struct.pmaplist* %20, null
%22 = zext i1 %21 to i32
%23 = sext i32 %22 to i64
store i64 %23, i64* %6
%24 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%25 = call i32 @xdr_bool(%struct.TYPE_5__* %24, i64* %6)
%26 = icmp ne i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %18
%28 = load i64, i64* @FALSE
store i64 %28, i64* %3
br label %62
29: ; preds = %18
%30 = load i64, i64* %6
%31 = icmp ne i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = load i64, i64* @TRUE
store i64 %33, i64* %3
br label %62
34: ; preds = %29
%35 = load i32, i32* %7
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load %struct.pmaplist**, %struct.pmaplist*** %5
%39 = load %struct.pmaplist*, %struct.pmaplist** %38
%40 = getelementptr inbounds %struct.pmaplist, %struct.pmaplist* %39, i32 0, i32 0
store %struct.pmaplist** %40, %struct.pmaplist*** %8
br label %41
41: ; preds = %37, %34
%42 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%43 = load %struct.pmaplist**, %struct.pmaplist*** %5
%44 = bitcast %struct.pmaplist** %43 to i32*
%45 = load i64, i64* @xdr_pmap
%46 = trunc i64 %45 to i32
%47 = call i32 @xdr_reference(%struct.TYPE_5__* %42, i32* %44, i32 8, i32 %46)
%48 = icmp ne i32 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %41
%50 = load i64, i64* @FALSE
store i64 %50, i64* %3
br label %62
51: ; preds = %41
%52 = load i32, i32* %7
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = load %struct.pmaplist**, %struct.pmaplist*** %8
br label %60
56: ; preds = %51
%57 = load %struct.pmaplist**, %struct.pmaplist*** %5
%58 = load %struct.pmaplist*, %struct.pmaplist** %57
%59 = getelementptr inbounds %struct.pmaplist, %struct.pmaplist* %58, i32 0, i32 0
br label %60
60: ; preds = %56, %54
%61 = phi %struct.pmaplist** [ %55, %54 ], [ %59, %56 ]
store %struct.pmaplist** %61, %struct.pmaplist*** %5
br label %15
62: ; preds = %27, %32, %49, %15
%63 = load i64, i64* %3
ret i64 %63
}

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