#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 */
int printf(char *, unsigned long, unsigned long, unsigned long, unsigned long);
int float_to_ulong(void) {
  float f1 = 1.5678e30f, f2 = (1ul << 63), f3 = (0xFFFFFFFFFFFFFFFFul),
        f4 = (0x7FFFFFFFFFFFFFFFl);
  unsigned long a = f1, b = f2, c = f3, d = f4;
  return printf("(float) unsigned long: %lu, %lu, %lu, %lu\n", a, b, c, d);
}


x86 assembly (clang, -O0):
<float_to_ulong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x719e4eae,-0x4(%rbp)
movl   $0x5f000000,-0x8(%rbp)
movl   $0x5f800000,-0xc(%rbp)
movl   $0x5f000000,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xebf(%rip),%xmm2
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x28(%rbp)
movss  -0x10(%rbp),%xmm0
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_to_ulong>:
lea    0xee9(%rip),%rdi
movabs $0x8000000000000000,%rdx
mov    %rdx,%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"(float) unsigned long: %lu, %lu, %lu, %lu\0A\00"
define i32 @float_to_ulong() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store float 0x4633C9D5C0000000, float* %1
store float 0x43E0000000000000, float* %2
store float 0x43F0000000000000, float* %3
store float 0x43E0000000000000, float* %4
%9 = load float, float* %1
%10 = fptoui float %9 to i64
store i64 %10, i64* %5
%11 = load float, float* %2
%12 = fptoui float %11 to i64
store i64 %12, i64* %6
%13 = load float, float* %3
%14 = fptoui float %13 to i64
store i64 %14, i64* %7
%15 = load float, float* %4
%16 = fptoui float %15 to i64
store i64 %16, i64* %8
%17 = load i64, i64* %5
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = load i64, i64* %8
%21 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %17, i64 %18, i64 %19, i64 %20)
ret i32 %21
}

LLVM IR (-O2):
@.str = [43 x i8] c"(float) unsigned long: %lu, %lu, %lu, %lu\0A\00"
define i32 @float_to_ulong() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 poison, i64 -9223372036854775808, i64 poison, i64 -9223372036854775808)
ret i32 %1
}