#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 int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
int /*<<< orphan*/ stdlib_base_float64_set_low_word(int, double *);
int main() {
  uint32_t low[] = {1374389535, 1374389545, 1374389555, 1374389565};
  double x = 3.14;
  int i;
  for (i = 0; i < 4; i++) {
    stdlib_base_float64_set_low_word(low[i], &x);
    printf("low: %u => %.15lf\n", low[i], x);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    119b <main+0x7b>
movslq -0x2c(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
lea    -0x28(%rbp),%rsi
call   1040 <stdlib_base_float64_set_low_word@plt>
movslq -0x2c(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
movsd  -0x28(%rbp),%xmm0
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1159 <main+0x39>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movabs $0x40091eb851eb851f,%rax
1e 09 40
mov    %rax,(%rsp)
mov    %rsp,%r14
mov    $0x51eb851f,%edi
mov    %r14,%rsi
call   1040 <stdlib_base_float64_set_low_word@plt>
movsd  (%rsp),%xmm0
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x51eb851f,%esi
call   1030 <printf@plt>
mov    $0x51eb8529,%edi
mov    %r14,%rsi
call   1040 <stdlib_base_float64_set_low_word@plt>
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x51eb8529,%esi
call   1030 <printf@plt>
mov    $0x51eb8533,%edi
mov    %r14,%rsi
call   1040 <stdlib_base_float64_set_low_word@plt>
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x51eb8533,%esi
call   1030 <printf@plt>
mov    $0x51eb853d,%edi
mov    %r14,%rsi
call   1040 <stdlib_base_float64_set_low_word@plt>
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x51eb853d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.low = [4 x i32] [i32 1374389535, i32 1374389545, i32 1374389555, i32 1374389565]
@.str = [19 x i8] c"low: %u => %.15lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [4 x i32]* %2 to i8*
store double 3.140000e+00, double* %3
store i32 0, i32* %4
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = call i32 @stdlib_base_float64_set_low_word(i32 %13, double* %3)
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = load double, double* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %18, double %19)
br label %21
21: ; preds = %9
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str = [19 x i8] c"low: %u => %.15lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 3.140000e+00, double* %1
%3 = call i32 @stdlib_base_float64_set_low_word(i32 1374389535, double* %1)
%4 = load double, double* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1374389535, double %4)
%6 = call i32 @stdlib_base_float64_set_low_word(i32 1374389545, double* %1)
%7 = load double, double* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1374389545, double %7)
%9 = call i32 @stdlib_base_float64_set_low_word(i32 1374389555, double* %1)
%10 = load double, double* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1374389555, double %10)
%12 = call i32 @stdlib_base_float64_set_low_word(i32 1374389565, double* %1)
%13 = load double, double* %1
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1374389565, double %13)
ret i32 0
}