#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 scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, scalar_t__);
main() {
  double a = 0.1;
  uint64_t *y;
  y = (uint64_t *)&a;
  a = 0;
  printf("a=%f, y=0x%llx\n", a, (uint64_t)*y);
  a = 1;
  printf("a=%f, y=0x%llx\n", a, (uint64_t)*y);
  a = -1;
  printf("a=%f, y=0x%llx\n", a, (uint64_t)*y);
  a = 0.1;
  printf("a=%f, y=0x%llx\n", a, (uint64_t)*y);
  a = -0.1;
  printf("a=%f, y=0x%llx\n", a, (uint64_t)*y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe69(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe3c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf08(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movsd  0xed3(%rip),%xmm0
movabs $0x3ff0000000000000,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xec1(%rip),%xmm0
movabs $0xbff0000000000000,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xeaf(%rip),%xmm0
movabs $0x3fb999999999999a,%rsi
99 b9 3f
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xe9d(%rip),%xmm0
movabs $0xbfb999999999999a,%rsi
99 b9 bf
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"a=%f, y=0x%llx\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i64*
store double 1.000000e-01, double* %1
%3 = bitcast double* %1 to i64*
store i64* %3, i64** %2
store double 0.000000e+00, double* %1
%4 = load double, double* %1
%5 = load i64*, i64** %2
%6 = load i64, i64* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %4, i64 %6)
store double 1.000000e+00, double* %1
%8 = load double, double* %1
%9 = load i64*, i64** %2
%10 = load i64, i64* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %8, i64 %10)
store double -1.000000e+00, double* %1
%12 = load double, double* %1
%13 = load i64*, i64** %2
%14 = load i64, i64* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %12, i64 %14)
store double 1.000000e-01, double* %1
%16 = load double, double* %1
%17 = load i64*, i64** %2
%18 = load i64, i64* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %16, i64 %18)
store double -1.000000e-01, double* %1
%20 = load double, double* %1
%21 = load i64*, i64** %2
%22 = load i64, i64* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %20, i64 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"a=%f, y=0x%llx\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 0.000000e+00, i64 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, i64 4607182418800017408)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double -1.000000e+00, i64 -4616189618054758400)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 1.000000e-01, i64 4591870180066957722)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double -1.000000e-01, i64 -4631501856787818086)
ret i32 0
}