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

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
#define XDR_DECODE 130
#define XDR_ENCODE 129
#define XDR_FREE 128
int /*<<< orphan*/ XDR_GETLONG(TYPE_1__ *, long *);
int /*<<< orphan*/ XDR_PUTLONG(TYPE_1__ *, long *);
bool_t xdr_u_long(XDR *xdrs, u_long *ulp) {
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    return (XDR_PUTLONG(xdrs, (long *)ulp));
  case XDR_DECODE:
    return (XDR_GETLONG(xdrs, (long *)ulp));
  case XDR_FREE:
    return (TRUE);
  }
  return (FALSE);
}


x86 assembly (clang, -O0):
<xdr_u_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x80,%eax
je     1199 <xdr_u_long+0x79>
jmp    1149 <xdr_u_long+0x29>
mov    -0x1c(%rbp),%eax
sub    $0x81,%eax
je     116f <xdr_u_long+0x4f>
jmp    115c <xdr_u_long+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x82,%eax
je     1184 <xdr_u_long+0x64>
jmp    11aa <xdr_u_long+0x8a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <XDR_PUTLONG@plt>
mov    %eax,-0x4(%rbp)
jmp    11b6 <xdr_u_long+0x96>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <XDR_GETLONG@plt>
mov    %eax,-0x4(%rbp)
jmp    11b6 <xdr_u_long+0x96>
mov    0x2e48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11b6 <xdr_u_long+0x96>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_u_long>:
mov    (%rdi),%eax
cmp    $0x80,%eax
je     113c <xdr_u_long+0x1c>
cmp    $0x82,%eax
je     1146 <xdr_u_long+0x26>
cmp    $0x81,%eax
jne    114b <xdr_u_long+0x2b>
jmp    1040 <XDR_PUTLONG@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
ret
jmp    1030 <XDR_GETLONG@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32 }
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @xdr_u_long(%struct.TYPE_5__* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_5__*
%5 = alloca i32*
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store i32* %1, i32** %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 i32, i32* %7
switch i32 %8, label %21 [
i32 129, label %9
i32 130, label %14
i32 128, label %19
]
9: ; preds = %2
%10 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%11 = load i32*, i32** %5
%12 = bitcast i32* %11 to i64*
%13 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %10, i64* %12)
store i32 %13, i32* %3
br label %23
14: ; preds = %2
%15 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%16 = load i32*, i32** %5
%17 = bitcast i32* %16 to i64*
%18 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %15, i64* %17)
store i32 %18, i32* %3
br label %23
19: ; preds = %2
%20 = load i32, i32* @TRUE
store i32 %20, i32* %3
br label %23
21: ; preds = %2
%22 = load i32, i32* @FALSE
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %19, %14, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32 }
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @xdr_u_long(%struct.TYPE_5__* %0, i32* %1) {
%3 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 129, label %5
i32 130, label %8
i32 128, label %11
]
5: ; preds = %2
%6 = bitcast i32* %1 to i64*
%7 = tail call i32 @XDR_PUTLONG(%struct.TYPE_5__* %0, i64* %6)
br label %15
8: ; preds = %2
%9 = bitcast i32* %1 to i64*
%10 = tail call i32 @XDR_GETLONG(%struct.TYPE_5__* %0, i64* %9)
br label %15
11: ; preds = %2
%12 = load i32, i32* @TRUE
br label %15
13: ; preds = %2
%14 = load i32, i32* @FALSE
br label %15
15: ; preds = %13, %11, %8, %5
%16 = phi i32 [ %14, %13 ], [ %12, %11 ], [ %10, %8 ], [ %7, %5 ]
ret i32 %16
}