#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, int, double);
int main() {
  double first[8] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8}, second[8];
  int k;
  second[0] = first[0];
  for (k = 1; k < 8; k++) {
    second[k] = first[k] + first[k - 1];
  }
  k = 0;
  while (k < 8) {
    printf("first[%d] - %3.2f -> secod[%d] - %5.2f\n", k, first[k], k,
           second[k]);
    ++k;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x1,-0x94(%rbp)
cmpl   $0x8,-0x94(%rbp)
jge    11ad <main+0x8d>
movslq -0x94(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
mov    -0x94(%rbp),%eax
sub    $0x1,%eax
cltq
addsd  -0x50(%rbp,%rax,8),%xmm0
movslq -0x94(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    115e <main+0x3e>
movl   $0x0,-0x94(%rbp)
cmpl   $0x8,-0x94(%rbp)
jge    120d <main+0xed>
mov    -0x94(%rbp),%esi
movslq -0x94(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
mov    -0x94(%rbp),%edx
movslq -0x94(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm1
ff ff
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11b7 <main+0x97>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf50(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movsd  0xed1(%rip),%xmm0
movsd  0xed1(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
movsd  0xebf(%rip),%xmm0
movsd  0xebf(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
movsd  0xead(%rip),%xmm0
movsd  0xead(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
movsd  0xe9b(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x4,%esi
movsd  0xe73(%rip),%xmm0
mov    $0x4,%edx
call   1030 <printf@plt>
movsd  0xe81(%rip),%xmm0
movsd  0xe81(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
movsd  0xe6f(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x6,%esi
movsd  0xe3f(%rip),%xmm0
mov    $0x6,%edx
call   1030 <printf@plt>
movsd  0xe55(%rip),%xmm0
movsd  0xe55(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x7,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.first = [8 x double] [double 1.100000e+00, double 2.200000e+00, double 3.300000e+00, double 4.400000e+00, double 5.500000e+00, double 6.600000e+00, double 7.700000e+00, double 8.800000e+00]
@.str = [40 x i8] c"first[%d] - %3.2f -> secod[%d] - %5.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x double]
%3 = alloca [8 x double]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [8 x double]* %2 to i8*
%6 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 0
%7 = load double, double* %6
%8 = getelementptr inbounds [8 x double], [8 x double]* %3, i64 0, i64 0
store double %7, double* %8
store i32 1, i32* %4
br label %9
9: ; preds = %26, %0
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %29
12: ; preds = %9
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %14
%16 = load double, double* %15
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %19
%21 = load double, double* %20
%22 = fadd double %16, %21
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [8 x double], [8 x double]* %3, i64 0, i64 %24
store double %22, double* %25
br label %26
26: ; preds = %12
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %9
29: ; preds = %9
store i32 0, i32* %4
br label %30
30: ; preds = %33, %29
%31 = load i32, i32* %4
%32 = icmp slt i32 %31, 8
br i1 %32, label %33, label %47
33: ; preds = %30
%34 = load i32, i32* %4
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %36
%38 = load double, double* %37
%39 = load i32, i32* %4
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [8 x double], [8 x double]* %3, i64 0, i64 %41
%43 = load double, double* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %34, double %38, i32 %39, double %43)
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
br label %30
47: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"first[%d] - %3.2f -> secod[%d] - %5.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 0, double 1.100000e+00, i32 0, double 1.100000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 1, double 2.200000e+00, i32 1, double 0x400A666666666667)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 2, double 3.300000e+00, i32 2, double 5.500000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 3, double 4.400000e+00, i32 3, double 7.700000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 4, double 5.500000e+00, i32 4, double 9.900000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 5, double 6.600000e+00, i32 5, double 1.210000e+01)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 6, double 7.700000e+00, i32 6, double 1.430000e+01)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 7, double 8.800000e+00, i32 7, double 1.650000e+01)
ret i32 0
}