#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, double *);
double sqrt(double);
int main() {
  double results[150000];
  char stream[256 * 1024 + 1];
  const int stream_limit = 256 * 1024;
  int count = 0;
  double num = 0;
  while (scanf("%lf", &num) != EOF) {
    results[count] = sqrt(num);
    count++;
  }
  int i;
  for (i = count - 1; i >= 0; i--) {
    printf("%.4lf\n", results[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x164fc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x40000,-0x164fa4(%rbp)
movl   $0x0,-0x164fa8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x164fb0(%rbp)
ff
lea    0xe98(%rip),%rdi
lea    -0x164fb0(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e6d(%rip),%rcx
cmp    (%rcx),%rax
je     11b5 <main+0x85>
movsd  -0x164fb0(%rbp),%xmm0
ff
call   1050 <sqrt@plt>
movslq -0x164fa8(%rbp),%rax
movsd  %xmm0,-0x124f90(%rbp,%rax,8)
ed ff
mov    -0x164fa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164fa8(%rbp)
jmp    1161 <main+0x31>
mov    -0x164fa8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x164fb4(%rbp)
cmpl   $0x0,-0x164fb4(%rbp)
jl     1201 <main+0xd1>
movslq -0x164fb4(%rbp),%rax
movsd  -0x124f90(%rbp,%rax,8),%xmm0
ed ff
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x164fb4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x164fb4(%rbp)
jmp    11c4 <main+0x94>
xor    %eax,%eax
add    $0x164fc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x124f98,%rsp
movq   $0x0,0x8(%rsp)
lea    0xeba(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e89(%rip),%r12
cmp    (%r12),%rax
je     11eb <main+0xbb>
xor    %ebx,%ebx
lea    0xe96(%rip),%r14
lea    0x8(%rsp),%r15
jmp    11a0 <main+0x70>
nopl   0x0(%rax)
call   1050 <sqrt@plt>
movsd  %xmm0,0x10(%rsp,%rbx,8)
add    $0x1,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
je     11b6 <main+0x86>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe52(%rip),%xmm0
jb     1180 <main+0x50>
sqrtsd %xmm0,%xmm0
jmp    1185 <main+0x55>
test   %ebx,%ebx
jle    11eb <main+0xbb>
mov    %ebx,%ebx
add    $0x1,%rbx
lea    0xe45(%rip),%r14
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsd  0x10(%rsp,%rax,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     11d0 <main+0xa0>
xor    %eax,%eax
add    $0x124f98,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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