#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ calloc(int, int);
int /*<<< orphan*/ error_print(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(double *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, double *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ realloc(double *, int);
scalar_t__ sqrt(double);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int /*<<< orphan*/ stderr;
void main(int argc, char *argv[]) {
  double *x, *x1, dum;
  double lev;
  int i, nn, nn1, j;
  long ik;
  FILE *fr, *fr1;
  if (argc < 2 || argc > 4) {
    error_print(argv[0]);
    exit(1);
  }
  sscanf(argv[3], "%le", &lev);
  fr = fopen(argv[1], "r");
  x = (double *)calloc(1, sizeof(double));
  ik = 0;
  while ((fscanf(fr, "%le", &dum)) != EOF) {
    x = (double *)realloc(x, sizeof(double) * (ik + 1));
    if (x == NULL) {
      fprintf(stderr, "mask: Allocation error while reading, exiting\n");
      exit(1);
    }
    x[ik] = dum;
    ik++;
  }
  nn = (int)sqrt((double)ik);
  x1 = (double *)calloc(1, sizeof(double));
  fr1 = fopen(argv[2], "r");
  ik = 0;
  while ((fscanf(fr1, "%le", &dum)) != EOF) {
    x1 = (double *)realloc(x1, sizeof(double) * (ik + 1));
    if (x1 == NULL) {
      fprintf(stderr, "mask: Allocation error while reading, exiting\n");
      exit(1);
    }
    x1[ik] = dum;
    ik++;
  }
  nn1 = (int)sqrt((double)ik);
  if (nn1 != nn)
    fprintf(stderr, "mask: dimensions of files are different, exiting\n");
  fclose(fr1);
  ik = 0;
  for (i = 1; i <= nn; i++) {
    for (j = 1; j <= nn; j++) {
      if (x1[ik] > lev)
        printf("%e\n", x[ik]);
      else
        printf("%e\n", 0.);
      ik++;
    }
    printf("\n");
  }
  free(x);
  free(x1);
  fclose(fr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     11e3 <main+0x23>
cmpl   $0x4,-0x4(%rbp)
jle    11f9 <main+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <error_print@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdf8(%rip),%rsi
lea    -0x30(%rbp),%rdx
call   1090 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde4(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x50(%rbp)
mov    $0x1,%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x50(%rbp),%rdi
lea    0xdb1(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1060 <fscanf@plt>
mov    0x2d89(%rip),%rcx
cmp    (%rcx),%rax
je     12d0 <main+0x110>
mov    -0x18(%rbp),%rdi
mov    -0x48(%rbp),%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%esi
call   10b0 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12ad <main+0xed>
mov    0x2d43(%rip),%rax
mov    (%rax),%edi
lea    0xd68(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1244 <main+0x84>
cvtsi2sdq -0x48(%rbp),%xmm0
call   10d0 <sqrt@plt>
mov    %eax,-0x38(%rbp)
mov    $0x1,%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd04(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x58(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x58(%rbp),%rdi
lea    0xce4(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1060 <fscanf@plt>
mov    0x2cbc(%rip),%rcx
cmp    (%rcx),%rax
je     139d <main+0x1dd>
mov    -0x20(%rbp),%rdi
mov    -0x48(%rbp),%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%esi
call   10b0 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    137a <main+0x1ba>
mov    0x2c76(%rip),%rax
mov    (%rax),%edi
lea    0xc9b(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1311 <main+0x151>
cvtsi2sdq -0x48(%rbp),%xmm0
call   10d0 <sqrt@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
je     13cc <main+0x20c>
mov    0x2c1a(%rip),%rax
mov    (%rax),%edi
lea    0xc6e(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x58(%rbp),%rdi
call   1040 <fclose@plt>
movq   $0x0,-0x48(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     1482 <main+0x2c2>
movl   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     1466 <main+0x2a6>
mov    -0x20(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    143b <main+0x27b>
mov    -0x18(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xc38(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    144c <main+0x28c>
lea    0xc25(%rip),%rdi
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    13f7 <main+0x237>
lea    0xbfc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13e4 <main+0x224>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r13
add    $0xfffffffb,%edi
cmp    $0xfffffffc,%edi
jbe    1456 <main+0x286>
mov    0x18(%r13),%rdi
lea    0xe08(%rip),%r14
lea    0x20(%rsp),%rdx
mov    %r14,%rsi
call   10a0 <sscanf@plt>
mov    0x8(%r13),%rdi
lea    0xdf4(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbp
mov    $0x8,%ebx
mov    $0x1,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,%r12
lea    0x8(%rsp),%rdx
mov    %rbp,0x10(%rsp)
mov    %rbp,%rdi
mov    %r14,%rsi
call   1070 <fscanf@plt>
mov    0x2d9d(%rip),%rcx
xorpd  %xmm0,%xmm0
cmp    (%rcx),%rax
je     12bc <main+0xec>
xor    %ebp,%ebp
lea    0xda3(%rip),%r14
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %ebx,%esi
call   10c0 <realloc@plt>
test   %rax,%rax
je     1437 <main+0x267>
mov    %rax,%r12
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rax,%rbp,8)
mov    0x10(%rsp),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1070 <fscanf@plt>
add    $0x8,%ebx
add    $0x1,%rbp
mov    0x2d39(%rip),%rcx
cmp    (%rcx),%rax
jne    1270 <main+0xa0>
xorps  %xmm0,%xmm0
cvtsi2sd %rbp,%xmm0
call   10e0 <sqrt@plt>
mov    %rax,%r15
mov    $0x8,%ebp
mov    $0x1,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,%r14
mov    0x10(%r13),%rdi
lea    0xd1e(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r13
lea    0xd0b(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1070 <fscanf@plt>
mov    0x2cdf(%rip),%rcx
cmp    (%rcx),%rax
xorpd  %xmm0,%xmm0
je     1370 <main+0x1a0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
call   10c0 <realloc@plt>
test   %rax,%rax
je     1437 <main+0x267>
mov    %rax,%r14
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rax,%rbx,8)
mov    %r13,%rdi
lea    0xcb5(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1070 <fscanf@plt>
add    $0x8,%ebp
add    $0x1,%rbx
mov    0x2c85(%rip),%rcx
cmp    (%rcx),%rax
jne    1320 <main+0x150>
xorps  %xmm0,%xmm0
cvtsi2sd %rbx,%xmm0
call   10e0 <sqrt@plt>
cmp    %r15d,%eax
je     138f <main+0x1bf>
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
lea    0xcab(%rip),%rsi
call   1090 <fprintf@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
test   %r15d,%r15d
jle    140e <main+0x23e>
mov    $0x1,%r13d
xor    %ebx,%ebx
lea    0xcbc(%rip),%rbp
mov    %r15,0x18(%rsp)
jmp    13db <main+0x20b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x1(%r13),%eax
mov    0x18(%rsp),%r15
cmp    %r15d,%r13d
mov    %eax,%r13d
je     140e <main+0x23e>
jmp    13f4 <main+0x224>
nopl   (%rax)
mov    %rbp,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x1,%rbx
add    $0xffffffff,%r15d
je     13c0 <main+0x1f0>
movsd  (%r14,%rbx,8),%xmm1
xorpd  %xmm0,%xmm0
ucomisd 0x20(%rsp),%xmm1
jbe    13e0 <main+0x210>
movsd  (%r12,%rbx,8),%xmm0
jmp    13e0 <main+0x210>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b9a(%rip),%rax
mov    (%rax),%edi
lea    0xbbf(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x0(%r13),%rdi
call   10b0 <error_print@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%le\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i64 0
@stderr = global i32 0
@.str.2 = [47 x i8] c"mask: Allocation error while reading, exiting\0A\00"
@.str.3 = [50 x i8] c"mask: dimensions of files are different, exiting\0A\00"
@.str.4 = [4 x i8] c"%e\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca i32*
%15 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 2
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 4
br i1 %20, label %21, label %27
21: ; preds = %18, %2
%22 = load i8**, i8*** %4
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @error_print(i8* %24)
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %18
%28 = load i8**, i8*** %4
%29 = getelementptr inbounds i8*, i8** %28, i64 3
%30 = load i8*, i8** %29
%31 = call i32 @sscanf(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %8)
%32 = load i8**, i8*** %4
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %35, i32** %14
%36 = call i64 @calloc(i32 1, i32 8)
%37 = inttoptr i64 %36 to double*
store double* %37, double** %5
store i64 0, i64* %13
br label %38
38: ; preds = %57, %27
%39 = load i32*, i32** %14
%40 = call i64 @fscanf(i32* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%41 = load i64, i64* @EOF
%42 = icmp ne i64 %40, %41
br i1 %42, label %43, label %64
43: ; preds = %38
%44 = load double*, double** %5
%45 = load i64, i64* %13
%46 = add nsw i64 %45, 1
%47 = mul i64 8, %46
%48 = trunc i64 %47 to i32
%49 = call i64 @realloc(double* %44, i32 %48)
%50 = inttoptr i64 %49 to double*
store double* %50, double** %5
%51 = load double*, double** %5
%52 = icmp eq double* %51, null
br i1 %52, label %53, label %57
53: ; preds = %43
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %43
%58 = load double, double* %7
%59 = load double*, double** %5
%60 = load i64, i64* %13
%61 = getelementptr inbounds double, double* %59, i64 %60
store double %58, double* %61
%62 = load i64, i64* %13
%63 = add nsw i64 %62, 1
store i64 %63, i64* %13
br label %38
64: ; preds = %38
%65 = load i64, i64* %13
%66 = sitofp i64 %65 to double
%67 = call i64 @sqrt(double %66)
%68 = trunc i64 %67 to i32
store i32 %68, i32* %10
%69 = call i64 @calloc(i32 1, i32 8)
%70 = inttoptr i64 %69 to double*
store double* %70, double** %6
%71 = load i8**, i8*** %4
%72 = getelementptr inbounds i8*, i8** %71, i64 2
%73 = load i8*, i8** %72
%74 = call i32* @fopen(i8* %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %74, i32** %15
store i64 0, i64* %13
br label %75
75: ; preds = %94, %64
%76 = load i32*, i32** %15
%77 = call i64 @fscanf(i32* %76, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%78 = load i64, i64* @EOF
%79 = icmp ne i64 %77, %78
br i1 %79, label %80, label %101
80: ; preds = %75
%81 = load double*, double** %6
%82 = load i64, i64* %13
%83 = add nsw i64 %82, 1
%84 = mul i64 8, %83
%85 = trunc i64 %84 to i32
%86 = call i64 @realloc(double* %81, i32 %85)
%87 = inttoptr i64 %86 to double*
store double* %87, double** %6
%88 = load double*, double** %6
%89 = icmp eq double* %88, null
br i1 %89, label %90, label %94
90: ; preds = %80
%91 = load i32, i32* @stderr
%92 = call i32 @fprintf(i32 %91, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%93 = call i32 @exit(i32 1)
unreachable
94: ; preds = %80
%95 = load double, double* %7
%96 = load double*, double** %6
%97 = load i64, i64* %13
%98 = getelementptr inbounds double, double* %96, i64 %97
store double %95, double* %98
%99 = load i64, i64* %13
%100 = add nsw i64 %99, 1
store i64 %100, i64* %13
br label %75
101: ; preds = %75
%102 = load i64, i64* %13
%103 = sitofp i64 %102 to double
%104 = call i64 @sqrt(double %103)
%105 = trunc i64 %104 to i32
store i32 %105, i32* %11
%106 = load i32, i32* %11
%107 = load i32, i32* %10
%108 = icmp ne i32 %106, %107
br i1 %108, label %109, label %112
109: ; preds = %101
%110 = load i32, i32* @stderr
%111 = call i32 @fprintf(i32 %110, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
br label %112
112: ; preds = %109, %101
%113 = load i32*, i32** %15
%114 = call i32 @fclose(i32* %113)
store i64 0, i64* %13
store i32 1, i32* %9
br label %115
115: ; preds = %147, %112
%116 = load i32, i32* %9
%117 = load i32, i32* %10
%118 = icmp sle i32 %116, %117
br i1 %118, label %119, label %150
119: ; preds = %115
store i32 1, i32* %12
br label %120
120: ; preds = %142, %119
%121 = load i32, i32* %12
%122 = load i32, i32* %10
%123 = icmp sle i32 %121, %122
br i1 %123, label %124, label %145
124: ; preds = %120
%125 = load double*, double** %6
%126 = load i64, i64* %13
%127 = getelementptr inbounds double, double* %125, i64 %126
%128 = load double, double* %127
%129 = load double, double* %8
%130 = fcmp ogt double %128, %129
br i1 %130, label %131, label %137
131: ; preds = %124
%132 = load double*, double** %5
%133 = load i64, i64* %13
%134 = getelementptr inbounds double, double* %132, i64 %133
%135 = load double, double* %134
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %135)
br label %139
137: ; preds = %124
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 0.000000e+00)
br label %139
139: ; preds = %137, %131
%140 = load i64, i64* %13
%141 = add nsw i64 %140, 1
store i64 %141, i64* %13
br label %142
142: ; preds = %139
%143 = load i32, i32* %12
%144 = add nsw i32 %143, 1
store i32 %144, i32* %12
br label %120
145: ; preds = %120
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %147
147: ; preds = %145
%148 = load i32, i32* %9
%149 = add nsw i32 %148, 1
store i32 %149, i32* %9
br label %115
150: ; preds = %115
%151 = load double*, double** %5
%152 = call i32 @free(double* %151)
%153 = load double*, double** %6
%154 = call i32 @free(double* %153)
%155 = load i32*, i32** %14
%156 = call i32 @fclose(i32* %155)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%le\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i64 0
@stderr = global i32 0
@.str.2 = [47 x i8] c"mask: Allocation error while reading, exiting\0A\00"
@.str.3 = [50 x i8] c"mask: dimensions of files are different, exiting\0A\00"
@.str.4 = [4 x i8] c"%e\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = add i32 %0, -5
%8 = icmp ult i32 %7, -3
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 @error_print(i8* %10)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = call i64 @calloc(i32 1, i32 8)
%21 = inttoptr i64 %20 to double*
%22 = call i64 @fscanf(i32* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%23 = load i64, i64* @EOF
%24 = icmp eq i64 %22, %23
br i1 %24, label %47, label %25
25: ; preds = %13, %38
%26 = phi double* [ %32, %38 ], [ %21, %13 ]
%27 = phi i64 [ %28, %38 ], [ 0, %13 ]
%28 = add nuw nsw i64 %27, 1
%29 = trunc i64 %28 to i32
%30 = shl i32 %29, 3
%31 = call i64 @realloc(double* %26, i32 %30)
%32 = inttoptr i64 %31 to double*
%33 = icmp eq i64 %31, 0
br i1 %33, label %34, label %38
34: ; preds = %25
%35 = load i32, i32* @stderr
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %25
%39 = load double, double* %3
%40 = getelementptr inbounds double, double* %32, i64 %27
store double %39, double* %40
%41 = call i64 @fscanf(i32* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%42 = load i64, i64* @EOF
%43 = icmp eq i64 %41, %42
br i1 %43, label %44, label %25
44: ; preds = %38
%45 = inttoptr i64 %31 to double*
%46 = sitofp i64 %28 to double
br label %47
47: ; preds = %44, %13
%48 = phi double [ %46, %44 ], [ 0.000000e+00, %13 ]
%49 = phi double* [ %45, %44 ], [ %21, %13 ]
%50 = call i64 @sqrt(double %48)
%51 = trunc i64 %50 to i32
%52 = call i64 @calloc(i32 1, i32 8)
%53 = inttoptr i64 %52 to double*
%54 = getelementptr inbounds i8*, i8** %1, i64 2
%55 = load i8*, i8** %54
%56 = call i32* @fopen(i8* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%57 = call i64 @fscanf(i32* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%58 = load i64, i64* @EOF
%59 = icmp eq i64 %57, %58
br i1 %59, label %82, label %60
60: ; preds = %47, %73
%61 = phi double* [ %67, %73 ], [ %53, %47 ]
%62 = phi i64 [ %63, %73 ], [ 0, %47 ]
%63 = add nuw nsw i64 %62, 1
%64 = trunc i64 %63 to i32
%65 = shl i32 %64, 3
%66 = call i64 @realloc(double* %61, i32 %65)
%67 = inttoptr i64 %66 to double*
%68 = icmp eq i64 %66, 0
br i1 %68, label %69, label %73
69: ; preds = %60
%70 = load i32, i32* @stderr
%71 = call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%72 = call i32 @exit(i32 1)
unreachable
73: ; preds = %60
%74 = load double, double* %3
%75 = getelementptr inbounds double, double* %67, i64 %62
store double %74, double* %75
%76 = call i64 @fscanf(i32* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%77 = load i64, i64* @EOF
%78 = icmp eq i64 %76, %77
br i1 %78, label %79, label %60
79: ; preds = %73
%80 = inttoptr i64 %66 to double*
%81 = sitofp i64 %63 to double
br label %82
82: ; preds = %79, %47
%83 = phi double [ %81, %79 ], [ 0.000000e+00, %47 ]
%84 = phi double* [ %80, %79 ], [ %53, %47 ]
%85 = call i64 @sqrt(double %83)
%86 = trunc i64 %85 to i32
%87 = icmp eq i32 %86, %51
br i1 %87, label %91, label %88
88: ; preds = %82
%89 = load i32, i32* @stderr
%90 = call i32 @fprintf(i32 %89, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
br label %91
91: ; preds = %88, %82
%92 = call i32 @fclose(i32* %56)
%93 = icmp slt i32 %51, 1
br i1 %93, label %118, label %94
94: ; preds = %91, %114
%95 = phi i64 [ %111, %114 ], [ 0, %91 ]
%96 = phi i32 [ %116, %114 ], [ 1, %91 ]
%97 = trunc i64 %95 to i32
%98 = add i32 %51, %97
br label %99
99: ; preds = %94, %108
%100 = phi i64 [ %111, %108 ], [ %95, %94 ]
%101 = getelementptr inbounds double, double* %84, i64 %100
%102 = load double, double* %101
%103 = load double, double* %4
%104 = fcmp ogt double %102, %103
br i1 %104, label %105, label %108
105: ; preds = %99
%106 = getelementptr inbounds double, double* %49, i64 %100
%107 = load double, double* %106
br label %108
108: ; preds = %99, %105
%109 = phi double [ %107, %105 ], [ 0.000000e+00, %99 ]
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %109)
%111 = add i64 %100, 1
%112 = trunc i64 %111 to i32
%113 = icmp eq i32 %98, %112
br i1 %113, label %114, label %99
114: ; preds = %108
%115 = call i32 @putchar(i32 10)
%116 = add nuw i32 %96, 1
%117 = icmp eq i32 %96, %51
br i1 %117, label %118, label %94
118: ; preds = %114, %91
%119 = call i32 @free(double* %49)
%120 = call i32 @free(double* %84)
%121 = call i32 @fclose(i32* %19)
ret void
}