; LLVM IR from tangjz/acm-icpc :: codeforces/1500A.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.std::pair" = type { i32, i32 }
%class.anon = type { i8 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE1a = external hidden global [200009 x i32], align 16
@_ZZ5solvevE3ord = external hidden global [200009 x i32], align 16
@_ZZ5solvevE2sp = external hidden global [200009 x i32], align 16
@_ZZ5solvevE3sp2 = external hidden global [200009 x i32], align 16
@_ZZ5solvevE3ans = external hidden global [4 x i32], align 16
@_ZZ5solvevE3vis = external hidden global [5000001 x %"struct.std::pair"], align 16
@_ZGVZ5solvevE3vis = external hidden global i64, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 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 %class.anon, align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %34, %0
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @_ZZ5solvevE1a, i64 %27
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %28)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  br label %34

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

37:                                               ; preds = %24
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr @_ZZ5solvevE3ord, i64 %39
  %41 = getelementptr inbounds i32, ptr %40, i64 1
  call void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef getelementptr inbounds (i32, ptr @_ZZ5solvevE3ord, i64 1), ptr noundef %41)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  br label %42

42:                                               ; preds = %136, %37
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = icmp sle i32 %43, %44
  br i1 %45, label %46, label %49

46:                                               ; preds = %42
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp slt i32 %47, 2
  br label %49

49:                                               ; preds = %46, %42
  %50 = phi i1 [ false, %42 ], [ %48, %46 ]
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %49
  %53 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %53, ptr %7, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %77, %52
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = load i32, ptr %1, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %58, label %74

58:                                               ; preds = %54
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %65, %72
  br label %74

74:                                               ; preds = %58, %54
  %75 = phi i1 [ false, %54 ], [ %73, %58 ]
  br i1 %75, label %76, label %80

76:                                               ; preds = %74
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %7, align 4, !tbaa !5
  br label %54, !llvm.loop !11

80:                                               ; preds = %74
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %85, label %91

85:                                               ; preds = %80
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  br label %92

91:                                               ; preds = %80
  br label %92

92:                                               ; preds = %91, %85
  %93 = phi i32 [ %90, %85 ], [ 0, %91 ]
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3sp2, i64 0, i64 %95
  store i32 %93, ptr %96, align 4, !tbaa !5
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %4, align 4, !tbaa !5
  %103 = sext i32 %101 to i64
  %104 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %103
  store i32 %100, ptr %104, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %133, %92
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = icmp slt i32 %106, 2
  br i1 %107, label %108, label %113

108:                                              ; preds = %105
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br label %113

113:                                              ; preds = %108, %105
  %114 = phi i1 [ false, %105 ], [ %112, %108 ]
  br i1 %114, label %115, label %136

115:                                              ; preds = %113
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %6, align 4, !tbaa !5
  %118 = sext i32 %116 to i64
  %119 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 %122
  store i32 %120, ptr %123, align 4, !tbaa !5
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !5
  %126 = sext i32 %124 to i64
  %127 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = add nsw i32 %129, 2
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 %131
  store i32 %128, ptr %132, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %115
  %134 = load i32, ptr %5, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %5, align 4, !tbaa !5
  br label %105, !llvm.loop !12

136:                                              ; preds = %113
  %137 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %137, ptr %6, align 4, !tbaa !5
  br label %42, !llvm.loop !13

138:                                              ; preds = %51
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = icmp eq i32 %139, 2
  br i1 %140, label %141, label %144

141:                                              ; preds = %138
  %142 = load i32, ptr %5, align 4, !tbaa !5
  %143 = shl i32 %142, 1
  store i32 %143, ptr %5, align 4, !tbaa !5
  br label %317

144:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = shl i32 %151, 1
  store i32 %152, ptr %8, align 4, !tbaa !5
  %153 = load atomic i8, ptr @_ZGVZ5solvevE3vis acquire, align 8
  %154 = icmp eq i8 %153, 0
  br i1 %154, label %155, label %165, !prof !14

155:                                              ; preds = %144
  %156 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ5solvevE3vis) #4
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %165

158:                                              ; preds = %155
  br label %159

159:                                              ; preds = %161, %158
  %160 = phi ptr [ @_ZZ5solvevE3vis, %158 ], [ %162, %161 ]
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %160)
          to label %161 unwind label %179

161:                                              ; preds = %159
  %162 = getelementptr inbounds %"struct.std::pair", ptr %160, i64 1
  %163 = icmp eq ptr %162, getelementptr inbounds (%"struct.std::pair", ptr @_ZZ5solvevE3vis, i64 5000001)
  br i1 %163, label %164, label %159

164:                                              ; preds = %161
  call void @__cxa_guard_release(ptr @_ZGVZ5solvevE3vis) #4
  br label %165

165:                                              ; preds = %164, %155, %144
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = mul i64 %167, 8
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ5solvevE3vis, i8 0, i64 %168, i1 false)
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %254, %165
  %170 = load i32, ptr %5, align 4, !tbaa !5
  %171 = icmp slt i32 %170, 4
  br i1 %171, label %172, label %176

172:                                              ; preds = %169
  %173 = load i32, ptr %11, align 4, !tbaa !5
  %174 = load i32, ptr %4, align 4, !tbaa !5
  %175 = icmp slt i32 %173, %174
  br label %176

176:                                              ; preds = %172, %169
  %177 = phi i1 [ false, %169 ], [ %175, %172 ]
  br i1 %177, label %183, label %178

178:                                              ; preds = %176
  store i32 13, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %257

179:                                              ; preds = %159
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %9, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %10, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZ5solvevE3vis) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %348

183:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %184 = load i32, ptr %11, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %13, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %250, %183
  %187 = load i32, ptr %5, align 4, !tbaa !5
  %188 = icmp slt i32 %187, 4
  br i1 %188, label %189, label %193

189:                                              ; preds = %186
  %190 = load i32, ptr %13, align 4, !tbaa !5
  %191 = load i32, ptr %4, align 4, !tbaa !5
  %192 = icmp slt i32 %190, %191
  br label %193

193:                                              ; preds = %189, %186
  %194 = phi i1 [ false, %186 ], [ %192, %189 ]
  br i1 %194, label %196, label %195

195:                                              ; preds = %193
  store i32 16, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %253

196:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %197 = load i32, ptr %11, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = load i32, ptr %13, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = add nsw i32 %203, %210
  store i32 %211, ptr %14, align 4, !tbaa !5
  %212 = load i32, ptr %14, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %213
  %215 = getelementptr inbounds %"struct.std::pair", ptr %214, i32 0, i32 0
  %216 = load i32, ptr %215, align 8, !tbaa !15
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %230, label %218

218:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %219 = load i32, ptr %11, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %220
  %222 = load i32, ptr %13, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %223
  %225 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %221, ptr noundef nonnull align 4 dereferenceable(4) %224)
  store i64 %225, ptr %15, align 4
  %226 = load i32, ptr %14, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %227
  %229 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %228, ptr noundef nonnull align 4 dereferenceable(8) %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %249

230:                                              ; preds = %196
  store i32 4, ptr %5, align 4, !tbaa !5
  %231 = load i32, ptr %14, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %232
  %234 = getelementptr inbounds %"struct.std::pair", ptr %233, i32 0, i32 0
  %235 = load i32, ptr %234, align 8, !tbaa !15
  store i32 %235, ptr @_ZZ5solvevE3ans, align 16, !tbaa !5
  %236 = load i32, ptr %14, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %237
  %239 = getelementptr inbounds %"struct.std::pair", ptr %238, i32 0, i32 1
  %240 = load i32, ptr %239, align 4, !tbaa !17
  store i32 %240, ptr getelementptr inbounds ([4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 1), align 4, !tbaa !5
  %241 = load i32, ptr %11, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !5
  store i32 %244, ptr getelementptr inbounds ([4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 2), align 8, !tbaa !5
  %245 = load i32, ptr %13, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !5
  store i32 %248, ptr getelementptr inbounds ([4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 3), align 4, !tbaa !5
  br label %249

249:                                              ; preds = %230, %218
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %250

250:                                              ; preds = %249
  %251 = load i32, ptr %13, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %13, align 4, !tbaa !5
  br label %186, !llvm.loop !18

253:                                              ; preds = %195
  br label %254

254:                                              ; preds = %253
  %255 = load i32, ptr %11, align 4, !tbaa !5
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %11, align 4, !tbaa !5
  br label %169, !llvm.loop !19

257:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %258

258:                                              ; preds = %313, %257
  %259 = load i32, ptr %5, align 4, !tbaa !5
  %260 = icmp slt i32 %259, 4
  br i1 %260, label %261, label %265

261:                                              ; preds = %258
  %262 = load i32, ptr %16, align 4, !tbaa !5
  %263 = load i32, ptr %4, align 4, !tbaa !5
  %264 = icmp slt i32 %262, %263
  br label %265

265:                                              ; preds = %261, %258
  %266 = phi i1 [ false, %258 ], [ %264, %261 ]
  br i1 %266, label %268, label %267

267:                                              ; preds = %265
  store i32 19, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %316

268:                                              ; preds = %265
  %269 = load i32, ptr %16, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3sp2, i64 0, i64 %270
  %272 = load i32, ptr %271, align 4, !tbaa !5
  %273 = icmp ne i32 %272, 0
  br i1 %273, label %275, label %274

274:                                              ; preds = %268
  br label %313

275:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %276 = load i32, ptr %16, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %277
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = shl i32 %282, 1
  store i32 %283, ptr %17, align 4, !tbaa !5
  %284 = load i32, ptr %17, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %285
  %287 = getelementptr inbounds %"struct.std::pair", ptr %286, i32 0, i32 0
  %288 = load i32, ptr %287, align 8, !tbaa !15
  %289 = icmp ne i32 %288, 0
  br i1 %289, label %291, label %290

290:                                              ; preds = %275
  store i32 21, ptr %12, align 4
  br label %310

291:                                              ; preds = %275
  store i32 4, ptr %5, align 4, !tbaa !5
  %292 = load i32, ptr %17, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %293
  %295 = getelementptr inbounds %"struct.std::pair", ptr %294, i32 0, i32 0
  %296 = load i32, ptr %295, align 8, !tbaa !15
  store i32 %296, ptr @_ZZ5solvevE3ans, align 16, !tbaa !5
  %297 = load i32, ptr %17, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %298
  %300 = getelementptr inbounds %"struct.std::pair", ptr %299, i32 0, i32 1
  %301 = load i32, ptr %300, align 4, !tbaa !17
  store i32 %301, ptr getelementptr inbounds ([4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 1), align 4, !tbaa !5
  %302 = load i32, ptr %16, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %303
  %305 = load i32, ptr %304, align 4, !tbaa !5
  store i32 %305, ptr getelementptr inbounds ([4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 2), align 8, !tbaa !5
  %306 = load i32, ptr %16, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3sp2, i64 0, i64 %307
  %309 = load i32, ptr %308, align 4, !tbaa !5
  store i32 %309, ptr getelementptr inbounds ([4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 3), align 4, !tbaa !5
  store i32 0, ptr %12, align 4
  br label %310

310:                                              ; preds = %291, %290
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %311 = load i32, ptr %12, align 4
  switch i32 %311, label %353 [
    i32 0, label %312
    i32 21, label %313
  ]

312:                                              ; preds = %310
  br label %313

313:                                              ; preds = %312, %310, %274
  %314 = load i32, ptr %16, align 4, !tbaa !5
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %16, align 4, !tbaa !5
  br label %258, !llvm.loop !20

316:                                              ; preds = %267
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %317

317:                                              ; preds = %316, %141
  %318 = load i32, ptr %5, align 4, !tbaa !5
  %319 = icmp eq i32 %318, 4
  br i1 %319, label %320, label %345

320:                                              ; preds = %317
  %321 = call i32 @puts(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %322

322:                                              ; preds = %341, %320
  %323 = load i32, ptr %18, align 4, !tbaa !5
  %324 = load i32, ptr %5, align 4, !tbaa !5
  %325 = icmp slt i32 %323, %324
  br i1 %325, label %327, label %326

326:                                              ; preds = %322
  store i32 22, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %344

327:                                              ; preds = %322
  %328 = load i32, ptr %18, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 %329
  %331 = load i32, ptr %330, align 4, !tbaa !5
  %332 = load i32, ptr %18, align 4, !tbaa !5
  %333 = load i32, ptr %5, align 4, !tbaa !5
  %334 = sub nsw i32 %333, 1
  %335 = icmp eq i32 %332, %334
  %336 = zext i1 %335 to i64
  %337 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %336
  %338 = load i8, ptr %337, align 1, !tbaa !21
  %339 = sext i8 %338 to i32
  %340 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %331, i32 noundef %339)
  br label %341

341:                                              ; preds = %327
  %342 = load i32, ptr %18, align 4, !tbaa !5
  %343 = add nsw i32 %342, 1
  store i32 %343, ptr %18, align 4, !tbaa !5
  br label %322, !llvm.loop !22

344:                                              ; preds = %326
  br label %347

345:                                              ; preds = %317
  %346 = call i32 @puts(ptr noundef @.str.5)
  br label %347

347:                                              ; preds = %345, %344
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void

348:                                              ; preds = %179
  %349 = load ptr, ptr %9, align 8
  %350 = load i32, ptr %10, align 4
  %351 = insertvalue { ptr, i32 } poison, ptr %349, 0
  %352 = insertvalue { ptr, i32 } %351, i32 %350, 1
  resume { ptr, i32 } %352

353:                                              ; preds = %310
  unreachable
}

; 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: 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 @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; 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: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

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

declare i32 @puts(ptr noundef) #2

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

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

!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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!"branch_weights", i32 1, i32 1048575}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!7, !7, i64 0}
!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.std::pair" = type { i32, i32 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE1a = external hidden global [200009 x i32], align 16
@_ZZ5solvevE3ord = external hidden global [200009 x i32], align 16
@_ZZ5solvevE2sp = external hidden global [200009 x i32], align 16
@_ZZ5solvevE3sp2 = external hidden local_unnamed_addr global [200009 x i32], align 16
@_ZZ5solvevE3ans = external hidden local_unnamed_addr global [4 x i32], align 16
@_ZZ5solvevE3vis = external hidden global [5000001 x %"struct.std::pair"], align 16
@_ZGVZ5solvevE3vis = external hidden global i64, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 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 %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %.not94 = icmp slt i32 %4, 1
  br i1 %.not94, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %4 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %15, %.lr.ph ]
  %5 = getelementptr inbounds i32, ptr @_ZZ5solvevE3ord, i64 %.pre-phi
  %6 = getelementptr inbounds i8, ptr %5, i64 4
  call void @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ord, i64 4), ptr noundef nonnull %6)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader93.preheader, label %._crit_edge105.thread

.preheader93.preheader:                           ; preds = %._crit_edge
  %9 = zext nneg i32 %7 to i64
  br label %.preheader93

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

.loopexit92.loopexit:                             ; preds = %.lr.ph100
  %16 = trunc nsw i64 %indvars.iv.next132 to i32
  br label %.loopexit92

.loopexit92:                                      ; preds = %.thread, %.loopexit92.loopexit, %42
  %.1.lcssa = phi i32 [ %.073103, %42 ], [ %16, %.loopexit92.loopexit ], [ %.073103, %.thread ]
  %indvars.iv.next139159 = add nuw nsw i64 %indvars.iv138, 1
  %17 = icmp sle i32 %.074.lcssa, %7
  %18 = icmp slt i32 %.1.lcssa, 2
  %19 = and i1 %18, %17
  br i1 %19, label %.preheader93, label %._crit_edge105, !llvm.loop !11

.preheader93:                                     ; preds = %.preheader93.preheader, %.loopexit92
  %indvars.iv138 = phi i64 [ 0, %.preheader93.preheader ], [ %indvars.iv.next139159, %.loopexit92 ]
  %.073103 = phi i32 [ 0, %.preheader93.preheader ], [ %.1.lcssa, %.loopexit92 ]
  %.075102 = phi i32 [ 1, %.preheader93.preheader ], [ %.074.lcssa, %.loopexit92 ]
  %20 = sext i32 %.075102 to i64
  %21 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %smax = call i32 @llvm.smax.i32(i32 %.075102, i32 %7)
  %26 = add nuw i32 %smax, 1
  br label %29

._crit_edge105:                                   ; preds = %.loopexit92
  %27 = trunc nuw i64 %indvars.iv.next139159 to i32
  %28 = icmp eq i32 %.1.lcssa, 2
  br i1 %28, label %.critedge89, label %._crit_edge105.thread

29:                                               ; preds = %.preheader93, %36
  %indvars.iv128 = phi i64 [ %20, %.preheader93 ], [ %indvars.iv.next129, %36 ]
  %30 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %indvars.iv128
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp eq i32 %25, %34
  br i1 %35, label %36, label %.critedge.split.loop.exit191

36:                                               ; preds = %29
  %indvars.iv.next129 = add nsw i64 %indvars.iv128, 1
  %.not87.not = icmp slt i64 %indvars.iv128, %9
  br i1 %.not87.not, label %29, label %.critedge, !llvm.loop !12

.critedge.split.loop.exit191:                     ; preds = %29
  %37 = trunc nsw i64 %indvars.iv128 to i32
  br label %.critedge

.critedge:                                        ; preds = %36, %.critedge.split.loop.exit191
  %.074.lcssa = phi i32 [ %37, %.critedge.split.loop.exit191 ], [ %26, %36 ]
  %38 = add nsw i32 %.075102, 1
  %39 = icmp slt i32 %38, %.074.lcssa
  br i1 %39, label %42, label %.thread

.thread:                                          ; preds = %.critedge
  %40 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3sp2, i64 0, i64 %indvars.iv138
  store i32 0, ptr %40, align 4, !tbaa !5
  %41 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %indvars.iv138
  store i32 %22, ptr %41, align 4, !tbaa !5
  br label %.loopexit92

42:                                               ; preds = %.critedge
  %43 = sext i32 %38 to i64
  %44 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3sp2, i64 0, i64 %indvars.iv138
  store i32 %45, ptr %46, align 4, !tbaa !5
  %47 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %indvars.iv138
  store i32 %22, ptr %47, align 4, !tbaa !5
  %48 = icmp slt i32 %.073103, 2
  %49 = and i1 %48, %39
  br i1 %49, label %.lr.ph100.preheader, label %.loopexit92

.lr.ph100.preheader:                              ; preds = %42
  %50 = sext i32 %.073103 to i64
  %51 = sext i32 %.074.lcssa to i64
  br label %.lr.ph100

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %.lr.ph100
  %indvars.iv133 = phi i64 [ %20, %.lr.ph100.preheader ], [ %indvars.iv.next134, %.lr.ph100 ]
  %indvars.iv131 = phi i64 [ %50, %.lr.ph100.preheader ], [ %indvars.iv.next132, %.lr.ph100 ]
  %52 = phi i32 [ %38, %.lr.ph100.preheader ], [ %65, %.lr.ph100 ]
  %53 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %indvars.iv133
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = getelementptr inbounds [4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 %indvars.iv131
  store i32 %54, ptr %55, align 4, !tbaa !5
  %indvars.iv.next134 = add nsw i64 %indvars.iv133, 2
  %56 = sext i32 %52 to i64
  %57 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3ord, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i64 %indvars.iv131, 2
  %60 = getelementptr inbounds [4 x i32], ptr @_ZZ5solvevE3ans, i64 0, i64 %59
  store i32 %58, ptr %60, align 4, !tbaa !5
  %indvars.iv.next132 = add nsw i64 %indvars.iv131, 1
  %61 = icmp slt i64 %indvars.iv131, 1
  %62 = add nsw i64 %indvars.iv133, 3
  %63 = icmp slt i64 %62, %51
  %64 = select i1 %61, i1 %63, i1 false
  %65 = trunc nsw i64 %62 to i32
  br i1 %64, label %.lr.ph100, label %.loopexit92.loopexit, !llvm.loop !13

._crit_edge105.thread:                            ; preds = %._crit_edge, %._crit_edge105
  %.070.lcssa157 = phi i32 [ %27, %._crit_edge105 ], [ 0, %._crit_edge ]
  %66 = zext i32 %.070.lcssa157 to i64
  %67 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = shl i32 %71, 1
  %73 = load atomic i8, ptr @_ZGVZ5solvevE3vis acquire, align 8
  %74 = icmp eq i8 %73, 0
  br i1 %74, label %75, label %79, !prof !14

75:                                               ; preds = %._crit_edge105.thread
  %76 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ5solvevE3vis) #8
  %.not82 = icmp eq i32 %76, 0
  br i1 %.not82, label %79, label %.preheader91

.preheader91:                                     ; preds = %75, %.preheader91
  %.idx = phi i64 [ %.add, %.preheader91 ], [ 0, %75 ]
  %.ptr = getelementptr inbounds i8, ptr @_ZZ5solvevE3vis, i64 %.idx
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %.ptr)
  %.add = add nuw nsw i64 %.idx, 8
  %77 = icmp eq i64 %.add, 40000008
  br i1 %77, label %78, label %.preheader91

78:                                               ; preds = %.preheader91
  call void @__cxa_guard_release(ptr nonnull @_ZGVZ5solvevE3vis) #8
  br label %79

79:                                               ; preds = %78, %75, %._crit_edge105.thread
  %80 = sext i32 %72 to i64
  %81 = shl nsw i64 %80, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ5solvevE3vis, i8 0, i64 %81, i1 false)
  %.not = icmp eq i32 %.070.lcssa157, 0
  br i1 %.not, label %._crit_edge121.thread, label %.lr.ph116

.loopexit90:                                      ; preds = %98
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  br i1 %82, label %.lr.ph116, label %.lr.ph120.preheader, !llvm.loop !15

.lr.ph120.preheader:                              ; preds = %.lr.ph116, %.loopexit90
  br label %.lr.ph120

.lr.ph116:                                        ; preds = %79, %.loopexit90
  %indvars.iv146 = phi i64 [ %indvars.iv.next147, %.loopexit90 ], [ 0, %79 ]
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %.loopexit90 ], [ 1, %79 ]
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %82 = icmp ult i64 %indvars.iv.next147, %66
  br i1 %82, label %.lr.ph111, label %.lr.ph120.preheader

.lr.ph111:                                        ; preds = %.lr.ph116
  %83 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %indvars.iv146
  br label %84

84:                                               ; preds = %.lr.ph111, %98
  %indvars.iv143 = phi i64 [ %indvars.iv141, %.lr.ph111 ], [ %indvars.iv.next144, %98 ]
  %85 = load i32, ptr %83, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %indvars.iv143
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, %88
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %95
  %97 = load i32, ptr %96, align 8, !tbaa !16
  %.not86 = icmp eq i32 %97, 0
  br i1 %.not86, label %98, label %.critedge89.sink.split

98:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %99 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %83, ptr noundef nonnull align 4 dereferenceable(4) %89)
  store i64 %99, ptr %2, align 8
  %100 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %96, ptr noundef nonnull align 4 dereferenceable(8) %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %101 = icmp ult i64 %indvars.iv.next144, %66
  br i1 %101, label %84, label %.loopexit90, !llvm.loop !18

.lr.ph120:                                        ; preds = %.lr.ph120.preheader, %114
  %indvars.iv149 = phi i64 [ %indvars.iv.next150, %114 ], [ 0, %.lr.ph120.preheader ]
  %102 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE3sp2, i64 0, i64 %indvars.iv149
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %.not84 = icmp eq i32 %103, 0
  br i1 %.not84, label %114, label %104

104:                                              ; preds = %.lr.ph120
  %105 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE2sp, i64 0, i64 %indvars.iv149
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [200009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = shl i32 %109, 1
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %111
  %113 = load i32, ptr %112, align 16, !tbaa !16
  %.not85 = icmp eq i32 %113, 0
  br i1 %.not85, label %114, label %.critedge89.sink.split

114:                                              ; preds = %104, %.lr.ph120
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %115 = icmp ult i64 %indvars.iv.next150, %66
  br i1 %115, label %.lr.ph120, label %._crit_edge121.thread, !llvm.loop !19

.critedge89.sink.split:                           ; preds = %84, %104
  %.lcssa182.sink = phi i32 [ %113, %104 ], [ %97, %84 ]
  %116 = phi i64 [ %111, %104 ], [ %95, %84 ]
  %.lcssa188.sink = phi i32 [ %106, %104 ], [ %85, %84 ]
  %.lcssa186.sink = phi i32 [ %103, %104 ], [ %90, %84 ]
  store i32 %.lcssa182.sink, ptr @_ZZ5solvevE3ans, align 16, !tbaa !5
  %117 = getelementptr inbounds [5000001 x %"struct.std::pair"], ptr @_ZZ5solvevE3vis, i64 0, i64 %116, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !20
  store i32 %118, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ans, i64 4), align 4, !tbaa !5
  store i32 %.lcssa188.sink, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ans, i64 8), align 8, !tbaa !5
  store i32 %.lcssa186.sink, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ans, i64 12), align 4, !tbaa !5
  br label %.critedge89

.critedge89:                                      ; preds = %.critedge89.sink.split, %._crit_edge105
  %119 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  %120 = load i32, ptr @_ZZ5solvevE3ans, align 16, !tbaa !5
  %121 = load i8, ptr @.str.4, align 1, !tbaa !21
  %122 = sext i8 %121 to i32
  %123 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %120, i32 noundef %122)
  %124 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ans, i64 4), align 4, !tbaa !5
  %125 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %124, i32 noundef %122)
  %126 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ans, i64 8), align 8, !tbaa !5
  %127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %126, i32 noundef %122)
  %128 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ans, i64 12), align 4, !tbaa !5
  %129 = load i8, ptr getelementptr inbounds (i8, ptr @.str.4, i64 1), align 1, !tbaa !21
  %130 = sext i8 %129 to i32
  %131 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %128, i32 noundef %130)
  br label %.loopexit

._crit_edge121.thread:                            ; preds = %114, %79
  %132 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %.loopexit

.loopexit:                                        ; preds = %.critedge89, %._crit_edge121.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret void
}

; 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 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 @"_ZSt4sortIPiZ5solvevE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

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

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

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

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


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