; LLVM IR from tangjz/acm-icpc :: codeforces/complete/89C.ll (Z5solvev)

; 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 }
%"struct.std::pair" = type <{ ptr, i32, [4 x i8] }>
%class.anon = type { ptr }
%class.anon.0 = type { ptr }

@_ZZ5solvevE3buf = external hidden global [20001 x i8], align 16
@_ZZ5solvevE4info = external hidden global [20001 x %struct.Node], align 16
@_ZZ5solvevE3stk = external hidden global [4000001 x %"struct.std::pair"], align 16
@_ZGVZ5solvevE3stk = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.Node, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %class.anon, align 8
  %14 = alloca %class.anon.0, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %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 ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !5
  %24 = load atomic i8, ptr @_ZGVZ5solvevE3stk acquire, align 8
  %25 = icmp eq i8 %24, 0
  br i1 %25, label %26, label %36, !prof !9

26:                                               ; preds = %0
  %27 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ5solvevE3stk) #2
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %36

29:                                               ; preds = %26
  br label %30

30:                                               ; preds = %32, %29
  %31 = phi ptr [ @_ZZ5solvevE3stk, %29 ], [ %33, %32 ]
  invoke void @_ZNSt4pairIPiiEC2IS0_iTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(12) %31)
          to label %32 unwind label %47

32:                                               ; preds = %30
  %33 = getelementptr inbounds %"struct.std::pair", ptr %31, i64 1
  %34 = icmp eq ptr %33, getelementptr inbounds (%"struct.std::pair", ptr @_ZZ5solvevE3stk, i64 4000001)
  br i1 %34, label %35, label %30

35:                                               ; preds = %32
  call void @__cxa_guard_release(ptr @_ZGVZ5solvevE3stk) #2
  br label %36

36:                                               ; preds = %35, %26, %0
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %71, %36
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %41 = add nsw i32 %40, 2
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 2
  %44 = mul nsw i32 %41, %43
  %45 = icmp slt i32 %39, %44
  br i1 %45, label %51, label %46

46:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  br label %74

47:                                               ; preds = %30
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %4, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %5, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZ5solvevE3stk) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #2
  br label %310

51:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #2
  %52 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sub nsw i32 %53, 1
  store i32 %54, ptr %52, align 4, !tbaa !10
  %55 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %55, align 4, !tbaa !12
  %58 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 2
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = add nsw i32 %60, 2
  %62 = sub nsw i32 %59, %61
  store i32 %62, ptr %58, align 4, !tbaa !13
  %63 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 3
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = add nsw i32 %65, 2
  %67 = add nsw i32 %64, %66
  store i32 %67, ptr %63, align 4, !tbaa !14
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %69
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %70, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #2
  br label %71

71:                                               ; preds = %51
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %6, align 4, !tbaa !5
  br label %38, !llvm.loop !16

74:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = add nsw i32 %75, 2
  store i32 %76, ptr %9, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %149, %74
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = load i32, ptr %1, align 4, !tbaa !5
  %80 = icmp sle i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  br label %156

82:                                               ; preds = %77
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i8, ptr @_ZZ5solvevE3buf, i64 %84
  %86 = getelementptr inbounds i8, ptr %85, i64 1
  %87 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %86)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %145, %82
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  br label %148

93:                                               ; preds = %88
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = add nsw i32 %94, %95
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [20001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !18
  %100 = sext i8 %99 to i32
  %101 = icmp ne i32 %100, 46
  br i1 %101, label %102, label %103

102:                                              ; preds = %93
  br label %145

103:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #2
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = add nsw i32 %104, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %107
  store ptr %108, ptr %12, align 8, !tbaa !19
  %109 = load ptr, ptr %12, align 8, !tbaa !19
  %110 = getelementptr inbounds %struct.Node, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !12
  %112 = load ptr, ptr %12, align 8, !tbaa !19
  %113 = getelementptr inbounds %struct.Node, ptr %112, i32 0, i32 0
  %114 = load i32, ptr %113, align 4, !tbaa !10
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.Node, ptr %116, i32 0, i32 1
  store i32 %111, ptr %117, align 4, !tbaa !12
  %118 = load ptr, ptr %12, align 8, !tbaa !19
  %119 = getelementptr inbounds %struct.Node, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 4, !tbaa !10
  %121 = load ptr, ptr %12, align 8, !tbaa !19
  %122 = getelementptr inbounds %struct.Node, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 4, !tbaa !12
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %124
  %126 = getelementptr inbounds %struct.Node, ptr %125, i32 0, i32 0
  store i32 %120, ptr %126, align 16, !tbaa !10
  %127 = load ptr, ptr %12, align 8, !tbaa !19
  %128 = getelementptr inbounds %struct.Node, ptr %127, i32 0, i32 3
  %129 = load i32, ptr %128, align 4, !tbaa !14
  %130 = load ptr, ptr %12, align 8, !tbaa !19
  %131 = getelementptr inbounds %struct.Node, ptr %130, i32 0, i32 2
  %132 = load i32, ptr %131, align 4, !tbaa !13
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %133
  %135 = getelementptr inbounds %struct.Node, ptr %134, i32 0, i32 3
  store i32 %129, ptr %135, align 4, !tbaa !14
  %136 = load ptr, ptr %12, align 8, !tbaa !19
  %137 = getelementptr inbounds %struct.Node, ptr %136, i32 0, i32 2
  %138 = load i32, ptr %137, align 4, !tbaa !13
  %139 = load ptr, ptr %12, align 8, !tbaa !19
  %140 = getelementptr inbounds %struct.Node, ptr %139, i32 0, i32 3
  %141 = load i32, ptr %140, align 4, !tbaa !14
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %142
  %144 = getelementptr inbounds %struct.Node, ptr %143, i32 0, i32 2
  store i32 %138, ptr %144, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #2
  br label %145

145:                                              ; preds = %103, %102
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %11, align 4, !tbaa !5
  br label %88, !llvm.loop !21

148:                                              ; preds = %92
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %8, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %8, align 4, !tbaa !5
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = add nsw i32 %152, 2
  %154 = load i32, ptr %9, align 4, !tbaa !5
  %155 = add nsw i32 %154, %153
  store i32 %155, ptr %9, align 4, !tbaa !5
  br label %77, !llvm.loop !22

156:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #2
  %157 = getelementptr inbounds %class.anon, ptr %13, i32 0, i32 0
  store ptr %3, ptr %157, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #2
  %158 = getelementptr inbounds %class.anon.0, ptr %14, i32 0, i32 0
  store ptr %3, ptr %158, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #2
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #2
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %303, %156
  %160 = load i32, ptr %17, align 4, !tbaa !5
  %161 = load i32, ptr %1, align 4, !tbaa !5
  %162 = icmp sle i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #2
  br label %306

164:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #2
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %299, %164
  %166 = load i32, ptr %18, align 4, !tbaa !5
  %167 = load i32, ptr %2, align 4, !tbaa !5
  %168 = icmp sle i32 %166, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #2
  br label %302

170:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #2
  %171 = load i32, ptr %17, align 4, !tbaa !5
  %172 = load i32, ptr %2, align 4, !tbaa !5
  %173 = add nsw i32 %172, 2
  %174 = mul nsw i32 %171, %173
  %175 = load i32, ptr %18, align 4, !tbaa !5
  %176 = add nsw i32 %174, %175
  store i32 %176, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #2
  %177 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %177, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #2
  %178 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %178, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #2
  store i32 0, ptr %22, align 4, !tbaa !5
  %179 = load i32, ptr %19, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [20001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %180
  %182 = load i8, ptr %181, align 1, !tbaa !18
  %183 = sext i8 %182 to i32
  %184 = icmp eq i32 %183, 46
  br i1 %184, label %185, label %186

185:                                              ; preds = %170
  store i32 16, ptr %10, align 4
  br label %296

186:                                              ; preds = %170
  br label %187

187:                                              ; preds = %274, %186
  %188 = load i32, ptr %20, align 4, !tbaa !5
  %189 = icmp sge i32 %188, 1
  br i1 %189, label %190, label %201

190:                                              ; preds = %187
  %191 = load i32, ptr %20, align 4, !tbaa !5
  %192 = load i32, ptr %1, align 4, !tbaa !5
  %193 = icmp sle i32 %191, %192
  br i1 %193, label %194, label %201

194:                                              ; preds = %190
  %195 = load i32, ptr %21, align 4, !tbaa !5
  %196 = icmp sge i32 %195, 1
  br i1 %196, label %197, label %201

197:                                              ; preds = %194
  %198 = load i32, ptr %21, align 4, !tbaa !5
  %199 = load i32, ptr %2, align 4, !tbaa !5
  %200 = icmp sle i32 %198, %199
  br label %201

201:                                              ; preds = %197, %194, %190, %187
  %202 = phi i1 [ false, %194 ], [ false, %190 ], [ false, %187 ], [ %200, %197 ]
  br i1 %202, label %203, label %283

203:                                              ; preds = %201
  %204 = load i32, ptr %22, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #2
  %206 = load i32, ptr %19, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %207
  store ptr %208, ptr %23, align 8, !tbaa !19
  %209 = load ptr, ptr %23, align 8, !tbaa !19
  %210 = getelementptr inbounds %struct.Node, ptr %209, i32 0, i32 0
  %211 = load i32, ptr %210, align 4, !tbaa !10
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %212
  %214 = getelementptr inbounds %struct.Node, ptr %213, i32 0, i32 1
  %215 = load ptr, ptr %23, align 8, !tbaa !19
  %216 = getelementptr inbounds %struct.Node, ptr %215, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !12
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %214, i32 noundef %217)
  %218 = load ptr, ptr %23, align 8, !tbaa !19
  %219 = getelementptr inbounds %struct.Node, ptr %218, i32 0, i32 1
  %220 = load i32, ptr %219, align 4, !tbaa !12
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %221
  %223 = getelementptr inbounds %struct.Node, ptr %222, i32 0, i32 0
  %224 = load ptr, ptr %23, align 8, !tbaa !19
  %225 = getelementptr inbounds %struct.Node, ptr %224, i32 0, i32 0
  %226 = load i32, ptr %225, align 4, !tbaa !10
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %223, i32 noundef %226)
  %227 = load ptr, ptr %23, align 8, !tbaa !19
  %228 = getelementptr inbounds %struct.Node, ptr %227, i32 0, i32 2
  %229 = load i32, ptr %228, align 4, !tbaa !13
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %230
  %232 = getelementptr inbounds %struct.Node, ptr %231, i32 0, i32 3
  %233 = load ptr, ptr %23, align 8, !tbaa !19
  %234 = getelementptr inbounds %struct.Node, ptr %233, i32 0, i32 3
  %235 = load i32, ptr %234, align 4, !tbaa !14
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %232, i32 noundef %235)
  %236 = load ptr, ptr %23, align 8, !tbaa !19
  %237 = getelementptr inbounds %struct.Node, ptr %236, i32 0, i32 3
  %238 = load i32, ptr %237, align 4, !tbaa !14
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %239
  %241 = getelementptr inbounds %struct.Node, ptr %240, i32 0, i32 2
  %242 = load ptr, ptr %23, align 8, !tbaa !19
  %243 = getelementptr inbounds %struct.Node, ptr %242, i32 0, i32 2
  %244 = load i32, ptr %243, align 4, !tbaa !13
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %241, i32 noundef %244)
  %245 = load i32, ptr %19, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [20001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %246
  %248 = load i8, ptr %247, align 1, !tbaa !18
  %249 = sext i8 %248 to i32
  switch i32 %249, label %274 [
    i32 76, label %250
    i32 82, label %256
    i32 85, label %262
    i32 68, label %268
  ]

250:                                              ; preds = %203
  %251 = load i32, ptr %19, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %252
  %254 = getelementptr inbounds %struct.Node, ptr %253, i32 0, i32 0
  %255 = load i32, ptr %254, align 16, !tbaa !10
  store i32 %255, ptr %19, align 4, !tbaa !5
  br label %274

256:                                              ; preds = %203
  %257 = load i32, ptr %19, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %258
  %260 = getelementptr inbounds %struct.Node, ptr %259, i32 0, i32 1
  %261 = load i32, ptr %260, align 4, !tbaa !12
  store i32 %261, ptr %19, align 4, !tbaa !5
  br label %274

262:                                              ; preds = %203
  %263 = load i32, ptr %19, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %264
  %266 = getelementptr inbounds %struct.Node, ptr %265, i32 0, i32 2
  %267 = load i32, ptr %266, align 8, !tbaa !13
  store i32 %267, ptr %19, align 4, !tbaa !5
  br label %274

268:                                              ; preds = %203
  %269 = load i32, ptr %19, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %270
  %272 = getelementptr inbounds %struct.Node, ptr %271, i32 0, i32 3
  %273 = load i32, ptr %272, align 4, !tbaa !14
  store i32 %273, ptr %19, align 4, !tbaa !5
  br label %274

274:                                              ; preds = %268, %262, %256, %250, %203
  %275 = load i32, ptr %19, align 4, !tbaa !5
  %276 = load i32, ptr %2, align 4, !tbaa !5
  %277 = add nsw i32 %276, 2
  %278 = sdiv i32 %275, %277
  store i32 %278, ptr %20, align 4, !tbaa !5
  %279 = load i32, ptr %19, align 4, !tbaa !5
  %280 = load i32, ptr %2, align 4, !tbaa !5
  %281 = add nsw i32 %280, 2
  %282 = srem i32 %279, %281
  store i32 %282, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #2
  br label %187, !llvm.loop !23

283:                                              ; preds = %201
  %284 = load i32, ptr %15, align 4, !tbaa !5
  %285 = load i32, ptr %22, align 4, !tbaa !5
  %286 = icmp slt i32 %284, %285
  br i1 %286, label %287, label %289

287:                                              ; preds = %283
  %288 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %288, ptr %15, align 4, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %289

289:                                              ; preds = %287, %283
  %290 = load i32, ptr %15, align 4, !tbaa !5
  %291 = load i32, ptr %22, align 4, !tbaa !5
  %292 = icmp eq i32 %290, %291
  %293 = zext i1 %292 to i32
  %294 = load i32, ptr %16, align 4, !tbaa !5
  %295 = add nsw i32 %294, %293
  store i32 %295, ptr %16, align 4, !tbaa !5
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(8) %14)
  store i32 0, ptr %10, align 4
  br label %296

296:                                              ; preds = %289, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #2
  %297 = load i32, ptr %10, align 4
  switch i32 %297, label %315 [
    i32 0, label %298
    i32 16, label %299
  ]

298:                                              ; preds = %296
  br label %299

299:                                              ; preds = %298, %296
  %300 = load i32, ptr %18, align 4, !tbaa !5
  %301 = add nsw i32 %300, 1
  store i32 %301, ptr %18, align 4, !tbaa !5
  br label %165, !llvm.loop !24

302:                                              ; preds = %169
  br label %303

303:                                              ; preds = %302
  %304 = load i32, ptr %17, align 4, !tbaa !5
  %305 = add nsw i32 %304, 1
  store i32 %305, ptr %17, align 4, !tbaa !5
  br label %159, !llvm.loop !25

306:                                              ; preds = %163
  %307 = load i32, ptr %15, align 4, !tbaa !5
  %308 = load i32, ptr %16, align 4, !tbaa !5
  %309 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %307, i32 noundef %308)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #2
  ret void

310:                                              ; preds = %47
  %311 = load ptr, ptr %4, align 8
  %312 = load i32, ptr %5, align 4
  %313 = insertvalue { ptr, i32 } poison, ptr %311, 0
  %314 = insertvalue { ptr, i32 } %313, i32 %312, 1
  resume { ptr, i32 } %314

315:                                              ; preds = %296
  unreachable
}

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

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIPiiEC2IS0_iTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #2

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #2

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

; 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) #5

; 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 hidden void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i32 noundef) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(8)) #7 align 2

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

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 = { nounwind }
attributes #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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" }

!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 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !6, i64 0}
!11 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!12 = !{!11, !6, i64 4}
!13 = !{!11, !6, i64 8}
!14 = !{!11, !6, i64 12}
!15 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17}


; 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 }
%"struct.std::pair" = type <{ ptr, i32, [4 x i8] }>
%class.anon = type { ptr }
%class.anon.0 = type { ptr }

@_ZZ5solvevE3buf = external hidden global [20001 x i8], align 16
@_ZZ5solvevE4info = external hidden global [20001 x %struct.Node], align 16
@_ZZ5solvevE3stk = external hidden global [4000001 x %"struct.std::pair"], align 16
@_ZGVZ5solvevE3stk = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %class.anon, align 8
  %5 = alloca %class.anon.0, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  %6 = load atomic i8, ptr @_ZGVZ5solvevE3stk acquire, align 8
  %7 = icmp eq i8 %6, 0
  br i1 %7, label %8, label %12, !prof !9

8:                                                ; preds = %0
  %9 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ5solvevE3stk) #8
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %12, label %.preheader94

.preheader94:                                     ; preds = %8, %.preheader94
  %.idx = phi i64 [ %.add, %.preheader94 ], [ 0, %8 ]
  %.ptr = getelementptr inbounds i8, ptr @_ZZ5solvevE3stk, i64 %.idx
  tail call void @_ZNSt4pairIPiiEC2IS0_iTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(12) %.ptr)
  %.add = add nuw nsw i64 %.idx, 16
  %10 = icmp eq i64 %.add, 64000016
  br i1 %10, label %11, label %.preheader94

11:                                               ; preds = %.preheader94
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZ5solvevE3stk) #8
  br label %12

12:                                               ; preds = %11, %8, %0
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = add nsw i32 %14, 2
  %16 = load i32, ptr %2, align 4
  %17 = add nsw i32 %16, 2
  %18 = mul nsw i32 %17, %15
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph.preheader, label %.preheader93

.lr.ph.preheader:                                 ; preds = %12
  %wide.trip.count = zext nneg i32 %18 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %20 = icmp eq i32 %18, 1
  br i1 %20, label %.preheader93.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.preheader93.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader93, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader93.loopexit.unr-lcssa
  %21 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %indvars.iv.unr
  %22 = trunc i64 %indvars.iv.unr to i32
  %23 = add i32 %22, -1
  store i32 %23, ptr %21, align 16, !tbaa !5
  %.sroa.4.0..sroa_idx.epil = getelementptr inbounds i8, ptr %21, i64 4
  %24 = trunc i64 %indvars.iv.unr to i32
  %25 = add i32 %24, 1
  store i32 %25, ptr %.sroa.4.0..sroa_idx.epil, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx.epil = getelementptr inbounds i8, ptr %21, i64 8
  %26 = trunc i64 %indvars.iv.unr to i32
  %27 = sub i32 %26, %17
  store i32 %27, ptr %.sroa.5.0..sroa_idx.epil, align 8, !tbaa !5
  %.sroa.6.0..sroa_idx.epil = getelementptr inbounds i8, ptr %21, i64 12
  %28 = trunc i64 %indvars.iv.unr to i32
  %29 = add i32 %17, %28
  store i32 %29, ptr %.sroa.6.0..sroa_idx.epil, align 4, !tbaa !5
  br label %.preheader93

.preheader93:                                     ; preds = %.lr.ph.epil, %.preheader93.loopexit.unr-lcssa, %12
  %.not81101 = icmp slt i32 %14, 1
  br i1 %.not81101, label %._crit_edge105.thread, label %.lr.ph104

._crit_edge105.thread:                            ; preds = %.preheader93
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  store ptr %3, ptr %4, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store ptr %3, ptr %5, align 8, !tbaa !10
  br label %._crit_edge122

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %30 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %indvars.iv
  %31 = trunc i64 %indvars.iv to i32
  %32 = add i32 %31, -1
  store i32 %32, ptr %30, align 16, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %30, i64 4
  %33 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %33, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %30, i64 8
  %34 = trunc i64 %indvars.iv to i32
  %35 = sub i32 %34, %17
  store i32 %35, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !5
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %30, i64 12
  %36 = trunc i64 %indvars.iv to i32
  %37 = add i32 %17, %36
  store i32 %37, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %38 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %indvars.iv.next
  %39 = trunc i64 %indvars.iv.next to i32
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %38, align 16, !tbaa !5
  %.sroa.4.0..sroa_idx.1 = getelementptr inbounds i8, ptr %38, i64 4
  %41 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  store i32 %41, ptr %.sroa.4.0..sroa_idx.1, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx.1 = getelementptr inbounds i8, ptr %38, i64 8
  %42 = trunc i64 %indvars.iv.next to i32
  %43 = sub i32 %42, %17
  store i32 %43, ptr %.sroa.5.0..sroa_idx.1, align 8, !tbaa !5
  %.sroa.6.0..sroa_idx.1 = getelementptr inbounds i8, ptr %38, i64 12
  %44 = trunc i64 %indvars.iv.next to i32
  %45 = add i32 %17, %44
  store i32 %45, ptr %.sroa.6.0..sroa_idx.1, align 4, !tbaa !5
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader93.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !12

._crit_edge105:                                   ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  store ptr %3, ptr %4, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store ptr %3, ptr %5, align 8, !tbaa !10
  %.not82118 = icmp slt i32 %54, 1
  %46 = icmp slt i32 %49, 1
  %or.cond = or i1 %.not82118, %46
  br i1 %or.cond, label %._crit_edge122, label %.preheader92

.lr.ph104:                                        ; preds = %.preheader93, %._crit_edge
  %.075103 = phi i32 [ %51, %._crit_edge ], [ 1, %.preheader93 ]
  %.077102 = phi i32 [ %53, %._crit_edge ], [ %17, %.preheader93 ]
  %47 = sext i32 %.077102 to i64
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3buf, i64 1), i64 %47
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %gep)
  %49 = load i32, ptr %2, align 4
  %.not8597 = icmp slt i32 %49, 1
  br i1 %.not8597, label %._crit_edge, label %.lr.ph99.preheader

.lr.ph99.preheader:                               ; preds = %.lr.ph104
  %50 = add nuw i32 %49, 1
  %wide.trip.count131 = zext i32 %50 to i64
  br label %.lr.ph99

._crit_edge:                                      ; preds = %75, %.lr.ph104
  %51 = add nuw nsw i32 %.075103, 1
  %52 = add i32 %.077102, 2
  %53 = add i32 %52, %49
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %.not81.not = icmp slt i32 %.075103, %54
  br i1 %.not81.not, label %.lr.ph104, label %._crit_edge105, !llvm.loop !14

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %75
  %indvars.iv128 = phi i64 [ 1, %.lr.ph99.preheader ], [ %indvars.iv.next129, %75 ]
  %55 = add nsw i64 %indvars.iv128, %47
  %56 = getelementptr inbounds [20001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !15
  %.not86 = icmp eq i8 %57, 46
  br i1 %.not86, label %58, label %75

58:                                               ; preds = %.lr.ph99
  %59 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %55
  %60 = getelementptr inbounds i8, ptr %59, i64 4
  %61 = load i32, ptr %60, align 4, !tbaa !16
  %62 = load i32, ptr %59, align 16, !tbaa !18
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %63, i32 1
  store i32 %61, ptr %64, align 4, !tbaa !16
  %65 = sext i32 %61 to i64
  %66 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %65
  store i32 %62, ptr %66, align 16, !tbaa !18
  %67 = getelementptr inbounds i8, ptr %59, i64 12
  %68 = load i32, ptr %67, align 4, !tbaa !19
  %69 = getelementptr inbounds i8, ptr %59, i64 8
  %70 = load i32, ptr %69, align 8, !tbaa !20
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %71, i32 3
  store i32 %68, ptr %72, align 4, !tbaa !19
  %73 = sext i32 %68 to i64
  %74 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %73, i32 2
  store i32 %70, ptr %74, align 8, !tbaa !20
  br label %75

75:                                               ; preds = %.lr.ph99, %58
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131
  br i1 %exitcond132.not, label %._crit_edge, label %.lr.ph99, !llvm.loop !21

.preheader92:                                     ; preds = %._crit_edge105, %._crit_edge115
  %76 = phi i32 [ %80, %._crit_edge115 ], [ %54, %._crit_edge105 ]
  %77 = phi i32 [ %81, %._crit_edge115 ], [ %49, %._crit_edge105 ]
  %78 = phi i32 [ %82, %._crit_edge115 ], [ %49, %._crit_edge105 ]
  %.068121 = phi i32 [ %83, %._crit_edge115 ], [ 1, %._crit_edge105 ]
  %.069120 = phi i32 [ %.170.lcssa, %._crit_edge115 ], [ 0, %._crit_edge105 ]
  %.071119 = phi i32 [ %.172.lcssa, %._crit_edge115 ], [ 0, %._crit_edge105 ]
  %.not83110 = icmp slt i32 %78, 1
  br i1 %.not83110, label %._crit_edge115, label %.lr.ph114

._crit_edge122:                                   ; preds = %._crit_edge115, %._crit_edge105.thread, %._crit_edge105
  %.071.lcssa = phi i32 [ 0, %._crit_edge105 ], [ 0, %._crit_edge105.thread ], [ %.172.lcssa, %._crit_edge115 ]
  %.069.lcssa = phi i32 [ 0, %._crit_edge105 ], [ 0, %._crit_edge105.thread ], [ %.170.lcssa, %._crit_edge115 ]
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.071.lcssa, i32 noundef %.069.lcssa)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret void

._crit_edge115.loopexit:                          ; preds = %140
  %.pre133 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge115

._crit_edge115:                                   ; preds = %._crit_edge115.loopexit, %.preheader92
  %80 = phi i32 [ %76, %.preheader92 ], [ %.pre133, %._crit_edge115.loopexit ]
  %81 = phi i32 [ %77, %.preheader92 ], [ %141, %._crit_edge115.loopexit ]
  %82 = phi i32 [ %78, %.preheader92 ], [ %141, %._crit_edge115.loopexit ]
  %.172.lcssa = phi i32 [ %.071119, %.preheader92 ], [ %.374, %._crit_edge115.loopexit ]
  %.170.lcssa = phi i32 [ %.069120, %.preheader92 ], [ %.3, %._crit_edge115.loopexit ]
  %83 = add nuw nsw i32 %.068121, 1
  %.not82.not = icmp slt i32 %.068121, %80
  br i1 %.not82.not, label %.preheader92, label %._crit_edge122, !llvm.loop !22

.lr.ph114:                                        ; preds = %.preheader92, %140
  %84 = phi i32 [ %141, %140 ], [ %77, %.preheader92 ]
  %85 = phi i32 [ %141, %140 ], [ %78, %.preheader92 ]
  %.067113 = phi i32 [ %142, %140 ], [ 1, %.preheader92 ]
  %.170112 = phi i32 [ %.3, %140 ], [ %.069120, %.preheader92 ]
  %.172111 = phi i32 [ %.374, %140 ], [ %.071119, %.preheader92 ]
  %86 = add nsw i32 %85, 2
  %87 = mul nsw i32 %86, %.068121
  %88 = add nsw i32 %87, %.067113
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [20001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !15
  %92 = icmp eq i8 %91, 46
  br i1 %92, label %140, label %.preheader

.preheader:                                       ; preds = %.lr.ph114, %130
  %93 = phi i32 [ %131, %130 ], [ %85, %.lr.ph114 ]
  %.063109 = phi i32 [ %98, %130 ], [ 0, %.lr.ph114 ]
  %.064108 = phi i32 [ %134, %130 ], [ %.067113, %.lr.ph114 ]
  %.065107 = phi i32 [ %133, %130 ], [ %.068121, %.lr.ph114 ]
  %.066106 = phi i32 [ %.1, %130 ], [ %88, %.lr.ph114 ]
  %94 = load i32, ptr %1, align 4, !tbaa !5
  %95 = icmp sgt i32 %.065107, %94
  %96 = icmp slt i32 %.064108, 1
  %or.cond.not91 = or i1 %95, %96
  %.not84 = icmp sgt i32 %.064108, %93
  %or.cond87 = or i1 %or.cond.not91, %.not84
  br i1 %or.cond87, label %.critedge, label %97

97:                                               ; preds = %.preheader
  %98 = add nuw nsw i32 %.063109, 1
  %99 = sext i32 %.066106 to i64
  %100 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %99
  %101 = load i32, ptr %100, align 16, !tbaa !18
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %102, i32 1
  %104 = getelementptr inbounds i8, ptr %100, i64 4
  %105 = load i32, ptr %104, align 4, !tbaa !16
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %103, i32 noundef %105)
  %106 = load i32, ptr %104, align 4, !tbaa !16
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %107
  %109 = load i32, ptr %100, align 16, !tbaa !18
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %108, i32 noundef %109)
  %110 = getelementptr inbounds i8, ptr %100, i64 8
  %111 = load i32, ptr %110, align 8, !tbaa !20
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %112, i32 3
  %114 = getelementptr inbounds i8, ptr %100, i64 12
  %115 = load i32, ptr %114, align 4, !tbaa !19
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %113, i32 noundef %115)
  %116 = load i32, ptr %114, align 4, !tbaa !19
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [20001 x %struct.Node], ptr @_ZZ5solvevE4info, i64 0, i64 %117, i32 2
  %119 = load i32, ptr %110, align 8, !tbaa !20
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %118, i32 noundef %119)
  %120 = getelementptr inbounds [20001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %99
  %121 = load i8, ptr %120, align 1, !tbaa !15
  switch i8 %121, label %130 [
    i8 76, label %122
    i8 82, label %124
    i8 85, label %126
    i8 68, label %128
  ]

122:                                              ; preds = %97
  %123 = load i32, ptr %100, align 16, !tbaa !18
  br label %130

124:                                              ; preds = %97
  %125 = load i32, ptr %104, align 4, !tbaa !16
  br label %130

126:                                              ; preds = %97
  %127 = load i32, ptr %110, align 8, !tbaa !20
  br label %130

128:                                              ; preds = %97
  %129 = load i32, ptr %114, align 4, !tbaa !19
  br label %130

130:                                              ; preds = %128, %126, %124, %122, %97
  %.1 = phi i32 [ %.066106, %97 ], [ %129, %128 ], [ %127, %126 ], [ %125, %124 ], [ %123, %122 ]
  %131 = load i32, ptr %2, align 4
  %132 = add nsw i32 %131, 2
  %133 = sdiv i32 %.1, %132
  %134 = srem i32 %.1, %132
  %135 = icmp sgt i32 %133, 0
  br i1 %135, label %.preheader, label %.critedge, !llvm.loop !24

.critedge:                                        ; preds = %.preheader, %130
  %.063.lcssa = phi i32 [ %.063109, %.preheader ], [ %98, %130 ]
  %136 = icmp slt i32 %.172111, %.063.lcssa
  %spec.select = call i32 @llvm.smax.i32(i32 %.172111, i32 %.063.lcssa)
  %spec.select88 = select i1 %136, i32 0, i32 %.170112
  %137 = icmp sge i32 %.063.lcssa, %.172111
  %138 = zext i1 %137 to i32
  %139 = add nsw i32 %spec.select88, %138
  call void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %.pre = load i32, ptr %2, align 4
  br label %140

140:                                              ; preds = %.lr.ph114, %.critedge
  %141 = phi i32 [ %.pre, %.critedge ], [ %84, %.lr.ph114 ]
  %.374 = phi i32 [ %spec.select, %.critedge ], [ %.172111, %.lr.ph114 ]
  %.3 = phi i32 [ %139, %.critedge ], [ %.170112, %.lr.ph114 ]
  %142 = add nuw nsw i32 %.067113, 1
  %.not83.not = icmp slt i32 %.067113, %141
  br i1 %.not83.not, label %.lr.ph114, label %._crit_edge115.loopexit, !llvm.loop !25
}

; 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 i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIPiiEC2IS0_iTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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 hidden void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZ5solvevENK3$_1clEv"(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6 align 2

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

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

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 = { nofree nounwind }
attributes #3 = { 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 #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }

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

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


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