#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 *, double);
int main() {
  int i;
  double a[10] = {11111, 111111, 111111111};
  for (i = 0; i < 3; ++i) {
    printf("%lf\n", a[i] * a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11a5 <main+0x85>
movslq -0x8(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
movslq -0x8(%rbp),%rax
mulsd  -0x60(%rbp,%rax,8),%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116d <main+0x4d>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf00(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x419D6F0DC4000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x4206FEDDE1880000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x4345EE2A3148FA58)
ret i32 0
}