#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;
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, long long *);
double sqrt(long long);
int main() {
  long long int a;
  double *b = (double *)malloc(sizeof(double) * (2 * 256 * 1024 / 4));
  int i = 0;
  while (scanf("%lld", &a) != EOF) {
    b[i++] = sqrt(a);
  }
  for (int j = i - 1; j >= 0; j--)
    printf("%0.4f\n", b[j]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe95(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e6d(%rip),%rcx
cmp    (%rcx),%rax
je     11a9 <main+0x69>
mov    -0x10(%rbp),%rdi
call   1060 <sqrt@plt>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1164 <main+0x24>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     11e3 <main+0xa3>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    11b2 <main+0x72>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    %rax,%r12
lea    0xe9f(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e76(%rip),%r13
cmp    0x0(%r13),%rax
je     11eb <main+0xab>
xor    %ebx,%ebx
lea    0xe7f(%rip),%r14
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rsp),%rdi
call   1060 <sqrt@plt>
movsd  %xmm0,(%r12,%rbx,8)
add    $0x1,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1190 <main+0x50>
test   %ebx,%ebx
jle    11eb <main+0xab>
mov    %ebx,%ebx
add    $0x1,%rbx
lea    0xe3f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsd  (%r12,%rax,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     11d0 <main+0x90>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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