#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 uint32_t;
typedef int int64_t;
typedef int int32_t;
typedef int bool_t;
struct TYPE_5__ {
  int x_op;
};
typedef TYPE_1__ XDR;

/* Variables and functions */
int FALSE;
int TRUE;
#define XDR_DECODE 130
#define XDR_ENCODE 129
#define XDR_FREE 128
int /*<<< orphan*/ XDR_GETINT32(TYPE_1__ *, int *);
int /*<<< orphan*/ XDR_PUTINT32(TYPE_1__ *, int *);
bool_t xdr_int64_t(XDR *xdrs, int64_t *ip) {
  int32_t t1;
  uint32_t t2;
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    t1 = (int32_t)((*ip) >> 32);
    t2 = (int32_t)(*ip);
    return (XDR_PUTINT32(xdrs, &t1) && XDR_PUTINT32(xdrs, &t2));
  case XDR_DECODE:
    if (!XDR_GETINT32(xdrs, &t1) || !XDR_GETINT32(xdrs, &t2))
      return FALSE;
    *ip = ((int64_t)t1) << 32;
    *ip |= t2;
    return TRUE;
  case XDR_FREE:
    return TRUE;
  default:
    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     1236 <xdr_int64_t+0x116>
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     11cb <xdr_int64_t+0xab>
jmp    1247 <xdr_int64_t+0x127>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <XDR_PUTINT32@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x25(%rbp)
je     11bb <xdr_int64_t+0x9b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <XDR_PUTINT32@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1253 <xdr_int64_t+0x133>
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <XDR_GETINT32@plt>
cmp    $0x0,%eax
je     11f7 <xdr_int64_t+0xd7>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <XDR_GETINT32@plt>
cmp    $0x0,%eax
jne    1208 <xdr_int64_t+0xe8>
mov    0x2dda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1253 <xdr_int64_t+0x133>
mov    -0x1c(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    0x2dbc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1253 <xdr_int64_t+0x133>
mov    0x2dab(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1253 <xdr_int64_t+0x133>
mov    0x2d8a(%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   %rbx
sub    $0x10,%rsp
mov    (%rdi),%eax
cmp    $0x80,%eax
je     1190 <xdr_int64_t+0x70>
mov    %rdi,%rbx
cmp    $0x82,%eax
je     116e <xdr_int64_t+0x4e>
cmp    $0x81,%eax
jne    1199 <xdr_int64_t+0x79>
mov    (%rsi),%eax
mov    %eax,0x8(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <XDR_PUTINT32@plt>
test   %eax,%eax
je     11a8 <xdr_int64_t+0x88>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <XDR_PUTINT32@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
jmp    11a2 <xdr_int64_t+0x82>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <XDR_GETINT32@plt>
test   %eax,%eax
je     1199 <xdr_int64_t+0x79>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <XDR_GETINT32@plt>
test   %eax,%eax
je     1199 <xdr_int64_t+0x79>
mov    0x2e51(%rip),%rax
jmp    11a0 <xdr_int64_t+0x80>
mov    0x2e38(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
jmp    11a2 <xdr_int64_t+0x82>

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 i32
%7 = alloca i32
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store i32* %1, i32** %5
%8 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%9 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 0
%10 = load i32, i32* %9
switch i32 %10, label %48 [
i32 129, label %11
i32 130, label %27
i32 128, label %46
]
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = ashr i32 %13, 32
store i32 %14, i32* %6
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
store i32 %16, i32* %7
%17 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%18 = call i32 @XDR_PUTINT32(%struct.TYPE_5__* %17, i32* %6)
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %11
%21 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%22 = call i32 @XDR_PUTINT32(%struct.TYPE_5__* %21, i32* %7)
%23 = icmp ne i32 %22, 0
br label %24
24: ; preds = %20, %11
%25 = phi i1 [ false, %11 ], [ %23, %20 ]
%26 = zext i1 %25 to i32
store i32 %26, i32* %3
br label %50
27: ; preds = %2
%28 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%29 = call i32 @XDR_GETINT32(%struct.TYPE_5__* %28, i32* %6)
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%33 = call i32 @XDR_GETINT32(%struct.TYPE_5__* %32, i32* %7)
%34 = icmp ne i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %31, %27
%36 = load i32, i32* @FALSE
store i32 %36, i32* %3
br label %50
37: ; preds = %31
%38 = load i32, i32* %6
%39 = shl i32 %38, 32
%40 = load i32*, i32** %5
store i32 %39, i32* %40
%41 = load i32, i32* %7
%42 = load i32*, i32** %5
%43 = load i32, i32* %42
%44 = or i32 %43, %41
store i32 %44, i32* %42
%45 = load i32, i32* @TRUE
store i32 %45, i32* %3
br label %50
46: ; preds = %2
%47 = load i32, i32* @TRUE
store i32 %47, i32* %3
br label %50
48: ; preds = %2
%49 = load i32, i32* @FALSE
store i32 %49, i32* %3
br label %50
50: ; preds = %48, %46, %37, %35, %24
%51 = load i32, i32* %3
ret i32 %51
}

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 i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0
%8 = load i32, i32* %7
switch i32 %8, label %29 [
i32 129, label %9
i32 130, label %17
i32 128, label %27
]
9: ; preds = %2
%10 = load i32, i32* %1
store i32 %10, i32* %4
%11 = call i32 @XDR_PUTINT32(%struct.TYPE_5__* %0, i32* %3)
%12 = icmp eq i32 %11, 0
br i1 %12, label %31, label %13
13: ; preds = %9
%14 = call i32 @XDR_PUTINT32(%struct.TYPE_5__* %0, i32* %4)
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i32
br label %31
17: ; preds = %2
%18 = call i32 @XDR_GETINT32(%struct.TYPE_5__* %0, i32* %3)
%19 = icmp eq i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = call i32 @XDR_GETINT32(%struct.TYPE_5__* %0, i32* %4)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20, %17
%24 = load i32, i32* @FALSE
br label %31
25: ; preds = %20
%26 = load i32, i32* @TRUE
br label %31
27: ; preds = %2
%28 = load i32, i32* @TRUE
br label %31
29: ; preds = %2
%30 = load i32, i32* @FALSE
br label %31
31: ; preds = %9, %13, %29, %27, %25, %23
%32 = phi i32 [ %30, %29 ], [ %28, %27 ], [ %26, %25 ], [ %24, %23 ], [ 0, %9 ], [ %16, %13 ]
ret i32 %32
}