#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_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ u_long;
typedef int bool_t;
struct TYPE_7__ {
  int x_op;
  TYPE_1__ *x_ops;
};
typedef TYPE_2__ XDR;
struct TYPE_6__ {
  int (*x_putlong)(TYPE_2__ *, long *);
  int (*x_getlong)(TYPE_2__ *, long *);
};

/* Variables and functions */
#define XDR_DECODE 130
#define XDR_ENCODE 129
#define XDR_FREE 128
int stub1(TYPE_2__ *, long *);
int stub2(TYPE_2__ *, long *);
bool_t xdr_u_long(XDR *xdrs, u_long *ulp) {
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    return ((*(xdrs)->x_ops->x_putlong)(xdrs, (long *)ulp));
  case XDR_DECODE:
    return ((*(xdrs)->x_ops->x_getlong)(xdrs, (long *)ulp));
  case XDR_FREE:
    return (1);
  }
  return (0);
}


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     118a <xdr_u_long+0x8a>
jmp    1129 <xdr_u_long+0x29>
mov    -0x1c(%rbp),%eax
sub    $0x81,%eax
je     114f <xdr_u_long+0x4f>
jmp    113c <xdr_u_long+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x82,%eax
je     116c <xdr_u_long+0x6c>
jmp    1196 <xdr_u_long+0x96>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    119d <xdr_u_long+0x9d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    119d <xdr_u_long+0x9d>
movl   $0x1,-0x4(%rbp)
jmp    119d <xdr_u_long+0x9d>
movl   $0x0,-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     1120 <xdr_u_long+0x20>
cmp    $0x82,%eax
je     1126 <xdr_u_long+0x26>
cmp    $0x81,%eax
jne    1130 <xdr_u_long+0x30>
mov    0x8(%rdi),%rax
mov    (%rax),%rax
jmp    *%rax
mov    $0x1,%eax
ret
mov    0x8(%rdi),%rax
mov    0x8(%rax),%rax
jmp    *%rax
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_7__ = type { i32, %struct.TYPE_6__* }
%struct.TYPE_6__ = type { i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)* }
define i32 @xdr_u_long(%struct.TYPE_7__* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_7__*
%5 = alloca i32*
store %struct.TYPE_7__* %0, %struct.TYPE_7__** %4
store i32* %1, i32** %5
%6 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%7 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %6, i32 0, i32 0
%8 = load i32, i32* %7
switch i32 %8, label %30 [
i32 129, label %9
i32 130, label %19
i32 128, label %29
]
9: ; preds = %2
%10 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%11 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %10, i32 0, i32 1
%12 = load %struct.TYPE_6__*, %struct.TYPE_6__** %11
%13 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %12, i32 0, i32 0
%14 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %13
%15 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%16 = load i32*, i32** %5
%17 = bitcast i32* %16 to i64*
%18 = call i32 %14(%struct.TYPE_7__* %15, i64* %17)
store i32 %18, i32* %3
br label %31
19: ; preds = %2
%20 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%21 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %20, i32 0, i32 1
%22 = load %struct.TYPE_6__*, %struct.TYPE_6__** %21
%23 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %22, i32 0, i32 1
%24 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %23
%25 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%26 = load i32*, i32** %5
%27 = bitcast i32* %26 to i64*
%28 = call i32 %24(%struct.TYPE_7__* %25, i64* %27)
store i32 %28, i32* %3
br label %31
29: ; preds = %2
store i32 1, i32* %3
br label %31
30: ; preds = %2
store i32 0, i32* %3
br label %31
31: ; preds = %30, %29, %19, %9
%32 = load i32, i32* %3
ret i32 %32
}

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