#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 */

/* Type definitions */

/* Variables and functions */
unsigned int gnulliver();
float gnulliver32f(float input32) {
  union {
    float x32;
    unsigned char ch[4];
  } bytes;
  static unsigned endian, init = 1;
  unsigned char tmpch;
  if (init) {
    endian = gnulliver();
    init = 0;
  }
  bytes.x32 = input32;
  if (endian != 0) {
    if (endian == (1 | 2 | 4 | 8)) {
      tmpch = bytes.ch[0];
      bytes.ch[0] = bytes.ch[3];
      bytes.ch[3] = tmpch;
      tmpch = bytes.ch[1];
      bytes.ch[1] = bytes.ch[2];
      bytes.ch[2] = tmpch;
    } else {
      tmpch = bytes.ch[0];
      bytes.ch[0] = bytes.ch[2];
      bytes.ch[2] = tmpch;
      tmpch = bytes.ch[1];
      bytes.ch[1] = bytes.ch[3];
      bytes.ch[3] = tmpch;
    }
  }
  return (bytes.x32);
}


x86 assembly (clang, -O0):
<gnulliver32f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
cmpl   $0x0,0x2f04(%rip)
je     1141 <gnulliver32f+0x31>
mov    $0x0,%al
call   1030 <gnulliver@plt>
mov    %eax,0x2ef9(%rip)
movl   $0x0,0x2ee7(%rip)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x0,0x2ede(%rip)
je     11b7 <gnulliver32f+0xa7>
cmpl   $0xf,0x2ed1(%rip)
jne    118e <gnulliver32f+0x7e>
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x6(%rbp)
jmp    11b2 <gnulliver32f+0xa2>
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x5(%rbp)
jmp    11b7 <gnulliver32f+0xa7>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnulliver32f>:
push   %rax
cmpb   $0x0,0x2f18(%rip)
je     1126 <gnulliver32f+0x16>
mov    0x2f0c(%rip),%eax
test   %eax,%eax
jne    114a <gnulliver32f+0x3a>
pop    %rax
ret
xor    %eax,%eax
movss  %xmm0,0x4(%rsp)
call   1030 <gnulliver@plt>
movd   0x4(%rsp),%xmm0
mov    %eax,0x2eed(%rip)
movb   $0x1,0x2eea(%rip)
test   %eax,%eax
je     1124 <gnulliver32f+0x14>
cmp    $0xf,%eax
jne    115b <gnulliver32f+0x4b>
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
pop    %rax
ret
movd   %xmm0,%eax
mov    %eax,%ecx
shr    $0x10,%ecx
and    $0xff00,%ecx
mov    %eax,%edx
rol    $0x10,%edx
shl    $0x10,%eax
and    $0xff000000,%eax
and    $0xff00ff,%edx
or     %ecx,%edx
or     %eax,%edx
movd   %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
@gnulliver32f.endian = internal global i32 0
@gnulliver32f.init = internal global i32 1
define float @gnulliver32f(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca i8
store float %0, float* %2
%5 = load i32, i32* @gnulliver32f.init
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @gnulliver()
store i32 %8, i32* @gnulliver32f.endian
store i32 0, i32* @gnulliver32f.init
br label %9
9: ; preds = %7, %1
%10 = load float, float* %2
%11 = bitcast %union.anon* %3 to float*
store float %10, float* %11
%12 = load i32, i32* @gnulliver32f.endian
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %64
14: ; preds = %9
%15 = load i32, i32* @gnulliver32f.endian
%16 = icmp eq i32 %15, 15
br i1 %16, label %17, label %40
17: ; preds = %14
%18 = bitcast %union.anon* %3 to [4 x i8]*
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%20 = load i8, i8* %19
store i8 %20, i8* %4
%21 = bitcast %union.anon* %3 to [4 x i8]*
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %21, i64 0, i64 3
%23 = load i8, i8* %22
%24 = bitcast %union.anon* %3 to [4 x i8]*
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %24, i64 0, i64 0
store i8 %23, i8* %25
%26 = load i8, i8* %4
%27 = bitcast %union.anon* %3 to [4 x i8]*
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %27, i64 0, i64 3
store i8 %26, i8* %28
%29 = bitcast %union.anon* %3 to [4 x i8]*
%30 = getelementptr inbounds [4 x i8], [4 x i8]* %29, i64 0, i64 1
%31 = load i8, i8* %30
store i8 %31, i8* %4
%32 = bitcast %union.anon* %3 to [4 x i8]*
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %32, i64 0, i64 2
%34 = load i8, i8* %33
%35 = bitcast %union.anon* %3 to [4 x i8]*
%36 = getelementptr inbounds [4 x i8], [4 x i8]* %35, i64 0, i64 1
store i8 %34, i8* %36
%37 = load i8, i8* %4
%38 = bitcast %union.anon* %3 to [4 x i8]*
%39 = getelementptr inbounds [4 x i8], [4 x i8]* %38, i64 0, i64 2
store i8 %37, i8* %39
br label %63
40: ; preds = %14
%41 = bitcast %union.anon* %3 to [4 x i8]*
%42 = getelementptr inbounds [4 x i8], [4 x i8]* %41, i64 0, i64 0
%43 = load i8, i8* %42
store i8 %43, i8* %4
%44 = bitcast %union.anon* %3 to [4 x i8]*
%45 = getelementptr inbounds [4 x i8], [4 x i8]* %44, i64 0, i64 2
%46 = load i8, i8* %45
%47 = bitcast %union.anon* %3 to [4 x i8]*
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %47, i64 0, i64 0
store i8 %46, i8* %48
%49 = load i8, i8* %4
%50 = bitcast %union.anon* %3 to [4 x i8]*
%51 = getelementptr inbounds [4 x i8], [4 x i8]* %50, i64 0, i64 2
store i8 %49, i8* %51
%52 = bitcast %union.anon* %3 to [4 x i8]*
%53 = getelementptr inbounds [4 x i8], [4 x i8]* %52, i64 0, i64 1
%54 = load i8, i8* %53
store i8 %54, i8* %4
%55 = bitcast %union.anon* %3 to [4 x i8]*
%56 = getelementptr inbounds [4 x i8], [4 x i8]* %55, i64 0, i64 3
%57 = load i8, i8* %56
%58 = bitcast %union.anon* %3 to [4 x i8]*
%59 = getelementptr inbounds [4 x i8], [4 x i8]* %58, i64 0, i64 1
store i8 %57, i8* %59
%60 = load i8, i8* %4
%61 = bitcast %union.anon* %3 to [4 x i8]*
%62 = getelementptr inbounds [4 x i8], [4 x i8]* %61, i64 0, i64 3
store i8 %60, i8* %62
br label %63
63: ; preds = %40, %17
br label %64
64: ; preds = %63, %9
%65 = bitcast %union.anon* %3 to float*
%66 = load float, float* %65
ret float %66
}

LLVM IR (-O2):
@gnulliver32f.endian = internal unnamed_addr global i32 0
@gnulliver32f.init = internal unnamed_addr global i1 false
define float @gnulliver32f(float %0) {
%2 = load i1, i1* @gnulliver32f.init
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @gnulliver()
store i32 %4, i32* @gnulliver32f.endian
store i1 true, i1* @gnulliver32f.init
br label %7
5: ; preds = %1
%6 = load i32, i32* @gnulliver32f.endian
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %6, %5 ], [ %4, %3 ]
switch i32 %8, label %13 [
i32 0, label %24
i32 15, label %9
]
9: ; preds = %7
%10 = bitcast float %0 to i32
%11 = tail call i32 @llvm.bswap.i32(i32 %10)
%12 = bitcast i32 %11 to float
br label %24
13: ; preds = %7
%14 = bitcast float %0 to i32
%15 = lshr i32 %14, 16
%16 = and i32 %15, 65280
%17 = tail call i32 @llvm.fshl.i32(i32 %14, i32 %14, i32 16)
%18 = shl i32 %14, 16
%19 = and i32 %18, -16777216
%20 = and i32 %17, 16711935
%21 = or i32 %20, %16
%22 = or i32 %21, %19
%23 = bitcast i32 %22 to float
br label %24
24: ; preds = %7, %9, %13
%25 = phi float [ %12, %9 ], [ %23, %13 ], [ %0, %7 ]
ret float %25
}