#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 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_GETLONG(TYPE_1__ *, long *);
int /*<<< orphan*/ XDR_PUTLONG(TYPE_1__ *, long *);
int /*<<< orphan*/ __BIG_ENDIAN;
int /*<<< orphan*/ __FLOAT_WORD_ORDER;
bool_t xdr_double(XDR *xdrs, double *dp) {
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    if (2 * sizeof(long) == sizeof(double)) {
      long *lp = (long *)dp;
      return (XDR_PUTLONG(xdrs, lp + !(__FLOAT_WORD_ORDER == __BIG_ENDIAN)) &&
              XDR_PUTLONG(xdrs, lp + (__FLOAT_WORD_ORDER == __BIG_ENDIAN)));
    } else if (2 * sizeof(int) == sizeof(double)) {
      int *ip = (int *)dp;
      long tmp[2];
      tmp[0] = ip[!(__FLOAT_WORD_ORDER == __BIG_ENDIAN)];
      tmp[1] = ip[(__FLOAT_WORD_ORDER == __BIG_ENDIAN)];
      return (XDR_PUTLONG(xdrs, tmp) && XDR_PUTLONG(xdrs, tmp + 1));
    }
    break;
  case XDR_DECODE:
    if (2 * sizeof(long) == sizeof(double)) {
      long *lp = (long *)dp;
      return (XDR_GETLONG(xdrs, lp + !(__FLOAT_WORD_ORDER == __BIG_ENDIAN)) &&
              XDR_GETLONG(xdrs, lp + (__FLOAT_WORD_ORDER == __BIG_ENDIAN)));
    } else if (2 * sizeof(int) == sizeof(double)) {
      int *ip = (int *)dp;
      long tmp[2];
      if (XDR_GETLONG(xdrs, tmp + !(__FLOAT_WORD_ORDER == __BIG_ENDIAN)) &&
          XDR_GETLONG(xdrs, tmp + (__FLOAT_WORD_ORDER == __BIG_ENDIAN))) {
        ip[0] = tmp[0];
        ip[1] = tmp[1];
        return (TRUE);
      }
    }
    break;
  case XDR_FREE:
    return (TRUE);
  }
  return (FALSE);
}


x86 assembly (clang, -O0):
<xdr_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
sub    $0x80,%eax
je     12c0 <xdr_double+0x1a0>
jmp    1149 <xdr_double+0x29>
mov    -0x54(%rbp),%eax
sub    $0x81,%eax
je     116f <xdr_double+0x4f>
jmp    115c <xdr_double+0x3c>
mov    -0x54(%rbp),%eax
sub    $0x82,%eax
je     1215 <xdr_double+0xf5>
jmp    12d1 <xdr_double+0x1b1>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2e66(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2e3d(%rip),%rdx
cmp    (%rdx),%ecx
sete   %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
movslq (%rax,%rcx,4),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2e39(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2e10(%rip),%rdx
cmp    (%rdx),%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
movslq (%rax,%rcx,4),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <XDR_PUTLONG@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x55(%rbp)
je     1205 <xdr_double+0xe5>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x8,%rsi
call   1040 <XDR_PUTLONG@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x55(%rbp)
mov    -0x55(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    12dd <xdr_double+0x1bd>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    0x2dbc(%rip),%rax
mov    (%rax),%eax
mov    0x2d93(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <XDR_GETLONG@plt>
cmp    $0x0,%eax
je     12bb <xdr_double+0x19b>
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    0x2d58(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <XDR_GETLONG@plt>
cmp    $0x0,%eax
je     12bb <xdr_double+0x19b>
mov    -0x50(%rbp),%rax
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%rax
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    0x2d2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12dd <xdr_double+0x1bd>
jmp    12d1 <xdr_double+0x1b1>
mov    0x2d19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12dd <xdr_double+0x1bd>
mov    0x2cf8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_double>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    (%rdi),%eax
cmp    $0x80,%eax
je     11fa <xdr_double+0xda>
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    $0x82,%eax
je     11a9 <xdr_double+0x89>
cmp    $0x81,%eax
jne    1203 <xdr_double+0xe3>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    0x2e68(%rip),%rcx
xor    %edx,%edx
xor    %esi,%esi
cmp    (%rcx),%eax
setne  %dl
movslq (%r14,%rdx,4),%rax
mov    %rax,(%rsp)
sete   %sil
movslq (%r14,%rsi,4),%rax
mov    %rax,0x8(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <XDR_PUTLONG@plt>
test   %eax,%eax
je     1218 <xdr_double+0xf8>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <XDR_PUTLONG@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
jmp    120c <xdr_double+0xec>
mov    0x2e38(%rip),%r15
mov    (%r15),%eax
mov    0x2e0e(%rip),%r12
xor    %ecx,%ecx
cmp    (%r12),%eax
setne  %cl
lea    (%rsp,%rcx,8),%rsi
mov    %rbx,%rdi
call   1030 <XDR_GETLONG@plt>
test   %eax,%eax
je     1203 <xdr_double+0xe3>
mov    (%r15),%eax
xor    %ecx,%ecx
cmp    (%r12),%eax
sete   %cl
lea    (%rsp,%rcx,8),%rsi
mov    %rbx,%rdi
call   1030 <XDR_GETLONG@plt>
test   %eax,%eax
je     1203 <xdr_double+0xe3>
pshufd $0xe8,(%rsp),%xmm0
movq   %xmm0,(%r14)
mov    0x2ddf(%rip),%rax
jmp    120a <xdr_double+0xea>
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xor    %eax,%eax
jmp    120c <xdr_double+0xec>

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32 }
@__FLOAT_WORD_ORDER = global i32 0
@__BIG_ENDIAN = global i32 0
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @xdr_double(%struct.TYPE_5__* %0, double* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_5__*
%5 = alloca double*
%6 = alloca i32*
%7 = alloca [2 x i64]
%8 = alloca i32*
%9 = alloca [2 x i64]
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store double* %1, double** %5
%10 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i32 0, i32 0
%12 = load i32, i32* %11
switch i32 %12, label %90 [
i32 129, label %13
i32 130, label %50
i32 128, label %88
]
13: ; preds = %2
%14 = load double*, double** %5
%15 = bitcast double* %14 to i32*
store i32* %15, i32** %6
%16 = load i32*, i32** %6
%17 = load i32, i32* @__FLOAT_WORD_ORDER
%18 = load i32, i32* @__BIG_ENDIAN
%19 = icmp eq i32 %17, %18
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %16, i64 %22
%24 = load i32, i32* %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
store i64 %25, i64* %26
%27 = load i32*, i32** %6
%28 = load i32, i32* @__FLOAT_WORD_ORDER
%29 = load i32, i32* @__BIG_ENDIAN
%30 = icmp eq i32 %28, %29
%31 = zext i1 %30 to i32
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %27, i64 %32
%34 = load i32, i32* %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 1
store i64 %35, i64* %36
%37 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%38 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%39 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %37, i64* %38)
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %47
41: ; preds = %13
%42 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%43 = getelementptr inbounds [2 x i64], [2 x i64]* %7, i64 0, i64 0
%44 = getelementptr inbounds i64, i64* %43, i64 1
%45 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %42, i64* %44)
%46 = icmp ne i32 %45, 0
br label %47
47: ; preds = %41, %13
%48 = phi i1 [ false, %13 ], [ %46, %41 ]
%49 = zext i1 %48 to i32
store i32 %49, i32* %3
br label %92
50: ; preds = %2
%51 = load double*, double** %5
%52 = bitcast double* %51 to i32*
store i32* %52, i32** %8
%53 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%54 = getelementptr inbounds [2 x i64], [2 x i64]* %9, i64 0, i64 0
%55 = load i32, i32* @__FLOAT_WORD_ORDER
%56 = load i32, i32* @__BIG_ENDIAN
%57 = icmp eq i32 %55, %56
%58 = xor i1 %57, true
%59 = zext i1 %58 to i32
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i64, i64* %54, i64 %60
%62 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %53, i64* %61)
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %87
64: ; preds = %50
%65 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%66 = getelementptr inbounds [2 x i64], [2 x i64]* %9, i64 0, i64 0
%67 = load i32, i32* @__FLOAT_WORD_ORDER
%68 = load i32, i32* @__BIG_ENDIAN
%69 = icmp eq i32 %67, %68
%70 = zext i1 %69 to i32
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i64, i64* %66, i64 %71
%73 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %65, i64* %72)
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %87
75: ; preds = %64
%76 = getelementptr inbounds [2 x i64], [2 x i64]* %9, i64 0, i64 0
%77 = load i64, i64* %76
%78 = trunc i64 %77 to i32
%79 = load i32*, i32** %8
%80 = getelementptr inbounds i32, i32* %79, i64 0
store i32 %78, i32* %80
%81 = getelementptr inbounds [2 x i64], [2 x i64]* %9, i64 0, i64 1
%82 = load i64, i64* %81
%83 = trunc i64 %82 to i32
%84 = load i32*, i32** %8
%85 = getelementptr inbounds i32, i32* %84, i64 1
store i32 %83, i32* %85
%86 = load i32, i32* @TRUE
store i32 %86, i32* %3
br label %92
87: ; preds = %64, %50
br label %90
88: ; preds = %2
%89 = load i32, i32* @TRUE
store i32 %89, i32* %3
br label %92
90: ; preds = %2, %87
%91 = load i32, i32* @FALSE
store i32 %91, i32* %3
br label %92
92: ; preds = %90, %88, %75, %47
%93 = load i32, i32* %3
ret i32 %93
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32 }
@__FLOAT_WORD_ORDER = global i32 0
@__BIG_ENDIAN = global i32 0
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @xdr_double(%struct.TYPE_5__* %0, double* nocapture %1) {
%3 = alloca [2 x i64]
%4 = alloca <2 x i64>
%5 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %57 [
i32 129, label %7
i32 130, label %32
i32 128, label %55
]
7: ; preds = %2
%8 = bitcast double* %1 to i32*
%9 = bitcast [2 x i64]* %3 to i8*
%10 = load i32, i32* @__FLOAT_WORD_ORDER
%11 = load i32, i32* @__BIG_ENDIAN
%12 = icmp ne i32 %10, %11
%13 = zext i1 %12 to i64
%14 = getelementptr inbounds i32, i32* %8, i64 %13
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
store i64 %16, i64* %17
%18 = icmp eq i32 %10, %11
%19 = zext i1 %18 to i64
%20 = getelementptr inbounds i32, i32* %8, i64 %19
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
store i64 %22, i64* %23
%24 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %0, i64* %17)
%25 = icmp eq i32 %24, 0
br i1 %25, label %30, label %26
26: ; preds = %7
%27 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %0, i64* %23)
%28 = icmp ne i32 %27, 0
%29 = zext i1 %28 to i32
br label %30
30: ; preds = %26, %7
%31 = phi i32 [ 0, %7 ], [ %29, %26 ]
br label %59
32: ; preds = %2
%33 = bitcast <2 x i64>* %4 to i8*
%34 = load i32, i32* @__FLOAT_WORD_ORDER
%35 = load i32, i32* @__BIG_ENDIAN
%36 = icmp ne i32 %34, %35
%37 = zext i1 %36 to i64
%38 = getelementptr inbounds <2 x i64>, <2 x i64>* %4, i64 0, i64 %37
%39 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %0, i64* %38)
%40 = icmp eq i32 %39, 0
br i1 %40, label %49, label %41
41: ; preds = %32
%42 = load i32, i32* @__FLOAT_WORD_ORDER
%43 = load i32, i32* @__BIG_ENDIAN
%44 = icmp eq i32 %42, %43
%45 = zext i1 %44 to i64
%46 = getelementptr inbounds <2 x i64>, <2 x i64>* %4, i64 0, i64 %45
%47 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %0, i64* %46)
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %41, %32
br label %57
50: ; preds = %41
%51 = load <2 x i64>, <2 x i64>* %4
%52 = trunc <2 x i64> %51 to <2 x i32>
%53 = bitcast double* %1 to <2 x i32>*
store <2 x i32> %52, <2 x i32>* %53
%54 = load i32, i32* @TRUE
br label %59
55: ; preds = %2
%56 = load i32, i32* @TRUE
br label %59
57: ; preds = %49, %2
%58 = load i32, i32* @FALSE
br label %59
59: ; preds = %50, %57, %55, %30
%60 = phi i32 [ %58, %57 ], [ %56, %55 ], [ %54, %50 ], [ %31, %30 ]
ret i32 %60
}