#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 *, int, double, double);
int main() {
  int i;
  double A[5] = {
      9.0,
      2.9,
      3.E+25,
      0.00007,
  };
  for (i = 0; i < 5; ++i) {
    printf("element %d is %g, \tits square is %g\n", i, A[i], A[i] * A[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11bf <main+0x9f>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm0
movslq -0x8(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm1
movslq -0x8(%rbp),%rax
mulsd  -0x30(%rbp,%rax,8),%xmm1
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117a <main+0x5a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf28(%rip),%rbx
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movsd  0xed6(%rip),%xmm0
movsd  0xed6(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
movsd  0xec9(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movsd  0xebc(%rip),%xmm0
movsd  0xebc(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"element %d is %g, \09its square is %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x double]
store i32 0, i32* %1
%4 = bitcast [5 x double]* %3 to i8*
%5 = bitcast i8* %4 to [5 x double]*
%6 = getelementptr inbounds [5 x double], [5 x double]* %5, i32 0, i32 0
store double 9.000000e+00, double* %6
%7 = getelementptr inbounds [5 x double], [5 x double]* %5, i32 0, i32 1
store double 2.900000e+00, double* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %5, i32 0, i32 2
store double 3.000000e+25, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %5, i32 0, i32 3
store double 0x3F12599ED7C6FBD2, double* %9
store i32 0, i32* %2
br label %10
10: ; preds = %29, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %32
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 %16
%18 = load double, double* %17
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 %20
%22 = load double, double* %21
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 %24
%26 = load double, double* %25
%27 = fmul double %22, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %14, double %18, double %27)
br label %29
29: ; preds = %13
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %10
32: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"element %d is %g, \09its square is %g\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 0, double 9.000000e+00, double 8.100000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 1, double 2.900000e+00, double 8.410000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 2, double 3.000000e+25, double 9.000000e+50)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 3, double 0x3F12599ED7C6FBD2, double 0x3E350B9B62C92D42)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 4, double 0.000000e+00, double 0.000000e+00)
ret i32 0
}