; LLVM IR from eyangch/competitive-programming :: USACOcontests/silver/2014.01 (ccski)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@dx = external dso_local global [4 x i32], align 16
@dy = external dso_local global [4 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #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 i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"class.std::priority_queue", align 8
  %28 = alloca i64, align 8
  %29 = alloca i8, align 1
  %30 = alloca %"struct.std::pair", align 4
  %31 = alloca i32, align 4
  %32 = alloca %"struct.std::pair", align 4
  %33 = alloca ptr, align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca %"struct.std::pair", align 4
  %37 = alloca %"struct.std::pair", align 4
  store i32 0, ptr %1, align 4
  %38 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %39 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %40 = getelementptr i8, ptr %39, i64 -24
  %41 = load i64, ptr %40, align 8
  %42 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %41
  %43 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %42, ptr noundef null)
  %44 = load ptr, ptr @stdin, align 8, !tbaa !8
  %45 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %44)
  %46 = load ptr, ptr @stdout, align 8, !tbaa !8
  %47 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %46)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #10
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %50 = load i32, ptr %3, align 4, !tbaa !11
  %51 = load i32, ptr %2, align 4, !tbaa !11
  %52 = mul nsw i32 %50, %51
  %53 = zext i32 %52 to i64
  %54 = call ptr @llvm.stacksave.p0()
  store ptr %54, ptr %4, align 8
  %55 = alloca %"class.std::vector", i64 %53, align 16
  store i64 %53, ptr %5, align 8
  %56 = icmp eq i64 %53, 0
  br i1 %56, label %63, label %57

57:                                               ; preds = %0
  %58 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %53
  br label %59

59:                                               ; preds = %59, %57
  %60 = phi ptr [ %55, %57 ], [ %61, %59 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %60) #10
  %61 = getelementptr inbounds %"class.std::vector", ptr %60, i64 1
  %62 = icmp eq ptr %61, %58
  br i1 %62, label %63, label %59

63:                                               ; preds = %59, %0
  %64 = load i32, ptr %2, align 4, !tbaa !11
  %65 = zext i32 %64 to i64
  %66 = load i32, ptr %3, align 4, !tbaa !11
  %67 = zext i32 %66 to i64
  %68 = mul nuw i64 %65, %67
  %69 = alloca i32, i64 %68, align 16
  store i64 %65, ptr %6, align 8
  store i64 %67, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %70

70:                                               ; preds = %99, %63
  %71 = load i32, ptr %8, align 4, !tbaa !11
  %72 = load i32, ptr %2, align 4, !tbaa !11
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

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

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %76

76:                                               ; preds = %91, %75
  %77 = load i32, ptr %10, align 4, !tbaa !11
  %78 = load i32, ptr %3, align 4, !tbaa !11
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  br label %98

81:                                               ; preds = %76
  %82 = load i32, ptr %8, align 4, !tbaa !11
  %83 = sext i32 %82 to i64
  %84 = mul nsw i64 %83, %67
  %85 = getelementptr inbounds i32, ptr %69, i64 %84
  %86 = load i32, ptr %10, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %85, i64 %87
  %89 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %88)
          to label %90 unwind label %94

90:                                               ; preds = %81
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %10, align 4, !tbaa !11
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %10, align 4, !tbaa !11
  br label %76, !llvm.loop !13

94:                                               ; preds = %81
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %11, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  br label %386

98:                                               ; preds = %80
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %8, align 4, !tbaa !11
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %8, align 4, !tbaa !11
  br label %70, !llvm.loop !15

102:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %194, %102
  %104 = load i32, ptr %13, align 4, !tbaa !11
  %105 = load i32, ptr %2, align 4, !tbaa !11
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %197

108:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %109

109:                                              ; preds = %190, %108
  %110 = load i32, ptr %14, align 4, !tbaa !11
  %111 = load i32, ptr %3, align 4, !tbaa !11
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  br label %193

114:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #10
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %115

115:                                              ; preds = %182, %114
  %116 = load i32, ptr %15, align 4, !tbaa !11
  %117 = icmp slt i32 %116, 4
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  br label %189

119:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  %120 = load i32, ptr %13, align 4, !tbaa !11
  %121 = load i32, ptr %15, align 4, !tbaa !11
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !11
  %125 = add nsw i32 %120, %124
  store i32 %125, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  %126 = load i32, ptr %14, align 4, !tbaa !11
  %127 = load i32, ptr %15, align 4, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !11
  %131 = add nsw i32 %126, %130
  store i32 %131, ptr %17, align 4, !tbaa !11
  %132 = load i32, ptr %16, align 4, !tbaa !11
  %133 = icmp slt i32 %132, 0
  br i1 %133, label %145, label %134

134:                                              ; preds = %119
  %135 = load i32, ptr %16, align 4, !tbaa !11
  %136 = load i32, ptr %2, align 4, !tbaa !11
  %137 = icmp sge i32 %135, %136
  br i1 %137, label %145, label %138

138:                                              ; preds = %134
  %139 = load i32, ptr %17, align 4, !tbaa !11
  %140 = icmp slt i32 %139, 0
  br i1 %140, label %145, label %141

141:                                              ; preds = %138
  %142 = load i32, ptr %17, align 4, !tbaa !11
  %143 = load i32, ptr %3, align 4, !tbaa !11
  %144 = icmp sge i32 %142, %143
  br i1 %144, label %145, label %146

145:                                              ; preds = %141, %138, %134, %119
  store i32 16, ptr %9, align 4
  br label %179

146:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  %147 = load i32, ptr %13, align 4, !tbaa !11
  %148 = sext i32 %147 to i64
  %149 = mul nsw i64 %148, %67
  %150 = getelementptr inbounds i32, ptr %69, i64 %149
  %151 = load i32, ptr %14, align 4, !tbaa !11
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds i32, ptr %150, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !11
  %155 = load i32, ptr %16, align 4, !tbaa !11
  %156 = sext i32 %155 to i64
  %157 = mul nsw i64 %156, %67
  %158 = getelementptr inbounds i32, ptr %69, i64 %157
  %159 = load i32, ptr %17, align 4, !tbaa !11
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds i32, ptr %158, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = sub nsw i32 %154, %162
  %164 = call i32 @llvm.abs.i32(i32 %163, i1 true)
  store i32 %164, ptr %18, align 4, !tbaa !11
  %165 = load i32, ptr %3, align 4, !tbaa !11
  %166 = load i32, ptr %13, align 4, !tbaa !11
  %167 = mul nsw i32 %165, %166
  %168 = load i32, ptr %14, align 4, !tbaa !11
  %169 = add nsw i32 %167, %168
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  %172 = load i32, ptr %3, align 4, !tbaa !11
  %173 = load i32, ptr %16, align 4, !tbaa !11
  %174 = mul nsw i32 %172, %173
  %175 = load i32, ptr %17, align 4, !tbaa !11
  %176 = add nsw i32 %174, %175
  store i32 %176, ptr %20, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %177 unwind label %185

177:                                              ; preds = %146
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %171, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %178 unwind label %185

178:                                              ; preds = %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  store i32 0, ptr %9, align 4
  br label %179

179:                                              ; preds = %178, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  %180 = load i32, ptr %9, align 4
  switch i32 %180, label %399 [
    i32 0, label %181
    i32 16, label %182
  ]

181:                                              ; preds = %179
  br label %182

182:                                              ; preds = %181, %179
  %183 = load i32, ptr %15, align 4, !tbaa !11
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %15, align 4, !tbaa !11
  br label %115, !llvm.loop !16

185:                                              ; preds = %177, %146
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %11, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %386

189:                                              ; preds = %118
  br label %190

190:                                              ; preds = %189
  %191 = load i32, ptr %14, align 4, !tbaa !11
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %14, align 4, !tbaa !11
  br label %109, !llvm.loop !17

193:                                              ; preds = %113
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %13, align 4, !tbaa !11
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %13, align 4, !tbaa !11
  br label %103, !llvm.loop !18

197:                                              ; preds = %107
  %198 = load i32, ptr %3, align 4, !tbaa !11
  %199 = load i32, ptr %2, align 4, !tbaa !11
  %200 = mul nsw i32 %198, %199
  %201 = zext i32 %200 to i64
  %202 = alloca i8, i64 %201, align 16
  store i64 %201, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #10
  store i32 0, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %203

203:                                              ; preds = %245, %197
  %204 = load i32, ptr %23, align 4, !tbaa !11
  %205 = load i32, ptr %2, align 4, !tbaa !11
  %206 = icmp slt i32 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %248

208:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #10
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %209

209:                                              ; preds = %241, %208
  %210 = load i32, ptr %24, align 4, !tbaa !11
  %211 = load i32, ptr %3, align 4, !tbaa !11
  %212 = icmp slt i32 %210, %211
  br i1 %212, label %214, label %213

213:                                              ; preds = %209
  store i32 20, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  br label %244

214:                                              ; preds = %209
  %215 = load i32, ptr %23, align 4, !tbaa !11
  %216 = load i32, ptr %3, align 4, !tbaa !11
  %217 = mul nsw i32 %215, %216
  %218 = load i32, ptr %24, align 4, !tbaa !11
  %219 = add nsw i32 %217, %218
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds i8, ptr %202, i64 %220
  %222 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %221)
          to label %223 unwind label %236

223:                                              ; preds = %214
  %224 = load i32, ptr %23, align 4, !tbaa !11
  %225 = load i32, ptr %3, align 4, !tbaa !11
  %226 = mul nsw i32 %224, %225
  %227 = load i32, ptr %24, align 4, !tbaa !11
  %228 = add nsw i32 %226, %227
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds i8, ptr %202, i64 %229
  %231 = load i8, ptr %230, align 1, !tbaa !19, !range !21, !noundef !22
  %232 = trunc i8 %231 to i1
  br i1 %232, label %233, label %240

233:                                              ; preds = %223
  %234 = load i32, ptr %22, align 4, !tbaa !11
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %22, align 4, !tbaa !11
  br label %240

236:                                              ; preds = %214
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %11, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %378

240:                                              ; preds = %233, %223
  br label %241

241:                                              ; preds = %240
  %242 = load i32, ptr %24, align 4, !tbaa !11
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %24, align 4, !tbaa !11
  br label %209, !llvm.loop !23

244:                                              ; preds = %213
  br label %245

245:                                              ; preds = %244
  %246 = load i32, ptr %23, align 4, !tbaa !11
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %23, align 4, !tbaa !11
  br label %203, !llvm.loop !24

248:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %249

249:                                              ; preds = %263, %248
  %250 = load i32, ptr %25, align 4, !tbaa !11
  %251 = load i32, ptr %3, align 4, !tbaa !11
  %252 = load i32, ptr %2, align 4, !tbaa !11
  %253 = mul nsw i32 %251, %252
  %254 = icmp slt i32 %250, %253
  br i1 %254, label %255, label %266

255:                                              ; preds = %249
  %256 = load i32, ptr %25, align 4, !tbaa !11
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds i8, ptr %202, i64 %257
  %259 = load i8, ptr %258, align 1, !tbaa !19, !range !21, !noundef !22
  %260 = trunc i8 %259 to i1
  br i1 %260, label %261, label %262

261:                                              ; preds = %255
  br label %266

262:                                              ; preds = %255
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %25, align 4, !tbaa !11
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %25, align 4, !tbaa !11
  br label %249, !llvm.loop !25

266:                                              ; preds = %261, %249
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #10
  store i32 0, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #10
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %27)
          to label %267 unwind label %296

267:                                              ; preds = %266
  %268 = load i32, ptr %3, align 4, !tbaa !11
  %269 = load i32, ptr %2, align 4, !tbaa !11
  %270 = mul nsw i32 %268, %269
  %271 = zext i32 %270 to i64
  %272 = alloca i8, i64 %271, align 16
  store i64 %271, ptr %28, align 8
  %273 = load i32, ptr %3, align 4, !tbaa !11
  %274 = load i32, ptr %2, align 4, !tbaa !11
  %275 = mul nsw i32 %273, %274
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds i8, ptr %272, i64 %276
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #10
  store i8 0, ptr %29, align 1, !tbaa !19
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef %272, ptr noundef %277, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %278 unwind label %300

278:                                              ; preds = %267
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #10
  store i32 0, ptr %31, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %279 unwind label %304

279:                                              ; preds = %278
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %27, ptr noundef nonnull align 4 dereferenceable(8) %30)
          to label %280 unwind label %304

280:                                              ; preds = %279
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  br label %281

281:                                              ; preds = %366, %364, %280
  %282 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %27)
          to label %283 unwind label %308

283:                                              ; preds = %281
  %284 = xor i1 %282, true
  br i1 %284, label %285, label %368

285:                                              ; preds = %283
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #10
  %286 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %27)
          to label %287 unwind label %312

287:                                              ; preds = %285
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %286, i64 8, i1 false)
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %27)
          to label %288 unwind label %312

288:                                              ; preds = %287
  %289 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 1
  %290 = load i32, ptr %289, align 4, !tbaa !26
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds i8, ptr %272, i64 %291
  %293 = load i8, ptr %292, align 1, !tbaa !19, !range !21, !noundef !22
  %294 = trunc i8 %293 to i1
  br i1 %294, label %295, label %316

295:                                              ; preds = %288
  store i32 26, ptr %9, align 4
  br label %364, !llvm.loop !28

296:                                              ; preds = %266
  %297 = landingpad { ptr, i32 }
          cleanup
  %298 = extractvalue { ptr, i32 } %297, 0
  store ptr %298, ptr %11, align 8
  %299 = extractvalue { ptr, i32 } %297, 1
  store i32 %299, ptr %12, align 4
  br label %377

300:                                              ; preds = %267
  %301 = landingpad { ptr, i32 }
          cleanup
  %302 = extractvalue { ptr, i32 } %301, 0
  store ptr %302, ptr %11, align 8
  %303 = extractvalue { ptr, i32 } %301, 1
  store i32 %303, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #10
  br label %376

304:                                              ; preds = %279, %278
  %305 = landingpad { ptr, i32 }
          cleanup
  %306 = extractvalue { ptr, i32 } %305, 0
  store ptr %306, ptr %11, align 8
  %307 = extractvalue { ptr, i32 } %305, 1
  store i32 %307, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  br label %376

308:                                              ; preds = %371, %368, %281
  %309 = landingpad { ptr, i32 }
          cleanup
  %310 = extractvalue { ptr, i32 } %309, 0
  store ptr %310, ptr %11, align 8
  %311 = extractvalue { ptr, i32 } %309, 1
  store i32 %311, ptr %12, align 4
  br label %376

312:                                              ; preds = %316, %287, %285
  %313 = landingpad { ptr, i32 }
          cleanup
  %314 = extractvalue { ptr, i32 } %313, 0
  store ptr %314, ptr %11, align 8
  %315 = extractvalue { ptr, i32 } %313, 1
  store i32 %315, ptr %12, align 4
  br label %367

316:                                              ; preds = %288
  %317 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 1
  %318 = load i32, ptr %317, align 4, !tbaa !26
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds i8, ptr %272, i64 %319
  store i8 1, ptr %320, align 1, !tbaa !19
  %321 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 0
  %322 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %321)
          to label %323 unwind label %312

323:                                              ; preds = %316
  %324 = load i32, ptr %322, align 4, !tbaa !11
  store i32 %324, ptr %26, align 4, !tbaa !11
  %325 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 1
  %326 = load i32, ptr %325, align 4, !tbaa !26
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds i8, ptr %202, i64 %327
  %329 = load i8, ptr %328, align 1, !tbaa !19, !range !21, !noundef !22
  %330 = trunc i8 %329 to i1
  %331 = zext i1 %330 to i32
  %332 = load i32, ptr %22, align 4, !tbaa !11
  %333 = sub nsw i32 %332, %331
  store i32 %333, ptr %22, align 4, !tbaa !11
  %334 = load i32, ptr %22, align 4, !tbaa !11
  %335 = icmp ne i32 %334, 0
  br i1 %335, label %337, label %336

336:                                              ; preds = %323
  store i32 27, ptr %9, align 4
  br label %364

337:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #10
  %338 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 1
  %339 = load i32, ptr %338, align 4, !tbaa !26
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %340
  store ptr %341, ptr %33, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #10
  %342 = load ptr, ptr %33, align 8, !tbaa !8
  %343 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %342) #10
  %344 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %343, ptr %344, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #10
  %345 = load ptr, ptr %33, align 8, !tbaa !8
  %346 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %345) #10
  %347 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %346, ptr %347, align 8
  br label %348

348:                                              ; preds = %357, %337
  %349 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #10
  br i1 %349, label %351, label %350

350:                                              ; preds = %348
  store i32 28, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  br label %363

351:                                              ; preds = %348
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #10
  %352 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 4 %352, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #10
  %353 = getelementptr inbounds %"struct.std::pair", ptr %36, i32 0, i32 1
  %354 = getelementptr inbounds %"struct.std::pair", ptr %36, i32 0, i32 0
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(4) %353, ptr noundef nonnull align 4 dereferenceable(4) %354)
          to label %355 unwind label %359

355:                                              ; preds = %351
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %27, ptr noundef nonnull align 4 dereferenceable(8) %37)
          to label %356 unwind label %359

356:                                              ; preds = %355
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #10
  br label %357

357:                                              ; preds = %356
  %358 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #10
  br label %348

359:                                              ; preds = %355, %351
  %360 = landingpad { ptr, i32 }
          cleanup
  %361 = extractvalue { ptr, i32 } %360, 0
  store ptr %361, ptr %11, align 8
  %362 = extractvalue { ptr, i32 } %360, 1
  store i32 %362, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  br label %367

363:                                              ; preds = %350
  store i32 0, ptr %9, align 4
  br label %364

364:                                              ; preds = %363, %336, %295
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #10
  %365 = load i32, ptr %9, align 4
  switch i32 %365, label %399 [
    i32 0, label %366
    i32 26, label %281
    i32 27, label %368
  ]

366:                                              ; preds = %364
  br label %281, !llvm.loop !28

367:                                              ; preds = %359, %312
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #10
  br label %376

368:                                              ; preds = %364, %283
  %369 = load i32, ptr %26, align 4, !tbaa !11
  %370 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %369)
          to label %371 unwind label %308

371:                                              ; preds = %368
  %372 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %370, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %373 unwind label %308

373:                                              ; preds = %371
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %27) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  %374 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %53
  %375 = icmp eq ptr %55, %374
  br i1 %375, label %383, label %379

376:                                              ; preds = %367, %308, %304, %300
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %27) #10
  br label %377

377:                                              ; preds = %376, %296
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  br label %378

378:                                              ; preds = %377, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  br label %386

379:                                              ; preds = %379, %373
  %380 = phi ptr [ %374, %373 ], [ %381, %379 ]
  %381 = getelementptr inbounds %"class.std::vector", ptr %380, i64 -1
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %381) #10
  %382 = icmp eq ptr %381, %55
  br i1 %382, label %383, label %379

383:                                              ; preds = %379, %373
  %384 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %384)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  %385 = load i32, ptr %1, align 4
  ret i32 %385

386:                                              ; preds = %378, %185, %94
  %387 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %53
  %388 = icmp eq ptr %55, %387
  br i1 %388, label %393, label %389

389:                                              ; preds = %389, %386
  %390 = phi ptr [ %387, %386 ], [ %391, %389 ]
  %391 = getelementptr inbounds %"class.std::vector", ptr %390, i64 -1
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %391) #10
  %392 = icmp eq ptr %391, %55
  br i1 %392, label %393, label %389

393:                                              ; preds = %389, %386
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  br label %394

394:                                              ; preds = %393
  %395 = load ptr, ptr %11, align 8
  %396 = load i32, ptr %12, align 4
  %397 = insertvalue { ptr, i32 } poison, ptr %395, 0
  %398 = insertvalue { ptr, i32 } %397, i32 %396, 1
  resume { ptr, i32 } %398

399:                                              ; preds = %364, %179
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #6 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #9

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #9 align 2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { 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 #10 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !10, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = !{!27, !12, i64 4}
!27 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!28 = distinct !{!28, !14}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@dx = external dso_local local_unnamed_addr global [4 x i32], align 16
@dy = external dso_local local_unnamed_addr global [4 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() 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 %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::priority_queue", align 8
  %9 = alloca i8, align 1
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca %"struct.std::pair", align 4
  %17 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = load ptr, ptr @stdin, align 8, !tbaa !8
  %24 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %23)
  %25 = load ptr, ptr @stdout, align 8, !tbaa !8
  %26 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %29 = load i32, ptr %2, align 4, !tbaa !11
  %30 = load i32, ptr %1, align 4, !tbaa !11
  %31 = mul nsw i32 %30, %29
  %32 = zext i32 %31 to i64
  %33 = call ptr @llvm.stacksave.p0()
  %34 = alloca %"class.std::vector", i64 %32, align 16
  %35 = icmp eq i32 %31, 0
  br i1 %35, label %.loopexit96, label %36

36:                                               ; preds = %0
  %37 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %32
  br label %38

38:                                               ; preds = %38, %36
  %39 = phi ptr [ %34, %36 ], [ %40, %38 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %39) #9
  %40 = getelementptr inbounds i8, ptr %39, i64 24
  %41 = icmp eq ptr %40, %37
  br i1 %41, label %.loopexit96, label %38

.loopexit96:                                      ; preds = %38, %0
  %42 = load i32, ptr %1, align 4, !tbaa !11
  %43 = zext i32 %42 to i64
  %44 = load i32, ptr %2, align 4
  %45 = zext i32 %44 to i64
  %46 = mul nuw i64 %45, %43
  %47 = alloca i32, i64 %46, align 16
  %48 = icmp sgt i32 %42, 0
  br i1 %48, label %.preheader95.lr.ph, label %._crit_edge108.thread177

.preheader95.lr.ph:                               ; preds = %.loopexit96
  %49 = icmp sgt i32 %44, 0
  br i1 %49, label %.preheader95, label %._crit_edge116.thread

.preheader95:                                     ; preds = %.preheader95.lr.ph, %._crit_edge
  %50 = phi i32 [ %57, %._crit_edge ], [ %42, %.preheader95.lr.ph ]
  %51 = phi i32 [ %58, %._crit_edge ], [ %44, %.preheader95.lr.ph ]
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %._crit_edge ], [ 0, %.preheader95.lr.ph ]
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader95
  %53 = mul nuw nsw i64 %indvars.iv140, %45
  %54 = getelementptr inbounds i32, ptr %47, i64 %53
  br label %61

.preheader94:                                     ; preds = %._crit_edge
  %55 = icmp sgt i32 %57, 0
  br i1 %55, label %.preheader93.lr.ph, label %._crit_edge108.thread177

.preheader93.lr.ph:                               ; preds = %.preheader94
  %56 = icmp sgt i32 %58, 0
  br i1 %56, label %.preheader93, label %._crit_edge116.thread

._crit_edge.loopexit:                             ; preds = %64
  %.pre = load i32, ptr %1, align 4, !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader95
  %57 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %50, %.preheader95 ]
  %58 = phi i32 [ %65, %._crit_edge.loopexit ], [ %51, %.preheader95 ]
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %59 = sext i32 %57 to i64
  %60 = icmp slt i64 %indvars.iv.next141, %59
  br i1 %60, label %.preheader95, label %.preheader94, !llvm.loop !13

61:                                               ; preds = %.lr.ph, %64
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %64 ]
  %62 = getelementptr inbounds i32, ptr %54, i64 %indvars.iv
  %63 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %62)
          to label %64 unwind label %68

64:                                               ; preds = %61
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %65 = load i32, ptr %2, align 4
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next, %66
  br i1 %67, label %61, label %._crit_edge.loopexit, !llvm.loop !16

68:                                               ; preds = %61
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %303

.preheader93:                                     ; preds = %.preheader93.lr.ph, %._crit_edge106
  %.pre156.pre160.pre162164 = phi i32 [ %.pre156.pre160.pre162165, %._crit_edge106 ], [ %58, %.preheader93.lr.ph ]
  %70 = phi i32 [ %95, %._crit_edge106 ], [ %57, %.preheader93.lr.ph ]
  %71 = phi i32 [ %96, %._crit_edge106 ], [ %58, %.preheader93.lr.ph ]
  %indvars.iv149 = phi i64 [ %indvars.iv.next150, %._crit_edge106 ], [ 0, %.preheader93.lr.ph ]
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.preheader92.lr.ph, label %._crit_edge106

.preheader92.lr.ph:                               ; preds = %.preheader93
  %73 = mul nuw nsw i64 %indvars.iv149, %45
  %74 = getelementptr inbounds i32, ptr %47, i64 %73
  %75 = trunc nuw nsw i64 %indvars.iv149 to i32
  br label %.preheader92

._crit_edge116.thread:                            ; preds = %.preheader93.lr.ph, %.preheader95.lr.ph
  %.ph = phi i32 [ %58, %.preheader93.lr.ph ], [ %44, %.preheader95.lr.ph ]
  %.ph173 = phi i32 [ %57, %.preheader93.lr.ph ], [ %42, %.preheader95.lr.ph ]
  %76 = mul nsw i32 %.ph, %.ph173
  %77 = zext i32 %76 to i64
  %78 = alloca i8, i64 %77, align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  br label %._crit_edge124

._crit_edge108.thread177:                         ; preds = %.preheader94, %.loopexit96
  %.ph175 = phi i32 [ %58, %.preheader94 ], [ %44, %.loopexit96 ]
  %.ph176 = phi i32 [ %57, %.preheader94 ], [ %42, %.loopexit96 ]
  %79 = mul nsw i32 %.ph175, %.ph176
  %80 = zext i32 %79 to i64
  %81 = alloca i8, i64 %80, align 16
  br label %._crit_edge116

._crit_edge108:                                   ; preds = %._crit_edge106
  %82 = mul nsw i32 %96, %95
  %83 = zext i32 %82 to i64
  %84 = alloca i8, i64 %83, align 16
  %85 = icmp sgt i32 %95, 0
  %86 = icmp sgt i32 %96, 0
  %or.cond = and i1 %85, %86
  br i1 %or.cond, label %.preheader91, label %._crit_edge116

.preheader92:                                     ; preds = %.preheader92.lr.ph, %202
  %.pre156.pre160.pre162166 = phi i32 [ %.pre156.pre160.pre162164, %.preheader92.lr.ph ], [ %.pre156.pre160.pre162167, %202 ]
  %87 = phi i32 [ %71, %.preheader92.lr.ph ], [ %.pre156.pre160.pre162167, %202 ]
  %indvars.iv146 = phi i64 [ 0, %.preheader92.lr.ph ], [ %indvars.iv.next147, %202 ]
  %88 = getelementptr inbounds i32, ptr %74, i64 %indvars.iv146
  %89 = load i32, ptr @dx, align 16, !tbaa !11
  %90 = add nsw i32 %89, %75
  %91 = load i32, ptr @dy, align 16, !tbaa !11
  %92 = trunc nuw nsw i64 %indvars.iv146 to i32
  %93 = add nsw i32 %91, %92
  %94 = icmp slt i32 %90, 0
  br i1 %94, label %121, label %99

._crit_edge106.loopexit:                          ; preds = %202
  %.pre157 = load i32, ptr %1, align 4, !tbaa !11
  br label %._crit_edge106

._crit_edge106:                                   ; preds = %._crit_edge106.loopexit, %.preheader93
  %.pre156.pre160.pre162165 = phi i32 [ %.pre156.pre160.pre162167, %._crit_edge106.loopexit ], [ %.pre156.pre160.pre162164, %.preheader93 ]
  %95 = phi i32 [ %.pre157, %._crit_edge106.loopexit ], [ %70, %.preheader93 ]
  %96 = phi i32 [ %.pre156.pre160.pre162167, %._crit_edge106.loopexit ], [ %71, %.preheader93 ]
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %97 = sext i32 %95 to i64
  %98 = icmp slt i64 %indvars.iv.next150, %97
  br i1 %98, label %.preheader93, label %._crit_edge108, !llvm.loop !17

99:                                               ; preds = %.preheader92
  %100 = load i32, ptr %1, align 4, !tbaa !11
  %101 = icmp slt i32 %90, %100
  %102 = icmp sgt i32 %93, -1
  %.not77 = icmp slt i32 %93, %87
  %103 = and i1 %102, %.not77
  %or.cond80 = select i1 %101, i1 %103, i1 false
  br i1 %or.cond80, label %104, label %121

104:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %105 = load i32, ptr %88, align 4, !tbaa !11
  %106 = zext nneg i32 %90 to i64
  %107 = mul nuw nsw i64 %106, %45
  %108 = getelementptr inbounds i32, ptr %47, i64 %107
  %109 = zext nneg i32 %93 to i64
  %110 = getelementptr inbounds i32, ptr %108, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !11
  %112 = sub nsw i32 %105, %111
  %113 = call i32 @llvm.abs.i32(i32 %112, i1 true)
  store i32 %113, ptr %3, align 4, !tbaa !11
  %114 = mul nsw i32 %87, %75
  %115 = add nsw i32 %114, %92
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %116
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %118 = mul nsw i32 %87, %90
  %119 = add nsw i32 %118, %93
  store i32 %119, ptr %5, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %117, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %120 unwind label %205

120:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %.pre156.pre160.pre162.pre = load i32, ptr %2, align 4
  br label %121

121:                                              ; preds = %.preheader92, %99, %120
  %.pre156.pre160.pre162 = phi i32 [ %.pre156.pre160.pre162166, %.preheader92 ], [ %.pre156.pre160.pre162166, %99 ], [ %.pre156.pre160.pre162.pre, %120 ]
  %122 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !11
  %123 = add nsw i32 %122, %75
  %124 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !11
  %125 = add nsw i32 %124, %92
  %126 = icmp slt i32 %123, 0
  br i1 %126, label %148, label %127

127:                                              ; preds = %121
  %128 = load i32, ptr %1, align 4, !tbaa !11
  %129 = icmp slt i32 %123, %128
  %130 = icmp sgt i32 %125, -1
  %or.cond.not87.1 = select i1 %129, i1 %130, i1 false
  %.not77.1 = icmp slt i32 %125, %.pre156.pre160.pre162
  %or.cond80.1 = select i1 %or.cond.not87.1, i1 %.not77.1, i1 false
  br i1 %or.cond80.1, label %131, label %148

131:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %132 = load i32, ptr %88, align 4, !tbaa !11
  %133 = zext nneg i32 %123 to i64
  %134 = mul nuw nsw i64 %133, %45
  %135 = getelementptr inbounds i32, ptr %47, i64 %134
  %136 = zext nneg i32 %125 to i64
  %137 = getelementptr inbounds i32, ptr %135, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !11
  %139 = sub nsw i32 %132, %138
  %140 = call i32 @llvm.abs.i32(i32 %139, i1 true)
  store i32 %140, ptr %3, align 4, !tbaa !11
  %141 = mul nsw i32 %.pre156.pre160.pre162, %75
  %142 = add nsw i32 %141, %92
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %143
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %145 = mul nsw i32 %.pre156.pre160.pre162, %123
  %146 = add nsw i32 %145, %125
  store i32 %146, ptr %5, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %144, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %147 unwind label %205

147:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %.pre156.pre160.pre = load i32, ptr %2, align 4
  br label %148

148:                                              ; preds = %147, %127, %121
  %.pre156.pre160.pre162169 = phi i32 [ %.pre156.pre160.pre, %147 ], [ %.pre156.pre160.pre162, %127 ], [ %.pre156.pre160.pre162, %121 ]
  %149 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !11
  %150 = add nsw i32 %149, %75
  %151 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !11
  %152 = add nsw i32 %151, %92
  %153 = icmp slt i32 %150, 0
  br i1 %153, label %175, label %154

154:                                              ; preds = %148
  %155 = load i32, ptr %1, align 4, !tbaa !11
  %156 = icmp slt i32 %150, %155
  %157 = icmp sgt i32 %152, -1
  %or.cond.not87.2 = select i1 %156, i1 %157, i1 false
  %.not77.2 = icmp slt i32 %152, %.pre156.pre160.pre162169
  %or.cond80.2 = select i1 %or.cond.not87.2, i1 %.not77.2, i1 false
  br i1 %or.cond80.2, label %158, label %175

158:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %159 = load i32, ptr %88, align 4, !tbaa !11
  %160 = zext nneg i32 %150 to i64
  %161 = mul nuw nsw i64 %160, %45
  %162 = getelementptr inbounds i32, ptr %47, i64 %161
  %163 = zext nneg i32 %152 to i64
  %164 = getelementptr inbounds i32, ptr %162, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !11
  %166 = sub nsw i32 %159, %165
  %167 = call i32 @llvm.abs.i32(i32 %166, i1 true)
  store i32 %167, ptr %3, align 4, !tbaa !11
  %168 = mul nsw i32 %.pre156.pre160.pre162169, %75
  %169 = add nsw i32 %168, %92
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %170
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %172 = mul nsw i32 %.pre156.pre160.pre162169, %150
  %173 = add nsw i32 %172, %152
  store i32 %173, ptr %5, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %171, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %174 unwind label %205

174:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %.pre156.pre = load i32, ptr %2, align 4
  br label %175

175:                                              ; preds = %174, %154, %148
  %.pre156.pre160.pre162168 = phi i32 [ %.pre156.pre, %174 ], [ %.pre156.pre160.pre162169, %154 ], [ %.pre156.pre160.pre162169, %148 ]
  %176 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !11
  %177 = add nsw i32 %176, %75
  %178 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !11
  %179 = add nsw i32 %178, %92
  %180 = icmp slt i32 %177, 0
  br i1 %180, label %202, label %181

181:                                              ; preds = %175
  %182 = load i32, ptr %1, align 4, !tbaa !11
  %183 = icmp slt i32 %177, %182
  %184 = icmp sgt i32 %179, -1
  %or.cond.not87.3 = select i1 %183, i1 %184, i1 false
  %.not77.3 = icmp slt i32 %179, %.pre156.pre160.pre162168
  %or.cond80.3 = select i1 %or.cond.not87.3, i1 %.not77.3, i1 false
  br i1 %or.cond80.3, label %185, label %202

185:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %186 = load i32, ptr %88, align 4, !tbaa !11
  %187 = zext nneg i32 %177 to i64
  %188 = mul nuw nsw i64 %187, %45
  %189 = getelementptr inbounds i32, ptr %47, i64 %188
  %190 = zext nneg i32 %179 to i64
  %191 = getelementptr inbounds i32, ptr %189, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !11
  %193 = sub nsw i32 %186, %192
  %194 = call i32 @llvm.abs.i32(i32 %193, i1 true)
  store i32 %194, ptr %3, align 4, !tbaa !11
  %195 = mul nsw i32 %.pre156.pre160.pre162168, %75
  %196 = add nsw i32 %195, %92
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %197
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %199 = mul nsw i32 %.pre156.pre160.pre162168, %177
  %200 = add nsw i32 %199, %179
  store i32 %200, ptr %5, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %3)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %198, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %201 unwind label %205

201:                                              ; preds = %185
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %.pre155 = load i32, ptr %2, align 4
  br label %202

202:                                              ; preds = %201, %181, %175
  %.pre156.pre160.pre162167 = phi i32 [ %.pre155, %201 ], [ %.pre156.pre160.pre162168, %181 ], [ %.pre156.pre160.pre162168, %175 ]
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %203 = sext i32 %.pre156.pre160.pre162167 to i64
  %204 = icmp slt i64 %indvars.iv.next147, %203
  br i1 %204, label %.preheader92, label %._crit_edge106.loopexit, !llvm.loop !18

205:                                              ; preds = %185, %158, %131, %104
  %206 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  br label %303

.preheader91:                                     ; preds = %._crit_edge108, %._crit_edge112
  %207 = phi i32 [ %212, %._crit_edge112 ], [ %95, %._crit_edge108 ]
  %208 = phi i32 [ %213, %._crit_edge112 ], [ %96, %._crit_edge108 ]
  %.047115 = phi i32 [ %214, %._crit_edge112 ], [ 0, %._crit_edge108 ]
  %.048114 = phi i32 [ %.1.lcssa, %._crit_edge112 ], [ 0, %._crit_edge108 ]
  %209 = icmp sgt i32 %208, 0
  br i1 %209, label %.lr.ph111, label %._crit_edge112

._crit_edge116.loopexit:                          ; preds = %._crit_edge112
  %.pre171 = mul nsw i32 %213, %212
  br label %._crit_edge116

._crit_edge116:                                   ; preds = %._crit_edge108.thread177, %._crit_edge116.loopexit, %._crit_edge108
  %210 = phi ptr [ %84, %._crit_edge116.loopexit ], [ %84, %._crit_edge108 ], [ %81, %._crit_edge108.thread177 ]
  %.pre-phi = phi i32 [ %.pre171, %._crit_edge116.loopexit ], [ %82, %._crit_edge108 ], [ %79, %._crit_edge108.thread177 ]
  %.048.lcssa = phi i32 [ %.1.lcssa, %._crit_edge116.loopexit ], [ 0, %._crit_edge108 ], [ 0, %._crit_edge108.thread177 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  %211 = icmp sgt i32 %.pre-phi, 0
  br i1 %211, label %.lr.ph123.preheader, label %._crit_edge124

.lr.ph123.preheader:                              ; preds = %._crit_edge116
  %wide.trip.count = zext nneg i32 %.pre-phi to i64
  br label %.lr.ph123

._crit_edge112.loopexit:                          ; preds = %222
  %.pre158 = load i32, ptr %1, align 4, !tbaa !11
  br label %._crit_edge112

._crit_edge112:                                   ; preds = %._crit_edge112.loopexit, %.preheader91
  %212 = phi i32 [ %207, %.preheader91 ], [ %.pre158, %._crit_edge112.loopexit ]
  %213 = phi i32 [ %208, %.preheader91 ], [ %223, %._crit_edge112.loopexit ]
  %.1.lcssa = phi i32 [ %.048114, %.preheader91 ], [ %spec.select, %._crit_edge112.loopexit ]
  %214 = add nuw nsw i32 %.047115, 1
  %215 = icmp slt i32 %214, %212
  br i1 %215, label %.preheader91, label %._crit_edge116.loopexit, !llvm.loop !19

.lr.ph111:                                        ; preds = %.preheader91, %222
  %216 = phi i32 [ %223, %222 ], [ %208, %.preheader91 ]
  %.046110 = phi i32 [ %230, %222 ], [ 0, %.preheader91 ]
  %.1109 = phi i32 [ %spec.select, %222 ], [ %.048114, %.preheader91 ]
  %217 = mul nsw i32 %216, %.047115
  %218 = add nsw i32 %217, %.046110
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds i8, ptr %84, i64 %219
  %221 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %220)
          to label %222 unwind label %232

222:                                              ; preds = %.lr.ph111
  %223 = load i32, ptr %2, align 4, !tbaa !11
  %224 = mul nsw i32 %223, %.047115
  %225 = add nsw i32 %224, %.046110
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds i8, ptr %84, i64 %226
  %228 = load i8, ptr %227, align 1, !tbaa !20, !range !22, !noundef !23
  %229 = zext nneg i8 %228 to i32
  %spec.select = add nsw i32 %.1109, %229
  %230 = add nuw nsw i32 %.046110, 1
  %231 = icmp slt i32 %230, %223
  br i1 %231, label %.lr.ph111, label %._crit_edge112.loopexit, !llvm.loop !24

232:                                              ; preds = %.lr.ph111
  %233 = landingpad { ptr, i32 }
          cleanup
  br label %303

.lr.ph123:                                        ; preds = %.lr.ph123.preheader, %237
  %indvars.iv152 = phi i64 [ 0, %.lr.ph123.preheader ], [ %indvars.iv.next153, %237 ]
  %234 = getelementptr inbounds i8, ptr %210, i64 %indvars.iv152
  %235 = load i8, ptr %234, align 1, !tbaa !20, !range !22, !noundef !23
  %236 = trunc nuw i8 %235 to i1
  br i1 %236, label %._crit_edge124.loopexit.split.loop.exit, label %237

237:                                              ; preds = %.lr.ph123
  %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next153, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge124, label %.lr.ph123, !llvm.loop !25

._crit_edge124.loopexit.split.loop.exit:          ; preds = %.lr.ph123
  %238 = trunc nuw nsw i64 %indvars.iv152 to i32
  br label %._crit_edge124

._crit_edge124:                                   ; preds = %237, %._crit_edge124.loopexit.split.loop.exit, %._crit_edge116.thread, %._crit_edge116
  %.048.lcssa180 = phi i32 [ %.048.lcssa, %._crit_edge116 ], [ 0, %._crit_edge116.thread ], [ %.048.lcssa, %._crit_edge124.loopexit.split.loop.exit ], [ %.048.lcssa, %237 ]
  %239 = phi ptr [ %210, %._crit_edge116 ], [ %78, %._crit_edge116.thread ], [ %210, %._crit_edge124.loopexit.split.loop.exit ], [ %210, %237 ]
  %storemerge.lcssa = phi i32 [ 0, %._crit_edge116 ], [ 0, %._crit_edge116.thread ], [ %238, %._crit_edge124.loopexit.split.loop.exit ], [ %.pre-phi, %237 ]
  store i32 %storemerge.lcssa, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  store i32 0, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #9
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %8)
  %240 = load i32, ptr %2, align 4, !tbaa !11
  %241 = load i32, ptr %1, align 4, !tbaa !11
  %242 = mul nsw i32 %241, %240
  %243 = zext i32 %242 to i64
  %244 = alloca i8, i64 %243, align 16
  %245 = sext i32 %242 to i64
  %246 = getelementptr inbounds i8, ptr %244, i64 %245
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #9
  store i8 0, ptr %9, align 1, !tbaa !20
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull %244, ptr noundef nonnull %246, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %247 unwind label %261

247:                                              ; preds = %._crit_edge124
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %6)
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %8, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %248 unwind label %263

248:                                              ; preds = %247
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  %249 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %8)
  br i1 %249, label %.loopexit90, label %.lr.ph133

.lr.ph133:                                        ; preds = %248
  %250 = getelementptr inbounds i8, ptr %12, i64 4
  %251 = getelementptr inbounds i8, ptr %15, i64 4
  br label %252

252:                                              ; preds = %.lr.ph133, %290
  %.3131 = phi i32 [ %.048.lcssa180, %.lr.ph133 ], [ %.4, %290 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  %253 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %8)
  %254 = load i64, ptr %253, align 4
  store i64 %254, ptr %12, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %8)
          to label %255 unwind label %267

255:                                              ; preds = %252
  %256 = load i32, ptr %250, align 4, !tbaa !26
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds i8, ptr %244, i64 %257
  %259 = load i8, ptr %258, align 1, !tbaa !20, !range !22, !noundef !23
  %260 = trunc nuw i8 %259 to i1
  br i1 %260, label %290, label %269, !llvm.loop !28

261:                                              ; preds = %._crit_edge124
  %262 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #9
  br label %299

263:                                              ; preds = %247
  %264 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br label %299

265:                                              ; preds = %295, %.loopexit90
  %266 = landingpad { ptr, i32 }
          cleanup
  br label %299

267:                                              ; preds = %252
  %268 = landingpad { ptr, i32 }
          cleanup
  br label %292

269:                                              ; preds = %255
  store i8 1, ptr %258, align 1, !tbaa !20
  %270 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %271 = load i32, ptr %270, align 4, !tbaa !11
  store i32 %271, ptr %7, align 4, !tbaa !11
  %272 = load i32, ptr %250, align 4, !tbaa !26
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds i8, ptr %239, i64 %273
  %275 = load i8, ptr %274, align 1, !tbaa !20, !range !22, !noundef !23
  %276 = zext nneg i8 %275 to i32
  %277 = sub nsw i32 %.3131, %276
  %.not = icmp eq i32 %277, 0
  br i1 %.not, label %.thread, label %278

.thread:                                          ; preds = %269
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %.loopexit90

278:                                              ; preds = %269
  %279 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %273
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %280 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %279) #9
  store ptr %280, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #9
  %281 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %279) #9
  store ptr %281, ptr %14, align 8
  %282 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  br i1 %282, label %.lr.ph129, label %._crit_edge130

._crit_edge130:                                   ; preds = %285, %278
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  br label %290

.lr.ph129:                                        ; preds = %278, %285
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #9
  %283 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  %284 = load i64, ptr %283, align 4
  store i64 %284, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #9
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %251, ptr noundef nonnull align 4 dereferenceable(4) %15)
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %8, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %285 unwind label %288

285:                                              ; preds = %.lr.ph129
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  %286 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  %287 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  br i1 %287, label %.lr.ph129, label %._crit_edge130

288:                                              ; preds = %.lr.ph129
  %289 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  br label %292

290:                                              ; preds = %255, %._crit_edge130
  %.4 = phi i32 [ %277, %._crit_edge130 ], [ %.3131, %255 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  %291 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %8)
  br i1 %291, label %.loopexit90.loopexit, label %252

292:                                              ; preds = %288, %267
  %.pn = phi { ptr, i32 } [ %289, %288 ], [ %268, %267 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %299

.loopexit90.loopexit:                             ; preds = %290
  %.pre159 = load i32, ptr %7, align 4, !tbaa !11
  br label %.loopexit90

.loopexit90:                                      ; preds = %.loopexit90.loopexit, %248, %.thread
  %293 = phi i32 [ %.pre159, %.loopexit90.loopexit ], [ 0, %248 ], [ %271, %.thread ]
  %294 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %293)
          to label %295 unwind label %265

295:                                              ; preds = %.loopexit90
  %296 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %294, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %297 unwind label %265

297:                                              ; preds = %295
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  br i1 %35, label %.loopexit89, label %.preheader88.preheader

.preheader88.preheader:                           ; preds = %297
  %298 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %32
  br label %.preheader88

299:                                              ; preds = %292, %265, %263, %261
  %.pn73 = phi { ptr, i32 } [ %266, %265 ], [ %.pn, %292 ], [ %264, %263 ], [ %262, %261 ]
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  br label %303

.preheader88:                                     ; preds = %.preheader88.preheader, %.preheader88
  %300 = phi ptr [ %301, %.preheader88 ], [ %298, %.preheader88.preheader ]
  %301 = getelementptr inbounds i8, ptr %300, i64 -24
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %301) #9
  %302 = icmp eq ptr %301, %34
  br i1 %302, label %.loopexit89, label %.preheader88

.loopexit89:                                      ; preds = %.preheader88, %297
  call void @llvm.stackrestore.p0(ptr %33)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0

303:                                              ; preds = %232, %299, %205, %68
  %.pn78 = phi { ptr, i32 } [ %69, %68 ], [ %206, %205 ], [ %233, %232 ], [ %.pn73, %299 ]
  br i1 %35, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %303
  %304 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %32
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %305 = phi ptr [ %306, %.preheader ], [ %304, %.preheader.preheader ]
  %306 = getelementptr inbounds i8, ptr %305, i64 -24
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %306) #9
  %307 = icmp eq ptr %306, %34
  br i1 %307, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %303
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn78
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #8 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14, !15}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14, !15}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !10, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = !{!27, !12, i64 4}
!27 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!28 = distinct !{!28, !14}


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