; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Image.ll (ZN7R2Image7ReadGRDEPKc)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R2Image = type { i32, i32, i32, i32, ptr }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.86 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #1

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7R2Image7ReadGRDEPKc(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca [2 x i32], align 4
  %9 = alloca [9 x double], align 16
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %33 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call noalias ptr @fopen(ptr noundef %34, ptr noundef @.str.25)
  store ptr %35, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %40, label %38

38:                                               ; preds = %2
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.86, ptr noundef %39)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %307

40:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = call i64 @fread(ptr noundef %8, i64 noundef 4, i64 noundef 2, ptr noundef %41)
  %43 = icmp ne i64 %42, 2
  br i1 %43, label %44, label %45

44:                                               ; preds = %40
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.87)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %306

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #7
  %46 = getelementptr inbounds [9 x double], ptr %9, i64 0, i64 0
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = call i64 @fread(ptr noundef %46, i64 noundef 8, i64 noundef 9, ptr noundef %47)
  %49 = icmp ne i64 %48, 9
  br i1 %49, label %50, label %51

50:                                               ; preds = %45
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.88)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %305

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %52 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 0
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 1
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = mul nsw i32 %53, %55
  store i32 %56, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %58, i64 8)
  %60 = extractvalue { i64, i1 } %59, 1
  %61 = extractvalue { i64, i1 } %59, 0
  %62 = select i1 %60, i64 -1, i64 %61
  %63 = call noalias noundef nonnull ptr @_Znam(i64 noundef %62) #8
  store ptr %63, ptr %11, align 8, !tbaa !5
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %67, label %66

66:                                               ; preds = %51
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.89, i32 noundef 1697, ptr noundef @.str.2)
  br label %67

67:                                               ; preds = %66, %51
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = call i64 @fread(ptr noundef %68, i64 noundef 8, i64 noundef %70, ptr noundef %71)
  %73 = load i32, ptr %10, align 4, !tbaa !9
  %74 = zext i32 %73 to i64
  %75 = icmp ne i64 %72, %74
  br i1 %75, label %76, label %78

76:                                               ; preds = %67
  %77 = load i32, ptr %10, align 4, !tbaa !9
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.90, i32 noundef %77)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %304

78:                                               ; preds = %67
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = call i32 @fclose(ptr noundef %79)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store double 0.000000e+00, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store double 1.000000e+00, ptr %13, align 8, !tbaa !11
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %200

83:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store double 0.000000e+00, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store double 0x47EFFFFFE0000000, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store double 0xC7EFFFFFE0000000, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %133, %83
  %85 = load i32, ptr %17, align 4, !tbaa !9
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %136

89:                                               ; preds = %84
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = load i32, ptr %17, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %90, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !11
  %95 = fcmp oeq double %94, -3.210000e+02
  br i1 %95, label %96, label %97

96:                                               ; preds = %89
  br label %133

97:                                               ; preds = %89
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = load i32, ptr %17, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds double, ptr %98, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !11
  %103 = load double, ptr %16, align 8, !tbaa !11
  %104 = fcmp ogt double %102, %103
  br i1 %104, label %105, label %111

105:                                              ; preds = %97
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load i32, ptr %17, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds double, ptr %106, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !11
  store double %110, ptr %16, align 8, !tbaa !11
  br label %111

111:                                              ; preds = %105, %97
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = load i32, ptr %17, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds double, ptr %112, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = load double, ptr %15, align 8, !tbaa !11
  %118 = fcmp olt double %116, %117
  br i1 %118, label %119, label %125

119:                                              ; preds = %111
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load i32, ptr %17, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds double, ptr %120, i64 %122
  %124 = load double, ptr %123, align 8, !tbaa !11
  store double %124, ptr %15, align 8, !tbaa !11
  br label %125

125:                                              ; preds = %119, %111
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = load i32, ptr %17, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %126, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = load double, ptr %14, align 8, !tbaa !11
  %132 = fadd double %131, %130
  store double %132, ptr %14, align 8, !tbaa !11
  br label %133

133:                                              ; preds = %125, %96
  %134 = load i32, ptr %17, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %17, align 4, !tbaa !9
  br label %84, !llvm.loop !13

136:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %137 = load double, ptr %14, align 8, !tbaa !11
  %138 = load i32, ptr %10, align 4, !tbaa !9
  %139 = sitofp i32 %138 to double
  %140 = fdiv double %137, %139
  store double %140, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store double 0.000000e+00, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %166, %136
  %142 = load i32, ptr %20, align 4, !tbaa !9
  %143 = load i32, ptr %10, align 4, !tbaa !9
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %141
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %169

146:                                              ; preds = %141
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = load i32, ptr %20, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds double, ptr %147, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = fcmp oeq double %151, -3.210000e+02
  br i1 %152, label %153, label %154

153:                                              ; preds = %146
  br label %166

154:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = load i32, ptr %20, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds double, ptr %155, i64 %157
  %159 = load double, ptr %158, align 8, !tbaa !11
  %160 = load double, ptr %18, align 8, !tbaa !11
  %161 = fsub double %159, %160
  store double %161, ptr %21, align 8, !tbaa !11
  %162 = load double, ptr %21, align 8, !tbaa !11
  %163 = load double, ptr %21, align 8, !tbaa !11
  %164 = load double, ptr %19, align 8, !tbaa !11
  %165 = call double @llvm.fmuladd.f64(double %162, double %163, double %164)
  store double %165, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %166

166:                                              ; preds = %154, %153
  %167 = load i32, ptr %20, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %20, align 4, !tbaa !9
  br label %141, !llvm.loop !15

169:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %170 = load double, ptr %19, align 8, !tbaa !11
  %171 = call double @sqrt(double noundef %170) #7
  store double %171, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %172 = load double, ptr %18, align 8, !tbaa !11
  %173 = load double, ptr %22, align 8, !tbaa !11
  %174 = call double @llvm.fmuladd.f64(double -3.000000e+00, double %173, double %172)
  store double %174, ptr %23, align 8, !tbaa !11
  %175 = load double, ptr %23, align 8, !tbaa !11
  %176 = load double, ptr %15, align 8, !tbaa !11
  %177 = fcmp olt double %175, %176
  br i1 %177, label %178, label %180

178:                                              ; preds = %169
  %179 = load double, ptr %15, align 8, !tbaa !11
  store double %179, ptr %23, align 8, !tbaa !11
  br label %180

180:                                              ; preds = %178, %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %181 = load double, ptr %18, align 8, !tbaa !11
  %182 = load double, ptr %22, align 8, !tbaa !11
  %183 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %182, double %181)
  store double %183, ptr %24, align 8, !tbaa !11
  %184 = load double, ptr %24, align 8, !tbaa !11
  %185 = load double, ptr %16, align 8, !tbaa !11
  %186 = fcmp ogt double %184, %185
  br i1 %186, label %187, label %189

187:                                              ; preds = %180
  %188 = load double, ptr %16, align 8, !tbaa !11
  store double %188, ptr %24, align 8, !tbaa !11
  br label %189

189:                                              ; preds = %187, %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %190 = load double, ptr %24, align 8, !tbaa !11
  %191 = load double, ptr %23, align 8, !tbaa !11
  %192 = fsub double %190, %191
  store double %192, ptr %25, align 8, !tbaa !11
  %193 = load double, ptr %25, align 8, !tbaa !11
  %194 = fcmp ogt double %193, 0.000000e+00
  br i1 %194, label %195, label %199

195:                                              ; preds = %189
  %196 = load double, ptr %23, align 8, !tbaa !11
  store double %196, ptr %12, align 8, !tbaa !11
  %197 = load double, ptr %25, align 8, !tbaa !11
  %198 = fdiv double 1.000000e+00, %197
  store double %198, ptr %13, align 8, !tbaa !11
  br label %199

199:                                              ; preds = %195, %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %200

200:                                              ; preds = %199, %78
  %201 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 2
  store i32 3, ptr %201, align 8, !tbaa !16
  %202 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 0
  %203 = load i32, ptr %202, align 4, !tbaa !9
  %204 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 0
  store i32 %203, ptr %204, align 8, !tbaa !18
  %205 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 1
  %206 = load i32, ptr %205, align 4, !tbaa !9
  %207 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 1
  store i32 %206, ptr %207, align 4, !tbaa !19
  %208 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 2
  %209 = load i32, ptr %208, align 8, !tbaa !16
  %210 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 0
  %211 = load i32, ptr %210, align 8, !tbaa !18
  %212 = mul nsw i32 %209, %211
  %213 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 3
  store i32 %212, ptr %213, align 4, !tbaa !20
  %214 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 3
  %215 = load i32, ptr %214, align 4, !tbaa !20
  %216 = srem i32 %215, 4
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %218, label %225

218:                                              ; preds = %200
  %219 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 3
  %220 = load i32, ptr %219, align 4, !tbaa !20
  %221 = sdiv i32 %220, 4
  %222 = add nsw i32 %221, 1
  %223 = mul nsw i32 %222, 4
  %224 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 3
  store i32 %223, ptr %224, align 4, !tbaa !20
  br label %225

225:                                              ; preds = %218, %200
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %226 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 3
  %227 = load i32, ptr %226, align 4, !tbaa !20
  %228 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 1
  %229 = load i32, ptr %228, align 4, !tbaa !19
  %230 = mul nsw i32 %227, %229
  store i32 %230, ptr %26, align 4, !tbaa !9
  %231 = load i32, ptr %26, align 4, !tbaa !9
  %232 = sext i32 %231 to i64
  %233 = call noalias noundef nonnull ptr @_Znam(i64 noundef %232) #8
  %234 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 4
  store ptr %233, ptr %234, align 8, !tbaa !21
  %235 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 4
  %236 = load ptr, ptr %235, align 8, !tbaa !21
  %237 = icmp ne ptr %236, null
  br i1 %237, label %239, label %238

238:                                              ; preds = %225
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1748, ptr noundef @.str.2)
  br label %239

239:                                              ; preds = %238, %225
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %240 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %240, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %241

241:                                              ; preds = %295, %239
  %242 = load i32, ptr %28, align 4, !tbaa !9
  %243 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 1
  %244 = load i32, ptr %243, align 4, !tbaa !19
  %245 = icmp slt i32 %242, %244
  br i1 %245, label %247, label %246

246:                                              ; preds = %241
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %298

247:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %248 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 4
  %249 = load ptr, ptr %248, align 8, !tbaa !21
  %250 = load i32, ptr %28, align 4, !tbaa !9
  %251 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 3
  %252 = load i32, ptr %251, align 4, !tbaa !20
  %253 = mul nsw i32 %250, %252
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds i8, ptr %249, i64 %254
  store ptr %255, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %256

256:                                              ; preds = %291, %247
  %257 = load i32, ptr %30, align 4, !tbaa !9
  %258 = getelementptr inbounds %class.R2Image, ptr %33, i32 0, i32 0
  %259 = load i32, ptr %258, align 8, !tbaa !18
  %260 = icmp slt i32 %257, %259
  br i1 %260, label %262, label %261

261:                                              ; preds = %256
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %294

262:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %263 = load ptr, ptr %27, align 8, !tbaa !5
  %264 = getelementptr inbounds double, ptr %263, i32 1
  store ptr %264, ptr %27, align 8, !tbaa !5
  %265 = load double, ptr %263, align 8, !tbaa !11
  %266 = load double, ptr %12, align 8, !tbaa !11
  %267 = fsub double %265, %266
  %268 = fmul double %267, 2.550000e+02
  %269 = load double, ptr %13, align 8, !tbaa !11
  %270 = fmul double %268, %269
  %271 = fptosi double %270 to i32
  store i32 %271, ptr %31, align 4, !tbaa !9
  %272 = load i32, ptr %31, align 4, !tbaa !9
  %273 = icmp slt i32 %272, 0
  br i1 %273, label %274, label %275

274:                                              ; preds = %262
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %275

275:                                              ; preds = %274, %262
  %276 = load i32, ptr %31, align 4, !tbaa !9
  %277 = icmp sgt i32 %276, 255
  br i1 %277, label %278, label %279

278:                                              ; preds = %275
  store i32 255, ptr %31, align 4, !tbaa !9
  br label %279

279:                                              ; preds = %278, %275
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #7
  %280 = load i32, ptr %31, align 4, !tbaa !9
  %281 = trunc i32 %280 to i8
  store i8 %281, ptr %32, align 1, !tbaa !22
  %282 = load i8, ptr %32, align 1, !tbaa !22
  %283 = load ptr, ptr %29, align 8, !tbaa !5
  %284 = getelementptr inbounds i8, ptr %283, i32 1
  store ptr %284, ptr %29, align 8, !tbaa !5
  store i8 %282, ptr %283, align 1, !tbaa !22
  %285 = load i8, ptr %32, align 1, !tbaa !22
  %286 = load ptr, ptr %29, align 8, !tbaa !5
  %287 = getelementptr inbounds i8, ptr %286, i32 1
  store ptr %287, ptr %29, align 8, !tbaa !5
  store i8 %285, ptr %286, align 1, !tbaa !22
  %288 = load i8, ptr %32, align 1, !tbaa !22
  %289 = load ptr, ptr %29, align 8, !tbaa !5
  %290 = getelementptr inbounds i8, ptr %289, i32 1
  store ptr %290, ptr %29, align 8, !tbaa !5
  store i8 %288, ptr %289, align 1, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %291

291:                                              ; preds = %279
  %292 = load i32, ptr %30, align 4, !tbaa !9
  %293 = add nsw i32 %292, 1
  store i32 %293, ptr %30, align 4, !tbaa !9
  br label %256, !llvm.loop !23

294:                                              ; preds = %261
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %295

295:                                              ; preds = %294
  %296 = load i32, ptr %28, align 4, !tbaa !9
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %28, align 4, !tbaa !9
  br label %241, !llvm.loop !24

298:                                              ; preds = %246
  %299 = load ptr, ptr %11, align 8, !tbaa !5
  %300 = icmp eq ptr %299, null
  br i1 %300, label %302, label %301

301:                                              ; preds = %298
  call void @_ZdaPv(ptr noundef %299) #9
  br label %302

302:                                              ; preds = %301, %298
  %303 = load i32, ptr %26, align 4, !tbaa !9
  store i32 %303, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %304

304:                                              ; preds = %302, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %305

305:                                              ; preds = %304, %50
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #7
  br label %306

306:                                              ; preds = %305, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %307

307:                                              ; preds = %306, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %308 = load i32, ptr %3, align 4
  ret i32 %308
}

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

declare void @_Z6RNFailPKcz(ptr noundef, ...) #2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !10, i64 8}
!17 = !{!"_ZTS7R2Image", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16}
!18 = !{!17, !10, i64 0}
!19 = !{!17, !10, i64 4}
!20 = !{!17, !10, i64 12}
!21 = !{!17, !6, i64 16}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.86 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7R2Image7ReadGRDEPKc(ptr nocapture noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca [2 x i32], align 4
  %4 = alloca [9 x double], align 16
  %5 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.25)
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %2
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.86, ptr noundef %1)
  br label %107

7:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %8 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 2, ptr noundef nonnull %5)
  %.not115 = icmp eq i64 %8, 2
  br i1 %.not115, label %10, label %9

9:                                                ; preds = %7
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.87)
  br label %106

10:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #9
  %11 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 8, i64 noundef 9, ptr noundef nonnull %5)
  %.not116 = icmp eq i64 %11, 9
  br i1 %.not116, label %13, label %12

12:                                               ; preds = %10
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.88)
  br label %105

13:                                               ; preds = %10
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %3, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = mul nsw i32 %16, %14
  %18 = sext i32 %17 to i64
  %19 = icmp slt i32 %17, 0
  %20 = shl nsw i64 %18, 3
  %21 = select i1 %19, i64 -1, i64 %20
  %22 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #10
  %23 = tail call i64 @fread(ptr noundef nonnull %22, i64 noundef 8, i64 noundef %18, ptr noundef nonnull %5)
  %24 = zext i32 %17 to i64
  %.not117 = icmp eq i64 %23, %24
  br i1 %.not117, label %26, label %25

25:                                               ; preds = %13
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.90, i32 noundef %17)
  br label %105

26:                                               ; preds = %13
  %27 = tail call i32 @fclose(ptr noundef nonnull %5)
  %28 = icmp sgt i32 %17, 0
  br i1 %28, label %.preheader, label %63

.lr.ph.preheader:                                 ; preds = %39
  %29 = uitofp nneg i32 %17 to double
  %30 = fdiv double %.196, %29
  %xtraiter = and i64 %23, 1
  %31 = icmp eq i64 %23, 1
  br i1 %31, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %23, -2
  br label %.lr.ph

.preheader:                                       ; preds = %26, %39
  %indvars.iv = phi i64 [ %indvars.iv.next, %39 ], [ 0, %26 ]
  %.095122 = phi double [ %.196, %39 ], [ 0.000000e+00, %26 ]
  %.097121 = phi double [ %.299, %39 ], [ 0x47EFFFFFE0000000, %26 ]
  %.0103120 = phi double [ %.2105, %39 ], [ 0xC7EFFFFFE0000000, %26 ]
  %32 = getelementptr inbounds double, ptr %22, i64 %indvars.iv
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = fcmp oeq double %33, -3.210000e+02
  br i1 %34, label %39, label %35

35:                                               ; preds = %.preheader
  %36 = fcmp ogt double %33, %.0103120
  %.1104 = select i1 %36, double %33, double %.0103120
  %37 = fcmp olt double %33, %.097121
  %.198 = select i1 %37, double %33, double %.097121
  %38 = fadd double %.095122, %33
  br label %39

39:                                               ; preds = %.preheader, %35
  %.2105 = phi double [ %.0103120, %.preheader ], [ %.1104, %35 ]
  %.299 = phi double [ %.097121, %.preheader ], [ %.198, %35 ]
  %.196 = phi double [ %.095122, %.preheader ], [ %38, %35 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %23
  br i1 %exitcond.not, label %.lr.ph.preheader, label %.preheader, !llvm.loop !11

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph, %.lr.ph.preheader
  %.1102.lcssa.ph = phi double [ poison, %.lr.ph.preheader ], [ %.1102.1, %.lr.ph ]
  %indvars.iv139.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next140.1, %.lr.ph ]
  %.0101123.unr = phi double [ 0.000000e+00, %.lr.ph.preheader ], [ %.1102.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa
  %40 = getelementptr inbounds double, ptr %22, i64 %indvars.iv139.unr
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = fcmp oeq double %41, -3.210000e+02
  %43 = fsub double %41, %30
  %44 = tail call double @llvm.fmuladd.f64(double %43, double %43, double %.0101123.unr)
  %.1102.epil = select i1 %42, double %.0101123.unr, double %44
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph.epil
  %.1102.lcssa = phi double [ %.1102.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.1102.epil, %.lr.ph.epil ]
  %45 = tail call double @sqrt(double noundef %.1102.lcssa) #9
  %46 = tail call double @llvm.fmuladd.f64(double %45, double -3.000000e+00, double %30)
  %47 = fcmp olt double %46, %.299
  %.094 = select i1 %47, double %.299, double %46
  %48 = tail call double @llvm.fmuladd.f64(double %45, double 3.000000e+00, double %30)
  %49 = fcmp ogt double %48, %.2105
  %.093 = select i1 %49, double %.2105, double %48
  %50 = fsub double %.093, %.094
  %51 = fcmp ogt double %50, 0.000000e+00
  %52 = fdiv double 1.000000e+00, %50
  %.091 = select i1 %51, double %52, double 1.000000e+00
  %.089 = select i1 %51, double %.094, double 0.000000e+00
  br label %63

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv139 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next140.1, %.lr.ph ]
  %.0101123 = phi double [ 0.000000e+00, %.lr.ph.preheader.new ], [ %.1102.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %53 = getelementptr inbounds double, ptr %22, i64 %indvars.iv139
  %54 = load double, ptr %53, align 8, !tbaa !9
  %55 = fcmp oeq double %54, -3.210000e+02
  %56 = fsub double %54, %30
  %57 = tail call double @llvm.fmuladd.f64(double %56, double %56, double %.0101123)
  %.1102 = select i1 %55, double %.0101123, double %57
  %indvars.iv.next140 = or disjoint i64 %indvars.iv139, 1
  %58 = getelementptr inbounds double, ptr %22, i64 %indvars.iv.next140
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = fcmp oeq double %59, -3.210000e+02
  %61 = fsub double %59, %30
  %62 = tail call double @llvm.fmuladd.f64(double %61, double %61, double %.1102)
  %.1102.1 = select i1 %60, double %.1102, double %62
  %indvars.iv.next140.1 = add nuw nsw i64 %indvars.iv139, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !13

63:                                               ; preds = %._crit_edge, %26
  %.192 = phi double [ %.091, %._crit_edge ], [ 1.000000e+00, %26 ]
  %.190 = phi double [ %.089, %._crit_edge ], [ 0.000000e+00, %26 ]
  %64 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 3, ptr %64, align 8, !tbaa !14
  store i32 %14, ptr %0, align 8, !tbaa !17
  %65 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %16, ptr %65, align 4, !tbaa !18
  %66 = mul nsw i32 %14, 3
  %67 = getelementptr inbounds i8, ptr %0, i64 12
  %68 = and i32 %66, 3
  %.not118 = icmp eq i32 %68, 0
  br i1 %.not118, label %73, label %69

69:                                               ; preds = %63
  %70 = sdiv i32 %66, 4
  %71 = shl nsw i32 %70, 2
  %72 = add i32 %71, 4
  br label %73

73:                                               ; preds = %69, %63
  %storemerge = phi i32 [ %72, %69 ], [ %66, %63 ]
  store i32 %storemerge, ptr %67, align 4, !tbaa !19
  %74 = mul nsw i32 %storemerge, %16
  %75 = sext i32 %74 to i64
  %76 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %75) #10
  %77 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %76, ptr %77, align 8, !tbaa !20
  %78 = icmp sgt i32 %16, 0
  %79 = icmp sgt i32 %14, 0
  %or.cond = and i1 %78, %79
  br i1 %or.cond, label %.lr.ph135.split, label %._crit_edge136

.lr.ph135.split:                                  ; preds = %73, %._crit_edge130
  %80 = phi i32 [ %88, %._crit_edge130 ], [ %16, %73 ]
  %81 = phi i32 [ %89, %._crit_edge130 ], [ %14, %73 ]
  %.086133 = phi i32 [ %90, %._crit_edge130 ], [ 0, %73 ]
  %.087132 = phi ptr [ %.188.lcssa, %._crit_edge130 ], [ %22, %73 ]
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %.lr.ph129.preheader, label %._crit_edge130

.lr.ph129.preheader:                              ; preds = %.lr.ph135.split
  %83 = load ptr, ptr %77, align 8, !tbaa !20
  %84 = load i32, ptr %67, align 4, !tbaa !19
  %85 = mul nsw i32 %84, %.086133
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %83, i64 %86
  br label %.lr.ph129

._crit_edge130.loopexit:                          ; preds = %.lr.ph129
  %.pre = load i32, ptr %65, align 4, !tbaa !18
  br label %._crit_edge130

._crit_edge130:                                   ; preds = %._crit_edge130.loopexit, %.lr.ph135.split
  %88 = phi i32 [ %80, %.lr.ph135.split ], [ %.pre, %._crit_edge130.loopexit ]
  %89 = phi i32 [ %81, %.lr.ph135.split ], [ %103, %._crit_edge130.loopexit ]
  %.188.lcssa = phi ptr [ %.087132, %.lr.ph135.split ], [ %92, %._crit_edge130.loopexit ]
  %90 = add nuw nsw i32 %.086133, 1
  %91 = icmp slt i32 %90, %88
  br i1 %91, label %.lr.ph135.split, label %._crit_edge136, !llvm.loop !21

.lr.ph129:                                        ; preds = %.lr.ph129.preheader, %.lr.ph129
  %.084127 = phi i32 [ %102, %.lr.ph129 ], [ 0, %.lr.ph129.preheader ]
  %.085126 = phi ptr [ %101, %.lr.ph129 ], [ %87, %.lr.ph129.preheader ]
  %.188125 = phi ptr [ %92, %.lr.ph129 ], [ %.087132, %.lr.ph129.preheader ]
  %92 = getelementptr inbounds i8, ptr %.188125, i64 8
  %93 = load double, ptr %.188125, align 8, !tbaa !9
  %94 = fsub double %93, %.190
  %95 = fmul double %94, 2.550000e+02
  %96 = fmul double %.192, %95
  %97 = fptosi double %96 to i32
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %97, i32 0)
  %spec.store.select1 = tail call i32 @llvm.umin.i32(i32 %spec.store.select, i32 255)
  %98 = trunc nuw i32 %spec.store.select1 to i8
  %99 = getelementptr inbounds i8, ptr %.085126, i64 1
  store i8 %98, ptr %.085126, align 1, !tbaa !23
  %100 = getelementptr inbounds i8, ptr %.085126, i64 2
  store i8 %98, ptr %99, align 1, !tbaa !23
  %101 = getelementptr inbounds i8, ptr %.085126, i64 3
  store i8 %98, ptr %100, align 1, !tbaa !23
  %102 = add nuw nsw i32 %.084127, 1
  %103 = load i32, ptr %0, align 8, !tbaa !17
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %.lr.ph129, label %._crit_edge130.loopexit, !llvm.loop !24

._crit_edge136:                                   ; preds = %._crit_edge130, %73
  tail call void @_ZdaPv(ptr noundef nonnull %22) #11
  br label %105

105:                                              ; preds = %25, %._crit_edge136, %12
  %.1 = phi i32 [ 0, %12 ], [ 0, %25 ], [ %74, %._crit_edge136 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #9
  br label %106

106:                                              ; preds = %105, %9
  %.2 = phi i32 [ 0, %9 ], [ %.1, %105 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br label %107

107:                                              ; preds = %106, %6
  %.3 = phi i32 [ %.2, %106 ], [ 0, %6 ]
  ret i32 %.3
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

declare void @_Z6RNFailPKcz(ptr noundef, ...) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !6, i64 8}
!15 = !{!"_ZTS7R2Image", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !16, i64 16}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!15, !6, i64 0}
!18 = !{!15, !6, i64 4}
!19 = !{!15, !6, i64 12}
!20 = !{!15, !16, i64 16}
!21 = distinct !{!21, !12, !22}
!22 = !{!"llvm.loop.unswitch.partial.disable"}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass