; LLVM IR from tangjz/acm-icpc :: usaco/Training/Chapter 2 Bigger challenges (cowtour)

; 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"

@n = external dso_local global i32, align 4
@x = external dso_local global [151 x i32], align 16
@y = external dso_local global [151 x i32], align 16
@f = external dso_local global [151 x [151 x double]], align 16
@g = external dso_local global [151 x double], align 16
@h = external dso_local global [151 x double], align 16
@ans = external dso_local global double, align 8
@str = external dso_local global [151 x i8], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  store i32 0, ptr %1, align 4
  %16 = load ptr, ptr @stdin, align 8, !tbaa !5
  %17 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %16)
  %18 = load ptr, ptr @stdout, align 8, !tbaa !5
  %19 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %18)
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %34, %0
  %22 = load i32, ptr %2, align 4, !tbaa !9
  %23 = load i32, ptr @n, align 4, !tbaa !9
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %37

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr @x, i64 %28
  %30 = load i32, ptr %2, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr @y, i64 %31
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %29, ptr noundef %32)
  br label %34

34:                                               ; preds = %26
  %35 = load i32, ptr %2, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !9
  br label %21, !llvm.loop !11

37:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %121, %37
  %39 = load i32, ptr %3, align 4, !tbaa !9
  %40 = load i32, ptr @n, align 4, !tbaa !9
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %124

43:                                               ; preds = %38
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.6, ptr noundef @str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %117, %43
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = load i32, ptr @n, align 4, !tbaa !9
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %120

50:                                               ; preds = %45
  %51 = load i32, ptr %3, align 4, !tbaa !9
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = icmp eq i32 %51, %52
  br i1 %53, label %61, label %54

54:                                               ; preds = %50
  %55 = load i32, ptr %5, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [151 x i8], ptr @str, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !13
  %59 = sext i8 %58 to i32
  %60 = icmp eq i32 %59, 49
  br i1 %60, label %61, label %109

61:                                               ; preds = %54, %50
  %62 = load i32, ptr %3, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = load i32, ptr %5, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = sub nsw i32 %65, %69
  %71 = load i32, ptr %3, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = load i32, ptr %5, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = sub nsw i32 %74, %78
  %80 = mul nsw i32 %70, %79
  %81 = load i32, ptr %3, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = load i32, ptr %5, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = sub nsw i32 %84, %88
  %90 = load i32, ptr %3, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = load i32, ptr %5, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = sub nsw i32 %93, %97
  %99 = mul nsw i32 %89, %98
  %100 = add nsw i32 %80, %99
  %101 = sitofp i32 %100 to double
  %102 = call double @sqrt(double noundef %101) #5
  %103 = load i32, ptr %3, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %104
  %106 = load i32, ptr %5, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [151 x double], ptr %105, i64 0, i64 %107
  store double %102, ptr %108, align 8, !tbaa !14
  br label %116

109:                                              ; preds = %54
  %110 = load i32, ptr %3, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %111
  %113 = load i32, ptr %5, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [151 x double], ptr %112, i64 0, i64 %114
  store double 1.000000e+10, ptr %115, align 8, !tbaa !14
  br label %116

116:                                              ; preds = %109, %61
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %5, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %5, align 4, !tbaa !9
  br label %45, !llvm.loop !16

120:                                              ; preds = %49
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %3, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %3, align 4, !tbaa !9
  br label %38, !llvm.loop !17

124:                                              ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %197, %124
  %126 = load i32, ptr %6, align 4, !tbaa !9
  %127 = load i32, ptr @n, align 4, !tbaa !9
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %200

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %193, %130
  %132 = load i32, ptr %7, align 4, !tbaa !9
  %133 = load i32, ptr @n, align 4, !tbaa !9
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %196

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %137

137:                                              ; preds = %189, %136
  %138 = load i32, ptr %8, align 4, !tbaa !9
  %139 = load i32, ptr @n, align 4, !tbaa !9
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %192

142:                                              ; preds = %137
  %143 = load i32, ptr %7, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %144
  %146 = load i32, ptr %8, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [151 x double], ptr %145, i64 0, i64 %147
  %149 = load double, ptr %148, align 8, !tbaa !14
  %150 = load i32, ptr %7, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %151
  %153 = load i32, ptr %6, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [151 x double], ptr %152, i64 0, i64 %154
  %156 = load double, ptr %155, align 8, !tbaa !14
  %157 = load i32, ptr %6, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %158
  %160 = load i32, ptr %8, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [151 x double], ptr %159, i64 0, i64 %161
  %163 = load double, ptr %162, align 8, !tbaa !14
  %164 = fadd double %156, %163
  %165 = fcmp ogt double %149, %164
  br i1 %165, label %166, label %188

166:                                              ; preds = %142
  %167 = load i32, ptr %7, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %168
  %170 = load i32, ptr %6, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [151 x double], ptr %169, i64 0, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !14
  %174 = load i32, ptr %6, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %175
  %177 = load i32, ptr %8, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [151 x double], ptr %176, i64 0, i64 %178
  %180 = load double, ptr %179, align 8, !tbaa !14
  %181 = fadd double %173, %180
  %182 = load i32, ptr %7, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %183
  %185 = load i32, ptr %8, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [151 x double], ptr %184, i64 0, i64 %186
  store double %181, ptr %187, align 8, !tbaa !14
  br label %188

188:                                              ; preds = %166, %142
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %8, align 4, !tbaa !9
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %8, align 4, !tbaa !9
  br label %137, !llvm.loop !18

192:                                              ; preds = %141
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %7, align 4, !tbaa !9
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %7, align 4, !tbaa !9
  br label %131, !llvm.loop !19

196:                                              ; preds = %135
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %6, align 4, !tbaa !9
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %6, align 4, !tbaa !9
  br label %125, !llvm.loop !20

200:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %201

201:                                              ; preds = %237, %200
  %202 = load i32, ptr %9, align 4, !tbaa !9
  %203 = load i32, ptr @n, align 4, !tbaa !9
  %204 = icmp slt i32 %202, %203
  br i1 %204, label %206, label %205

205:                                              ; preds = %201
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %240

206:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %207

207:                                              ; preds = %233, %206
  %208 = load i32, ptr %10, align 4, !tbaa !9
  %209 = load i32, ptr @n, align 4, !tbaa !9
  %210 = icmp slt i32 %208, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %207
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %236

212:                                              ; preds = %207
  %213 = load i32, ptr %9, align 4, !tbaa !9
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %214
  %216 = load i32, ptr %10, align 4, !tbaa !9
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [151 x double], ptr %215, i64 0, i64 %217
  %219 = load double, ptr %218, align 8, !tbaa !14
  %220 = fcmp olt double %219, 5.000000e+09
  br i1 %220, label %221, label %232

221:                                              ; preds = %212
  %222 = load i32, ptr %9, align 4, !tbaa !9
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [151 x double], ptr @g, i64 0, i64 %223
  %225 = load i32, ptr %9, align 4, !tbaa !9
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %226
  %228 = load i32, ptr %10, align 4, !tbaa !9
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [151 x double], ptr %227, i64 0, i64 %229
  %231 = load double, ptr %230, align 8, !tbaa !14
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %224, double noundef %231)
  br label %232

232:                                              ; preds = %221, %212
  br label %233

233:                                              ; preds = %232
  %234 = load i32, ptr %10, align 4, !tbaa !9
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %10, align 4, !tbaa !9
  br label %207, !llvm.loop !21

236:                                              ; preds = %211
  br label %237

237:                                              ; preds = %236
  %238 = load i32, ptr %9, align 4, !tbaa !9
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %9, align 4, !tbaa !9
  br label %201, !llvm.loop !22

240:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %241

241:                                              ; preds = %274, %240
  %242 = load i32, ptr %11, align 4, !tbaa !9
  %243 = load i32, ptr @n, align 4, !tbaa !9
  %244 = icmp slt i32 %242, %243
  br i1 %244, label %246, label %245

245:                                              ; preds = %241
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %277

246:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %247

247:                                              ; preds = %270, %246
  %248 = load i32, ptr %12, align 4, !tbaa !9
  %249 = load i32, ptr @n, align 4, !tbaa !9
  %250 = icmp slt i32 %248, %249
  br i1 %250, label %252, label %251

251:                                              ; preds = %247
  store i32 29, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %273

252:                                              ; preds = %247
  %253 = load i32, ptr %11, align 4, !tbaa !9
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %254
  %256 = load i32, ptr %12, align 4, !tbaa !9
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [151 x double], ptr %255, i64 0, i64 %257
  %259 = load double, ptr %258, align 8, !tbaa !14
  %260 = fcmp olt double %259, 5.000000e+09
  br i1 %260, label %261, label %269

261:                                              ; preds = %252
  %262 = load i32, ptr %11, align 4, !tbaa !9
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [151 x double], ptr @h, i64 0, i64 %263
  %265 = load i32, ptr %12, align 4, !tbaa !9
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [151 x double], ptr @g, i64 0, i64 %266
  %268 = load double, ptr %267, align 8, !tbaa !14
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %264, double noundef %268)
  br label %269

269:                                              ; preds = %261, %252
  br label %270

270:                                              ; preds = %269
  %271 = load i32, ptr %12, align 4, !tbaa !9
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %12, align 4, !tbaa !9
  br label %247, !llvm.loop !23

273:                                              ; preds = %251
  br label %274

274:                                              ; preds = %273
  %275 = load i32, ptr %11, align 4, !tbaa !9
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %11, align 4, !tbaa !9
  br label %241, !llvm.loop !24

277:                                              ; preds = %245
  store double 1.000000e+10, ptr @ans, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %278

278:                                              ; preds = %369, %277
  %279 = load i32, ptr %13, align 4, !tbaa !9
  %280 = load i32, ptr @n, align 4, !tbaa !9
  %281 = icmp slt i32 %279, %280
  br i1 %281, label %283, label %282

282:                                              ; preds = %278
  store i32 32, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %372

283:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %284

284:                                              ; preds = %365, %283
  %285 = load i32, ptr %14, align 4, !tbaa !9
  %286 = load i32, ptr @n, align 4, !tbaa !9
  %287 = icmp slt i32 %285, %286
  br i1 %287, label %289, label %288

288:                                              ; preds = %284
  store i32 35, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %368

289:                                              ; preds = %284
  %290 = load i32, ptr %13, align 4, !tbaa !9
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %291
  %293 = load i32, ptr %14, align 4, !tbaa !9
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [151 x double], ptr %292, i64 0, i64 %294
  %296 = load double, ptr %295, align 8, !tbaa !14
  %297 = fcmp olt double %296, 5.000000e+09
  br i1 %297, label %298, label %299

298:                                              ; preds = %289
  br label %365

299:                                              ; preds = %289
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %300 = load i32, ptr %13, align 4, !tbaa !9
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [151 x double], ptr @g, i64 0, i64 %301
  %303 = load double, ptr %302, align 8, !tbaa !14
  %304 = load i32, ptr %14, align 4, !tbaa !9
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [151 x double], ptr @g, i64 0, i64 %305
  %307 = load double, ptr %306, align 8, !tbaa !14
  %308 = fadd double %303, %307
  %309 = load i32, ptr %13, align 4, !tbaa !9
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %310
  %312 = load i32, ptr %311, align 4, !tbaa !9
  %313 = load i32, ptr %14, align 4, !tbaa !9
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %314
  %316 = load i32, ptr %315, align 4, !tbaa !9
  %317 = sub nsw i32 %312, %316
  %318 = load i32, ptr %13, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %319
  %321 = load i32, ptr %320, align 4, !tbaa !9
  %322 = load i32, ptr %14, align 4, !tbaa !9
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %323
  %325 = load i32, ptr %324, align 4, !tbaa !9
  %326 = sub nsw i32 %321, %325
  %327 = mul nsw i32 %317, %326
  %328 = load i32, ptr %13, align 4, !tbaa !9
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %329
  %331 = load i32, ptr %330, align 4, !tbaa !9
  %332 = load i32, ptr %14, align 4, !tbaa !9
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %333
  %335 = load i32, ptr %334, align 4, !tbaa !9
  %336 = sub nsw i32 %331, %335
  %337 = load i32, ptr %13, align 4, !tbaa !9
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %338
  %340 = load i32, ptr %339, align 4, !tbaa !9
  %341 = load i32, ptr %14, align 4, !tbaa !9
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %342
  %344 = load i32, ptr %343, align 4, !tbaa !9
  %345 = sub nsw i32 %340, %344
  %346 = mul nsw i32 %336, %345
  %347 = add nsw i32 %327, %346
  %348 = sitofp i32 %347 to double
  %349 = call double @sqrt(double noundef %348) #5
  %350 = fadd double %308, %349
  store double %350, ptr %15, align 8, !tbaa !14
  %351 = load i32, ptr %13, align 4, !tbaa !9
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [151 x double], ptr @h, i64 0, i64 %352
  %354 = load double, ptr %353, align 8, !tbaa !14
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %15, double noundef %354)
  %355 = load i32, ptr %14, align 4, !tbaa !9
  %356 = sext i32 %355 to i64
  %357 = getelementptr inbounds [151 x double], ptr @h, i64 0, i64 %356
  %358 = load double, ptr %357, align 8, !tbaa !14
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %15, double noundef %358)
  %359 = load double, ptr @ans, align 8, !tbaa !14
  %360 = load double, ptr %15, align 8, !tbaa !14
  %361 = fcmp ogt double %359, %360
  br i1 %361, label %362, label %364

362:                                              ; preds = %299
  %363 = load double, ptr %15, align 8, !tbaa !14
  store double %363, ptr @ans, align 8, !tbaa !14
  br label %364

364:                                              ; preds = %362, %299
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %365

365:                                              ; preds = %364, %298
  %366 = load i32, ptr %14, align 4, !tbaa !9
  %367 = add nsw i32 %366, 1
  store i32 %367, ptr %14, align 4, !tbaa !9
  br label %284, !llvm.loop !25

368:                                              ; preds = %288
  br label %369

369:                                              ; preds = %368
  %370 = load i32, ptr %13, align 4, !tbaa !9
  %371 = add nsw i32 %370, 1
  store i32 %371, ptr %13, align 4, !tbaa !9
  br label %278, !llvm.loop !26

372:                                              ; preds = %282
  %373 = load double, ptr @ans, align 8, !tbaa !14
  %374 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %373)
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

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

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

declare i32 @printf(ptr noundef, ...) #2

attributes #0 = { mustprogress nounwind 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 #1 = { mustprogress norecurse 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


; 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"

@n = external dso_local global i32, align 4
@x = external dso_local global [151 x i32], align 16
@y = external dso_local global [151 x i32], align 16
@f = external dso_local local_unnamed_addr global [151 x [151 x double]], align 16
@g = external dso_local global [151 x double], align 16
@h = external dso_local global [151 x double], align 16
@ans = external dso_local local_unnamed_addr global double, align 8
@str = external dso_local global [151 x i8], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca double, align 8
  %2 = load ptr, ptr @stdin, align 8, !tbaa !5
  %3 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %2)
  %4 = load ptr, ptr @stdout, align 8, !tbaa !5
  %5 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %4)
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n)
  %7 = load i32, ptr @n, align 4, !tbaa !9
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge118.thread

.preheader98:                                     ; preds = %.lr.ph
  %9 = icmp sgt i32 %13, 0
  br i1 %9, label %.lr.ph103, label %._crit_edge118.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %10 = getelementptr inbounds i32, ptr @x, i64 %indvars.iv
  %11 = getelementptr inbounds i32, ptr @y, i64 %indvars.iv
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next, %14
  br i1 %15, label %.lr.ph, label %.preheader98, !llvm.loop !11

.preheader97:                                     ; preds = %._crit_edge
  %16 = icmp sgt i32 %79, 0
  br i1 %16, label %.preheader96.us.preheader, label %._crit_edge118.thread

.preheader96.us.preheader:                        ; preds = %.preheader97
  %wide.trip.count148 = zext nneg i32 %79 to i64
  %17 = mul nuw nsw i64 %wide.trip.count148, 1216
  %scevgep = getelementptr i8, ptr getelementptr (i8, ptr @f, i64 -1208), i64 %17
  %18 = mul nuw nsw i64 %wide.trip.count148, 1208
  %19 = shl nuw nsw i64 %wide.trip.count148, 3
  %20 = getelementptr i8, ptr @f, i64 %18
  %21 = getelementptr i8, ptr %20, i64 -1200
  %22 = getelementptr i8, ptr @f, i64 %19
  %min.iters.check = icmp ult i32 %79, 4
  %n.vec = and i64 %wide.trip.count148, 2147483644
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count148
  %xtraiter = and i64 %wide.trip.count148, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %23 = add nsw i64 %wide.trip.count148, -1
  br label %.preheader96.us

.preheader96.us:                                  ; preds = %.preheader96.us.preheader, %._crit_edge108.split.us.us
  %indvars.iv145 = phi i64 [ 0, %.preheader96.us.preheader ], [ %indvars.iv.next146, %._crit_edge108.split.us.us ]
  %24 = shl nuw nsw i64 %indvars.iv145, 3
  %scevgep188 = getelementptr i8, ptr @f, i64 %24
  %scevgep189 = getelementptr i8, ptr %21, i64 %24
  %25 = mul nuw nsw i64 %indvars.iv145, 1208
  %scevgep190 = getelementptr i8, ptr @f, i64 %25
  %scevgep191 = getelementptr i8, ptr %22, i64 %25
  %bound0 = icmp ugt ptr %scevgep189, @f
  %bound1 = icmp ult ptr %scevgep188, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound0192 = icmp ugt ptr %scevgep191, @f
  %bound1193 = icmp ult ptr %scevgep190, %scevgep
  %found.conflict194 = and i1 %bound0192, %bound1193
  %conflict.rdx = or i1 %found.conflict, %found.conflict194
  br label %.preheader95.us.us

.preheader95.us.us:                               ; preds = %._crit_edge106.us.us, %.preheader96.us
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %._crit_edge106.us.us ], [ 0, %.preheader96.us ]
  %26 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %indvars.iv145
  %brmerge = select i1 %min.iters.check, i1 true, i1 %conflict.rdx
  br i1 %brmerge, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.preheader95.us.us
  %27 = load double, ptr %26, align 8, !tbaa !13, !alias.scope !15
  %broadcast.splatinsert198 = insertelement <2 x double> poison, double %27, i64 0
  %broadcast.splat199 = shufflevector <2 x double> %broadcast.splatinsert198, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue205, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue205 ]
  %28 = or disjoint i64 %index, 2
  %29 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %wide.load = load <2 x double>, ptr %29, align 8, !tbaa !13, !alias.scope !18, !noalias !20
  %wide.load195 = load <2 x double>, ptr %30, align 8, !tbaa !13, !alias.scope !18, !noalias !20
  %31 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv145, i64 %index
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %wide.load196 = load <2 x double>, ptr %31, align 8, !tbaa !13, !alias.scope !22
  %wide.load197 = load <2 x double>, ptr %32, align 8, !tbaa !13, !alias.scope !22
  %33 = fadd <2 x double> %broadcast.splat199, %wide.load196
  %34 = fadd <2 x double> %broadcast.splat199, %wide.load197
  %35 = fcmp ogt <2 x double> %wide.load, %33
  %36 = fcmp ogt <2 x double> %wide.load195, %34
  %37 = extractelement <2 x i1> %35, i64 0
  br i1 %37, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %38 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %index
  %39 = extractelement <2 x double> %33, i64 0
  store double %39, ptr %38, align 8, !tbaa !13, !alias.scope !18, !noalias !20
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %40 = extractelement <2 x i1> %35, i64 1
  br i1 %40, label %pred.store.if200, label %pred.store.continue201

pred.store.if200:                                 ; preds = %pred.store.continue
  %41 = or disjoint i64 %index, 1
  %42 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %41
  %43 = extractelement <2 x double> %33, i64 1
  store double %43, ptr %42, align 8, !tbaa !13, !alias.scope !18, !noalias !20
  br label %pred.store.continue201

pred.store.continue201:                           ; preds = %pred.store.if200, %pred.store.continue
  %44 = extractelement <2 x i1> %36, i64 0
  br i1 %44, label %pred.store.if202, label %pred.store.continue203

pred.store.if202:                                 ; preds = %pred.store.continue201
  %45 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %28
  %46 = extractelement <2 x double> %34, i64 0
  store double %46, ptr %45, align 8, !tbaa !13, !alias.scope !18, !noalias !20
  br label %pred.store.continue203

pred.store.continue203:                           ; preds = %pred.store.if202, %pred.store.continue201
  %47 = extractelement <2 x i1> %36, i64 1
  br i1 %47, label %pred.store.if204, label %pred.store.continue205

pred.store.if204:                                 ; preds = %pred.store.continue203
  %48 = or disjoint i64 %index, 3
  %49 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %48
  %50 = extractelement <2 x double> %34, i64 1
  store double %50, ptr %49, align 8, !tbaa !13, !alias.scope !18, !noalias !20
  br label %pred.store.continue205

pred.store.continue205:                           ; preds = %pred.store.if204, %pred.store.continue203
  %index.next = add nuw i64 %index, 4
  %51 = icmp eq i64 %index.next, %n.vec
  br i1 %51, label %middle.block, label %vector.body, !llvm.loop !23

middle.block:                                     ; preds = %pred.store.continue205
  br i1 %cmp.n, label %._crit_edge106.us.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.preheader95.us.us, %middle.block
  %indvars.iv135.ph = phi i64 [ 0, %.preheader95.us.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %52 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %indvars.iv135.ph
  %53 = load double, ptr %52, align 8, !tbaa !13
  %54 = load double, ptr %26, align 8, !tbaa !13
  %55 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv145, i64 %indvars.iv135.ph
  %56 = load double, ptr %55, align 8, !tbaa !13
  %57 = fadd double %54, %56
  %58 = fcmp ogt double %53, %57
  br i1 %58, label %59, label %scalar.ph.prol.loopexit.unr-lcssa

59:                                               ; preds = %scalar.ph.prol
  store double %57, ptr %52, align 8, !tbaa !13
  br label %scalar.ph.prol.loopexit.unr-lcssa

scalar.ph.prol.loopexit.unr-lcssa:                ; preds = %59, %scalar.ph.prol
  %indvars.iv.next136.prol = or disjoint i64 %indvars.iv135.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol.loopexit.unr-lcssa, %scalar.ph.preheader
  %indvars.iv135.unr = phi i64 [ %indvars.iv135.ph, %scalar.ph.preheader ], [ %indvars.iv.next136.prol, %scalar.ph.prol.loopexit.unr-lcssa ]
  %60 = icmp eq i64 %indvars.iv135.ph, %23
  br i1 %60, label %._crit_edge106.us.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %77
  %indvars.iv135 = phi i64 [ %indvars.iv.next136.1, %77 ], [ %indvars.iv135.unr, %scalar.ph.prol.loopexit ]
  %61 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %indvars.iv135
  %62 = load double, ptr %61, align 8, !tbaa !13
  %63 = load double, ptr %26, align 8, !tbaa !13
  %64 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv145, i64 %indvars.iv135
  %65 = load double, ptr %64, align 8, !tbaa !13
  %66 = fadd double %63, %65
  %67 = fcmp ogt double %62, %66
  br i1 %67, label %68, label %scalar.ph.1

68:                                               ; preds = %scalar.ph
  store double %66, ptr %61, align 8, !tbaa !13
  br label %scalar.ph.1

scalar.ph.1:                                      ; preds = %68, %scalar.ph
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %69 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv140, i64 %indvars.iv.next136
  %70 = load double, ptr %69, align 8, !tbaa !13
  %71 = load double, ptr %26, align 8, !tbaa !13
  %72 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv145, i64 %indvars.iv.next136
  %73 = load double, ptr %72, align 8, !tbaa !13
  %74 = fadd double %71, %73
  %75 = fcmp ogt double %70, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %scalar.ph.1
  store double %74, ptr %69, align 8, !tbaa !13
  br label %77

77:                                               ; preds = %76, %scalar.ph.1
  %indvars.iv.next136.1 = add nuw nsw i64 %indvars.iv135, 2
  %exitcond139.not.1 = icmp eq i64 %indvars.iv.next136.1, %wide.trip.count148
  br i1 %exitcond139.not.1, label %._crit_edge106.us.us, label %scalar.ph, !llvm.loop !26

._crit_edge106.us.us:                             ; preds = %scalar.ph.prol.loopexit, %77, %middle.block
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %exitcond144.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count148
  br i1 %exitcond144.not, label %._crit_edge108.split.us.us, label %.preheader95.us.us, !llvm.loop !27

._crit_edge108.split.us.us:                       ; preds = %._crit_edge106.us.us
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148
  br i1 %exitcond149.not, label %.preheader94, label %.preheader96.us, !llvm.loop !28

.lr.ph103:                                        ; preds = %.preheader98, %._crit_edge
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %._crit_edge ], [ 0, %.preheader98 ]
  %78 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @str)
  %79 = load i32, ptr @n, align 4, !tbaa !9
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph101, label %._crit_edge

.lr.ph101:                                        ; preds = %.lr.ph103
  %81 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %indvars.iv132
  %82 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %indvars.iv132
  %wide.trip.count = zext nneg i32 %79 to i64
  br label %85

._crit_edge:                                      ; preds = %104, %.lr.ph103
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %83 = sext i32 %79 to i64
  %84 = icmp slt i64 %indvars.iv.next133, %83
  br i1 %84, label %.lr.ph103, label %.preheader97, !llvm.loop !29

85:                                               ; preds = %.lr.ph101, %104
  %indvars.iv129 = phi i64 [ 0, %.lr.ph101 ], [ %indvars.iv.next130, %104 ]
  %86 = icmp eq i64 %indvars.iv132, %indvars.iv129
  br i1 %86, label %91, label %87

87:                                               ; preds = %85
  %88 = getelementptr inbounds [151 x i8], ptr @str, i64 0, i64 %indvars.iv129
  %89 = load i8, ptr %88, align 1, !tbaa !30
  %90 = icmp eq i8 %89, 49
  br i1 %90, label %91, label %104

91:                                               ; preds = %87, %85
  %92 = load i32, ptr %81, align 4, !tbaa !9
  %93 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %indvars.iv129
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = sub nsw i32 %92, %94
  %96 = mul nsw i32 %95, %95
  %97 = load i32, ptr %82, align 4, !tbaa !9
  %98 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %indvars.iv129
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = sub nsw i32 %97, %99
  %101 = mul nsw i32 %100, %100
  %102 = add nuw nsw i32 %101, %96
  %103 = uitofp nneg i32 %102 to double
  %sqrt = tail call double @llvm.sqrt.f64(double %103)
  br label %104

104:                                              ; preds = %87, %91
  %sqrt.sink = phi double [ %sqrt, %91 ], [ 1.000000e+10, %87 ]
  %105 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv132, i64 %indvars.iv129
  store double %sqrt.sink, ptr %105, align 8, !tbaa !13
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %85, !llvm.loop !31

.preheader94:                                     ; preds = %._crit_edge108.split.us.us
  br i1 %16, label %.preheader93, label %.preheader92

.preheader93:                                     ; preds = %.preheader94, %._crit_edge112
  %106 = phi i32 [ %111, %._crit_edge112 ], [ %79, %.preheader94 ]
  %indvars.iv153 = phi i64 [ %indvars.iv.next154, %._crit_edge112 ], [ 0, %.preheader94 ]
  %107 = icmp sgt i32 %106, 0
  br i1 %107, label %.lr.ph111, label %._crit_edge112

.lr.ph111:                                        ; preds = %.preheader93
  %108 = getelementptr inbounds [151 x double], ptr @g, i64 0, i64 %indvars.iv153
  br label %114

.preheader92:                                     ; preds = %._crit_edge112, %.preheader94
  %109 = phi i32 [ %79, %.preheader94 ], [ %111, %._crit_edge112 ]
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %.preheader91, label %._crit_edge118.thread

._crit_edge112:                                   ; preds = %121, %.preheader93
  %111 = phi i32 [ %106, %.preheader93 ], [ %122, %121 ]
  %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
  %112 = sext i32 %111 to i64
  %113 = icmp slt i64 %indvars.iv.next154, %112
  br i1 %113, label %.preheader93, label %.preheader92, !llvm.loop !32

114:                                              ; preds = %.lr.ph111, %121
  %115 = phi i32 [ %106, %.lr.ph111 ], [ %122, %121 ]
  %116 = phi i32 [ %106, %.lr.ph111 ], [ %123, %121 ]
  %indvars.iv150 = phi i64 [ 0, %.lr.ph111 ], [ %indvars.iv.next151, %121 ]
  %117 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv153, i64 %indvars.iv150
  %118 = load double, ptr %117, align 8, !tbaa !13
  %119 = fcmp olt double %118, 5.000000e+09
  br i1 %119, label %120, label %121

120:                                              ; preds = %114
  tail call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %108, double noundef %118)
  %.pre = load i32, ptr @n, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %114, %120
  %122 = phi i32 [ %115, %114 ], [ %.pre, %120 ]
  %123 = phi i32 [ %116, %114 ], [ %.pre, %120 ]
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %124 = sext i32 %123 to i64
  %125 = icmp slt i64 %indvars.iv.next151, %124
  br i1 %125, label %114, label %._crit_edge112, !llvm.loop !34

.preheader91:                                     ; preds = %.preheader92, %._crit_edge116
  %126 = phi i32 [ %130, %._crit_edge116 ], [ %109, %.preheader92 ]
  %indvars.iv159 = phi i64 [ %indvars.iv.next160, %._crit_edge116 ], [ 0, %.preheader92 ]
  %127 = icmp sgt i32 %126, 0
  br i1 %127, label %.lr.ph115, label %._crit_edge116

.lr.ph115:                                        ; preds = %.preheader91
  %128 = getelementptr inbounds [151 x double], ptr @h, i64 0, i64 %indvars.iv159
  br label %133

._crit_edge118.thread:                            ; preds = %.preheader92, %.preheader98, %0, %.preheader97
  store double 1.000000e+10, ptr @ans, align 8, !tbaa !13
  br label %._crit_edge123

._crit_edge118:                                   ; preds = %._crit_edge116
  store double 1.000000e+10, ptr @ans, align 8, !tbaa !13
  %129 = icmp sgt i32 %130, 0
  br i1 %129, label %.preheader, label %._crit_edge123

._crit_edge116:                                   ; preds = %142, %.preheader91
  %130 = phi i32 [ %126, %.preheader91 ], [ %143, %142 ]
  %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
  %131 = sext i32 %130 to i64
  %132 = icmp slt i64 %indvars.iv.next160, %131
  br i1 %132, label %.preheader91, label %._crit_edge118, !llvm.loop !35

133:                                              ; preds = %.lr.ph115, %142
  %134 = phi i32 [ %126, %.lr.ph115 ], [ %143, %142 ]
  %135 = phi i32 [ %126, %.lr.ph115 ], [ %144, %142 ]
  %indvars.iv156 = phi i64 [ 0, %.lr.ph115 ], [ %indvars.iv.next157, %142 ]
  %136 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv159, i64 %indvars.iv156
  %137 = load double, ptr %136, align 8, !tbaa !13
  %138 = fcmp olt double %137, 5.000000e+09
  br i1 %138, label %139, label %142

139:                                              ; preds = %133
  %140 = getelementptr inbounds [151 x double], ptr @g, i64 0, i64 %indvars.iv156
  %141 = load double, ptr %140, align 8, !tbaa !13
  tail call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %128, double noundef %141)
  %.pre168 = load i32, ptr @n, align 4, !tbaa !9
  br label %142

142:                                              ; preds = %133, %139
  %143 = phi i32 [ %134, %133 ], [ %.pre168, %139 ]
  %144 = phi i32 [ %135, %133 ], [ %.pre168, %139 ]
  %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
  %145 = sext i32 %144 to i64
  %146 = icmp slt i64 %indvars.iv.next157, %145
  br i1 %146, label %133, label %._crit_edge116, !llvm.loop !36

.preheader:                                       ; preds = %._crit_edge118, %._crit_edge121
  %147 = phi double [ %156, %._crit_edge121 ], [ 1.000000e+10, %._crit_edge118 ]
  %148 = phi i32 [ %157, %._crit_edge121 ], [ %130, %._crit_edge118 ]
  %indvars.iv165 = phi i64 [ %indvars.iv.next166, %._crit_edge121 ], [ 0, %._crit_edge118 ]
  %149 = icmp sgt i32 %148, 0
  br i1 %149, label %.lr.ph120, label %._crit_edge121

.lr.ph120:                                        ; preds = %.preheader
  %150 = getelementptr inbounds [151 x double], ptr @g, i64 0, i64 %indvars.iv165
  %151 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %indvars.iv165
  %152 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %indvars.iv165
  %153 = getelementptr inbounds [151 x double], ptr @h, i64 0, i64 %indvars.iv165
  br label %160

._crit_edge123:                                   ; preds = %._crit_edge121, %._crit_edge118.thread, %._crit_edge118
  %154 = phi double [ 1.000000e+10, %._crit_edge118 ], [ 1.000000e+10, %._crit_edge118.thread ], [ %156, %._crit_edge121 ]
  %155 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %154)
  ret i32 0

._crit_edge121:                                   ; preds = %194, %.preheader
  %156 = phi double [ %147, %.preheader ], [ %195, %194 ]
  %157 = phi i32 [ %148, %.preheader ], [ %196, %194 ]
  %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1
  %158 = sext i32 %157 to i64
  %159 = icmp slt i64 %indvars.iv.next166, %158
  br i1 %159, label %.preheader, label %._crit_edge123, !llvm.loop !37

160:                                              ; preds = %.lr.ph120, %194
  %161 = phi double [ %147, %.lr.ph120 ], [ %195, %194 ]
  %162 = phi i32 [ %148, %.lr.ph120 ], [ %196, %194 ]
  %163 = phi i32 [ %148, %.lr.ph120 ], [ %197, %194 ]
  %indvars.iv162 = phi i64 [ 0, %.lr.ph120 ], [ %indvars.iv.next163, %194 ]
  %164 = getelementptr inbounds [151 x [151 x double]], ptr @f, i64 0, i64 %indvars.iv165, i64 %indvars.iv162
  %165 = load double, ptr %164, align 8, !tbaa !13
  %166 = fcmp olt double %165, 5.000000e+09
  br i1 %166, label %194, label %167

167:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %168 = load double, ptr %150, align 8, !tbaa !13
  %169 = getelementptr inbounds [151 x double], ptr @g, i64 0, i64 %indvars.iv162
  %170 = load double, ptr %169, align 8, !tbaa !13
  %171 = fadd double %168, %170
  %172 = load i32, ptr %151, align 4, !tbaa !9
  %173 = getelementptr inbounds [151 x i32], ptr @x, i64 0, i64 %indvars.iv162
  %174 = load i32, ptr %173, align 4, !tbaa !9
  %175 = sub nsw i32 %172, %174
  %176 = mul nsw i32 %175, %175
  %177 = load i32, ptr %152, align 4, !tbaa !9
  %178 = getelementptr inbounds [151 x i32], ptr @y, i64 0, i64 %indvars.iv162
  %179 = load i32, ptr %178, align 4, !tbaa !9
  %180 = sub nsw i32 %177, %179
  %181 = mul nsw i32 %180, %180
  %182 = add nuw nsw i32 %181, %176
  %183 = uitofp nneg i32 %182 to double
  %sqrt90 = call double @llvm.sqrt.f64(double %183)
  %184 = fadd double %171, %sqrt90
  store double %184, ptr %1, align 8, !tbaa !13
  %185 = load double, ptr %153, align 8, !tbaa !13
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %1, double noundef %185)
  %186 = getelementptr inbounds [151 x double], ptr @h, i64 0, i64 %indvars.iv162
  %187 = load double, ptr %186, align 8, !tbaa !13
  call void @_Z3updRdd(ptr noundef nonnull align 8 dereferenceable(8) %1, double noundef %187)
  %188 = load double, ptr @ans, align 8, !tbaa !13
  %189 = load double, ptr %1, align 8, !tbaa !13
  %190 = fcmp ogt double %188, %189
  br i1 %190, label %191, label %192

191:                                              ; preds = %167
  store double %189, ptr @ans, align 8, !tbaa !13
  br label %192

192:                                              ; preds = %191, %167
  %193 = phi double [ %189, %191 ], [ %188, %167 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %.pre169 = load i32, ptr @n, align 4, !tbaa !9
  br label %194

194:                                              ; preds = %160, %192
  %195 = phi double [ %161, %160 ], [ %193, %192 ]
  %196 = phi i32 [ %162, %160 ], [ %.pre169, %192 ]
  %197 = phi i32 [ %163, %160 ], [ %.pre169, %192 ]
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %198 = sext i32 %197 to i64
  %199 = icmp slt i64 %indvars.iv.next163, %198
  br i1 %199, label %160, label %._crit_edge121, !llvm.loop !38
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

attributes #0 = { mustprogress nounwind 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 #1 = { mustprogress norecurse 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 #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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = !{!16, !21}
!21 = distinct !{!21, !17}
!22 = !{!21}
!23 = distinct !{!23, !12, !24, !25}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !12, !24}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = !{!7, !7, i64 0}
!31 = distinct !{!31, !12}
!32 = distinct !{!32, !12, !33}
!33 = !{!"llvm.loop.unswitch.partial.disable"}
!34 = distinct !{!34, !12}
!35 = distinct !{!35, !12, !33}
!36 = distinct !{!36, !12}
!37 = distinct !{!37, !12, !33}
!38 = distinct !{!38, !12}


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