#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 */
#define XDR_DECODE 130
#define XDR_ENCODE 129
#define XDR_FREE 128
int XDR_GETLONG(TYPE_1__ *, long *);
int XDR_PUTLONG(TYPE_1__ *, long *);
bool_t xdr_float(XDR *xdrs, float *fp) {
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    if (sizeof(float) == sizeof(long))
      return (XDR_PUTLONG(xdrs, (long *)fp));
    else if (sizeof(float) == sizeof(int)) {
      long tmp = *(int *)fp;
      return (XDR_PUTLONG(xdrs, &tmp));
    }
    break;
  case XDR_DECODE:
    if (sizeof(float) == sizeof(long))
      return (XDR_GETLONG(xdrs, (long *)fp));
    else if (sizeof(float) == sizeof(int)) {
      long tmp;
      if (XDR_GETLONG(xdrs, &tmp)) {
        *(int *)fp = tmp;
        return ((1));
      }
    }
    break;
  case XDR_FREE:
    return ((1));
  }
  return ((0));
}


x86 assembly (clang, -O0):
<xdr_float>:
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,-0x2c(%rbp)
sub    $0x80,%eax
je     11c2 <xdr_float+0xa2>
jmp    1149 <xdr_float+0x29>
mov    -0x2c(%rbp),%eax
sub    $0x81,%eax
je     116f <xdr_float+0x4f>
jmp    115c <xdr_float+0x3c>
mov    -0x2c(%rbp),%eax
sub    $0x82,%eax
je     118f <xdr_float+0x6f>
jmp    11ce <xdr_float+0xae>
mov    -0x18(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <XDR_PUTLONG@plt>
mov    %eax,-0x4(%rbp)
jmp    11d5 <xdr_float+0xb5>
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <XDR_GETLONG@plt>
cmp    $0x0,%eax
je     11bd <xdr_float+0x9d>
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11d5 <xdr_float+0xb5>
jmp    11ce <xdr_float+0xae>
movl   $0x1,-0x4(%rbp)
jmp    11d5 <xdr_float+0xb5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_float>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%eax
mov    $0x1,%ebx
cmp    $0x80,%eax
je     116c <xdr_float+0x4c>
mov    %rsi,%r14
cmp    $0x82,%eax
je     1156 <xdr_float+0x36>
cmp    $0x81,%eax
jne    116a <xdr_float+0x4a>
movslq (%r14),%rax
mov    %rax,(%rsp)
mov    %rsp,%rsi
call   1040 <XDR_PUTLONG@plt>
mov    %eax,%ebx
jmp    116c <xdr_float+0x4c>
mov    %rsp,%rsi
call   1030 <XDR_GETLONG@plt>
test   %eax,%eax
je     116a <xdr_float+0x4a>
mov    (%rsp),%eax
mov    %eax,(%r14)
jmp    116c <xdr_float+0x4c>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32 }
define i32 @xdr_float(%struct.TYPE_5__* %0, float* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_5__*
%5 = alloca float*
%6 = alloca i64
%7 = alloca i64
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store float* %1, float** %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 %29 [
i32 129, label %11
i32 130, label %18
i32 128, label %28
]
11: ; preds = %2
%12 = load float*, float** %5
%13 = bitcast float* %12 to i32*
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
store i64 %15, i64* %6
%16 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%17 = call i32 @XDR_PUTLONG(%struct.TYPE_5__* %16, i64* %6)
store i32 %17, i32* %3
br label %30
18: ; preds = %2
%19 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%20 = call i32 @XDR_GETLONG(%struct.TYPE_5__* %19, i64* %7)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i64, i64* %7
%24 = trunc i64 %23 to i32
%25 = load float*, float** %5
%26 = bitcast float* %25 to i32*
store i32 %24, i32* %26
store i32 1, i32* %3
br label %30
27: ; preds = %18
br label %29
28: ; preds = %2
store i32 1, i32* %3
br label %30
29: ; preds = %2, %27
store i32 0, i32* %3
br label %30
30: ; preds = %29, %28, %22, %11
%31 = load i32, i32* %3
ret i32 %31
}

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