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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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,-0x18(%rbp)
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movq   $0x0,-0x38(%rbp)
cmpq   $0x5,-0x38(%rbp)
jae    11c5 <main+0xa5>
mov    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm0
mov    -0x38(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm1
mov    -0x38(%rbp),%rax
mulsd  -0x30(%rbp,%rax,8),%xmm1
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    117b <main+0x5b>
mov    0x2e14(%rip),%rax
mov    (%rax),%eax
add    $0x40,%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    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x2,%esi
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xeb6(%rip),%xmm0
movsd  0xeb6(%rip),%xmm1
mov    $0x3,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xea9(%rip),%xmm0
movsd  0xea9(%rip),%xmm1
mov    $0x4,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"element %zu is %g, \09its square is %g\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x double]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [5 x double]* %2 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 3
store double 0x3F12599ED7C6FBD2, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %5, i32 0, i32 4
store double 3.000000e+25, double* %9
store i64 0, i64* %3
br label %10
10: ; preds = %26, %0
%11 = load i64, i64* %3
%12 = icmp ult i64 %11, 5
br i1 %12, label %13, label %29
13: ; preds = %10
%14 = load i64, i64* %3
%15 = load i64, i64* %3
%16 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 %15
%17 = load double, double* %16
%18 = load i64, i64* %3
%19 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 %18
%20 = load double, double* %19
%21 = load i64, i64* %3
%22 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 %21
%23 = load double, double* %22
%24 = fmul double %20, %23
%25 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %14, double %17, double %24)
br label %26
26: ; preds = %13
%27 = load i64, i64* %3
%28 = add i64 %27, 1
store i64 %28, i64* %3
br label %10
29: ; preds = %10
%30 = load i32, i32* @EXIT_SUCCESS
ret i32 %30
}

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