#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 *, unsigned long long, double,
                          unsigned long long, double);
int main() {
  unsigned long long NX = 124, X;
  do {
    X = NX;
    printf("%llu = %f  %lld = %f\n", X, (double)X, X,
           (double)(signed long long)X);
    NX += 1ULL << 60;
  } while (X < NX);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x7c,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
movq   %rsi,%xmm0
movaps 0xec1(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xec5(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rdx
cvtsi2sdq -0x18(%rbp),%xmm1
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movabs $0x1000000000000000,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1127 <main+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xfa8(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    $0x7c,%esi
mov    $0x7c,%edx
mov    %rbx,%rdi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movabs $0x100000000000007c,%rdx
movsd  0xec1(%rip),%xmm0
mov    %rbx,%rdi
mov    %rdx,%rsi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movabs $0x200000000000007c,%rdx
movsd  0xea9(%rip),%xmm0
mov    %rbx,%rdi
mov    %rdx,%rsi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movabs $0x300000000000007c,%rdx
movsd  0xe91(%rip),%xmm0
mov    %rbx,%rdi
mov    %rdx,%rsi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movabs $0x400000000000007c,%rdx
movsd  0xe79(%rip),%xmm0
mov    %rbx,%rdi
mov    %rdx,%rsi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movabs $0x500000000000007c,%rdx
movsd  0xe61(%rip),%xmm0
mov    %rbx,%rdi
mov    %rdx,%rsi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movabs $0x600000000000007c,%rdx
movsd  0xe49(%rip),%xmm0
mov    %rbx,%rdi
mov    %rdx,%rsi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movabs $0x700000000000007c,%rdx
movsd  0xe31(%rip),%xmm0
mov    %rbx,%rdi
mov    %rdx,%rsi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movsd  0xe23(%rip),%xmm0
movabs $0x800000000000007c,%rdx
movsd  0xe19(%rip),%xmm1
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
movsd  0xe0e(%rip),%xmm0
movabs $0x900000000000007c,%rdx
movsd  0xe04(%rip),%xmm1
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
movsd  0xdf9(%rip),%xmm0
movabs $0xa00000000000007c,%rdx
movsd  0xdef(%rip),%xmm1
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
movsd  0xde4(%rip),%xmm0
movabs $0xb00000000000007c,%rdx
movsd  0xdda(%rip),%xmm1
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
movsd  0xdcf(%rip),%xmm0
movabs $0xc00000000000007c,%rdx
movsd  0xdc5(%rip),%xmm1
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
movsd  0xdba(%rip),%xmm0
movabs $0xd00000000000007c,%rdx
movsd  0xdb0(%rip),%xmm1
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
movsd  0xda5(%rip),%xmm0
movabs $0xe00000000000007c,%rdx
movsd  0xd9b(%rip),%xmm1
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
movsd  0xd90(%rip),%xmm0
movabs $0xf00000000000007c,%rdx
movsd  0xd86(%rip),%xmm1
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%llu = %f %lld = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 124, i64* %2
br label %4
4: ; preds = %15, %0
%5 = load i64, i64* %2
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = uitofp i64 %7 to double
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = sitofp i64 %10 to double
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %6, double %8, i64 %9, double %11)
%13 = load i64, i64* %2
%14 = add i64 %13, 1152921504606846976
store i64 %14, i64* %2
br label %15
15: ; preds = %4
%16 = load i64, i64* %3
%17 = load i64, i64* %2
%18 = icmp ult i64 %16, %17
br i1 %18, label %4, label %19
19: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"%llu = %f %lld = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 124, double 1.240000e+02, i64 124, double 1.240000e+02)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 1152921504606847100, double 0x43B0000000000000, i64 1152921504606847100, double 0x43B0000000000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 2305843009213694076, double 0x43C0000000000000, i64 2305843009213694076, double 0x43C0000000000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 3458764513820541052, double 0x43C8000000000000, i64 3458764513820541052, double 0x43C8000000000000)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 4611686018427388028, double 0x43D0000000000000, i64 4611686018427388028, double 0x43D0000000000000)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 5764607523034235004, double 0x43D4000000000000, i64 5764607523034235004, double 0x43D4000000000000)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 6917529027641081980, double 0x43D8000000000000, i64 6917529027641081980, double 0x43D8000000000000)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 8070450532247928956, double 0x43DC000000000000, i64 8070450532247928956, double 0x43DC000000000000)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 -9223372036854775684, double 0x43E0000000000000, i64 -9223372036854775684, double 0xC3E0000000000000)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 -8070450532247928708, double 0x43E2000000000000, i64 -8070450532247928708, double 0xC3DC000000000000)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 -6917529027641081732, double 0x43E4000000000000, i64 -6917529027641081732, double 0xC3D8000000000000)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 -5764607523034234756, double 0x43E6000000000000, i64 -5764607523034234756, double 0xC3D4000000000000)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 -4611686018427387780, double 0x43E8000000000000, i64 -4611686018427387780, double 0xC3D0000000000000)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 -3458764513820540804, double 0x43EA000000000000, i64 -3458764513820540804, double 0xC3C8000000000000)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 -2305843009213693828, double 0x43EC000000000000, i64 -2305843009213693828, double 0xC3C0000000000000)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 -1152921504606846852, double 0x43EE000000000000, i64 -1152921504606846852, double 0xC3AFFFFFFFFFFFFF)
ret i32 0
}