#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, int, double);
int /*<<< orphan*/ stdlib_base_float64_from_words(int, int, double *);
int main() {
  uint32_t high = 1074339512;
  uint32_t low[] = {0, 10000, 1000000, 1374389535};
  double x;
  int i;
  for (i = 0; i < 4; i++) {
    stdlib_base_float64_from_words(high, low[i], &x);
    printf("high: %u, low: %u => %lf\n", high, low[i], x);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x40091eb8,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    119b <main+0x7b>
mov    -0x8(%rbp),%edi
movslq -0x2c(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    -0x28(%rbp),%rdx
call   1040 <stdlib_base_float64_from_words@plt>
mov    -0x8(%rbp),%esi
movslq -0x2c(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
movsd  -0x28(%rbp),%xmm0
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1153 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
mov    $0x40091eb8,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <stdlib_base_float64_from_words@plt>
movsd  (%rsp),%xmm0
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    $0x40091eb8,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x40091eb8,%edi
mov    $0x2710,%esi
mov    %r14,%rdx
call   1040 <stdlib_base_float64_from_words@plt>
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x40091eb8,%esi
mov    $0x2710,%edx
call   1030 <printf@plt>
mov    $0x40091eb8,%edi
mov    $0xf4240,%esi
mov    %r14,%rdx
call   1040 <stdlib_base_float64_from_words@plt>
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x40091eb8,%esi
mov    $0xf4240,%edx
call   1030 <printf@plt>
mov    $0x40091eb8,%edi
mov    $0x51eb851f,%esi
mov    %r14,%rdx
call   1040 <stdlib_base_float64_from_words@plt>
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x40091eb8,%esi
mov    $0x51eb851f,%edx
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 0, i32 10000, i32 1000000, i32 1374389535]
@.str = [26 x i8] c"high: %u, low: %u => %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
store i32 1074339512, i32* %2
%6 = bitcast [4 x i32]* %3 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %24, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @stdlib_base_float64_from_words(i32 %11, i32 %15, double* %4)
%17 = load i32, i32* %2
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = load double, double* %4
%23 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %21, double %22)
br label %24
24: ; preds = %10
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %7
27: ; preds = %7
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [26 x i8] c"high: %u, low: %u => %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @stdlib_base_float64_from_words(i32 1074339512, i32 0, double* %1)
%4 = load double, double* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1074339512, i32 0, double %4)
%6 = call i32 @stdlib_base_float64_from_words(i32 1074339512, i32 10000, double* %1)
%7 = load double, double* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1074339512, i32 10000, double %7)
%9 = call i32 @stdlib_base_float64_from_words(i32 1074339512, i32 1000000, double* %1)
%10 = load double, double* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1074339512, i32 1000000, double %10)
%12 = call i32 @stdlib_base_float64_from_words(i32 1074339512, i32 1374389535, double* %1)
%13 = load double, double* %1
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1074339512, i32 1374389535, double %13)
ret i32 0
}