#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, float *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *arg[]) {
  union {
    float f;
    uint32_t i;
  } input;
  fscanf(stdin, "%f", &input.f);
  input.i = ((input.i & 0xffff0000u) >> 16) | ((input.i & 0x0000ffffu) << 16);
  input.i = ((input.i & 0xff00ff00u) >> 8) | ((input.i & 0x00ff00ffu) << 8);
  fprintf(stdout, "%08X", input.i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rdx
lea    0xeb6(%rip),%rsi
call   1030 <fscanf@plt>
mov    -0x18(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    -0x18(%rbp),%ecx
and    $0xffff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff00ff00,%eax
shr    $0x8,%eax
mov    -0x18(%rbp),%ecx
and    $0xff00ff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xe69(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    %rsp,%rdx
call   1030 <fscanf@plt>
mov    (%rsp),%edx
bswap  %edx
mov    %edx,(%rsp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { float }
@stdin = global i32 0
@.str = [3 x i8] c"%f\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"%08X\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %union.anon
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stdin
%8 = bitcast %union.anon* %6 to float*
%9 = call i32 @fscanf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %8)
%10 = bitcast %union.anon* %6 to i32*
%11 = load i32, i32* %10
%12 = and i32 %11, -65536
%13 = lshr i32 %12, 16
%14 = bitcast %union.anon* %6 to i32*
%15 = load i32, i32* %14
%16 = and i32 %15, 65535
%17 = shl i32 %16, 16
%18 = or i32 %13, %17
%19 = bitcast %union.anon* %6 to i32*
store i32 %18, i32* %19
%20 = bitcast %union.anon* %6 to i32*
%21 = load i32, i32* %20
%22 = and i32 %21, -16711936
%23 = lshr i32 %22, 8
%24 = bitcast %union.anon* %6 to i32*
%25 = load i32, i32* %24
%26 = and i32 %25, 16711935
%27 = shl i32 %26, 8
%28 = or i32 %23, %27
%29 = bitcast %union.anon* %6 to i32*
store i32 %28, i32* %29
%30 = load i32, i32* @stdout
%31 = bitcast %union.anon* %6 to i32*
%32 = load i32, i32* %31
%33 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
%union.anon = type { float }
@stdin = global i32 0
@.str = [3 x i8] c"%f\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"%08X\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %union.anon
%4 = bitcast %union.anon* %3 to i8*
%5 = load i32, i32* @stdin
%6 = getelementptr inbounds %union.anon, %union.anon* %3, i64 0, i32 0
%7 = call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %6)
%8 = bitcast %union.anon* %3 to i32*
%9 = load i32, i32* %8
%10 = call i32 @llvm.bswap.i32(i32 %9)
store i32 %10, i32* %8
%11 = load i32, i32* @stdout
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}