int main() {
  union {
    float f;
    unsigned int i;
  } dfloat;
  union {
    double f;
    unsigned long i;
  } ddouble;
  printf("[%s:%d] sizeof(float) %ld sizeof(double) %ld\n", __FUNCTION__, 14,
         sizeof(float), sizeof(double));
  dfloat.i = 0x3f60be97;
  printf("[%s:%d] f %f\n", __FUNCTION__, 16, dfloat.f);
  printf("[%s:%d] i %x\n", __FUNCTION__, 17, dfloat.i);
  dfloat.f = 3.14159;
  printf("[%s:%d] 2f %f\n", __FUNCTION__, 19, dfloat.f);
  printf("[%s:%d] 2i %x\n", __FUNCTION__, 20, dfloat.i);
  ddouble.f = 3.14159;
  printf("[%s:%d] 2f %f\n", __FUNCTION__, 22, ddouble.f);
  printf("[%s:%d] 2i %lx\n", __FUNCTION__, 23, ddouble.i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee6(%rip),%rdi
lea    0xf0d(%rip),%rsi
mov    $0xe,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3f60be97,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xee4(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x10,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0x11,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe75(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb3(%rip),%rdi
lea    0xe8b(%rip),%rsi
mov    $0x13,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%ecx
lea    0xea5(%rip),%rdi
lea    0xe6e(%rip),%rsi
mov    $0x14,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xe20(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe6a(%rip),%rdi
lea    0xe42(%rip),%rsi
mov    $0x16,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rcx
lea    0xe6a(%rip),%rdi
lea    0xe24(%rip),%rsi
mov    $0x17,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xefd(%rip),%rdi
lea    0xf24(%rip),%rbx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    %rbx,%rsi
mov    $0xe,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
movsd  0xeb5(%rip),%xmm0
mov    %rbx,%rsi
mov    $0x10,%edx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    %rbx,%rsi
mov    $0x11,%edx
mov    $0x3f60be97,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%r14
movsd  0xe84(%rip),%xmm0
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x13,%edx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rbx,%rsi
mov    $0x14,%edx
mov    $0x40490fd0,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0xe57(%rip),%xmm0
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x16,%edx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
movabs $0x400921f9f01b866e,%rcx
21 09 40
mov    %rbx,%rsi
mov    $0x17,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.anon = type { float }
%union.anon.0 = type { double }
@.str = [46 x i8] c"[%s:%d] sizeof(float) %ld sizeof(double) %ld\0A\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
@.str.1 = [14 x i8] c"[%s:%d] f %f\0A\00"
@.str.2 = [14 x i8] c"[%s:%d] i %x\0A\00"
@.str.3 = [15 x i8] c"[%s:%d] 2f %f\0A\00"
@.str.4 = [15 x i8] c"[%s:%d] 2i %x\0A\00"
@.str.5 = [16 x i8] c"[%s:%d] 2i %lx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = alloca %union.anon.0
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 14, i64 4, i64 8)
%5 = bitcast %union.anon* %2 to i32*
store i32 1063304855, i32* %5
%6 = bitcast %union.anon* %2 to float*
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 16, double %8)
%10 = bitcast %union.anon* %2 to i32*
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 17, i32 %11)
%13 = bitcast %union.anon* %2 to float*
store float 0x400921FA00000000, float* %13
%14 = bitcast %union.anon* %2 to float*
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 19, double %16)
%18 = bitcast %union.anon* %2 to i32*
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 20, i32 %19)
%21 = bitcast %union.anon.0* %3 to double*
store double 3.141590e+00, double* %21
%22 = bitcast %union.anon.0* %3 to double*
%23 = load double, double* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 22, double %23)
%25 = bitcast %union.anon.0* %3 to i64*
%26 = load i64, i64* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 23, i64 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"[%s:%d] sizeof(float) %ld sizeof(double) %ld\0A\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
@.str.1 = [14 x i8] c"[%s:%d] f %f\0A\00"
@.str.2 = [14 x i8] c"[%s:%d] i %x\0A\00"
@.str.3 = [15 x i8] c"[%s:%d] 2f %f\0A\00"
@.str.4 = [15 x i8] c"[%s:%d] 2i %x\0A\00"
@.str.5 = [16 x i8] c"[%s:%d] 2i %lx\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 14, i64 4, i64 8)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 16, double 0x3FEC17D2E0000000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 17, i32 1063304855)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 19, double 0x400921FA00000000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 20, i32 1078530000)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 22, double 3.141590e+00)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 23, i64 4614256650576692846)
ret i32 0
}