; LLVM IR from tangjz/acm-icpc :: lydsy (4073)

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

%struct.CNode = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@cur = external dso_local global i32, align 4
@pre = external dso_local global i32, align 4
@f = external dso_local global [2 x [10001 x i64]], align 16
@a = external dso_local global [251 x %struct.CNode], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solveiiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #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 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() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [2 x i8], align 1
  %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 %struct.CNode, align 4
  %13 = alloca i32, align 4
  %14 = alloca x86_fp80, align 16
  %15 = alloca x86_fp80, align 16
  %16 = alloca x86_fp80, align 16
  %17 = alloca x86_fp80, align 16
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca x86_fp80, align 16
  %24 = alloca i32, align 4
  %25 = alloca x86_fp80, align 16
  %26 = alloca x86_fp80, align 16
  %27 = alloca x86_fp80, align 16
  %28 = alloca i32, align 4
  %29 = alloca x86_fp80, align 16
  %30 = alloca x86_fp80, align 16
  store i32 0, ptr %1, align 4
  br label %31

31:                                               ; preds = %339, %0
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %33 = icmp eq i32 %32, 2
  br i1 %33, label %34, label %340

34:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %47, %34
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %50

40:                                               ; preds = %35
  %41 = load i32, ptr @cur, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %42
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [10001 x i64], ptr %43, i64 0, i64 %45
  store i64 -2000000000000000000, ptr %46, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %40
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %2, align 4, !tbaa !5
  br label %35, !llvm.loop !11

50:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %51 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %51, ptr %3, align 4, !tbaa !5
  store i32 0, ptr @n, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %128, %50
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %3, align 4, !tbaa !5
  %55 = icmp ne i32 %53, 0
  br i1 %55, label %56, label %129

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 2, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %57 = getelementptr inbounds [2 x i8], ptr %4, i64 0, i64 0
  %58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %57)
  %59 = getelementptr inbounds [2 x i8], ptr %4, i64 0, i64 0
  %60 = load i8, ptr %59, align 1, !tbaa !13
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 68
  br i1 %62, label %63, label %118

63:                                               ; preds = %56
  %64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %5, ptr noundef %6, ptr noundef %7)
  %65 = load i32, ptr @pre, align 4, !tbaa !5
  %66 = xor i32 %65, 1
  store i32 %66, ptr @pre, align 4, !tbaa !5
  %67 = load i32, ptr @cur, align 4, !tbaa !5
  %68 = xor i32 %67, 1
  store i32 %68, ptr @cur, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %81, %63
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = load i32, ptr @m, align 4, !tbaa !5
  %72 = icmp sle i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %84

74:                                               ; preds = %69
  %75 = load i32, ptr @cur, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %76
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [10001 x i64], ptr %77, i64 0, i64 %79
  store i64 -2000000000000000000, ptr %80, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %74
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %8, align 4, !tbaa !5
  br label %69, !llvm.loop !14

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

85:                                               ; preds = %114, %84
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %89, label %93

89:                                               ; preds = %85
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = load i32, ptr @m, align 4, !tbaa !5
  %92 = icmp sle i32 %90, %91
  br label %93

93:                                               ; preds = %89, %85
  %94 = phi i1 [ false, %85 ], [ %92, %89 ]
  br i1 %94, label %96, label %95

95:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %117

96:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %97 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %97, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %98 = load i32, ptr @m, align 4, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = sub nsw i32 %98, %99
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = sdiv i32 %100, %101
  %103 = load i32, ptr %5, align 4, !tbaa !5
  %104 = mul nsw i32 %102, %103
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = add nsw i32 %104, %105
  store i32 %106, ptr %11, align 4, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = load i32, ptr %11, align 4, !tbaa !5
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = load i32, ptr %11, align 4, !tbaa !5
  %111 = load i32, ptr %5, align 4, !tbaa !5
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z5solveiiiiiii(i32 noundef %107, i32 noundef %108, i32 noundef %109, i32 noundef %110, i32 noundef %111, i32 noundef %112, i32 noundef %113)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %114

114:                                              ; preds = %96
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %9, align 4, !tbaa !5
  br label %85, !llvm.loop !15

117:                                              ; preds = %95
  br label %128

118:                                              ; preds = %56
  %119 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %120 = getelementptr inbounds %struct.CNode, ptr %12, i32 0, i32 0
  %121 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %121, ptr %120, align 4, !tbaa !16
  %122 = getelementptr inbounds %struct.CNode, ptr %12, i32 0, i32 1
  %123 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %123, ptr %122, align 4, !tbaa !18
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr @n, align 4, !tbaa !5
  %126 = sext i32 %124 to i64
  %127 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %126
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %127, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %128

128:                                              ; preds = %118, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %4) #7
  br label %52, !llvm.loop !20

129:                                              ; preds = %52
  %130 = load i32, ptr @n, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds %struct.CNode, ptr @a, i64 %131
  call void @_ZSt4sortIP5CNodeEvT_S2_(ptr noundef @a, ptr noundef %132)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  store x86_fp80 0xK00000000000000000000, ptr %14, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  store x86_fp80 0xK00000000000000000000, ptr %15, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  store x86_fp80 0xK00000000000000000000, ptr %16, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  %133 = load i32, ptr @cur, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %134
  %136 = load i32, ptr @m, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [10001 x i64], ptr %135, i64 0, i64 %137
  %139 = load i64, ptr %138, align 8, !tbaa !9
  %140 = sitofp i64 %139 to x86_fp80
  store x86_fp80 %140, ptr %17, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %326, %129
  %142 = load i32, ptr %18, align 4, !tbaa !5
  %143 = load i32, ptr @n, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %141
  store i32 15, ptr %20, align 4
  br label %328

146:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %147 = load i32, ptr %18, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %148
  %150 = getelementptr inbounds %struct.CNode, ptr %149, i32 0, i32 0
  %151 = load i32, ptr %150, align 8, !tbaa !16
  store i32 %151, ptr %21, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %191, %146
  %153 = load i32, ptr %19, align 4, !tbaa !5
  %154 = load i32, ptr @n, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %156, label %164

156:                                              ; preds = %152
  %157 = load i32, ptr %19, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %158
  %160 = getelementptr inbounds %struct.CNode, ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 8, !tbaa !16
  %162 = load i32, ptr %21, align 4, !tbaa !5
  %163 = icmp eq i32 %161, %162
  br label %164

164:                                              ; preds = %156, %152
  %165 = phi i1 [ false, %152 ], [ %163, %156 ]
  br i1 %165, label %166, label %194

166:                                              ; preds = %164
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %190, label %169

169:                                              ; preds = %166
  %170 = load i32, ptr %19, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.CNode, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 4, !tbaa !18
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %187

176:                                              ; preds = %169
  %177 = load i32, ptr %19, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %178
  %180 = getelementptr inbounds %struct.CNode, ptr %179, i32 0, i32 1
  %181 = load i32, ptr %180, align 4, !tbaa !18
  %182 = sitofp i32 %181 to double
  %183 = fdiv double 1.000000e+00, %182
  %184 = fpext double %183 to x86_fp80
  %185 = load x86_fp80, ptr %14, align 16, !tbaa !21
  %186 = fadd x86_fp80 %185, %184
  store x86_fp80 %186, ptr %14, align 16, !tbaa !21
  br label %188

187:                                              ; preds = %169
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %187, %176
  %189 = phi x86_fp80 [ %186, %176 ], [ 0xK3FFF8000000000000000, %187 ]
  br label %190

190:                                              ; preds = %188, %166
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %19, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %19, align 4, !tbaa !5
  br label %152, !llvm.loop !23

194:                                              ; preds = %164
  %195 = load i32, ptr %13, align 4, !tbaa !5
  %196 = icmp ne i32 %195, 0
  br i1 %196, label %197, label %240

197:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %236, %197
  %199 = load i32, ptr %22, align 4, !tbaa !5
  %200 = load i32, ptr @m, align 4, !tbaa !5
  %201 = icmp sle i32 %199, %200
  br i1 %201, label %203, label %202

202:                                              ; preds = %198
  store i32 21, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %239

203:                                              ; preds = %198
  %204 = load i32, ptr %22, align 4, !tbaa !5
  %205 = sitofp i32 %204 to x86_fp80
  %206 = load x86_fp80, ptr %15, align 16, !tbaa !21
  %207 = call noundef i32 @_Z4dcmpee(x86_fp80 noundef %205, x86_fp80 noundef %206)
  %208 = icmp sge i32 %207, 0
  br i1 %208, label %209, label %235

209:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  %210 = load i32, ptr @cur, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %211
  %213 = load i32, ptr @m, align 4, !tbaa !5
  %214 = load i32, ptr %22, align 4, !tbaa !5
  %215 = sub nsw i32 %213, %214
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [10001 x i64], ptr %212, i64 0, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !9
  %219 = sitofp i64 %218 to x86_fp80
  %220 = load x86_fp80, ptr %16, align 16, !tbaa !21
  %221 = fadd x86_fp80 %219, %220
  %222 = load i32, ptr %22, align 4, !tbaa !5
  %223 = sitofp i32 %222 to x86_fp80
  %224 = load x86_fp80, ptr %15, align 16, !tbaa !21
  %225 = fsub x86_fp80 %223, %224
  %226 = load i32, ptr %21, align 4, !tbaa !5
  %227 = sitofp i32 %226 to x86_fp80
  %228 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %225, x86_fp80 %227, x86_fp80 %221)
  store x86_fp80 %228, ptr %23, align 16, !tbaa !21
  %229 = load x86_fp80, ptr %17, align 16, !tbaa !21
  %230 = load x86_fp80, ptr %23, align 16, !tbaa !21
  %231 = fcmp olt x86_fp80 %229, %230
  br i1 %231, label %232, label %234

232:                                              ; preds = %209
  %233 = load x86_fp80, ptr %23, align 16, !tbaa !21
  store x86_fp80 %233, ptr %17, align 16, !tbaa !21
  br label %234

234:                                              ; preds = %232, %209
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  br label %235

235:                                              ; preds = %234, %203
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %22, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %22, align 4, !tbaa !5
  br label %198, !llvm.loop !24

239:                                              ; preds = %202
  store i32 15, ptr %20, align 4
  br label %323

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

241:                                              ; preds = %289, %240
  %242 = load i32, ptr %24, align 4, !tbaa !5
  %243 = load i32, ptr @m, align 4, !tbaa !5
  %244 = icmp sle i32 %242, %243
  br i1 %244, label %246, label %245

245:                                              ; preds = %241
  store i32 24, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %292

246:                                              ; preds = %241
  %247 = load i32, ptr %24, align 4, !tbaa !5
  %248 = sitofp i32 %247 to x86_fp80
  %249 = load x86_fp80, ptr %15, align 16, !tbaa !21
  %250 = call noundef i32 @_Z4dcmpee(x86_fp80 noundef %248, x86_fp80 noundef %249)
  %251 = icmp sge i32 %250, 0
  br i1 %251, label %252, label %288

252:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  %253 = load i32, ptr %24, align 4, !tbaa !5
  %254 = sitofp i32 %253 to x86_fp80
  %255 = load x86_fp80, ptr %15, align 16, !tbaa !21
  %256 = fsub x86_fp80 %254, %255
  store x86_fp80 %256, ptr %25, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %257 = load i32, ptr %21, align 4, !tbaa !5
  %258 = sitofp i32 %257 to x86_fp80
  %259 = load x86_fp80, ptr %25, align 16, !tbaa !21
  %260 = load x86_fp80, ptr %14, align 16, !tbaa !21
  %261 = fdiv x86_fp80 %259, %260
  %262 = fsub x86_fp80 %258, %261
  store x86_fp80 %262, ptr %26, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #7
  %263 = load i32, ptr @cur, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %264
  %266 = load i32, ptr @m, align 4, !tbaa !5
  %267 = load i32, ptr %24, align 4, !tbaa !5
  %268 = sub nsw i32 %266, %267
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [10001 x i64], ptr %265, i64 0, i64 %269
  %271 = load i64, ptr %270, align 8, !tbaa !9
  %272 = sitofp i64 %271 to x86_fp80
  %273 = load x86_fp80, ptr %16, align 16, !tbaa !21
  %274 = fadd x86_fp80 %272, %273
  %275 = load i32, ptr %21, align 4, !tbaa !5
  %276 = sitofp i32 %275 to x86_fp80
  %277 = load x86_fp80, ptr %26, align 16, !tbaa !21
  %278 = fadd x86_fp80 %276, %277
  %279 = fmul x86_fp80 %278, 0xK3FFE8000000000000000
  %280 = load x86_fp80, ptr %25, align 16, !tbaa !21
  %281 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %279, x86_fp80 %280, x86_fp80 %274)
  store x86_fp80 %281, ptr %27, align 16, !tbaa !21
  %282 = load x86_fp80, ptr %17, align 16, !tbaa !21
  %283 = load x86_fp80, ptr %27, align 16, !tbaa !21
  %284 = fcmp olt x86_fp80 %282, %283
  br i1 %284, label %285, label %287

285:                                              ; preds = %252
  %286 = load x86_fp80, ptr %27, align 16, !tbaa !21
  store x86_fp80 %286, ptr %17, align 16, !tbaa !21
  br label %287

287:                                              ; preds = %285, %252
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  br label %288

288:                                              ; preds = %287, %246
  br label %289

289:                                              ; preds = %288
  %290 = load i32, ptr %24, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %24, align 4, !tbaa !5
  br label %241, !llvm.loop !25

292:                                              ; preds = %245
  %293 = load i32, ptr %19, align 4, !tbaa !5
  %294 = load i32, ptr @n, align 4, !tbaa !5
  %295 = icmp eq i32 %293, %294
  br i1 %295, label %296, label %297

296:                                              ; preds = %292
  store i32 17, ptr %20, align 4
  br label %323

297:                                              ; preds = %292
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %298 = load i32, ptr %19, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %299
  %301 = getelementptr inbounds %struct.CNode, ptr %300, i32 0, i32 0
  %302 = load i32, ptr %301, align 8, !tbaa !16
  store i32 %302, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #7
  %303 = load i32, ptr %21, align 4, !tbaa !5
  %304 = load i32, ptr %28, align 4, !tbaa !5
  %305 = sub nsw i32 %303, %304
  %306 = sitofp i32 %305 to x86_fp80
  %307 = load x86_fp80, ptr %14, align 16, !tbaa !21
  %308 = fmul x86_fp80 %306, %307
  store x86_fp80 %308, ptr %29, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #7
  %309 = load x86_fp80, ptr %15, align 16, !tbaa !21
  %310 = load x86_fp80, ptr %29, align 16, !tbaa !21
  %311 = fadd x86_fp80 %309, %310
  store x86_fp80 %311, ptr %30, align 16, !tbaa !21
  %312 = load i32, ptr %21, align 4, !tbaa !5
  %313 = load i32, ptr %28, align 4, !tbaa !5
  %314 = add nsw i32 %312, %313
  %315 = sitofp i32 %314 to double
  %316 = fmul double %315, 5.000000e-01
  %317 = fpext double %316 to x86_fp80
  %318 = load x86_fp80, ptr %29, align 16, !tbaa !21
  %319 = load x86_fp80, ptr %16, align 16, !tbaa !21
  %320 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %317, x86_fp80 %318, x86_fp80 %319)
  store x86_fp80 %320, ptr %16, align 16, !tbaa !21
  %321 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %321, ptr %21, align 4, !tbaa !5
  %322 = load x86_fp80, ptr %30, align 16, !tbaa !21
  store x86_fp80 %322, ptr %15, align 16, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  store i32 0, ptr %20, align 4
  br label %323

323:                                              ; preds = %297, %296, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  %324 = load i32, ptr %20, align 4
  switch i32 %324, label %328 [
    i32 0, label %325
    i32 17, label %326
  ]

325:                                              ; preds = %323
  br label %326

326:                                              ; preds = %325, %323
  %327 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %327, ptr %18, align 4, !tbaa !5
  br label %141, !llvm.loop !26

328:                                              ; preds = %323, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %329

329:                                              ; preds = %328
  %330 = load x86_fp80, ptr %17, align 16, !tbaa !21
  %331 = call noundef i32 @_Z4dcmpee(x86_fp80 noundef %330, x86_fp80 noundef 0xKC03BDE0B6B3A76400000)
  %332 = icmp sgt i32 %331, 0
  br i1 %332, label %333, label %337

333:                                              ; preds = %329
  %334 = load x86_fp80, ptr %17, align 16, !tbaa !21
  %335 = fptrunc x86_fp80 %334 to double
  %336 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %335)
  br label %339

337:                                              ; preds = %329
  %338 = call i32 @puts(ptr noundef @.str.4)
  br label %339

339:                                              ; preds = %337, %333
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %31, !llvm.loop !27

340:                                              ; preds = %31
  ret i32 0
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5CNodeEvT_S2_(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z4dcmpee(x86_fp80 noundef, x86_fp80 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #6

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

declare i32 @puts(ptr noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS5CNode", !6, i64 0, !6, i64 4}
!18 = !{!17, !6, i64 4}
!19 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!20 = distinct !{!20, !12}
!21 = !{!22, !22, i64 0}
!22 = !{!"long double", !7, i64 0}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !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"

%struct.CNode = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@cur = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [2 x [10001 x i64]], align 16
@a = external dso_local global [251 x %struct.CNode], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solveiiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) 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 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 #2 {
  %1 = alloca [2 x i8], align 1
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %6 = icmp eq i32 %5, 2
  br i1 %6, label %.preheader123, label %._crit_edge161

.preheader123:                                    ; preds = %0, %163
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %.not127 = icmp slt i32 %7, 1
  br i1 %.not127, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader123
  %8 = load i32, ptr @cur, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = add nuw i32 %7, 1
  %wide.trip.count = zext i32 %10 to i64
  %11 = zext nneg i32 %7 to i64
  %min.iters.check203 = icmp ult i32 %7, 4
  br i1 %min.iters.check203, label %scalar.ph202.preheader, label %vector.ph204

scalar.ph202.preheader:                           ; preds = %middle.block201, %.lr.ph
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph ], [ %ind.end207, %middle.block201 ]
  br label %scalar.ph202

vector.ph204:                                     ; preds = %.lr.ph
  %n.vec206 = and i64 %11, 2147483644
  %ind.end207 = or disjoint i64 %n.vec206, 1
  br label %vector.body209

vector.body209:                                   ; preds = %vector.body209, %vector.ph204
  %index210 = phi i64 [ 0, %vector.ph204 ], [ %index.next212, %vector.body209 ]
  %offset.idx211 = or disjoint i64 %index210, 1
  %12 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %9, i64 %offset.idx211
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  store <2 x i64> <i64 -2000000000000000000, i64 -2000000000000000000>, ptr %12, align 8, !tbaa !9
  store <2 x i64> <i64 -2000000000000000000, i64 -2000000000000000000>, ptr %13, align 8, !tbaa !9
  %index.next212 = add nuw i64 %index210, 4
  %14 = icmp eq i64 %index.next212, %n.vec206
  br i1 %14, label %middle.block201, label %vector.body209, !llvm.loop !11

middle.block201:                                  ; preds = %vector.body209
  %cmp.n213 = icmp eq i64 %n.vec206, %11
  br i1 %cmp.n213, label %._crit_edge, label %scalar.ph202.preheader

._crit_edge:                                      ; preds = %scalar.ph202, %middle.block201, %.preheader123
  %15 = load i32, ptr @n, align 4, !tbaa !5
  store i32 0, ptr @n, align 4, !tbaa !5
  %.not105135 = icmp eq i32 %15, 0
  br i1 %.not105135, label %._crit_edge138, label %.lr.ph137

scalar.ph202:                                     ; preds = %scalar.ph202.preheader, %scalar.ph202
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph202 ], [ %indvars.iv.ph, %scalar.ph202.preheader ]
  %16 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %9, i64 %indvars.iv
  store i64 -2000000000000000000, ptr %16, align 8, !tbaa !9
  %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 %._crit_edge, label %scalar.ph202, !llvm.loop !15

.lr.ph137:                                        ; preds = %._crit_edge, %.loopexit
  %.in = phi i32 [ %17, %.loopexit ], [ %15, %._crit_edge ]
  %17 = add nsw i32 %.in, -1
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %19 = load i8, ptr %1, align 1, !tbaa !16
  %20 = icmp eq i8 %19, 68
  br i1 %20, label %21, label %53

21:                                               ; preds = %.lr.ph137
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %23 = load i32, ptr @pre, align 4, !tbaa !5
  %24 = xor i32 %23, 1
  store i32 %24, ptr @pre, align 4, !tbaa !5
  %25 = load i32, ptr @cur, align 4, !tbaa !5
  %26 = xor i32 %25, 1
  store i32 %26, ptr @cur, align 4, !tbaa !5
  %27 = load i32, ptr @m, align 4
  %.not111129 = icmp slt i32 %27, 1
  br i1 %.not111129, label %.preheader119, label %.lr.ph132

.lr.ph132:                                        ; preds = %21
  %28 = sext i32 %26 to i64
  %29 = add nuw i32 %27, 1
  %wide.trip.count172 = zext i32 %29 to i64
  %30 = zext nneg i32 %27 to i64
  %min.iters.check = icmp ult i32 %27, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph132
  %indvars.iv169.ph = phi i64 [ 1, %.lr.ph132 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph132
  %n.vec = and i64 %30, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %31 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %28, i64 %offset.idx
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  store <2 x i64> <i64 -2000000000000000000, i64 -2000000000000000000>, ptr %31, align 8, !tbaa !9
  store <2 x i64> <i64 -2000000000000000000, i64 -2000000000000000000>, ptr %32, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %33 = icmp eq i64 %index.next, %n.vec
  br i1 %33, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %30
  br i1 %cmp.n, label %.preheader119, label %scalar.ph.preheader

.preheader119:                                    ; preds = %scalar.ph, %middle.block, %21
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  %36 = icmp sgt i32 %27, -1
  %37 = and i1 %35, %36
  br i1 %37, label %.lr.ph134, label %.loopexit

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv169 = phi i64 [ %indvars.iv.next170, %scalar.ph ], [ %indvars.iv169.ph, %scalar.ph.preheader ]
  %38 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %28, i64 %indvars.iv169
  store i64 -2000000000000000000, ptr %38, align 8, !tbaa !9
  %indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1
  %exitcond173.not = icmp eq i64 %indvars.iv.next170, %wide.trip.count172
  br i1 %exitcond173.not, label %.preheader119, label %scalar.ph, !llvm.loop !18

.lr.ph134:                                        ; preds = %.preheader119, %.lr.ph134
  %39 = phi i32 [ %50, %.lr.ph134 ], [ %27, %.preheader119 ]
  %40 = phi i32 [ %48, %.lr.ph134 ], [ %34, %.preheader119 ]
  %.082133 = phi i32 [ %47, %.lr.ph134 ], [ 0, %.preheader119 ]
  %.fr162 = freeze i32 %39
  %41 = sub i32 %.fr162, %.082133
  %42 = srem i32 %41, %40
  %43 = sub nsw i32 %41, %42
  %44 = add nsw i32 %43, %.082133
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z5solveiiiiiii(i32 noundef %.082133, i32 noundef %44, i32 noundef %.082133, i32 noundef %44, i32 noundef %40, i32 noundef %45, i32 noundef %46)
  %47 = add nuw nsw i32 %.082133, 1
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  %50 = load i32, ptr @m, align 4
  %51 = icmp slt i32 %.082133, %50
  %52 = select i1 %49, i1 %51, i1 false
  br i1 %52, label %.lr.ph134, label %.loopexit, !llvm.loop !19

53:                                               ; preds = %.lr.ph137
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @n, align 4, !tbaa !5
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %59
  store i32 %55, ptr %60, align 8, !tbaa !5
  %.sroa.462.0..sroa_idx = getelementptr inbounds i8, ptr %60, i64 4
  store i32 %56, ptr %.sroa.462.0..sroa_idx, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph134, %.preheader119, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %1) #7
  %.not105 = icmp eq i32 %17, 0
  br i1 %.not105, label %._crit_edge138.loopexit, label %.lr.ph137, !llvm.loop !20

._crit_edge138.loopexit:                          ; preds = %.loopexit
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge138

._crit_edge138:                                   ; preds = %._crit_edge138.loopexit, %._crit_edge
  %61 = phi i32 [ %.pre, %._crit_edge138.loopexit ], [ 0, %._crit_edge ]
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds %struct.CNode, ptr @a, i64 %62
  call void @_ZSt4sortIP5CNodeEvT_S2_(ptr noundef nonnull @a, ptr noundef nonnull %63)
  %64 = load i32, ptr @cur, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = load i32, ptr @m, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %65, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !9
  %70 = sitofp i64 %69 to x86_fp80
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.lr.ph154, label %.loopexit121

.lr.ph154:                                        ; preds = %._crit_edge138, %154
  %73 = phi i32 [ %116, %154 ], [ %71, %._crit_edge138 ]
  %74 = phi i32 [ %117, %154 ], [ %66, %._crit_edge138 ]
  %.084151 = phi x86_fp80 [ %.185.lcssa, %154 ], [ 0xK00000000000000000000, %._crit_edge138 ]
  %.087150 = phi x86_fp80 [ %.188.ph, %154 ], [ 0xK00000000000000000000, %._crit_edge138 ]
  %.089149 = phi x86_fp80 [ %.190.ph, %154 ], [ 0xK00000000000000000000, %._crit_edge138 ]
  %.091148 = phi x86_fp80 [ %.4.lcssa, %154 ], [ %70, %._crit_edge138 ]
  %.094147 = phi i32 [ %.196.lcssa, %154 ], [ 0, %._crit_edge138 ]
  %75 = sext i32 %.094147 to i64
  %76 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %75
  %77 = load i32, ptr %76, align 8, !tbaa !21
  %78 = sext i32 %73 to i64
  %79 = add nsw i32 %.094147, 1
  %smax = call i32 @llvm.smax.i32(i32 %73, i32 %79)
  br label %80

80:                                               ; preds = %.lr.ph154, %93
  %indvars.iv174 = phi i64 [ %75, %.lr.ph154 ], [ %indvars.iv.next175, %93 ]
  %.1141 = phi i32 [ 0, %.lr.ph154 ], [ %.2, %93 ]
  %.185140 = phi x86_fp80 [ %.084151, %.lr.ph154 ], [ %.286, %93 ]
  %81 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %indvars.iv174
  %82 = load i32, ptr %81, align 8, !tbaa !21
  %83 = icmp eq i32 %82, %77
  br i1 %83, label %84, label %.critedge.split.loop.exit187

84:                                               ; preds = %80
  %.not109 = icmp eq i32 %.1141, 0
  br i1 %.not109, label %85, label %93

85:                                               ; preds = %84
  %86 = getelementptr inbounds i8, ptr %81, i64 4
  %87 = load i32, ptr %86, align 4, !tbaa !23
  %.not110 = icmp eq i32 %87, 0
  br i1 %.not110, label %93, label %88

88:                                               ; preds = %85
  %89 = sitofp i32 %87 to double
  %90 = fdiv double 1.000000e+00, %89
  %91 = fpext double %90 to x86_fp80
  %92 = fadd x86_fp80 %.185140, %91
  br label %93

93:                                               ; preds = %85, %84, %88
  %.286 = phi x86_fp80 [ %.185140, %84 ], [ %92, %88 ], [ %.185140, %85 ]
  %.2 = phi i32 [ 1, %84 ], [ 0, %88 ], [ 1, %85 ]
  %indvars.iv.next175 = add nsw i64 %indvars.iv174, 1
  %94 = icmp slt i64 %indvars.iv.next175, %78
  br i1 %94, label %80, label %.critedge, !llvm.loop !24

.critedge.split.loop.exit187:                     ; preds = %80
  %95 = trunc nsw i64 %indvars.iv174 to i32
  br label %.critedge

.critedge:                                        ; preds = %93, %.critedge.split.loop.exit187
  %.196.lcssa = phi i32 [ %95, %.critedge.split.loop.exit187 ], [ %smax, %93 ]
  %.185.lcssa = phi x86_fp80 [ %.185140, %.critedge.split.loop.exit187 ], [ %.286, %93 ]
  %.1.lcssa = phi i32 [ %.1141, %.critedge.split.loop.exit187 ], [ %.2, %93 ]
  %.not106 = icmp eq i32 %.1.lcssa, 0
  %.not107142 = icmp slt i32 %74, 0
  br i1 %.not106, label %.preheader, label %.preheader120

.preheader120:                                    ; preds = %.critedge
  br i1 %.not107142, label %.loopexit121, label %.lr.ph159

.lr.ph159:                                        ; preds = %.preheader120
  %96 = sitofp i32 %77 to x86_fp80
  br label %98

.preheader:                                       ; preds = %.critedge
  br i1 %.not107142, label %._crit_edge146, label %.lr.ph145

.lr.ph145:                                        ; preds = %.preheader
  %97 = sitofp i32 %77 to x86_fp80
  br label %119

98:                                               ; preds = %.lr.ph159, %114
  %.192158 = phi x86_fp80 [ %.091148, %.lr.ph159 ], [ %.3, %114 ]
  %.099157 = phi i32 [ 0, %.lr.ph159 ], [ %115, %114 ]
  %99 = uitofp nneg i32 %.099157 to x86_fp80
  %100 = call noundef i32 @_Z4dcmpee(x86_fp80 noundef %99, x86_fp80 noundef %.087150)
  %101 = icmp sgt i32 %100, -1
  %.pre177 = load i32, ptr @m, align 4, !tbaa !5
  br i1 %101, label %102, label %114

102:                                              ; preds = %98
  %103 = load i32, ptr @cur, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = sub nsw i32 %.pre177, %.099157
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %104, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = sitofp i64 %108 to x86_fp80
  %110 = fadd x86_fp80 %.089149, %109
  %111 = fsub x86_fp80 %99, %.087150
  %112 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %111, x86_fp80 %96, x86_fp80 %110)
  %113 = fcmp olt x86_fp80 %.192158, %112
  %.293 = select i1 %113, x86_fp80 %112, x86_fp80 %.192158
  br label %114

114:                                              ; preds = %98, %102
  %.3 = phi x86_fp80 [ %.293, %102 ], [ %.192158, %98 ]
  %115 = add nuw nsw i32 %.099157, 1
  %.not108.not = icmp slt i32 %.099157, %.pre177
  br i1 %.not108.not, label %98, label %.loopexit121, !llvm.loop !25

._crit_edge146.loopexit:                          ; preds = %139
  %.pre179 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge146

._crit_edge146:                                   ; preds = %._crit_edge146.loopexit, %.preheader
  %116 = phi i32 [ %73, %.preheader ], [ %.pre179, %._crit_edge146.loopexit ]
  %117 = phi i32 [ %74, %.preheader ], [ %.pre178, %._crit_edge146.loopexit ]
  %.4.lcssa = phi x86_fp80 [ %.091148, %.preheader ], [ %.6, %._crit_edge146.loopexit ]
  %118 = icmp eq i32 %.196.lcssa, %116
  br i1 %118, label %154, label %141

119:                                              ; preds = %.lr.ph145, %139
  %.4144 = phi x86_fp80 [ %.091148, %.lr.ph145 ], [ %.6, %139 ]
  %.097143 = phi i32 [ 0, %.lr.ph145 ], [ %140, %139 ]
  %120 = uitofp nneg i32 %.097143 to x86_fp80
  %121 = call noundef i32 @_Z4dcmpee(x86_fp80 noundef %120, x86_fp80 noundef %.087150)
  %122 = icmp sgt i32 %121, -1
  %.pre178 = load i32, ptr @m, align 4, !tbaa !5
  br i1 %122, label %123, label %139

123:                                              ; preds = %119
  %124 = fsub x86_fp80 %120, %.087150
  %125 = fdiv x86_fp80 %124, %.185.lcssa
  %126 = fsub x86_fp80 %97, %125
  %127 = load i32, ptr @cur, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = sub nsw i32 %.pre178, %.097143
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [2 x [10001 x i64]], ptr @f, i64 0, i64 %128, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !9
  %133 = sitofp i64 %132 to x86_fp80
  %134 = fadd x86_fp80 %.089149, %133
  %135 = fadd x86_fp80 %126, %97
  %136 = fmul x86_fp80 %135, 0xK3FFE8000000000000000
  %137 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %136, x86_fp80 %124, x86_fp80 %134)
  %138 = fcmp olt x86_fp80 %.4144, %137
  %.5 = select i1 %138, x86_fp80 %137, x86_fp80 %.4144
  br label %139

139:                                              ; preds = %119, %123
  %.6 = phi x86_fp80 [ %.5, %123 ], [ %.4144, %119 ]
  %140 = add nuw nsw i32 %.097143, 1
  %.not107.not = icmp slt i32 %.097143, %.pre178
  br i1 %.not107.not, label %119, label %._crit_edge146.loopexit, !llvm.loop !26

141:                                              ; preds = %._crit_edge146
  %142 = sext i32 %.196.lcssa to i64
  %143 = getelementptr inbounds [251 x %struct.CNode], ptr @a, i64 0, i64 %142
  %144 = load i32, ptr %143, align 8, !tbaa !21
  %145 = sub nsw i32 %77, %144
  %146 = sitofp i32 %145 to x86_fp80
  %147 = fmul x86_fp80 %.185.lcssa, %146
  %148 = fadd x86_fp80 %.087150, %147
  %149 = add nsw i32 %144, %77
  %150 = sitofp i32 %149 to double
  %151 = fmul double %150, 5.000000e-01
  %152 = fpext double %151 to x86_fp80
  %153 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %152, x86_fp80 %147, x86_fp80 %.089149)
  br label %154

154:                                              ; preds = %141, %._crit_edge146
  %.190.ph = phi x86_fp80 [ %.089149, %._crit_edge146 ], [ %153, %141 ]
  %.188.ph = phi x86_fp80 [ %.087150, %._crit_edge146 ], [ %148, %141 ]
  %155 = icmp slt i32 %.196.lcssa, %116
  br i1 %155, label %.lr.ph154, label %.loopexit121, !llvm.loop !27

.loopexit121:                                     ; preds = %154, %114, %._crit_edge138, %.preheader120
  %.8 = phi x86_fp80 [ %.091148, %.preheader120 ], [ %70, %._crit_edge138 ], [ %.3, %114 ], [ %.4.lcssa, %154 ]
  %156 = call noundef i32 @_Z4dcmpee(x86_fp80 noundef %.8, x86_fp80 noundef 0xKC03BDE0B6B3A76400000)
  %157 = icmp sgt i32 %156, 0
  br i1 %157, label %158, label %161

158:                                              ; preds = %.loopexit121
  %159 = fptrunc x86_fp80 %.8 to double
  %160 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %159)
  br label %163

161:                                              ; preds = %.loopexit121
  %162 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %163

163:                                              ; preds = %161, %158
  %164 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %165 = icmp eq i32 %164, 2
  br i1 %165, label %.preheader123, label %._crit_edge161, !llvm.loop !28

._crit_edge161:                                   ; preds = %163, %0
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5CNodeEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z4dcmpee(x86_fp80 noundef, x86_fp80 noundef) local_unnamed_addr #4

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !12, !13, !14}
!18 = distinct !{!18, !12, !14, !13}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !6, i64 0}
!22 = !{!"_ZTS5CNode", !6, i64 0, !6, i64 4}
!23 = !{!22, !6, i64 4}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}


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