#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 */
double *malloc(int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(int i) {
  double *a = malloc(5 * sizeof(double));
  for (i = 0; i < 5; scanf("%lf", a + i++))
    ;
  for (i = 0; i < 5; printf("%.1lf ", a[i++]))
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    118f <main+0x5f>
jmp    1166 <main+0x36>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cltq
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe7b(%rip),%rdi
call   1050 <scanf@plt>
jmp    1157 <main+0x27>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11cd <main+0x9d>
jmp    11a5 <main+0x75>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <main+0x66>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <scanf@plt>
lea    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
lea    0x10(%rbx),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
lea    0x18(%rbx),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
lea    0x20(%rbx),%rsi
mov    %r14,%rdi
call   1050 <scanf@plt>
movsd  (%rbx),%xmm0
lea    0xe76(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.1lf \00"
define i32 @main(i32 %0) {
%2 = tail call double* @malloc(i32 40)
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = getelementptr inbounds double, double* %2, i64 1
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%6 = getelementptr inbounds double, double* %2, i64 2
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%8 = getelementptr inbounds double, double* %2, i64 3
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %8)
%10 = getelementptr inbounds double, double* %2, i64 4
%11 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %10)
%12 = load double, double* %2
%13 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = load double, double* %4
%15 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %14)
%16 = load double, double* %6
%17 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load double, double* %8
%19 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %18)
%20 = load double, double* %10
%21 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %20)
ret i32 0
}