#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 /*<<< orphan*/ printf(char *, long);
main() {
  union {
    long l_e;
    float f_e;
  } u;
  long l_v;
  float f_v;
  l_v = u.l_e = 10;
  printf("%f ", (float)l_v);
  printf("%f ", u.f_e);
  f_v = u.f_e = 3.555;
  printf("%d ", (long)f_v);
  printf("%d ", u.l_e);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0xa,-0x8(%rbp)
movq   $0xa,-0x10(%rbp)
cvtsi2ssq -0x10(%rbp),%xmm0
cvttss2si %xmm0,%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
cvttss2si -0x8(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
movss  0xea7(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe9a(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x14(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    $0xa,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rbx
mov    $0x3,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x4063851f,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { i64 }
@.str = [4 x i8] c"%f \00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca %union.anon
%2 = alloca i64
%3 = alloca float
%4 = bitcast %union.anon* %1 to i64*
store i64 10, i64* %4
store i64 10, i64* %2
%5 = load i64, i64* %2
%6 = sitofp i64 %5 to float
%7 = fptosi float %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = bitcast %union.anon* %1 to float*
%10 = load float, float* %9
%11 = fptosi float %10 to i64
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = bitcast %union.anon* %1 to float*
store float 0x400C70A3E0000000, float* %13
store float 0x400C70A3E0000000, float* %3
%14 = load float, float* %3
%15 = fptosi float %14 to i64
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %15)
%17 = bitcast %union.anon* %1 to i64*
%18 = load i64, i64* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f \00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 1080263967)
ret i32 0
}