#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 */

/* Type definitions */
typedef int /*<<< orphan*/ xdrproc_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ xdr_bool(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ xdr_reference(int /*<<< orphan*/ *, char **, unsigned int,
                                 int /*<<< orphan*/);
bool_t xdr_pointer(XDR *xdrs, char **objpp, unsigned int obj_size,
                   xdrproc_t xdr_obj) {
  bool_t more_data;
  more_data = (*objpp != NULL);
  if (!xdr_bool(xdrs, &more_data)) {
    return (FALSE);
  }
  if (!more_data) {
    *objpp = NULL;
    return (TRUE);
  }
  return (xdr_reference(xdrs, objpp, obj_size, xdr_obj));
}


x86 assembly (clang, -O0):
<xdr_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <xdr_bool@plt>
cmp    $0x0,%eax
jne    1170 <xdr_pointer+0x50>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ac <xdr_pointer+0x8c>
cmpl   $0x0,-0x24(%rbp)
jne    1196 <xdr_pointer+0x76>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    0x2e5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ac <xdr_pointer+0x8c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1030 <xdr_reference@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_pointer>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
cmpq   $0x0,(%rsi)
setne  %al
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1040 <xdr_bool@plt>
test   %eax,%eax
je     1168 <xdr_pointer+0x48>
cmpl   $0x0,0x4(%rsp)
je     1171 <xdr_pointer+0x51>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1030 <xdr_reference@plt>
jmp    1181 <xdr_pointer+0x61>
mov    0x2e69(%rip),%rax
jmp    117f <xdr_pointer+0x5f>
movq   $0x0,(%rbx)
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_pointer(i32* %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i8**, i8*** %7
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
%14 = zext i1 %13 to i32
store i32 %14, i32* %10
%15 = load i32*, i32** %6
%16 = call i32 @xdr_bool(i32* %15, i32* %10)
%17 = icmp ne i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %4
%19 = load i32, i32* @FALSE
store i32 %19, i32* %5
br label %32
20: ; preds = %4
%21 = load i32, i32* %10
%22 = icmp ne i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i8**, i8*** %7
store i8* null, i8** %24
%25 = load i32, i32* @TRUE
store i32 %25, i32* %5
br label %32
26: ; preds = %20
%27 = load i32*, i32** %6
%28 = load i8**, i8*** %7
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = call i32 @xdr_reference(i32* %27, i8** %28, i32 %29, i32 %30)
store i32 %31, i32* %5
br label %32
32: ; preds = %26, %23, %18
%33 = load i32, i32* %5
ret i32 %33
}

LLVM IR (-O2):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_pointer(i32* %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = load i8*, i8** %1
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = call i32 @xdr_bool(i32* %0, i32* %5)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i32, i32* @FALSE
br label %21
14: ; preds = %4
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
store i8* null, i8** %1
%18 = load i32, i32* @TRUE
br label %21
19: ; preds = %14
%20 = call i32 @xdr_reference(i32* %0, i8** %1, i32 %2, i32 %3)
br label %21
21: ; preds = %19, %17, %12
%22 = phi i32 [ %20, %19 ], [ %18, %17 ], [ %13, %12 ]
ret i32 %22
}