#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 u_long;
typedef int u_int64_t;
typedef int /*<<< orphan*/ int64_t;
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_int64_t(XDR *xdrs, int64_t *llp) {
  u_long ul[2];
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    ul[0] = (u_long)((u_int64_t)*llp >> 32) & 0xffffffff;
    ul[1] = (u_long)((u_int64_t)*llp) & 0xffffffff;
    if (XDR_PUTLONG(xdrs, (long *)&ul[0]) == FALSE)
      return (FALSE);
    return (XDR_PUTLONG(xdrs, (long *)&ul[1]));
  case XDR_DECODE:
    if (XDR_GETLONG(xdrs, (long *)&ul[0]) == FALSE)
      return (FALSE);
    if (XDR_GETLONG(xdrs, (long *)&ul[1]) == FALSE)
      return (FALSE);
    *llp = (int64_t)(((u_int64_t)ul[0] << 32) | ((u_int64_t)ul[1]));
    return (TRUE);
  case XDR_FREE:
    return (TRUE);
  }
  return (FALSE);
}


x86 assembly (clang, -O0):
<xdr_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     1258 <xdr_int64_t+0x138>
jmp    1149 <xdr_int64_t+0x29>
mov    -0x24(%rbp),%eax
sub    $0x81,%eax
je     116f <xdr_int64_t+0x4f>
jmp    115c <xdr_int64_t+0x3c>
mov    -0x24(%rbp),%eax
sub    $0x82,%eax
je     11d4 <xdr_int64_t+0xb4>
jmp    1269 <xdr_int64_t+0x149>
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),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <XDR_PUTLONG@plt>
mov    0x2e36(%rip),%rcx
cmp    (%rcx),%eax
jne    11bb <xdr_int64_t+0x9b>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1275 <xdr_int64_t+0x155>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
add    $0x4,%rsi
call   1040 <XDR_PUTLONG@plt>
mov    %eax,-0x4(%rbp)
jmp    1275 <xdr_int64_t+0x155>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <XDR_GETLONG@plt>
mov    0x2df0(%rip),%rcx
cmp    (%rcx),%eax
jne    1201 <xdr_int64_t+0xe1>
mov    0x2de1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1275 <xdr_int64_t+0x155>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
add    $0x4,%rsi
call   1030 <XDR_GETLONG@plt>
mov    0x2dbf(%rip),%rcx
cmp    (%rcx),%eax
jne    1232 <xdr_int64_t+0x112>
mov    0x2db0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1275 <xdr_int64_t+0x155>
mov    -0x20(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,%ecx
or     -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2d9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1275 <xdr_int64_t+0x155>
mov    0x2d89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1275 <xdr_int64_t+0x155>
mov    0x2d68(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_int64_t>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%eax
cmp    $0x80,%eax
je     1196 <xdr_int64_t+0x76>
mov    %rdi,%rbx
cmp    $0x82,%eax
je     1169 <xdr_int64_t+0x49>
cmp    $0x81,%eax
jne    119f <xdr_int64_t+0x7f>
mov    (%rsi),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <XDR_PUTLONG@plt>
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%eax
je     11a8 <xdr_int64_t+0x88>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <XDR_PUTLONG@plt>
jmp    11a8 <xdr_int64_t+0x88>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <XDR_GETLONG@plt>
mov    0x2e5d(%rip),%r14
cmp    (%r14),%eax
je     11a8 <xdr_int64_t+0x88>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <XDR_GETLONG@plt>
mov    %eax,%ecx
mov    (%r14),%eax
cmp    %eax,%ecx
je     11a8 <xdr_int64_t+0x88>
mov    0x2e4b(%rip),%rax
jmp    11a6 <xdr_int64_t+0x86>
mov    0x2e32(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32 }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_int64_t(%struct.TYPE_5__* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_5__*
%5 = alloca i32*
%6 = alloca [2 x i32]
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store i32* %1, i32** %5
%7 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%8 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%9 = load i32, i32* %8
switch i32 %9, label %62 [
i32 129, label %10
i32 130, label %33
i32 128, label %60
]
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_5__*, %struct.TYPE_5__** %4
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%22 = bitcast i32* %21 to i64*
%23 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %20, i64* %22)
%24 = load i32, i32* @FALSE
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %10
%27 = load i32, i32* @FALSE
store i32 %27, i32* %3
br label %64
28: ; preds = %10
%29 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%31 = bitcast i32* %30 to i64*
%32 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %29, i64* %31)
store i32 %32, i32* %3
br label %64
33: ; preds = %2
%34 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%36 = bitcast i32* %35 to i64*
%37 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %34, i64* %36)
%38 = load i32, i32* @FALSE
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %42
40: ; preds = %33
%41 = load i32, i32* @FALSE
store i32 %41, i32* %3
br label %64
42: ; preds = %33
%43 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%45 = bitcast i32* %44 to i64*
%46 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %43, i64* %45)
%47 = load i32, i32* @FALSE
%48 = icmp eq i32 %46, %47
br i1 %48, label %49, label %51
49: ; preds = %42
%50 = load i32, i32* @FALSE
store i32 %50, i32* %3
br label %64
51: ; preds = %42
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%53 = load i32, i32* %52
%54 = shl i32 %53, 32
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%56 = load i32, i32* %55
%57 = or i32 %54, %56
%58 = load i32*, i32** %5
store i32 %57, i32* %58
%59 = load i32, i32* @TRUE
store i32 %59, i32* %3
br label %64
60: ; preds = %2
%61 = load i32, i32* @TRUE
store i32 %61, i32* %3
br label %64
62: ; preds = %2
%63 = load i32, i32* @FALSE
store i32 %63, i32* %3
br label %64
64: ; preds = %62, %60, %51, %49, %40, %28, %26
%65 = load i32, i32* %3
ret i32 %65
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32 }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_int64_t(%struct.TYPE_5__* %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_5__, %struct.TYPE_5__* %0, i64 0, i32 0
%7 = load i32, i32* %6
switch i32 %7, label %31 [
i32 129, label %8
i32 130, label %17
i32 128, label %29
]
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 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %0, i64* %3)
%12 = load i32, i32* @FALSE
%13 = icmp eq i32 %11, %12
br i1 %13, label %33, label %14
14: ; preds = %8
%15 = bitcast i32* %10 to i64*
%16 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %0, i64* %15)
br label %33
17: ; preds = %2
%18 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %0, i64* %3)
%19 = load i32, i32* @FALSE
%20 = icmp eq i32 %18, %19
br i1 %20, label %33, label %21
21: ; preds = %17
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%23 = bitcast i32* %22 to i64*
%24 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %0, i64* %23)
%25 = load i32, i32* @FALSE
%26 = icmp eq i32 %24, %25
%27 = load i32, i32* @TRUE
%28 = select i1 %26, i32 %25, i32 %27
br label %33
29: ; preds = %2
%30 = load i32, i32* @TRUE
br label %33
31: ; preds = %2
%32 = load i32, i32* @FALSE
br label %33
33: ; preds = %21, %17, %8, %31, %29, %14
%34 = phi i32 [ %32, %31 ], [ %30, %29 ], [ %16, %14 ], [ %11, %8 ], [ %18, %17 ], [ %28, %21 ]
ret i32 %34
}