#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__ calloc(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ stderr;
int read_arcinfo_grid(char *filename, double **lat, double **lng, int *ncols,
                      int *nrows, double *ll_lat, double *ll_lng,
                      double *cellsize, int *NODATA, double **values) {
  FILE *farc;
  int i, j;
  double tmp_lat;
  double tmp_lng;
  int cell;
  int Ncells;
  double tmpvalue;
  if ((farc = fopen(filename, "r")) == NULL) {
    fprintf(stderr, "ERROR: Unable of open ARCINFO grid %s for reading.\n",
            filename);
    exit(0);
  }
  fscanf(farc, "%*s %i", &ncols[0]);
  fscanf(farc, "%*s %i", &nrows[0]);
  fscanf(farc, "%*s %lf", &ll_lng[0]);
  fscanf(farc, "%*s %lf", &ll_lat[0]);
  fscanf(farc, "%*s %lf", &cellsize[0]);
  fscanf(farc, "%*s %i", &NODATA[0]);
  Ncells = ncols[0] * nrows[0];
  lat[0] = (double *)calloc(Ncells, sizeof(double));
  lng[0] = (double *)calloc(Ncells, sizeof(double));
  values[0] = (double *)calloc(Ncells, sizeof(double));
  cell = 0;
  for (j = 0; j < nrows[0]; j++) {
    tmp_lat = ll_lat[0] + (double)(nrows[0] - j - 0.5) * cellsize[0];
    for (i = 0; i < ncols[0]; i++) {
      tmp_lng = ll_lng[0] + (double)(i + 0.5) * cellsize[0];
      fscanf(farc, "%lf", &tmpvalue);
      lat[0][cell] = tmp_lat;
      lng[0][cell] = tmp_lng;
      values[0][cell] = tmpvalue;
      cell++;
    }
  }
  fclose(farc);
  Ncells = cell;
  return Ncells;
}


x86 assembly (clang, -O0):
<read_arcinfo_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    11ce <read_arcinfo_grid+0x6e>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe48(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe61(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe4b(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    -0x38(%rbp),%rdi
mov    0x10(%rbp),%rdx
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xe26(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    -0x38(%rbp),%rdi
mov    0x18(%rbp),%rdx
lea    0xe10(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    -0x38(%rbp),%rdi
mov    0x20(%rbp),%rdx
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x58(%rbp),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x58(%rbp),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%rcx
mov    0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    13bd <read_arcinfo_grid+0x25d>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
sub    -0x40(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xd1f(%rip),%xmm2
subsd  %xmm2,%xmm0
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    13aa <read_arcinfo_grid+0x24a>
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm1
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  0xcdb(%rip),%xmm2
addsd  %xmm2,%xmm0
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xd00(%rip),%rsi
lea    -0x60(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mov    0x28(%rbp),%rax
mov    (%rax),%rax
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1301 <read_arcinfo_grid+0x1a1>
jmp    13af <read_arcinfo_grid+0x24f>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12b5 <read_arcinfo_grid+0x155>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x54(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_arcinfo_grid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe87(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     139f <read_arcinfo_grid+0x23f>
mov    %rax,%rbp
lea    0xea5(%rip),%r14
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
lea    0xe85(%rip),%r14
mov    %rbp,%rdi
mov    %r14,%rsi
mov    0x70(%rsp),%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    0x78(%rsp),%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    %rbp,%rdi
lea    0xe3e(%rip),%rsi
mov    0x80(%rsp),%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    (%r15),%r14d
imul   (%r12),%r14d
mov    %r14d,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,(%rbx)
mov    %r14d,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,0x0(%r13)
mov    %r14d,%edi
xor    %r14d,%r14d
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    0x88(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%r15),%ecx
test   %ecx,%ecx
jle    1385 <read_arcinfo_grid+0x225>
mov    (%r12),%eax
xor    %r14d,%r14d
xor    %esi,%esi
mov    %r15,0x18(%rsp)
jmp    12a1 <read_arcinfo_grid+0x141>
cs nopw 0x0(%rax,%rax,1)
mov    0xc(%rsp),%ecx
add    %r14d,%ecx
mov    %ecx,%r14d
mov    0x18(%rsp),%r15
mov    (%r15),%ecx
mov    0x8(%rsp),%esi
add    $0x1,%esi
cmp    %esi,%ecx
jle    1385 <read_arcinfo_grid+0x225>
mov    %ecx,%edx
sub    %esi,%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
addsd  0xd4c(%rip),%xmm1
test   %eax,%eax
jle    1296 <read_arcinfo_grid+0x136>
mov    %esi,0x8(%rsp)
mov    0x78(%rsp),%rax
movsd  (%rax),%xmm0
mulsd  %xmm0,%xmm1
mov    0x10(%rsp),%rax
addsd  (%rax),%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %r14d,0xc(%rsp)
movslq %r14d,%r15
mov    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%r14),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xd05(%rip),%xmm1
mulsd  %xmm0,%xmm1
mov    0x70(%rsp),%rax
addsd  (%rax),%xmm1
movsd  %xmm1,0x28(%rsp)
mov    %rbp,%rdi
lea    0xd31(%rip),%rsi
lea    0x30(%rsp),%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    (%rbx),%rax
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,(%rax,%r15,8)
mov    0x0(%r13),%rax
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,(%rax,%r15,8)
movsd  0x30(%rsp),%xmm0
mov    0x88(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%r15,8)
mov    (%r12),%eax
cmp    %eax,%r14d
jge    1280 <read_arcinfo_grid+0x120>
mov    0x78(%rsp),%rax
movsd  (%rax),%xmm0
add    $0x1,%r14d
add    $0x1,%r15
jmp    12f0 <read_arcinfo_grid+0x190>
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    %r14d,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c3a(%rip),%rax
mov    (%rax),%edi
lea    0xc63(%rip),%rsi
mov    %r14,%rdx
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1080 <exit@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [52 x i8] c"ERROR: Unable of open ARCINFO grid %s for reading.\0A\00"
@.str.2 = [7 x i8] c"%*s %i\00"
@.str.3 = [8 x i8] c"%*s %lf\00"
@.str.4 = [4 x i8] c"%lf\00"
define i32 @read_arcinfo_grid(i8* %0, double** nocapture %1, double** nocapture %2, i32* %3, i32* %4, double* %5, double* %6, double* %7, i32* %8, double** nocapture %9) {
%11 = alloca double
%12 = bitcast double* %11 to i8*
%13 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%18 = tail call i32 @exit(i32 0)
unreachable
19: ; preds = %10
%20 = tail call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%21 = tail call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%22 = tail call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %6)
%23 = tail call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %5)
%24 = tail call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %7)
%25 = tail call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = mul nsw i32 %27, %26
%29 = tail call i64 @calloc(i32 %28, i32 8)
%30 = inttoptr i64 %29 to double*
store double* %30, double** %1
%31 = tail call i64 @calloc(i32 %28, i32 8)
%32 = inttoptr i64 %31 to double*
store double* %32, double** %2
%33 = tail call i64 @calloc(i32 %28, i32 8)
%34 = inttoptr i64 %33 to double*
store double* %34, double** %9
%35 = load i32, i32* %4
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %84
37: ; preds = %19
%38 = load i32, i32* %3
br label %39
39: ; preds = %37, %78
%40 = phi i32 [ %79, %78 ], [ %35, %37 ]
%41 = phi i32 [ %80, %78 ], [ %38, %37 ]
%42 = phi i32 [ %81, %78 ], [ 0, %37 ]
%43 = phi i32 [ %82, %78 ], [ 0, %37 ]
%44 = load double, double* %5
%45 = sub nsw i32 %40, %43
%46 = sitofp i32 %45 to double
%47 = fadd double %46, -5.000000e-01
%48 = load double, double* %7
%49 = call double @llvm.fmuladd.f64(double %47, double %48, double %44)
%50 = icmp sgt i32 %41, 0
br i1 %50, label %51, label %78
51: ; preds = %39
%52 = sext i32 %42 to i64
br label %53
53: ; preds = %73, %51
%54 = phi double [ %48, %51 ], [ %74, %73 ]
%55 = phi i64 [ %52, %51 ], [ %69, %73 ]
%56 = phi i32 [ 0, %51 ], [ %70, %73 ]
%57 = load double, double* %6
%58 = sitofp i32 %56 to double
%59 = fadd double %58, 5.000000e-01
%60 = call double @llvm.fmuladd.f64(double %59, double %54, double %57)
%61 = call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %11)
%62 = load double*, double** %1
%63 = getelementptr inbounds double, double* %62, i64 %55
store double %49, double* %63
%64 = load double*, double** %2
%65 = getelementptr inbounds double, double* %64, i64 %55
store double %60, double* %65
%66 = load double, double* %11
%67 = load double*, double** %9
%68 = getelementptr inbounds double, double* %67, i64 %55
store double %66, double* %68
%69 = add nsw i64 %55, 1
%70 = add nuw nsw i32 %56, 1
%71 = load i32, i32* %3
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %75
73: ; preds = %53
%74 = load double, double* %7
br label %53
75: ; preds = %53
%76 = trunc i64 %69 to i32
%77 = load i32, i32* %4
br label %78
78: ; preds = %75, %39
%79 = phi i32 [ %40, %39 ], [ %77, %75 ]
%80 = phi i32 [ %41, %39 ], [ %71, %75 ]
%81 = phi i32 [ %42, %39 ], [ %76, %75 ]
%82 = add nuw nsw i32 %43, 1
%83 = icmp sgt i32 %79, %82
br i1 %83, label %39, label %84
84: ; preds = %78, %19
%85 = phi i32 [ 0, %19 ], [ %81, %78 ]
%86 = call i32 @fclose(i32* %13)
ret i32 %85
}