#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 /*<<< orphan*/);
int scanf(char *, double *);
int /*<<< orphan*/ sqrt(double);
int main() {
  int i, j;
  double n[500000];
  for (i = 0; i < 500000; i++) {
    if (1 != scanf("%lf\n", &n[i]))
      break;
  }
  for (j = i - 1; j >= 0; j--) {
    printf("%lf\n", sqrt(n[j]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0910,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7a120,-0x8(%rbp)
jge    119b <main+0x6b>
movslq -0x8(%rbp),%rax
lea    -0x3d0910(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe91(%rip),%rdi
call   1040 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1188 <main+0x58>
jmp    119b <main+0x6b>
jmp    118d <main+0x5d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x19>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     11dc <main+0xac>
movslq -0xc(%rbp),%rax
movsd  -0x3d0910(%rbp,%rax,8),%xmm0
c2 ff
call   1050 <sqrt@plt>
mov    %eax,%esi
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11a4 <main+0x74>
xor    %eax,%eax
add    $0x3d0910,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3d0900,%rsp
mov    %rsp,%r15
xor    %ebx,%ebx
lea    0xeb8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1178 <main+0x48>
add    $0x1,%rbx
add    $0x8,%r15
cmp    $0x7a120,%rbx
jne    1150 <main+0x20>
mov    $0x7a120,%ebx
jmp    117c <main+0x4c>
test   %ebx,%ebx
jle    11af <main+0x7f>
add    $0x1,%rbx
lea    0xe79(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsd  -0x10(%rsp,%rbx,8),%xmm0
call   1050 <sqrt@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1190 <main+0x60>
xor    %eax,%eax
add    $0x3d0900,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca [500000 x double]
%2 = bitcast [500000 x double]* %1 to i8*
br label %3
3: ; preds = %0, %8
%4 = phi i64 [ 0, %0 ], [ %9, %8 ]
%5 = getelementptr inbounds [500000 x double], [500000 x double]* %1, i64 0, i64 %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 500000
br i1 %10, label %14, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %8, %11
%15 = phi i64 [ %4, %11 ], [ 500000, %8 ]
%16 = and i64 %15, 4294967295
br label %17
17: ; preds = %14, %17
%18 = phi i64 [ %16, %14 ], [ %19, %17 ]
%19 = add nsw i64 %18, -1
%20 = getelementptr inbounds [500000 x double], [500000 x double]* %1, i64 0, i64 %19
%21 = load double, double* %20
%22 = call i32 @sqrt(double %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = icmp ugt i64 %18, 1
br i1 %24, label %17, label %25
25: ; preds = %17, %11
ret i32 0
}