#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_4__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ caddr_t;
typedef int /*<<< orphan*/ bool_t;
struct TYPE_4__ {
  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_opaque(TYPE_1__ *, int /*<<< orphan*/, int);
bool_t xdr_int64_t(XDR *xdrs, int64_t *int64_p) {
  int64_t x;
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    return (xdr_opaque(xdrs, (caddr_t)int64_p, sizeof(int64_t)));
  case XDR_DECODE:
    if (!xdr_opaque(xdrs, (caddr_t)&x, sizeof x)) {
      return (FALSE);
    }
    *int64_p = x;
    return (TRUE);
  case XDR_FREE:
    return (TRUE);
  }
  return (FALSE);
}


x86 assembly (clang, -O0):
<xdr_int64_t>:
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,-0x20(%rbp)
sub    $0x80,%eax
je     11c3 <xdr_int64_t+0xb3>
jmp    1139 <xdr_int64_t+0x29>
mov    -0x20(%rbp),%eax
sub    $0x81,%eax
je     115f <xdr_int64_t+0x4f>
jmp    114c <xdr_int64_t+0x3c>
mov    -0x20(%rbp),%eax
sub    $0x82,%eax
je     117b <xdr_int64_t+0x6b>
jmp    11d4 <xdr_int64_t+0xc4>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
mov    $0x4,%edx
call   1030 <xdr_opaque@plt>
mov    %eax,-0x4(%rbp)
jmp    11e0 <xdr_int64_t+0xd0>
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rax
mov    %eax,%esi
mov    $0x4,%edx
call   1030 <xdr_opaque@plt>
cmp    $0x0,%eax
jne    11a9 <xdr_int64_t+0x99>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e0 <xdr_int64_t+0xd0>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e0 <xdr_int64_t+0xd0>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e0 <xdr_int64_t+0xd0>
mov    0x2dfd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_int64_t>:
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%eax
cmp    $0x80,%eax
je     1159 <xdr_int64_t+0x49>
mov    %rsi,%rbx
cmp    $0x82,%eax
je     1140 <xdr_int64_t+0x30>
cmp    $0x81,%eax
jne    1162 <xdr_int64_t+0x52>
mov    %ebx,%esi
mov    $0x4,%edx
add    $0x10,%rsp
pop    %rbx
jmp    1030 <xdr_opaque@plt>
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <xdr_opaque@plt>
test   %eax,%eax
je     1162 <xdr_int64_t+0x52>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
mov    0x2e88(%rip),%rax
jmp    1169 <xdr_int64_t+0x59>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_int64_t(%struct.TYPE_4__* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %23 [
i32 129, label %7
i32 130, label %11
i32 128, label %21
]
7: ; preds = %2
%8 = ptrtoint i32* %1 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @xdr_opaque(%struct.TYPE_4__* %0, i32 %9, i32 4)
br label %25
11: ; preds = %2
%12 = ptrtoint i32* %3 to i64
%13 = trunc i64 %12 to i32
%14 = call i32 @xdr_opaque(%struct.TYPE_4__* %0, i32 %13, i32 4)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i32, i32* @FALSE
br label %25
18: ; preds = %11
%19 = load i32, i32* %3
store i32 %19, i32* %1
%20 = load i32, i32* @TRUE
br label %25
21: ; preds = %2
%22 = load i32, i32* @TRUE
br label %25
23: ; preds = %2
%24 = load i32, i32* @FALSE
br label %25
25: ; preds = %23, %21, %18, %16, %7
%26 = phi i32 [ %24, %23 ], [ %22, %21 ], [ %20, %18 ], [ %17, %16 ], [ %10, %7 ]
ret i32 %26
}