; LLVM IR from tangjz/acm-icpc :: codeforces/complete (853B)

; 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.Node = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@w = external dso_local global [100009 x i32], align 16
@f = external dso_local global [1000009 x i64], align 16
@g = external dso_local global [1000009 x i64], align 16
@a = external dso_local global [100009 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

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

18:                                               ; preds = %33, %0
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %36

23:                                               ; preds = %18
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %25
  call void @_ZN4Node4readEv(ptr noundef nonnull align 4 dereferenceable(16) %26)
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %28
  %30 = getelementptr inbounds %struct.Node, ptr %29, i32 0, i32 0
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %30)
  %32 = load i32, ptr %31, align 4, !tbaa !5
  store i32 %32, ptr %2, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %23
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %3, align 4, !tbaa !5
  br label %18, !llvm.loop !9

36:                                               ; preds = %22
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !5
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.Node, ptr @a, i64 %40
  %42 = getelementptr inbounds %struct.Node, ptr %41, i64 1
  call void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef getelementptr inbounds (%struct.Node, ptr @a, i64 1), ptr noundef %42)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %43 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %43, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !11
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = mul i64 %45, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @w, i64 1), i8 63, i64 %46, i1 false)
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = mul i64 %48, 8
  call void @llvm.memset.p0.i64(ptr align 8 getelementptr inbounds (i64, ptr @f, i64 1), i8 63, i64 %49, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %149, %36
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = load i32, ptr @m, align 4, !tbaa !5
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %55, label %54

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

55:                                               ; preds = %50
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.Node, ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 8, !tbaa !13
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %55
  br label %149

63:                                               ; preds = %55
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.Node, ptr %66, i32 0, i32 3
  %68 = load i32, ptr %67, align 4, !tbaa !15
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %70
  %72 = getelementptr inbounds %struct.Node, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !16
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = icmp slt i32 %68, %76
  br i1 %77, label %78, label %148

78:                                               ; preds = %63
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.Node, ptr %81, i32 0, i32 1
  %83 = load i32, ptr %82, align 4, !tbaa !16
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = icmp eq i32 %86, 1061109567
  br i1 %87, label %88, label %98

88:                                               ; preds = %78
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = add nsw i32 %89, -1
  store i32 %90, ptr %4, align 4, !tbaa !5
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.Node, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 4, !tbaa !16
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %96
  store i32 0, ptr %97, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %88, %78
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.Node, ptr %101, i32 0, i32 3
  %103 = load i32, ptr %102, align 4, !tbaa !15
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.Node, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !16
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sub nsw i32 %103, %111
  %113 = sext i32 %112 to i64
  %114 = load i64, ptr %5, align 8, !tbaa !11
  %115 = add nsw i64 %114, %113
  store i64 %115, ptr %5, align 8, !tbaa !11
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %117
  %119 = getelementptr inbounds %struct.Node, ptr %118, i32 0, i32 3
  %120 = load i32, ptr %119, align 4, !tbaa !15
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %122
  %124 = getelementptr inbounds %struct.Node, ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !16
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %126
  store i32 %120, ptr %127, align 4, !tbaa !5
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %147, label %130

130:                                              ; preds = %98
  %131 = load i32, ptr %6, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %132
  %134 = getelementptr inbounds %struct.Node, ptr %133, i32 0, i32 0
  %135 = load i32, ptr %134, align 16, !tbaa !17
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %136
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %139 = load i64, ptr %138, align 8, !tbaa !11
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %141
  %143 = getelementptr inbounds %struct.Node, ptr %142, i32 0, i32 0
  %144 = load i32, ptr %143, align 16, !tbaa !17
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %145
  store i64 %139, ptr %146, align 8, !tbaa !11
  br label %147

147:                                              ; preds = %130, %98
  br label %148

148:                                              ; preds = %147, %63
  br label %149

149:                                              ; preds = %148, %62
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %6, align 4, !tbaa !5
  br label %50, !llvm.loop !18

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

153:                                              ; preds = %171, %152
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = icmp sle i32 %154, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %174

158:                                              ; preds = %153
  %159 = load i32, ptr %7, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %160
  %162 = load i32, ptr %7, align 4, !tbaa !5
  %163 = sub nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %164
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %161, ptr noundef nonnull align 8 dereferenceable(8) %165)
  %167 = load i64, ptr %166, align 8, !tbaa !11
  %168 = load i32, ptr %7, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %169
  store i64 %167, ptr %170, align 8, !tbaa !11
  br label %171

171:                                              ; preds = %158
  %172 = load i32, ptr %7, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %7, align 4, !tbaa !5
  br label %153, !llvm.loop !19

174:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %175 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %175, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !11
  %176 = load i32, ptr @n, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = mul i64 %177, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @w, i64 1), i8 63, i64 %178, i1 false)
  %179 = load i32, ptr %2, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = mul i64 %180, 8
  call void @llvm.memset.p0.i64(ptr align 8 getelementptr inbounds (i64, ptr @g, i64 1), i8 63, i64 %181, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %182 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %182, ptr %10, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %281, %174
  %184 = load i32, ptr %10, align 4, !tbaa !5
  %185 = icmp sge i32 %184, 1
  br i1 %185, label %187, label %186

186:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %284

187:                                              ; preds = %183
  %188 = load i32, ptr %10, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %189
  %191 = getelementptr inbounds %struct.Node, ptr %190, i32 0, i32 1
  %192 = load i32, ptr %191, align 4, !tbaa !16
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %194, label %195

194:                                              ; preds = %187
  br label %281

195:                                              ; preds = %187
  %196 = load i32, ptr %10, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %197
  %199 = getelementptr inbounds %struct.Node, ptr %198, i32 0, i32 3
  %200 = load i32, ptr %199, align 4, !tbaa !15
  %201 = load i32, ptr %10, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %202
  %204 = getelementptr inbounds %struct.Node, ptr %203, i32 0, i32 2
  %205 = load i32, ptr %204, align 8, !tbaa !13
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = icmp slt i32 %200, %208
  br i1 %209, label %210, label %280

210:                                              ; preds = %195
  %211 = load i32, ptr %10, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %212
  %214 = getelementptr inbounds %struct.Node, ptr %213, i32 0, i32 2
  %215 = load i32, ptr %214, align 8, !tbaa !13
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = icmp eq i32 %218, 1061109567
  br i1 %219, label %220, label %230

220:                                              ; preds = %210
  %221 = load i32, ptr %8, align 4, !tbaa !5
  %222 = add nsw i32 %221, -1
  store i32 %222, ptr %8, align 4, !tbaa !5
  %223 = load i32, ptr %10, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %224
  %226 = getelementptr inbounds %struct.Node, ptr %225, i32 0, i32 2
  %227 = load i32, ptr %226, align 8, !tbaa !13
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %228
  store i32 0, ptr %229, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %220, %210
  %231 = load i32, ptr %10, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %232
  %234 = getelementptr inbounds %struct.Node, ptr %233, i32 0, i32 3
  %235 = load i32, ptr %234, align 4, !tbaa !15
  %236 = load i32, ptr %10, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %237
  %239 = getelementptr inbounds %struct.Node, ptr %238, i32 0, i32 2
  %240 = load i32, ptr %239, align 8, !tbaa !13
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = sub nsw i32 %235, %243
  %245 = sext i32 %244 to i64
  %246 = load i64, ptr %9, align 8, !tbaa !11
  %247 = add nsw i64 %246, %245
  store i64 %247, ptr %9, align 8, !tbaa !11
  %248 = load i32, ptr %10, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %249
  %251 = getelementptr inbounds %struct.Node, ptr %250, i32 0, i32 3
  %252 = load i32, ptr %251, align 4, !tbaa !15
  %253 = load i32, ptr %10, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %254
  %256 = getelementptr inbounds %struct.Node, ptr %255, i32 0, i32 2
  %257 = load i32, ptr %256, align 8, !tbaa !13
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %258
  store i32 %252, ptr %259, align 4, !tbaa !5
  %260 = load i32, ptr %8, align 4, !tbaa !5
  %261 = icmp ne i32 %260, 0
  br i1 %261, label %279, label %262

262:                                              ; preds = %230
  %263 = load i32, ptr %10, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %264
  %266 = getelementptr inbounds %struct.Node, ptr %265, i32 0, i32 0
  %267 = load i32, ptr %266, align 16, !tbaa !17
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %268
  %270 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %269, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %271 = load i64, ptr %270, align 8, !tbaa !11
  %272 = load i32, ptr %10, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %273
  %275 = getelementptr inbounds %struct.Node, ptr %274, i32 0, i32 0
  %276 = load i32, ptr %275, align 16, !tbaa !17
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %277
  store i64 %271, ptr %278, align 8, !tbaa !11
  br label %279

279:                                              ; preds = %262, %230
  br label %280

280:                                              ; preds = %279, %195
  br label %281

281:                                              ; preds = %280, %194
  %282 = load i32, ptr %10, align 4, !tbaa !5
  %283 = add nsw i32 %282, -1
  store i32 %283, ptr %10, align 4, !tbaa !5
  br label %183, !llvm.loop !20

284:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %285 = load i32, ptr %2, align 4, !tbaa !5
  %286 = sub nsw i32 %285, 1
  store i32 %286, ptr %11, align 4, !tbaa !5
  br label %287

287:                                              ; preds = %304, %284
  %288 = load i32, ptr %11, align 4, !tbaa !5
  %289 = icmp sge i32 %288, 1
  br i1 %289, label %291, label %290

290:                                              ; preds = %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %307

291:                                              ; preds = %287
  %292 = load i32, ptr %11, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %293
  %295 = load i32, ptr %11, align 4, !tbaa !5
  %296 = add nsw i32 %295, 1
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %297
  %299 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %294, ptr noundef nonnull align 8 dereferenceable(8) %298)
  %300 = load i64, ptr %299, align 8, !tbaa !11
  %301 = load i32, ptr %11, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %302
  store i64 %300, ptr %303, align 8, !tbaa !11
  br label %304

304:                                              ; preds = %291
  %305 = load i32, ptr %11, align 4, !tbaa !5
  %306 = add nsw i32 %305, -1
  store i32 %306, ptr %11, align 4, !tbaa !5
  br label %287, !llvm.loop !21

307:                                              ; preds = %290
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 4557430888798830399, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %308

308:                                              ; preds = %329, %307
  %309 = load i32, ptr %13, align 4, !tbaa !5
  %310 = load i32, ptr @dt, align 4, !tbaa !5
  %311 = add nsw i32 %309, %310
  %312 = load i32, ptr %2, align 4, !tbaa !5
  %313 = icmp sle i32 %311, %312
  br i1 %313, label %315, label %314

314:                                              ; preds = %308
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %332

315:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %316 = load i32, ptr %13, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %317
  %319 = load i64, ptr %318, align 8, !tbaa !11
  %320 = load i32, ptr %13, align 4, !tbaa !5
  %321 = load i32, ptr @dt, align 4, !tbaa !5
  %322 = add nsw i32 %320, %321
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %323
  %325 = load i64, ptr %324, align 8, !tbaa !11
  %326 = add nsw i64 %319, %325
  store i64 %326, ptr %14, align 8, !tbaa !11
  %327 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %328 = load i64, ptr %327, align 8, !tbaa !11
  store i64 %328, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %329

329:                                              ; preds = %315
  %330 = load i32, ptr %13, align 4, !tbaa !5
  %331 = add nsw i32 %330, 1
  store i32 %331, ptr %13, align 4, !tbaa !5
  br label %308, !llvm.loop !22

332:                                              ; preds = %314
  %333 = load i64, ptr %12, align 8, !tbaa !11
  %334 = icmp slt i64 %333, 4557430888798830399
  br i1 %334, label %335, label %338

335:                                              ; preds = %332
  %336 = load i64, ptr %12, align 8, !tbaa !11
  %337 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %336)
  br label %340

338:                                              ; preds = %332
  %339 = call i32 @puts(ptr noundef @.str.2)
  br label %340

340:                                              ; preds = %338, %335
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Node4readEv(ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

declare i32 @puts(ptr noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 nounwind willreturn memory(argmem: write) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!15 = !{!14, !6, i64 12}
!16 = !{!14, !6, i64 4}
!17 = !{!14, !6, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


; 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.Node = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@w = external dso_local local_unnamed_addr global [100009 x i32], align 16
@f = external dso_local global [1000009 x i64], align 16
@g = external dso_local global [1000009 x i64], align 16
@a = external dso_local global [100009 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @dt)
  %7 = load i32, ptr @dt, align 4, !tbaa !5
  %8 = add nsw i32 %7, 1
  store i32 %8, ptr @dt, align 4, !tbaa !5
  %9 = load i32, ptr @m, align 4, !tbaa !5
  %.not68 = icmp slt i32 %9, 1
  br i1 %.not68, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre116 = sext i32 %9 to i64
  br label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %10 = add nsw i32 %23, 1
  br label %._crit_edge

._crit_edge:                                      ; preds = %.._crit_edge_crit_edge, %._crit_edge.loopexit
  %.pre-phi = phi i64 [ %.pre116, %.._crit_edge_crit_edge ], [ %25, %._crit_edge.loopexit ]
  %11 = phi i32 [ 1, %.._crit_edge_crit_edge ], [ %10, %._crit_edge.loopexit ]
  store i32 %11, ptr %1, align 4, !tbaa !5
  %12 = getelementptr inbounds %struct.Node, ptr @a, i64 %.pre-phi
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  call void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 16), ptr noundef nonnull %13)
  %14 = load i32, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i64 0, ptr %2, align 8, !tbaa !9
  %15 = sext i32 %14 to i64
  %16 = shl nsw i64 %15, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @w, i64 4), i8 63, i64 %16, i1 false)
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = shl nsw i64 %18, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @f, i64 8), i8 63, i64 %19, i1 false)
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %.not6070 = icmp slt i32 %20, 1
  br i1 %.not6070, label %.preheader, label %.lr.ph74

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %21 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv
  call void @_ZN4Node4readEv(ptr noundef nonnull align 4 dereferenceable(16) %21)
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %23 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %23, ptr %1, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %.not.not = icmp slt i64 %indvars.iv, %25
  br i1 %.not.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !11

.preheader.loopexit:                              ; preds = %57
  %.pre112 = load i32, ptr %1, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %._crit_edge
  %26 = phi i32 [ %58, %.preheader.loopexit ], [ %20, %._crit_edge ]
  %27 = phi i32 [ %.pre112, %.preheader.loopexit ], [ %17, %._crit_edge ]
  %.not6175 = icmp slt i32 %27, 2
  br i1 %.not6175, label %.preheader.._crit_edge78_crit_edge, label %.lr.ph77

.preheader.._crit_edge78_crit_edge:               ; preds = %.preheader
  %.pre117 = sext i32 %27 to i64
  br label %._crit_edge78

.lr.ph74:                                         ; preds = %._crit_edge, %57
  %28 = phi i32 [ %58, %57 ], [ %20, %._crit_edge ]
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %57 ], [ 1, %._crit_edge ]
  %.05371 = phi i32 [ %.255, %57 ], [ %14, %._crit_edge ]
  %29 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv97
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %31 = load i32, ptr %30, align 8, !tbaa !13
  %.not65 = icmp eq i32 %31, 0
  br i1 %.not65, label %32, label %57

32:                                               ; preds = %.lr.ph74
  %33 = getelementptr inbounds i8, ptr %29, i64 12
  %34 = load i32, ptr %33, align 4, !tbaa !15
  %35 = getelementptr inbounds i8, ptr %29, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !16
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp slt i32 %34, %39
  br i1 %40, label %41, label %57

41:                                               ; preds = %32
  %42 = icmp eq i32 %39, 1061109567
  %spec.select = select i1 %42, i32 0, i32 %39
  %43 = sext i1 %42 to i32
  %spec.select125 = add nsw i32 %.05371, %43
  %44 = sub nsw i32 %34, %spec.select
  %45 = sext i32 %44 to i64
  %46 = load i64, ptr %2, align 8, !tbaa !9
  %47 = add nsw i64 %46, %45
  store i64 %47, ptr %2, align 8, !tbaa !9
  store i32 %34, ptr %38, align 4, !tbaa !5
  %.not66 = icmp eq i32 %spec.select125, 0
  br i1 %.not66, label %48, label %57

48:                                               ; preds = %41
  %49 = load i32, ptr %29, align 16, !tbaa !17
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %50
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = load i32, ptr %29, align 16, !tbaa !17
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %55
  store i64 %53, ptr %56, align 8, !tbaa !9
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %32, %48, %41, %.lr.ph74
  %58 = phi i32 [ %28, %.lr.ph74 ], [ %28, %41 ], [ %.pre, %48 ], [ %28, %32 ]
  %.255 = phi i32 [ %.05371, %.lr.ph74 ], [ %spec.select125, %41 ], [ 0, %48 ], [ %.05371, %32 ]
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %59 = sext i32 %58 to i64
  %.not60.not = icmp slt i64 %indvars.iv97, %59
  br i1 %.not60.not, label %.lr.ph74, label %.preheader.loopexit, !llvm.loop !18

._crit_edge78.loopexit:                           ; preds = %.lr.ph77
  %.pre113 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge78

._crit_edge78:                                    ; preds = %.preheader.._crit_edge78_crit_edge, %._crit_edge78.loopexit
  %.pre-phi118 = phi i64 [ %.pre117, %.preheader.._crit_edge78_crit_edge ], [ %73, %._crit_edge78.loopexit ]
  %60 = phi i32 [ %26, %.preheader.._crit_edge78_crit_edge ], [ %.pre113, %._crit_edge78.loopexit ]
  %.lcssa = phi i32 [ %27, %.preheader.._crit_edge78_crit_edge ], [ %72, %._crit_edge78.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %61 = load i32, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 0, ptr %3, align 8, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = shl nsw i64 %62, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @w, i64 4), i8 63, i64 %63, i1 false)
  %64 = shl nsw i64 %.pre-phi118, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @g, i64 8), i8 63, i64 %64, i1 false)
  %65 = icmp sgt i32 %60, 0
  br i1 %65, label %.lr.ph83.preheader, label %._crit_edge84

.lr.ph83.preheader:                               ; preds = %._crit_edge78
  %66 = zext nneg i32 %60 to i64
  br label %.lr.ph83

.lr.ph77:                                         ; preds = %.preheader, %.lr.ph77
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.lr.ph77 ], [ 2, %.preheader ]
  %67 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %indvars.iv100
  %68 = add nsw i64 %indvars.iv100, -1
  %69 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %68
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 8 dereferenceable(8) %69)
  %71 = load i64, ptr %70, align 8, !tbaa !9
  store i64 %71, ptr %67, align 8, !tbaa !9
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %72 = load i32, ptr %1, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %.not61.not = icmp slt i64 %indvars.iv100, %73
  br i1 %.not61.not, label %.lr.ph77, label %._crit_edge78.loopexit, !llvm.loop !19

._crit_edge84.loopexit:                           ; preds = %105
  %.pre114 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge84

._crit_edge84:                                    ; preds = %._crit_edge84.loopexit, %._crit_edge78
  %74 = phi i32 [ %.pre114, %._crit_edge84.loopexit ], [ %.lcssa, %._crit_edge78 ]
  %75 = icmp sgt i32 %74, 1
  br i1 %75, label %.lr.ph87.preheader, label %._crit_edge88

.lr.ph87.preheader:                               ; preds = %._crit_edge84
  %76 = zext nneg i32 %74 to i64
  br label %.lr.ph87

.lr.ph83:                                         ; preds = %.lr.ph83.preheader, %105
  %indvars.iv103 = phi i64 [ %66, %.lr.ph83.preheader ], [ %indvars.iv.next104, %105 ]
  %.05080 = phi i32 [ %61, %.lr.ph83.preheader ], [ %.2, %105 ]
  %77 = getelementptr inbounds [100009 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv103
  %78 = getelementptr inbounds i8, ptr %77, i64 4
  %79 = load i32, ptr %78, align 4, !tbaa !16
  %.not63 = icmp eq i32 %79, 0
  br i1 %.not63, label %80, label %105

80:                                               ; preds = %.lr.ph83
  %81 = getelementptr inbounds i8, ptr %77, i64 12
  %82 = load i32, ptr %81, align 4, !tbaa !15
  %83 = getelementptr inbounds i8, ptr %77, i64 8
  %84 = load i32, ptr %83, align 8, !tbaa !13
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100009 x i32], ptr @w, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = icmp slt i32 %82, %87
  br i1 %88, label %89, label %105

89:                                               ; preds = %80
  %90 = icmp eq i32 %87, 1061109567
  %spec.select126 = select i1 %90, i32 0, i32 %87
  %91 = sext i1 %90 to i32
  %spec.select127 = add nsw i32 %.05080, %91
  %92 = sub nsw i32 %82, %spec.select126
  %93 = sext i32 %92 to i64
  %94 = load i64, ptr %3, align 8, !tbaa !9
  %95 = add nsw i64 %94, %93
  store i64 %95, ptr %3, align 8, !tbaa !9
  store i32 %82, ptr %86, align 4, !tbaa !5
  %.not64 = icmp eq i32 %spec.select127, 0
  br i1 %.not64, label %96, label %105

96:                                               ; preds = %89
  %97 = load i32, ptr %77, align 16, !tbaa !17
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %98
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %101 = load i64, ptr %100, align 8, !tbaa !9
  %102 = load i32, ptr %77, align 16, !tbaa !17
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %103
  store i64 %101, ptr %104, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %80, %96, %89, %.lr.ph83
  %.2 = phi i32 [ %.05080, %.lr.ph83 ], [ %spec.select127, %89 ], [ 0, %96 ], [ %.05080, %80 ]
  %indvars.iv.next104 = add nsw i64 %indvars.iv103, -1
  %106 = icmp sgt i64 %indvars.iv103, 1
  br i1 %106, label %.lr.ph83, label %._crit_edge84.loopexit, !llvm.loop !20

._crit_edge88.loopexit:                           ; preds = %.lr.ph87
  %.pre115 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge88

._crit_edge88:                                    ; preds = %._crit_edge88.loopexit, %._crit_edge84
  %107 = phi i32 [ %.pre115, %._crit_edge88.loopexit ], [ %74, %._crit_edge84 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 4557430888798830399, ptr %4, align 8, !tbaa !9
  %108 = load i32, ptr @dt, align 4, !tbaa !5
  %.not6289.not = icmp slt i32 %108, %107
  br i1 %.not6289.not, label %.lr.ph92.preheader, label %._crit_edge93.thread

.lr.ph92.preheader:                               ; preds = %._crit_edge88
  %109 = add nsw i32 %108, 1
  br label %.lr.ph92

.lr.ph87:                                         ; preds = %.lr.ph87.preheader, %.lr.ph87
  %indvars.iv106 = phi i64 [ %76, %.lr.ph87.preheader ], [ %indvars.iv.next107, %.lr.ph87 ]
  %indvars.iv.next107 = add nsw i64 %indvars.iv106, -1
  %110 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %indvars.iv.next107
  %111 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %indvars.iv106
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %110, ptr noundef nonnull align 8 dereferenceable(8) %111)
  %113 = load i64, ptr %112, align 8, !tbaa !9
  store i64 %113, ptr %110, align 8, !tbaa !9
  %114 = icmp ugt i64 %indvars.iv106, 2
  br i1 %114, label %.lr.ph87, label %._crit_edge88.loopexit, !llvm.loop !21

._crit_edge93:                                    ; preds = %.lr.ph92
  %115 = icmp slt i64 %124, 4557430888798830399
  br i1 %115, label %129, label %._crit_edge93.thread

.lr.ph92:                                         ; preds = %.lr.ph92.preheader, %.lr.ph92
  %indvars.iv109 = phi i64 [ 1, %.lr.ph92.preheader ], [ %indvars.iv.next110, %.lr.ph92 ]
  %116 = phi i32 [ %109, %.lr.ph92.preheader ], [ %127, %.lr.ph92 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %117 = getelementptr inbounds [1000009 x i64], ptr @f, i64 0, i64 %indvars.iv109
  %118 = load i64, ptr %117, align 8, !tbaa !9
  %119 = sext i32 %116 to i64
  %120 = getelementptr inbounds [1000009 x i64], ptr @g, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = add nsw i64 %121, %118
  store i64 %122, ptr %5, align 8, !tbaa !9
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %124 = load i64, ptr %123, align 8, !tbaa !9
  store i64 %124, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %125 = load i32, ptr @dt, align 4, !tbaa !5
  %126 = trunc nuw i64 %indvars.iv.next110 to i32
  %127 = add nsw i32 %125, %126
  %128 = load i32, ptr %1, align 4, !tbaa !5
  %.not62 = icmp sgt i32 %127, %128
  br i1 %.not62, label %._crit_edge93, label %.lr.ph92, !llvm.loop !22

129:                                              ; preds = %._crit_edge93
  %130 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %124)
  br label %132

._crit_edge93.thread:                             ; preds = %._crit_edge88, %._crit_edge93
  %131 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %132

132:                                              ; preds = %._crit_edge93.thread, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Node4readEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!14, !6, i64 8}
!14 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!15 = !{!14, !6, i64 12}
!16 = !{!14, !6, i64 4}
!17 = !{!14, !6, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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