#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_9__ TYPE_2__;
typedef struct TYPE_8__ TYPE_1__;

/* Type definitions */
typedef int uint64_t;
typedef int u_long;
typedef int bool_t;
struct TYPE_9__ {
  int x_op;
  TYPE_1__ *x_ops;
};
typedef TYPE_2__ XDR;
struct TYPE_8__ {
  int (*x_putlong)(TYPE_2__ *, long *);
  int /*<<< orphan*/ (*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 *);
int /*<<< orphan*/ stub3(TYPE_2__ *, long *);
int /*<<< orphan*/ stub4(TYPE_2__ *, long *);
bool_t xdr_u_int64_t(XDR *xdrs, uint64_t *ullp) {
  u_long ul[2];
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    ul[0] = (u_long)(*ullp >> 32) & 0xffffffff;
    ul[1] = (u_long)(*ullp) & 0xffffffff;
    if ((*(xdrs)->x_ops->x_putlong)(xdrs, (long *)&ul[0]) == 0)
      return (0);
    return ((*(xdrs)->x_ops->x_putlong)(xdrs, (long *)&ul[1]));
  case XDR_DECODE:
    if ((*(xdrs)->x_ops->x_getlong)(xdrs, (long *)&ul[0]) == 0)
      return (0);
    if ((*(xdrs)->x_ops->x_getlong)(xdrs, (long *)&ul[1]) == 0)
      return (0);
    *ullp = (uint64_t)(((uint64_t)ul[0] << 32) | ((uint64_t)ul[1]));
    return (1);
  case XDR_FREE:
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<xdr_u_int64_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
sub    $0x80,%eax
je     1234 <xdr_u_int64_t+0x134>
jmp    1129 <xdr_u_int64_t+0x29>
mov    -0x24(%rbp),%eax
sub    $0x81,%eax
je     114f <xdr_u_int64_t+0x4f>
jmp    113c <xdr_u_int64_t+0x3c>
mov    -0x24(%rbp),%eax
sub    $0x82,%eax
je     11b9 <xdr_u_int64_t+0xb9>
jmp    1240 <xdr_u_int64_t+0x140>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x20,%ecx
sar    %cl,%eax
and    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
and    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   *%rax
cmp    $0x0,%eax
jne    1198 <xdr_u_int64_t+0x98>
movl   $0x0,-0x4(%rbp)
jmp    1247 <xdr_u_int64_t+0x147>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
add    $0x4,%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    1247 <xdr_u_int64_t+0x147>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   *%rax
cmp    $0x0,%eax
jne    11e4 <xdr_u_int64_t+0xe4>
movl   $0x0,-0x4(%rbp)
jmp    1247 <xdr_u_int64_t+0x147>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
add    $0x4,%rsi
call   *%rax
cmp    $0x0,%eax
jne    1213 <xdr_u_int64_t+0x113>
movl   $0x0,-0x4(%rbp)
jmp    1247 <xdr_u_int64_t+0x147>
mov    -0x20(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,%ecx
or     -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1247 <xdr_u_int64_t+0x147>
movl   $0x1,-0x4(%rbp)
jmp    1247 <xdr_u_int64_t+0x147>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_u_int64_t>:
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%eax
cmp    $0x80,%eax
je     1147 <xdr_u_int64_t+0x47>
mov    %rdi,%rbx
cmp    $0x82,%eax
je     114e <xdr_u_int64_t+0x4e>
cmp    $0x81,%eax
jne    117b <xdr_u_int64_t+0x7b>
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
mov    0x8(%rbx),%rax
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   *(%rax)
test   %eax,%eax
je     117b <xdr_u_int64_t+0x7b>
lea    0xc(%rsp),%rsi
mov    0x8(%rbx),%rax
mov    %rbx,%rdi
call   *(%rax)
jmp    117d <xdr_u_int64_t+0x7d>
mov    $0x1,%eax
jmp    117d <xdr_u_int64_t+0x7d>
mov    0x8(%rbx),%rax
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   *0x8(%rax)
test   %eax,%eax
je     117b <xdr_u_int64_t+0x7b>
mov    0x8(%rbx),%rax
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   *0x8(%rax)
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
jmp    117d <xdr_u_int64_t+0x7d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_9__ = type { i32, %struct.TYPE_8__* }
%struct.TYPE_8__ = type { i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)* }
define i32 @xdr_u_int64_t(%struct.TYPE_9__* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_9__*
%5 = alloca i32*
%6 = alloca [2 x i32]
store %struct.TYPE_9__* %0, %struct.TYPE_9__** %4
store i32* %1, i32** %5
%7 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%8 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %7, i32 0, i32 0
%9 = load i32, i32* %8
switch i32 %9, label %74 [
i32 129, label %10
i32 130, label %41
i32 128, label %73
]
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = ashr i32 %12, 32
%14 = and i32 %13, -1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 %14, i32* %15
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = and i32 %17, -1
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %18, i32* %19
%20 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%21 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %20, i32 0, i32 1
%22 = load %struct.TYPE_8__*, %struct.TYPE_8__** %21
%23 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %22, i32 0, i32 0
%24 = load i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)** %23
%25 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%27 = bitcast i32* %26 to i64*
%28 = call i32 %24(%struct.TYPE_9__* %25, i64* %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %10
store i32 0, i32* %3
br label %75
31: ; preds = %10
%32 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%33 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %32, i32 0, i32 1
%34 = load %struct.TYPE_8__*, %struct.TYPE_8__** %33
%35 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %34, i32 0, i32 0
%36 = load i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)** %35
%37 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%39 = bitcast i32* %38 to i64*
%40 = call i32 %36(%struct.TYPE_9__* %37, i64* %39)
store i32 %40, i32* %3
br label %75
41: ; preds = %2
%42 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%43 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %42, i32 0, i32 1
%44 = load %struct.TYPE_8__*, %struct.TYPE_8__** %43
%45 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %44, i32 0, i32 1
%46 = load i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)** %45
%47 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%48 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%49 = bitcast i32* %48 to i64*
%50 = call i32 %46(%struct.TYPE_9__* %47, i64* %49)
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %41
store i32 0, i32* %3
br label %75
53: ; preds = %41
%54 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%55 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %54, i32 0, i32 1
%56 = load %struct.TYPE_8__*, %struct.TYPE_8__** %55
%57 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %56, i32 0, i32 1
%58 = load i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)** %57
%59 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%61 = bitcast i32* %60 to i64*
%62 = call i32 %58(%struct.TYPE_9__* %59, i64* %61)
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %53
store i32 0, i32* %3
br label %75
65: ; preds = %53
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%67 = load i32, i32* %66
%68 = shl i32 %67, 32
%69 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%70 = load i32, i32* %69
%71 = or i32 %68, %70
%72 = load i32*, i32** %5
store i32 %71, i32* %72
store i32 1, i32* %3
br label %75
73: ; preds = %2
store i32 1, i32* %3
br label %75
74: ; preds = %2
store i32 0, i32* %3
br label %75
75: ; preds = %74, %73, %65, %64, %52, %31, %30
%76 = load i32, i32* %3
ret i32 %76
}

LLVM IR (-O2):
%struct.TYPE_9__ = type { i32, %struct.TYPE_8__* }
%struct.TYPE_8__ = type { i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)* }
define i32 @xdr_u_int64_t(%struct.TYPE_9__* %0, i32* nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to [2 x i32]*
%5 = bitcast i64* %3 to i8*
%6 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %0, i64 0, i32 0
%7 = load i32, i32* %6
switch i32 %7, label %39 [
i32 129, label %8
i32 130, label %23
i32 128, label %40
]
8: ; preds = %2
%9 = load i32, i32* %1
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %0, i64 0, i32 1
%12 = load %struct.TYPE_8__*, %struct.TYPE_8__** %11
%13 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %12, i64 0, i32 0
%14 = load i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)** %13
%15 = call i32 %14(%struct.TYPE_9__* %0, i64* %3)
%16 = icmp eq i32 %15, 0
br i1 %16, label %40, label %17
17: ; preds = %8
%18 = load %struct.TYPE_8__*, %struct.TYPE_8__** %11
%19 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %18, i64 0, i32 0
%20 = load i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)** %19
%21 = bitcast i32* %10 to i64*
%22 = call i32 %20(%struct.TYPE_9__* %0, i64* %21)
br label %40
23: ; preds = %2
%24 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %0, i64 0, i32 1
%25 = load %struct.TYPE_8__*, %struct.TYPE_8__** %24
%26 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %25, i64 0, i32 1
%27 = load i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)** %26
%28 = call i32 %27(%struct.TYPE_9__* %0, i64* %3)
%29 = icmp eq i32 %28, 0
br i1 %29, label %40, label %30
30: ; preds = %23
%31 = load %struct.TYPE_8__*, %struct.TYPE_8__** %24
%32 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %31, i64 0, i32 1
%33 = load i32 (%struct.TYPE_9__*, i64*)*, i32 (%struct.TYPE_9__*, i64*)** %32
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%35 = bitcast i32* %34 to i64*
%36 = call i32 %33(%struct.TYPE_9__* %0, i64* %35)
%37 = icmp ne i32 %36, 0
%38 = zext i1 %37 to i32
br label %40
39: ; preds = %2
br label %40
40: ; preds = %2, %30, %23, %8, %39, %17
%41 = phi i32 [ 0, %39 ], [ %22, %17 ], [ 0, %8 ], [ 0, %23 ], [ %38, %30 ], [ 1, %2 ]
ret i32 %41
}