#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 /*<<< orphan*/ dd;

/* Variables and functions */
int /*<<< orphan*/ write(int, double *, int);
int main() {
  int ii = 0;
  double dd;
  for (ii = 0; ii < 10; ++ii) {
    dd = 100 * (1 << ii);
    write(1, &dd, sizeof(dd));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    116e <main+0x5e>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
imul   $0x64,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x1,%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x4059000000000000,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x4069000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x4079000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x4089000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x4099000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x40a9000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x40b9000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x40c9000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x40d9000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
movabs $0x40e9000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %2
%9 = shl i32 1, %8
%10 = mul nsw i32 100, %9
%11 = sitofp i32 %10 to double
store double %11, double* %3
%12 = call i32 @write(i32 1, double* %3, i32 8)
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 1.000000e+02, double* %1
%3 = call i32 @write(i32 1, double* %1, i32 8)
store double 2.000000e+02, double* %1
%4 = call i32 @write(i32 1, double* %1, i32 8)
store double 4.000000e+02, double* %1
%5 = call i32 @write(i32 1, double* %1, i32 8)
store double 8.000000e+02, double* %1
%6 = call i32 @write(i32 1, double* %1, i32 8)
store double 1.600000e+03, double* %1
%7 = call i32 @write(i32 1, double* %1, i32 8)
store double 3.200000e+03, double* %1
%8 = call i32 @write(i32 1, double* %1, i32 8)
store double 6.400000e+03, double* %1
%9 = call i32 @write(i32 1, double* %1, i32 8)
store double 1.280000e+04, double* %1
%10 = call i32 @write(i32 1, double* %1, i32 8)
store double 2.560000e+04, double* %1
%11 = call i32 @write(i32 1, double* %1, i32 8)
store double 5.120000e+04, double* %1
%12 = call i32 @write(i32 1, double* %1, i32 8)
ret i32 0
}