; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101385I)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@a = external dso_local global [19 x double], align 16
@.str = external hidden unnamed_addr constant [9 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 [10 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 [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z4calcv() #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %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 i32, align 4
  store i32 0, ptr %1, align 4
  %20 = load ptr, ptr @stdin, align 8, !tbaa !5
  %21 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %20)
  %22 = load ptr, ptr @stdout, align 8, !tbaa !5
  %23 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %22)
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @t)
  br label %25

25:                                               ; preds = %381, %42, %0
  %26 = load i32, ptr @t, align 4, !tbaa !9
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr @t, align 4, !tbaa !9
  %28 = icmp ne i32 %26, 0
  br i1 %28, label %29, label %382

29:                                               ; preds = %25
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef @m, ptr noundef @s, ptr noundef @h)
  %31 = load i32, ptr @m, align 4, !tbaa !9
  %32 = load i32, ptr @h, align 4, !tbaa !9
  %33 = sub nsw i32 %31, %32
  %34 = sitofp i32 %33 to double
  %35 = call noundef i32 @_Z3sgnd(double noundef %34)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %45, label %37

37:                                               ; preds = %29
  %38 = load i32, ptr @s, align 4, !tbaa !9
  %39 = sitofp i32 %38 to double
  %40 = call noundef i32 @_Z3sgnd(double noundef %39)
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %45, label %42

42:                                               ; preds = %37
  %43 = load i32, ptr @h, align 4, !tbaa !9
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %43)
  br label %25, !llvm.loop !11

45:                                               ; preds = %37, %29
  store i32 3, ptr @n, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %354, %45
  %47 = load i32, ptr @n, align 4, !tbaa !9
  %48 = icmp sle i32 %47, 19
  br i1 %48, label %49, label %357

49:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %50 = load i32, ptr @n, align 4, !tbaa !9
  %51 = ashr i32 %50, 1
  store i32 %51, ptr %2, align 4, !tbaa !9
  %52 = load i32, ptr @h, align 4, !tbaa !9
  %53 = sitofp i32 %52 to double
  %54 = load i32, ptr %2, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %55
  store double %53, ptr %56, align 8, !tbaa !13
  %57 = load i32, ptr @h, align 4, !tbaa !9
  %58 = load i32, ptr @m, align 4, !tbaa !9
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %116

60:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %61 = load i32, ptr @n, align 4, !tbaa !9
  %62 = load i32, ptr @m, align 4, !tbaa !9
  %63 = mul nsw i32 %61, %62
  %64 = load i32, ptr %2, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  %66 = load i32, ptr @h, align 4, !tbaa !9
  %67 = mul nsw i32 %65, %66
  %68 = sub nsw i32 %63, %67
  %69 = sitofp i32 %68 to double
  %70 = load i32, ptr @n, align 4, !tbaa !9
  %71 = load i32, ptr %2, align 4, !tbaa !9
  %72 = sub nsw i32 %70, %71
  %73 = sub nsw i32 %72, 1
  %74 = sitofp i32 %73 to double
  %75 = fdiv double %69, %74
  store double %75, ptr %3, align 8, !tbaa !13
  %76 = load double, ptr %3, align 8, !tbaa !13
  %77 = fsub double %76, 1.000000e+02
  %78 = call noundef i32 @_Z3sgnd(double noundef %77)
  %79 = icmp sgt i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %60
  store i32 6, ptr %4, align 4
  br label %113

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

82:                                               ; preds = %93, %81
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %84 = load i32, ptr %2, align 4, !tbaa !9
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %96

87:                                               ; preds = %82
  %88 = load i32, ptr @h, align 4, !tbaa !9
  %89 = sitofp i32 %88 to double
  %90 = load i32, ptr %5, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %91
  store double %89, ptr %92, align 8, !tbaa !13
  br label %93

93:                                               ; preds = %87
  %94 = load i32, ptr %5, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %5, align 4, !tbaa !9
  br label %82, !llvm.loop !15

96:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %97 = load i32, ptr %2, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %6, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %109, %96
  %100 = load i32, ptr %6, align 4, !tbaa !9
  %101 = load i32, ptr @n, align 4, !tbaa !9
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %112

104:                                              ; preds = %99
  %105 = load double, ptr %3, align 8, !tbaa !13
  %106 = load i32, ptr %6, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %107
  store double %105, ptr %108, align 8, !tbaa !13
  br label %109

109:                                              ; preds = %104
  %110 = load i32, ptr %6, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %6, align 4, !tbaa !9
  br label %99, !llvm.loop !16

112:                                              ; preds = %103
  store i32 0, ptr %4, align 4
  br label %113

113:                                              ; preds = %112, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  %114 = load i32, ptr %4, align 4
  switch i32 %114, label %351 [
    i32 0, label %115
  ]

115:                                              ; preds = %113
  br label %170

116:                                              ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %117 = load i32, ptr @n, align 4, !tbaa !9
  %118 = load i32, ptr @m, align 4, !tbaa !9
  %119 = mul nsw i32 %117, %118
  %120 = load i32, ptr @n, align 4, !tbaa !9
  %121 = load i32, ptr %2, align 4, !tbaa !9
  %122 = sub nsw i32 %120, %121
  %123 = load i32, ptr @h, align 4, !tbaa !9
  %124 = mul nsw i32 %122, %123
  %125 = sub nsw i32 %119, %124
  %126 = sitofp i32 %125 to double
  %127 = load i32, ptr %2, align 4, !tbaa !9
  %128 = sitofp i32 %127 to double
  %129 = fdiv double %126, %128
  store double %129, ptr %7, align 8, !tbaa !13
  %130 = load double, ptr %7, align 8, !tbaa !13
  %131 = fsub double %130, 0.000000e+00
  %132 = call noundef i32 @_Z3sgnd(double noundef %131)
  %133 = icmp slt i32 %132, 0
  br i1 %133, label %134, label %135

134:                                              ; preds = %116
  store i32 6, ptr %4, align 4
  br label %167

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

136:                                              ; preds = %146, %135
  %137 = load i32, ptr %8, align 4, !tbaa !9
  %138 = load i32, ptr %2, align 4, !tbaa !9
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %149

141:                                              ; preds = %136
  %142 = load double, ptr %7, align 8, !tbaa !13
  %143 = load i32, ptr %8, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %144
  store double %142, ptr %145, align 8, !tbaa !13
  br label %146

146:                                              ; preds = %141
  %147 = load i32, ptr %8, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %8, align 4, !tbaa !9
  br label %136, !llvm.loop !17

149:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %150 = load i32, ptr %2, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %9, align 4, !tbaa !9
  br label %152

152:                                              ; preds = %163, %149
  %153 = load i32, ptr %9, align 4, !tbaa !9
  %154 = load i32, ptr @n, align 4, !tbaa !9
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %166

157:                                              ; preds = %152
  %158 = load i32, ptr @h, align 4, !tbaa !9
  %159 = sitofp i32 %158 to double
  %160 = load i32, ptr %9, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %161
  store double %159, ptr %162, align 8, !tbaa !13
  br label %163

163:                                              ; preds = %157
  %164 = load i32, ptr %9, align 4, !tbaa !9
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %9, align 4, !tbaa !9
  br label %152, !llvm.loop !18

166:                                              ; preds = %156
  store i32 0, ptr %4, align 4
  br label %167

167:                                              ; preds = %166, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  %168 = load i32, ptr %4, align 4
  switch i32 %168, label %351 [
    i32 0, label %169
  ]

169:                                              ; preds = %167
  br label %170

170:                                              ; preds = %169, %115
  %171 = call noundef double @_Z4calcv()
  %172 = load i32, ptr @s, align 4, !tbaa !9
  %173 = sitofp i32 %172 to double
  %174 = fsub double %171, %173
  %175 = call noundef i32 @_Z3sgnd(double noundef %174)
  %176 = icmp sgt i32 %175, 0
  br i1 %176, label %177, label %178

177:                                              ; preds = %170
  store i32 6, ptr %4, align 4
  br label %351

178:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %179 = load i32, ptr @n, align 4, !tbaa !9
  %180 = sub nsw i32 %179, 1
  store i32 %180, ptr %11, align 4, !tbaa !9
  br label %181

181:                                              ; preds = %339, %178
  %182 = load i32, ptr %10, align 4, !tbaa !9
  %183 = load i32, ptr %11, align 4, !tbaa !9
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 19, ptr %4, align 4
  br label %341

186:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %187 = load i32, ptr %10, align 4, !tbaa !9
  %188 = load i32, ptr %2, align 4, !tbaa !9
  %189 = icmp slt i32 %187, %188
  br i1 %189, label %190, label %196

190:                                              ; preds = %186
  %191 = load i32, ptr %10, align 4, !tbaa !9
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %192
  %194 = load double, ptr %193, align 8, !tbaa !13
  %195 = fsub double %194, 0.000000e+00
  br label %204

196:                                              ; preds = %186
  %197 = load i32, ptr %10, align 4, !tbaa !9
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %198
  %200 = load double, ptr %199, align 8, !tbaa !13
  %201 = load i32, ptr @h, align 4, !tbaa !9
  %202 = sitofp i32 %201 to double
  %203 = fsub double %200, %202
  br label %204

204:                                              ; preds = %196, %190
  %205 = phi double [ %195, %190 ], [ %203, %196 ]
  store double %205, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %206 = load i32, ptr %11, align 4, !tbaa !9
  %207 = load i32, ptr %2, align 4, !tbaa !9
  %208 = icmp sle i32 %206, %207
  br i1 %208, label %209, label %217

209:                                              ; preds = %204
  %210 = load i32, ptr @h, align 4, !tbaa !9
  %211 = sitofp i32 %210 to double
  %212 = load i32, ptr %11, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %213
  %215 = load double, ptr %214, align 8, !tbaa !13
  %216 = fsub double %211, %215
  br label %223

217:                                              ; preds = %204
  %218 = load i32, ptr %11, align 4, !tbaa !9
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %219
  %221 = load double, ptr %220, align 8, !tbaa !13
  %222 = fsub double 1.000000e+02, %221
  br label %223

223:                                              ; preds = %217, %209
  %224 = phi double [ %216, %209 ], [ %222, %217 ]
  store double %224, ptr %13, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %226 = load double, ptr %225, align 8, !tbaa !13
  store double %226, ptr %14, align 8, !tbaa !13
  %227 = load double, ptr %14, align 8, !tbaa !13
  %228 = load i32, ptr %10, align 4, !tbaa !9
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %229
  %231 = load double, ptr %230, align 8, !tbaa !13
  %232 = fsub double %231, %227
  store double %232, ptr %230, align 8, !tbaa !13
  %233 = load double, ptr %14, align 8, !tbaa !13
  %234 = load i32, ptr %11, align 4, !tbaa !9
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %235
  %237 = load double, ptr %236, align 8, !tbaa !13
  %238 = fadd double %237, %233
  store double %238, ptr %236, align 8, !tbaa !13
  %239 = call noundef double @_Z4calcv()
  %240 = load i32, ptr @s, align 4, !tbaa !9
  %241 = sitofp i32 %240 to double
  %242 = fsub double %239, %241
  %243 = call noundef i32 @_Z3sgnd(double noundef %242)
  %244 = icmp slt i32 %243, 0
  br i1 %244, label %245, label %264

245:                                              ; preds = %223
  %246 = load double, ptr %12, align 8, !tbaa !13
  %247 = load double, ptr %14, align 8, !tbaa !13
  %248 = fsub double %246, %247
  %249 = call noundef i32 @_Z3sgnd(double noundef %248)
  %250 = icmp ne i32 %249, 0
  %251 = xor i1 %250, true
  %252 = zext i1 %251 to i32
  %253 = load i32, ptr %10, align 4, !tbaa !9
  %254 = add nsw i32 %253, %252
  store i32 %254, ptr %10, align 4, !tbaa !9
  %255 = load double, ptr %13, align 8, !tbaa !13
  %256 = load double, ptr %14, align 8, !tbaa !13
  %257 = fsub double %255, %256
  %258 = call noundef i32 @_Z3sgnd(double noundef %257)
  %259 = icmp ne i32 %258, 0
  %260 = xor i1 %259, true
  %261 = zext i1 %260 to i32
  %262 = load i32, ptr %11, align 4, !tbaa !9
  %263 = sub nsw i32 %262, %261
  store i32 %263, ptr %11, align 4, !tbaa !9
  store i32 20, ptr %4, align 4
  br label %339, !llvm.loop !19

264:                                              ; preds = %223
  %265 = load double, ptr %14, align 8, !tbaa !13
  %266 = load i32, ptr %10, align 4, !tbaa !9
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %267
  %269 = load double, ptr %268, align 8, !tbaa !13
  %270 = fadd double %269, %265
  store double %270, ptr %268, align 8, !tbaa !13
  %271 = load double, ptr %14, align 8, !tbaa !13
  %272 = load i32, ptr %11, align 4, !tbaa !9
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %273
  %275 = load double, ptr %274, align 8, !tbaa !13
  %276 = fsub double %275, %271
  store double %276, ptr %274, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store double 0.000000e+00, ptr %15, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %277 = load double, ptr %14, align 8, !tbaa !13
  store double %277, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %278

278:                                              ; preds = %323, %264
  %279 = load i32, ptr %17, align 4, !tbaa !9
  %280 = icmp slt i32 %279, 40
  br i1 %280, label %282, label %281

281:                                              ; preds = %278
  store i32 21, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %326

282:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %283 = load double, ptr %15, align 8, !tbaa !13
  %284 = load double, ptr %16, align 8, !tbaa !13
  %285 = load double, ptr %15, align 8, !tbaa !13
  %286 = fsub double %284, %285
  %287 = call double @llvm.fmuladd.f64(double %286, double 5.000000e-01, double %283)
  store double %287, ptr %18, align 8, !tbaa !13
  %288 = load double, ptr %18, align 8, !tbaa !13
  %289 = load i32, ptr %10, align 4, !tbaa !9
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %290
  %292 = load double, ptr %291, align 8, !tbaa !13
  %293 = fsub double %292, %288
  store double %293, ptr %291, align 8, !tbaa !13
  %294 = load double, ptr %18, align 8, !tbaa !13
  %295 = load i32, ptr %11, align 4, !tbaa !9
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %296
  %298 = load double, ptr %297, align 8, !tbaa !13
  %299 = fadd double %298, %294
  store double %299, ptr %297, align 8, !tbaa !13
  %300 = call noundef double @_Z4calcv()
  %301 = load i32, ptr @s, align 4, !tbaa !9
  %302 = sitofp i32 %301 to double
  %303 = fsub double %300, %302
  %304 = call noundef i32 @_Z3sgnd(double noundef %303)
  %305 = icmp slt i32 %304, 0
  br i1 %305, label %306, label %308

306:                                              ; preds = %282
  %307 = load double, ptr %18, align 8, !tbaa !13
  store double %307, ptr %15, align 8, !tbaa !13
  br label %310

308:                                              ; preds = %282
  %309 = load double, ptr %18, align 8, !tbaa !13
  store double %309, ptr %16, align 8, !tbaa !13
  br label %310

310:                                              ; preds = %308, %306
  %311 = load double, ptr %18, align 8, !tbaa !13
  %312 = load i32, ptr %10, align 4, !tbaa !9
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %313
  %315 = load double, ptr %314, align 8, !tbaa !13
  %316 = fadd double %315, %311
  store double %316, ptr %314, align 8, !tbaa !13
  %317 = load double, ptr %18, align 8, !tbaa !13
  %318 = load i32, ptr %11, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %319
  %321 = load double, ptr %320, align 8, !tbaa !13
  %322 = fsub double %321, %317
  store double %322, ptr %320, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %323

323:                                              ; preds = %310
  %324 = load i32, ptr %17, align 4, !tbaa !9
  %325 = add nsw i32 %324, 1
  store i32 %325, ptr %17, align 4, !tbaa !9
  br label %278, !llvm.loop !20

326:                                              ; preds = %281
  %327 = load double, ptr %16, align 8, !tbaa !13
  %328 = load i32, ptr %10, align 4, !tbaa !9
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %329
  %331 = load double, ptr %330, align 8, !tbaa !13
  %332 = fsub double %331, %327
  store double %332, ptr %330, align 8, !tbaa !13
  %333 = load double, ptr %16, align 8, !tbaa !13
  %334 = load i32, ptr %11, align 4, !tbaa !9
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %335
  %337 = load double, ptr %336, align 8, !tbaa !13
  %338 = fadd double %337, %333
  store double %338, ptr %336, align 8, !tbaa !13
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %339

339:                                              ; preds = %326, %245
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %340 = load i32, ptr %4, align 4
  switch i32 %340, label %341 [
    i32 20, label %181
  ]

341:                                              ; preds = %339, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %342

342:                                              ; preds = %341
  %343 = call noundef double @_Z4calcv()
  %344 = load i32, ptr @s, align 4, !tbaa !9
  %345 = sitofp i32 %344 to double
  %346 = fsub double %343, %345
  %347 = call noundef i32 @_Z3sgnd(double noundef %346)
  %348 = icmp eq i32 %347, 0
  br i1 %348, label %349, label %350

349:                                              ; preds = %342
  store i32 4, ptr %4, align 4
  br label %351

350:                                              ; preds = %342
  store i32 0, ptr %4, align 4
  br label %351

351:                                              ; preds = %350, %349, %177, %167, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %352 = load i32, ptr %4, align 4
  switch i32 %352, label %383 [
    i32 0, label %353
    i32 6, label %354
    i32 4, label %357
  ]

353:                                              ; preds = %351
  br label %354

354:                                              ; preds = %353, %351
  %355 = load i32, ptr @n, align 4, !tbaa !9
  %356 = add nsw i32 %355, 2
  store i32 %356, ptr @n, align 4, !tbaa !9
  br label %46, !llvm.loop !21

357:                                              ; preds = %351, %46
  %358 = load i32, ptr @n, align 4, !tbaa !9
  %359 = icmp sle i32 %358, 19
  br i1 %359, label %360, label %379

360:                                              ; preds = %357
  %361 = load i32, ptr @n, align 4, !tbaa !9
  %362 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %361)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %363

363:                                              ; preds = %374, %360
  %364 = load i32, ptr %19, align 4, !tbaa !9
  %365 = load i32, ptr @n, align 4, !tbaa !9
  %366 = icmp slt i32 %364, %365
  br i1 %366, label %368, label %367

367:                                              ; preds = %363
  store i32 24, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %377

368:                                              ; preds = %363
  %369 = load i32, ptr %19, align 4, !tbaa !9
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %370
  %372 = load double, ptr %371, align 8, !tbaa !13
  %373 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %372)
  br label %374

374:                                              ; preds = %368
  %375 = load i32, ptr %19, align 4, !tbaa !9
  %376 = add nsw i32 %375, 1
  store i32 %376, ptr %19, align 4, !tbaa !9
  br label %363, !llvm.loop !22

377:                                              ; preds = %367
  %378 = call i32 @putchar(i32 noundef 10)
  br label %381

379:                                              ; preds = %357
  %380 = call i32 @puts(ptr noundef @.str.8)
  br label %381

381:                                              ; preds = %379, %377
  br label %25, !llvm.loop !11

382:                                              ; preds = %25
  ret i32 0

383:                                              ; preds = %351
  unreachable
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #6

declare i32 @puts(ptr noundef) #4

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { "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 = { inlinehint 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 #6 = { inlinehint 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 #7 = { 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 = distinct !{!15, !12}
!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}


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

@t = external dso_local global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [19 x double], align 16
@.str = external hidden unnamed_addr constant [9 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 [10 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 [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z4calcv() local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca double, align 8
  %2 = alloca double, align 8
  %3 = load ptr, ptr @stdin, align 8, !tbaa !5
  %4 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %3)
  %5 = load ptr, ptr @stdout, align 8, !tbaa !5
  %6 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %5)
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @t)
  %8 = load i32, ptr @t, align 4, !tbaa !9
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr @t, align 4, !tbaa !9
  %.not131 = icmp eq i32 %8, 0
  br i1 %.not131, label %._crit_edge134, label %.lr.ph133

.lr.ph133:                                        ; preds = %0, %.backedge
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @m, ptr noundef nonnull @s, ptr noundef nonnull @h)
  %11 = load i32, ptr @m, align 4, !tbaa !9
  %12 = load i32, ptr @h, align 4, !tbaa !9
  %13 = sub nsw i32 %11, %12
  %14 = sitofp i32 %13 to double
  %15 = call noundef i32 @_Z3sgnd(double noundef %14)
  %.not96 = icmp eq i32 %15, 0
  br i1 %.not96, label %16, label %25

16:                                               ; preds = %.lr.ph133
  %17 = load i32, ptr @s, align 4, !tbaa !9
  %18 = sitofp i32 %17 to double
  %19 = call noundef i32 @_Z3sgnd(double noundef %18)
  %.not97 = icmp eq i32 %19, 0
  br i1 %.not97, label %20, label %25

20:                                               ; preds = %16
  %21 = load i32, ptr @h, align 4, !tbaa !9
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %21)
  br label %.backedge

.backedge:                                        ; preds = %._crit_edge130, %.thread110, %20
  %23 = load i32, ptr @t, align 4, !tbaa !9
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr @t, align 4, !tbaa !9
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %._crit_edge134, label %.lr.ph133, !llvm.loop !11

25:                                               ; preds = %16, %.lr.ph133
  store i32 3, ptr @n, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %25, %.thread106
  %storemerge126 = phi i32 [ 3, %25 ], [ %174, %.thread106 ]
  %27 = ashr i32 %storemerge126, 1
  %28 = load i32, ptr @h, align 4, !tbaa !9
  %29 = sitofp i32 %28 to double
  %30 = sext i32 %27 to i64
  %31 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %30
  store double %29, ptr %31, align 8, !tbaa !13
  %32 = load i32, ptr @m, align 4, !tbaa !9
  %33 = icmp slt i32 %28, %32
  %34 = mul nsw i32 %32, %storemerge126
  br i1 %33, label %35, label %63

35:                                               ; preds = %26
  %36 = add nsw i32 %27, 1
  %37 = mul nsw i32 %28, %36
  %38 = sub nsw i32 %34, %37
  %39 = sitofp i32 %38 to double
  %40 = xor i32 %27, -1
  %41 = add i32 %storemerge126, %40
  %42 = sitofp i32 %41 to double
  %43 = fdiv double %39, %42
  %44 = fadd double %43, -1.000000e+02
  %45 = call noundef i32 @_Z3sgnd(double noundef %44)
  %46 = icmp slt i32 %45, 1
  br i1 %46, label %.preheader111, label %.thread106

.preheader111:                                    ; preds = %35
  %47 = icmp sgt i32 %27, 0
  br i1 %47, label %.lr.ph119, label %.preheader

.lr.ph119:                                        ; preds = %.preheader111
  %48 = load i32, ptr @h, align 4, !tbaa !9
  %49 = sitofp i32 %48 to double
  %wide.trip.count145 = zext nneg i32 %27 to i64
  %min.iters.check163 = icmp ult i32 %27, 4
  br i1 %min.iters.check163, label %scalar.ph162.preheader, label %vector.ph164

scalar.ph162.preheader:                           ; preds = %middle.block161, %.lr.ph119
  %indvars.iv142.ph = phi i64 [ 0, %.lr.ph119 ], [ %n.vec166, %middle.block161 ]
  br label %scalar.ph162

vector.ph164:                                     ; preds = %.lr.ph119
  %n.vec166 = and i64 %wide.trip.count145, 2147483644
  %broadcast.splatinsert170 = insertelement <2 x double> poison, double %49, i64 0
  %broadcast.splat171 = shufflevector <2 x double> %broadcast.splatinsert170, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body168

vector.body168:                                   ; preds = %vector.body168, %vector.ph164
  %index169 = phi i64 [ 0, %vector.ph164 ], [ %index.next172, %vector.body168 ]
  %50 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %index169
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  store <2 x double> %broadcast.splat171, ptr %50, align 16, !tbaa !13
  store <2 x double> %broadcast.splat171, ptr %51, align 16, !tbaa !13
  %index.next172 = add nuw i64 %index169, 4
  %52 = icmp eq i64 %index.next172, %n.vec166
  br i1 %52, label %middle.block161, label %vector.body168, !llvm.loop !15

middle.block161:                                  ; preds = %vector.body168
  %cmp.n173 = icmp eq i64 %n.vec166, %wide.trip.count145
  br i1 %cmp.n173, label %.preheader, label %scalar.ph162.preheader

.preheader:                                       ; preds = %scalar.ph162, %middle.block161, %.preheader111
  %53 = load i32, ptr @n, align 4, !tbaa !9
  %54 = icmp slt i32 %36, %53
  br i1 %54, label %.lr.ph121.preheader, label %._crit_edge122

.lr.ph121.preheader:                              ; preds = %.preheader
  %55 = add nsw i64 %30, 1
  %wide.trip.count150 = sext i32 %53 to i64
  %56 = xor i64 %30, -1
  %57 = add nsw i64 %56, %wide.trip.count150
  %min.iters.check = icmp ult i64 %57, 4
  br i1 %min.iters.check, label %.lr.ph121.preheader202, label %vector.ph

.lr.ph121.preheader202:                           ; preds = %middle.block, %.lr.ph121.preheader
  %indvars.iv147.ph = phi i64 [ %55, %.lr.ph121.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph121

vector.ph:                                        ; preds = %.lr.ph121.preheader
  %n.vec = and i64 %57, -4
  %ind.end = add nsw i64 %55, %n.vec
  %broadcast.splatinsert = insertelement <2 x double> poison, double %43, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %55, %index
  %58 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %offset.idx
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store <2 x double> %broadcast.splat, ptr %58, align 8, !tbaa !13
  store <2 x double> %broadcast.splat, ptr %59, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 4
  %60 = icmp eq i64 %index.next, %n.vec
  br i1 %60, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %57, %n.vec
  br i1 %cmp.n, label %._crit_edge122, label %.lr.ph121.preheader202

scalar.ph162:                                     ; preds = %scalar.ph162.preheader, %scalar.ph162
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %scalar.ph162 ], [ %indvars.iv142.ph, %scalar.ph162.preheader ]
  %61 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %indvars.iv142
  store double %49, ptr %61, align 8, !tbaa !13
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %exitcond146.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count145
  br i1 %exitcond146.not, label %.preheader, label %scalar.ph162, !llvm.loop !19

.lr.ph121:                                        ; preds = %.lr.ph121.preheader202, %.lr.ph121
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %.lr.ph121 ], [ %indvars.iv147.ph, %.lr.ph121.preheader202 ]
  %62 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %indvars.iv147
  store double %43, ptr %62, align 8, !tbaa !13
  %indvars.iv.next148 = add nsw i64 %indvars.iv147, 1
  %exitcond151.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count150
  br i1 %exitcond151.not, label %._crit_edge122, label %.lr.ph121, !llvm.loop !20

63:                                               ; preds = %26
  %.neg = sub i32 %27, %storemerge126
  %.neg98 = mul i32 %28, %.neg
  %64 = add i32 %34, %.neg98
  %65 = sitofp i32 %64 to double
  %66 = sitofp i32 %27 to double
  %67 = fdiv double %65, %66
  %68 = call noundef i32 @_Z3sgnd(double noundef %67)
  %69 = icmp sgt i32 %68, -1
  br i1 %69, label %.preheader113, label %.thread106

.preheader113:                                    ; preds = %63
  %70 = icmp sgt i32 %27, 0
  br i1 %70, label %.lr.ph.preheader, label %.preheader112

.lr.ph.preheader:                                 ; preds = %.preheader113
  %wide.trip.count = zext nneg i32 %27 to i64
  %min.iters.check191 = icmp ult i32 %27, 4
  br i1 %min.iters.check191, label %.lr.ph.preheader204, label %vector.ph192

.lr.ph.preheader204:                              ; preds = %middle.block189, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec194, %middle.block189 ]
  br label %.lr.ph

vector.ph192:                                     ; preds = %.lr.ph.preheader
  %n.vec194 = and i64 %wide.trip.count, 2147483644
  %broadcast.splatinsert198 = insertelement <2 x double> poison, double %67, i64 0
  %broadcast.splat199 = shufflevector <2 x double> %broadcast.splatinsert198, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body196

vector.body196:                                   ; preds = %vector.body196, %vector.ph192
  %index197 = phi i64 [ 0, %vector.ph192 ], [ %index.next200, %vector.body196 ]
  %71 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %index197
  %72 = getelementptr inbounds i8, ptr %71, i64 16
  store <2 x double> %broadcast.splat199, ptr %71, align 16, !tbaa !13
  store <2 x double> %broadcast.splat199, ptr %72, align 16, !tbaa !13
  %index.next200 = add nuw i64 %index197, 4
  %73 = icmp eq i64 %index.next200, %n.vec194
  br i1 %73, label %middle.block189, label %vector.body196, !llvm.loop !21

middle.block189:                                  ; preds = %vector.body196
  %cmp.n201 = icmp eq i64 %n.vec194, %wide.trip.count
  br i1 %cmp.n201, label %.preheader112, label %.lr.ph.preheader204

.preheader112:                                    ; preds = %.lr.ph, %middle.block189, %.preheader113
  %74 = load i32, ptr @n, align 4, !tbaa !9
  %.086115 = add nsw i32 %27, 1
  %75 = icmp slt i32 %.086115, %74
  br i1 %75, label %.lr.ph117, label %._crit_edge122

.lr.ph117:                                        ; preds = %.preheader112
  %76 = load i32, ptr @h, align 4, !tbaa !9
  %77 = sitofp i32 %76 to double
  %78 = add nsw i64 %30, 1
  %wide.trip.count140 = sext i32 %74 to i64
  %79 = xor i64 %30, -1
  %80 = add nsw i64 %79, %wide.trip.count140
  %min.iters.check176 = icmp ult i64 %80, 4
  br i1 %min.iters.check176, label %scalar.ph175.preheader, label %vector.ph177

scalar.ph175.preheader:                           ; preds = %middle.block174, %.lr.ph117
  %indvars.iv137.ph = phi i64 [ %78, %.lr.ph117 ], [ %ind.end180, %middle.block174 ]
  br label %scalar.ph175

vector.ph177:                                     ; preds = %.lr.ph117
  %n.vec179 = and i64 %80, -4
  %ind.end180 = add nsw i64 %78, %n.vec179
  %broadcast.splatinsert185 = insertelement <2 x double> poison, double %77, i64 0
  %broadcast.splat186 = shufflevector <2 x double> %broadcast.splatinsert185, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body182

vector.body182:                                   ; preds = %vector.body182, %vector.ph177
  %index183 = phi i64 [ 0, %vector.ph177 ], [ %index.next187, %vector.body182 ]
  %offset.idx184 = add i64 %78, %index183
  %81 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %offset.idx184
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  store <2 x double> %broadcast.splat186, ptr %81, align 8, !tbaa !13
  store <2 x double> %broadcast.splat186, ptr %82, align 8, !tbaa !13
  %index.next187 = add nuw i64 %index183, 4
  %83 = icmp eq i64 %index.next187, %n.vec179
  br i1 %83, label %middle.block174, label %vector.body182, !llvm.loop !22

middle.block174:                                  ; preds = %vector.body182
  %cmp.n188 = icmp eq i64 %80, %n.vec179
  br i1 %cmp.n188, label %._crit_edge122, label %scalar.ph175.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader204, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader204 ]
  %84 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %indvars.iv
  store double %67, ptr %84, align 8, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader112, label %.lr.ph, !llvm.loop !23

scalar.ph175:                                     ; preds = %scalar.ph175.preheader, %scalar.ph175
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %scalar.ph175 ], [ %indvars.iv137.ph, %scalar.ph175.preheader ]
  %85 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %indvars.iv137
  store double %77, ptr %85, align 8, !tbaa !13
  %indvars.iv.next138 = add nsw i64 %indvars.iv137, 1
  %exitcond141.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count140
  br i1 %exitcond141.not, label %._crit_edge122, label %scalar.ph175, !llvm.loop !24

._crit_edge122:                                   ; preds = %scalar.ph175, %.lr.ph121, %middle.block174, %middle.block, %.preheader112, %.preheader
  %86 = call noundef double @_Z4calcv()
  %87 = load i32, ptr @s, align 4, !tbaa !9
  %88 = sitofp i32 %87 to double
  %89 = fsub double %86, %88
  %90 = call noundef i32 @_Z3sgnd(double noundef %89)
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %.thread106, label %92

92:                                               ; preds = %._crit_edge122
  %93 = load i32, ptr @n, align 4, !tbaa !9
  %94 = add nsw i32 %93, -1
  br label %95

95:                                               ; preds = %165, %92
  %.084 = phi i32 [ 0, %92 ], [ %.185, %165 ]
  %.082 = phi i32 [ %94, %92 ], [ %.183, %165 ]
  %96 = icmp slt i32 %.084, %.082
  br i1 %96, label %97, label %166

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %98 = icmp slt i32 %.084, %27
  %99 = sext i32 %.084 to i64
  %100 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !13
  %102 = load i32, ptr @h, align 4
  %103 = sitofp i32 %102 to double
  %104 = fsub double %101, %103
  %105 = select i1 %98, double %101, double %104
  store double %105, ptr %1, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %.not99 = icmp sgt i32 %.082, %27
  %106 = load i32, ptr @h, align 4
  %107 = sitofp i32 %106 to double
  %.sink = select i1 %.not99, double 1.000000e+02, double %107
  %108 = sext i32 %.082 to i64
  %109 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !13
  %111 = fsub double %.sink, %110
  store double %111, ptr %2, align 8, !tbaa !13
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %113 = load double, ptr %112, align 8, !tbaa !13
  %114 = sext i32 %.084 to i64
  %115 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !13
  %117 = fsub double %116, %113
  store double %117, ptr %115, align 8, !tbaa !13
  %118 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %108
  %119 = load double, ptr %118, align 8, !tbaa !13
  %120 = fadd double %113, %119
  store double %120, ptr %118, align 8, !tbaa !13
  %121 = call noundef double @_Z4calcv()
  %122 = load i32, ptr @s, align 4, !tbaa !9
  %123 = sitofp i32 %122 to double
  %124 = fsub double %121, %123
  %125 = call noundef i32 @_Z3sgnd(double noundef %124)
  %126 = icmp slt i32 %125, 0
  br i1 %126, label %127, label %137

127:                                              ; preds = %97
  %128 = load double, ptr %1, align 8, !tbaa !13
  %129 = fsub double %128, %113
  %130 = call noundef i32 @_Z3sgnd(double noundef %129)
  %.not100 = icmp eq i32 %130, 0
  %131 = zext i1 %.not100 to i32
  %132 = add nsw i32 %.084, %131
  %133 = load double, ptr %2, align 8, !tbaa !13
  %134 = fsub double %133, %113
  %135 = call noundef i32 @_Z3sgnd(double noundef %134)
  %.not101 = icmp eq i32 %135, 0
  %.neg102 = sext i1 %.not101 to i32
  %136 = add nsw i32 %.082, %.neg102
  br label %165, !llvm.loop !25

137:                                              ; preds = %97
  %138 = load double, ptr %115, align 8, !tbaa !13
  %139 = fadd double %113, %138
  store double %139, ptr %115, align 8, !tbaa !13
  %140 = load double, ptr %118, align 8, !tbaa !13
  %141 = fsub double %140, %113
  store double %141, ptr %118, align 8, !tbaa !13
  br label %147

142:                                              ; preds = %147
  %143 = load double, ptr %115, align 8, !tbaa !13
  %144 = fsub double %143, %.077.
  store double %144, ptr %115, align 8, !tbaa !13
  %145 = load double, ptr %118, align 8, !tbaa !13
  %146 = fadd double %.077., %145
  store double %146, ptr %118, align 8, !tbaa !13
  br label %165

147:                                              ; preds = %137, %147
  %.076125 = phi i32 [ 0, %137 ], [ %164, %147 ]
  %.077124 = phi double [ %113, %137 ], [ %.077., %147 ]
  %.079123 = phi double [ 0.000000e+00, %137 ], [ %..079, %147 ]
  %148 = fsub double %.077124, %.079123
  %149 = call double @llvm.fmuladd.f64(double %148, double 5.000000e-01, double %.079123)
  %150 = load double, ptr %115, align 8, !tbaa !13
  %151 = fsub double %150, %149
  store double %151, ptr %115, align 8, !tbaa !13
  %152 = load double, ptr %118, align 8, !tbaa !13
  %153 = fadd double %149, %152
  store double %153, ptr %118, align 8, !tbaa !13
  %154 = call noundef double @_Z4calcv()
  %155 = load i32, ptr @s, align 4, !tbaa !9
  %156 = sitofp i32 %155 to double
  %157 = fsub double %154, %156
  %158 = call noundef i32 @_Z3sgnd(double noundef %157)
  %159 = icmp slt i32 %158, 0
  %..079 = select i1 %159, double %149, double %.079123
  %.077. = select i1 %159, double %.077124, double %149
  %160 = load double, ptr %115, align 8, !tbaa !13
  %161 = fadd double %149, %160
  store double %161, ptr %115, align 8, !tbaa !13
  %162 = load double, ptr %118, align 8, !tbaa !13
  %163 = fsub double %162, %149
  store double %163, ptr %118, align 8, !tbaa !13
  %164 = add nuw nsw i32 %.076125, 1
  %exitcond152.not = icmp eq i32 %164, 40
  br i1 %exitcond152.not, label %142, label %147, !llvm.loop !26

165:                                              ; preds = %142, %127
  %.185 = phi i32 [ %132, %127 ], [ %.084, %142 ]
  %.183 = phi i32 [ %136, %127 ], [ %.082, %142 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  br i1 %126, label %95, label %166

166:                                              ; preds = %165, %95
  %167 = call noundef double @_Z4calcv()
  %168 = load i32, ptr @s, align 4, !tbaa !9
  %169 = sitofp i32 %168 to double
  %170 = fsub double %167, %169
  %171 = call noundef i32 @_Z3sgnd(double noundef %170)
  %172 = icmp eq i32 %171, 0
  br i1 %172, label %176, label %.thread106

.thread106:                                       ; preds = %63, %35, %._crit_edge122, %166
  %173 = load i32, ptr @n, align 4, !tbaa !9
  %174 = add nsw i32 %173, 2
  store i32 %174, ptr @n, align 4, !tbaa !9
  %175 = icmp slt i32 %173, 18
  br i1 %175, label %26, label %.thread110, !llvm.loop !27

176:                                              ; preds = %166
  %.pr = load i32, ptr @n, align 4, !tbaa !9
  %177 = icmp slt i32 %.pr, 20
  br i1 %177, label %178, label %.thread110

178:                                              ; preds = %176
  %179 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.pr)
  %180 = load i32, ptr @n, align 4, !tbaa !9
  %181 = icmp sgt i32 %180, 0
  br i1 %181, label %.lr.ph129, label %._crit_edge130

._crit_edge130:                                   ; preds = %.lr.ph129, %178
  %182 = call i32 @putchar(i32 noundef 10)
  br label %.backedge

.lr.ph129:                                        ; preds = %178, %.lr.ph129
  %indvars.iv153 = phi i64 [ %indvars.iv.next154, %.lr.ph129 ], [ 0, %178 ]
  %183 = getelementptr inbounds [19 x double], ptr @a, i64 0, i64 %indvars.iv153
  %184 = load double, ptr %183, align 8, !tbaa !13
  %185 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %184)
  %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
  %186 = load i32, ptr @n, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = icmp slt i64 %indvars.iv.next154, %187
  br i1 %188, label %.lr.ph129, label %._crit_edge130, !llvm.loop !28

.thread110:                                       ; preds = %.thread106, %176
  %189 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.8)
  br label %.backedge

._crit_edge134:                                   ; preds = %.backedge, %0
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { "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 = { 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 #6 = { inlinehint 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 #7 = { inlinehint mustprogress nofree 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 #8 = { 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 = distinct !{!15, !12, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !12, !16, !17}
!19 = distinct !{!19, !12, !17, !16}
!20 = distinct !{!20, !12, !17, !16}
!21 = distinct !{!21, !12, !16, !17}
!22 = distinct !{!22, !12, !16, !17}
!23 = distinct !{!23, !12, !17, !16}
!24 = distinct !{!24, !12, !17, !16}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}


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