#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 long int32_t;
typedef int /*<<< orphan*/ bool_t;
struct TYPE_5__ {
  scalar_t__ x_op;
};
typedef TYPE_1__ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
scalar_t__ XDR_DECODE;
scalar_t__ XDR_ENCODE;
scalar_t__ XDR_FREE;
int /*<<< orphan*/ XDR_GETLONG(TYPE_1__ *, long *);
int /*<<< orphan*/ XDR_PUTLONG(TYPE_1__ *, long *);
bool_t xdr_long(XDR *xdrs, long *lp) {
  if (xdrs->x_op == XDR_ENCODE &&
      (sizeof(int32_t) == sizeof(long) || (int32_t)*lp == *lp))
    return XDR_PUTLONG(xdrs, lp);
  if (xdrs->x_op == XDR_DECODE)
    return XDR_GETLONG(xdrs, lp);
  if (xdrs->x_op == XDR_FREE)
    return TRUE;
  return FALSE;
}


x86 assembly (clang, -O0):
<xdr_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
jne    115c <xdr_long+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <XDR_PUTLONG@plt>
mov    %eax,-0x4(%rbp)
jmp    11bc <xdr_long+0x9c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
jne    1188 <xdr_long+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <XDR_GETLONG@plt>
mov    %eax,-0x4(%rbp)
jmp    11bc <xdr_long+0x9c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2e32(%rip),%rcx
cmp    (%rcx),%rax
jne    11b0 <xdr_long+0x90>
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <xdr_long+0x9c>
mov    0x2e09(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_long>:
mov    (%rdi),%rax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
jne    1134 <xdr_long+0x14>
jmp    1040 <XDR_PUTLONG@plt>
mov    0x2eb5(%rip),%rcx
cmp    (%rcx),%rax
jne    1145 <xdr_long+0x25>
jmp    1030 <XDR_GETLONG@plt>
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <xdr_long+0x3b>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i64 }
@XDR_ENCODE = global i64 0
@XDR_DECODE = global i64 0
@XDR_FREE = global i64 0
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @xdr_long(%struct.TYPE_5__* %0, i64* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_5__*
%5 = alloca i64*
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store i64* %1, i64** %5
%6 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* @XDR_ENCODE
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%13 = load i64*, i64** %5
%14 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %12, i64* %13)
store i32 %14, i32* %3
br label %35
15: ; preds = %2
%16 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%17 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %16, i32 0, i32 0
%18 = load i64, i64* %17
%19 = load i64, i64* @XDR_DECODE
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%23 = load i64*, i64** %5
%24 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %22, i64* %23)
store i32 %24, i32* %3
br label %35
25: ; preds = %15
%26 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%27 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %26, i32 0, i32 0
%28 = load i64, i64* %27
%29 = load i64, i64* @XDR_FREE
%30 = icmp eq i64 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = load i32, i32* @TRUE
store i32 %32, i32* %3
br label %35
33: ; preds = %25
%34 = load i32, i32* @FALSE
store i32 %34, i32* %3
br label %35
35: ; preds = %33, %31, %21, %11
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64 }
@XDR_ENCODE = global i64 0
@XDR_DECODE = global i64 0
@XDR_FREE = global i64 0
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @xdr_long(%struct.TYPE_5__* %0, i64* %1) {
%3 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = load i64, i64* @XDR_ENCODE
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @XDR_PUTLONG(%struct.TYPE_5__* %0, i64* %1)
br label %21
9: ; preds = %2
%10 = load i64, i64* @XDR_DECODE
%11 = icmp eq i64 %4, %10
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @XDR_GETLONG(%struct.TYPE_5__* %0, i64* %1)
br label %21
14: ; preds = %9
%15 = load i64, i64* @XDR_FREE
%16 = icmp eq i64 %4, %15
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = load i32, i32* @TRUE
br label %21
19: ; preds = %14
%20 = load i32, i32* @FALSE
br label %21
21: ; preds = %19, %17, %12, %7
%22 = phi i32 [ %8, %7 ], [ %13, %12 ], [ %18, %17 ], [ %20, %19 ]
ret i32 %22
}