; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/355 Division 2/Problem D (D)

; 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::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 }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.5" = type { i32, %"struct.std::pair" }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@g = external dso_local global [330 x [330 x i32]], align 16
@pts = external dso_local global [108900 x %"class.std::vector"], align 16
@d = external dso_local global [330 x [330 x i32]], align 16
@v = external dso_local global [330 x [330 x i32]], align 16
@dx = external dso_local global [4 x i32], align 16
@dy = external dso_local global [4 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z9manhattaniiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4goodii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::vector.0", align 8
  %18 = alloca %"class.std::vector.0", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair.5", align 4
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca { i64, i32 }, align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %31 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca %"struct.std::pair.5", align 4
  %41 = alloca %"struct.std::pair", align 4
  %42 = alloca { i64, i32 }, align 8
  %43 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %44 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @p)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %104, %0
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %107

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %100, %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %103

61:                                               ; preds = %56
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [330 x [330 x i32]], ptr @g, i64 0, i64 %63
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [330 x i32], ptr %64, i64 0, i64 %66
  %68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %67)
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [330 x [330 x i32]], ptr @g, i64 0, i64 %70
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [330 x i32], ptr %71, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %78 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %78, ptr %5, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %77, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [330 x [330 x i32]], ptr @g, i64 0, i64 %80
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [330 x i32], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp sgt i32 %85, 1
  br i1 %86, label %87, label %88

87:                                               ; preds = %61
  br label %92

88:                                               ; preds = %61
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = call noundef i32 @_Z9manhattaniiii(i32 noundef 1, i32 noundef 1, i32 noundef %89, i32 noundef %90)
  br label %92

92:                                               ; preds = %88, %87
  %93 = phi i32 [ 1000000000, %87 ], [ %91, %88 ]
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %95
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [330 x i32], ptr %96, i64 0, i64 %98
  store i32 %93, ptr %99, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %92
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %4, align 4, !tbaa !5
  br label %56, !llvm.loop !9

103:                                              ; preds = %60
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %2, align 4, !tbaa !5
  br label %50, !llvm.loop !11

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

108:                                              ; preds = %470, %107
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = load i32, ptr @p, align 4, !tbaa !5
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %473

113:                                              ; preds = %108
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = sub nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %116
  %118 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %117) #8
  %119 = icmp ult i64 %118, 300
  br i1 %119, label %120, label %204

120:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %122
  %124 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %123) #8
  %125 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  br label %126

126:                                              ; preds = %201, %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %128
  %130 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #8
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  %132 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br i1 %132, label %134, label %133

133:                                              ; preds = %126
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %203

134:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %135 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  %136 = getelementptr inbounds %"struct.std::pair", ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 4, !tbaa !12
  store i32 %137, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %138 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  %139 = getelementptr inbounds %"struct.std::pair", ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !14
  store i32 %140, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %197, %134
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = load i32, ptr %6, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %146
  %148 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %147) #8
  %149 = icmp ult i64 %143, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %141
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %200

151:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %152 = load i32, ptr %6, align 4, !tbaa !5
  %153 = sub nsw i32 %152, 1
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %154
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %155, i64 noundef %157) #8
  %159 = getelementptr inbounds %"struct.std::pair", ptr %158, i32 0, i32 0
  %160 = load i32, ptr %159, align 4, !tbaa !12
  store i32 %160, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %161 = load i32, ptr %6, align 4, !tbaa !5
  %162 = sub nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %163
  %165 = load i32, ptr %11, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %164, i64 noundef %166) #8
  %168 = getelementptr inbounds %"struct.std::pair", ptr %167, i32 0, i32 1
  %169 = load i32, ptr %168, align 4, !tbaa !14
  store i32 %169, ptr %13, align 4, !tbaa !5
  %170 = load i32, ptr %9, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %171
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [330 x i32], ptr %172, i64 0, i64 %174
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %176 = load i32, ptr %12, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %177
  %179 = load i32, ptr %13, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [330 x i32], ptr %178, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = load i32, ptr %9, align 4, !tbaa !5
  %184 = load i32, ptr %10, align 4, !tbaa !5
  %185 = load i32, ptr %12, align 4, !tbaa !5
  %186 = load i32, ptr %13, align 4, !tbaa !5
  %187 = call noundef i32 @_Z9manhattaniiii(i32 noundef %183, i32 noundef %184, i32 noundef %185, i32 noundef %186)
  %188 = add nsw i32 %182, %187
  store i32 %188, ptr %14, align 4, !tbaa !5
  %189 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %175, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = load i32, ptr %9, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %192
  %194 = load i32, ptr %10, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [330 x i32], ptr %193, i64 0, i64 %195
  store i32 %190, ptr %196, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %197

197:                                              ; preds = %151
  %198 = load i32, ptr %11, align 4, !tbaa !5
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %11, align 4, !tbaa !5
  br label %141, !llvm.loop !15

200:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %201

201:                                              ; preds = %200
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br label %126, !llvm.loop !16

203:                                              ; preds = %133
  br label %469

204:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %205

205:                                              ; preds = %227, %204
  %206 = load i32, ptr %15, align 4, !tbaa !5
  %207 = load i32, ptr @n, align 4, !tbaa !5
  %208 = icmp sle i32 %206, %207
  br i1 %208, label %210, label %209

209:                                              ; preds = %205
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %230

210:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %211

211:                                              ; preds = %223, %210
  %212 = load i32, ptr %16, align 4, !tbaa !5
  %213 = load i32, ptr @m, align 4, !tbaa !5
  %214 = icmp sle i32 %212, %213
  br i1 %214, label %216, label %215

215:                                              ; preds = %211
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %226

216:                                              ; preds = %211
  %217 = load i32, ptr %15, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %218
  %220 = load i32, ptr %16, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [330 x i32], ptr %219, i64 0, i64 %221
  store i32 1000000000, ptr %222, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %216
  %224 = load i32, ptr %16, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %16, align 4, !tbaa !5
  br label %211, !llvm.loop !17

226:                                              ; preds = %215
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %15, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %15, align 4, !tbaa !5
  br label %205, !llvm.loop !18

230:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %231 = load i32, ptr %6, align 4, !tbaa !5
  %232 = sub nsw i32 %231, 1
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %233
  %235 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %234) #8
  %236 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %235, ptr %236, align 8
  br label %237

237:                                              ; preds = %264, %230
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %238 = load i32, ptr %6, align 4, !tbaa !5
  %239 = sub nsw i32 %238, 1
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %240
  %242 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %241) #8
  %243 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %242, ptr %243, align 8
  %244 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br i1 %244, label %246, label %245

245:                                              ; preds = %237
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %270

246:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %247 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  %248 = getelementptr inbounds %"struct.std::pair", ptr %247, i32 0, i32 0
  %249 = load i32, ptr %248, align 4, !tbaa !12
  store i32 %249, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %250 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  %251 = getelementptr inbounds %"struct.std::pair", ptr %250, i32 0, i32 1
  %252 = load i32, ptr %251, align 4, !tbaa !14
  store i32 %252, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #8
  %253 = load i32, ptr %21, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %254
  %256 = load i32, ptr %22, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [330 x i32], ptr %255, i64 0, i64 %257
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %259 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %260 unwind label %266

260:                                              ; preds = %246
  store i64 %259, ptr %24, align 4
  %261 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %258, ptr noundef nonnull align 4 dereferenceable(8) %24)
          to label %262 unwind label %266

262:                                              ; preds = %260
  store { i64, i32 } %261, ptr %27, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %27, i64 12, i1 false)
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(12) %23)
          to label %263 unwind label %266

263:                                              ; preds = %262
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %264

264:                                              ; preds = %263
  %265 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  br label %237, !llvm.loop !19

266:                                              ; preds = %262, %260, %246
  %267 = landingpad { ptr, i32 }
          cleanup
  %268 = extractvalue { ptr, i32 } %267, 0
  store ptr %268, ptr %25, align 8
  %269 = extractvalue { ptr, i32 } %267, 1
  store i32 %269, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %468

270:                                              ; preds = %245
  %271 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %272 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %28, i32 0, i32 0
  store ptr %271, ptr %272, align 8
  %273 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %274 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %29, i32 0, i32 0
  store ptr %273, ptr %274, align 8
  %275 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %28, i32 0, i32 0
  %276 = load ptr, ptr %275, align 8
  %277 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %29, i32 0, i32 0
  %278 = load ptr, ptr %277, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %276, ptr %278)
          to label %279 unwind label %352

279:                                              ; preds = %270
  %280 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %281 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %30, i32 0, i32 0
  store ptr %280, ptr %281, align 8
  %282 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %283 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %31, i32 0, i32 0
  store ptr %282, ptr %283, align 8
  %284 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %30, i32 0, i32 0
  %285 = load ptr, ptr %284, align 8
  %286 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %31, i32 0, i32 0
  %287 = load ptr, ptr %286, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %285, ptr %287)
          to label %288 unwind label %352

288:                                              ; preds = %279
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  store i32 0, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !5
  %289 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(12) %289)
          to label %290 unwind label %356

290:                                              ; preds = %288
  %291 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %292 = getelementptr inbounds %"struct.std::pair.5", ptr %291, i32 0, i32 0
  %293 = load i32, ptr %292, align 4, !tbaa !20
  %294 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %295 = getelementptr inbounds %"struct.std::pair.5", ptr %294, i32 0, i32 1
  %296 = getelementptr inbounds %"struct.std::pair", ptr %295, i32 0, i32 0
  %297 = load i32, ptr %296, align 4, !tbaa !22
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %298
  %300 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %301 = getelementptr inbounds %"struct.std::pair.5", ptr %300, i32 0, i32 1
  %302 = getelementptr inbounds %"struct.std::pair", ptr %301, i32 0, i32 1
  %303 = load i32, ptr %302, align 4, !tbaa !23
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [330 x i32], ptr %299, i64 0, i64 %304
  store i32 %293, ptr %305, align 4, !tbaa !5
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  br label %306

306:                                              ; preds = %428, %290
  %307 = load i32, ptr %33, align 4, !tbaa !5
  %308 = sext i32 %307 to i64
  %309 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %310 = icmp ult i64 %308, %309
  br i1 %310, label %311, label %430

311:                                              ; preds = %306
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %312 = load i32, ptr %33, align 4, !tbaa !5
  %313 = sext i32 %312 to i64
  %314 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %313) #8
  %315 = getelementptr inbounds %"struct.std::pair.5", ptr %314, i32 0, i32 1
  %316 = getelementptr inbounds %"struct.std::pair", ptr %315, i32 0, i32 0
  %317 = load i32, ptr %316, align 4, !tbaa !22
  store i32 %317, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %318 = load i32, ptr %33, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %319) #8
  %321 = getelementptr inbounds %"struct.std::pair.5", ptr %320, i32 0, i32 1
  %322 = getelementptr inbounds %"struct.std::pair", ptr %321, i32 0, i32 1
  %323 = load i32, ptr %322, align 4, !tbaa !23
  store i32 %323, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %324 = load i32, ptr %33, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %325) #8
  %327 = getelementptr inbounds %"struct.std::pair.5", ptr %326, i32 0, i32 0
  %328 = load i32, ptr %327, align 4, !tbaa !20
  store i32 %328, ptr %36, align 4, !tbaa !5
  %329 = load i32, ptr %33, align 4, !tbaa !5
  %330 = add nsw i32 %329, 1
  store i32 %330, ptr %33, align 4, !tbaa !5
  %331 = load i32, ptr %36, align 4, !tbaa !5
  %332 = load i32, ptr %34, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %333
  %335 = load i32, ptr %35, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [330 x i32], ptr %334, i64 0, i64 %336
  store i32 %331, ptr %337, align 4, !tbaa !5
  br label %338

338:                                              ; preds = %351, %311
  %339 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %340 = icmp ugt i64 %339, 0
  br i1 %340, label %341, label %347

341:                                              ; preds = %338
  %342 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  %343 = getelementptr inbounds %"struct.std::pair.5", ptr %342, i32 0, i32 0
  %344 = load i32, ptr %343, align 4, !tbaa !20
  %345 = load i32, ptr %36, align 4, !tbaa !5
  %346 = icmp eq i32 %344, %345
  br label %347

347:                                              ; preds = %341, %338
  %348 = phi i1 [ false, %338 ], [ %346, %341 ]
  br i1 %348, label %349, label %364

349:                                              ; preds = %347
  %350 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(12) %350)
          to label %351 unwind label %360

351:                                              ; preds = %349
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  br label %338, !llvm.loop !24

352:                                              ; preds = %279, %270
  %353 = landingpad { ptr, i32 }
          cleanup
  %354 = extractvalue { ptr, i32 } %353, 0
  store ptr %354, ptr %25, align 8
  %355 = extractvalue { ptr, i32 } %353, 1
  store i32 %355, ptr %26, align 4
  br label %468

356:                                              ; preds = %288
  %357 = landingpad { ptr, i32 }
          cleanup
  %358 = extractvalue { ptr, i32 } %357, 0
  store ptr %358, ptr %25, align 8
  %359 = extractvalue { ptr, i32 } %357, 1
  store i32 %359, ptr %26, align 4
  br label %467

360:                                              ; preds = %349
  %361 = landingpad { ptr, i32 }
          cleanup
  %362 = extractvalue { ptr, i32 } %361, 0
  store ptr %362, ptr %25, align 8
  %363 = extractvalue { ptr, i32 } %361, 1
  store i32 %363, ptr %26, align 4
  br label %429

364:                                              ; preds = %347
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  store i32 0, ptr %37, align 4, !tbaa !5
  br label %365

365:                                              ; preds = %425, %364
  %366 = load i32, ptr %37, align 4, !tbaa !5
  %367 = icmp slt i32 %366, 4
  br i1 %367, label %369, label %368

368:                                              ; preds = %365
  store i32 30, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %428

369:                                              ; preds = %365
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  %370 = load i32, ptr %34, align 4, !tbaa !5
  %371 = load i32, ptr %37, align 4, !tbaa !5
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %372
  %374 = load i32, ptr %373, align 4, !tbaa !5
  %375 = add nsw i32 %370, %374
  store i32 %375, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  %376 = load i32, ptr %35, align 4, !tbaa !5
  %377 = load i32, ptr %37, align 4, !tbaa !5
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %378
  %380 = load i32, ptr %379, align 4, !tbaa !5
  %381 = add nsw i32 %376, %380
  store i32 %381, ptr %39, align 4, !tbaa !5
  %382 = load i32, ptr %38, align 4, !tbaa !5
  %383 = load i32, ptr %39, align 4, !tbaa !5
  %384 = call noundef zeroext i1 @_Z4goodii(i32 noundef %382, i32 noundef %383)
  br i1 %384, label %385, label %424

385:                                              ; preds = %369
  %386 = load i32, ptr %38, align 4, !tbaa !5
  %387 = sext i32 %386 to i64
  %388 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %387
  %389 = load i32, ptr %39, align 4, !tbaa !5
  %390 = sext i32 %389 to i64
  %391 = getelementptr inbounds [330 x i32], ptr %388, i64 0, i64 %390
  %392 = load i32, ptr %391, align 4, !tbaa !5
  %393 = icmp eq i32 %392, 1000000000
  br i1 %393, label %394, label %424

394:                                              ; preds = %385
  %395 = load i32, ptr %34, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %396
  %398 = load i32, ptr %35, align 4, !tbaa !5
  %399 = sext i32 %398 to i64
  %400 = getelementptr inbounds [330 x i32], ptr %397, i64 0, i64 %399
  %401 = load i32, ptr %400, align 4, !tbaa !5
  %402 = add nsw i32 %401, 1
  %403 = load i32, ptr %38, align 4, !tbaa !5
  %404 = sext i32 %403 to i64
  %405 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %404
  %406 = load i32, ptr %39, align 4, !tbaa !5
  %407 = sext i32 %406 to i64
  %408 = getelementptr inbounds [330 x i32], ptr %405, i64 0, i64 %407
  store i32 %402, ptr %408, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %40) #8
  %409 = load i32, ptr %38, align 4, !tbaa !5
  %410 = sext i32 %409 to i64
  %411 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %410
  %412 = load i32, ptr %39, align 4, !tbaa !5
  %413 = sext i32 %412 to i64
  %414 = getelementptr inbounds [330 x i32], ptr %411, i64 0, i64 %413
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %415 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %38, ptr noundef nonnull align 4 dereferenceable(4) %39)
          to label %416 unwind label %420

416:                                              ; preds = %394
  store i64 %415, ptr %41, align 4
  %417 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %414, ptr noundef nonnull align 4 dereferenceable(8) %41)
          to label %418 unwind label %420

418:                                              ; preds = %416
  store { i64, i32 } %417, ptr %42, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 8 %42, i64 12, i1 false)
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(12) %40)
          to label %419 unwind label %420

419:                                              ; preds = %418
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %40) #8
  br label %424

420:                                              ; preds = %418, %416, %394
  %421 = landingpad { ptr, i32 }
          cleanup
  %422 = extractvalue { ptr, i32 } %421, 0
  store ptr %422, ptr %25, align 8
  %423 = extractvalue { ptr, i32 } %421, 1
  store i32 %423, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %429

424:                                              ; preds = %419, %385, %369
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %425

425:                                              ; preds = %424
  %426 = load i32, ptr %37, align 4, !tbaa !5
  %427 = add nsw i32 %426, 1
  store i32 %427, ptr %37, align 4, !tbaa !5
  br label %365, !llvm.loop !25

428:                                              ; preds = %368
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %306, !llvm.loop !26

429:                                              ; preds = %420, %360
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %467

430:                                              ; preds = %306
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #8
  %431 = load i32, ptr %6, align 4, !tbaa !5
  %432 = sext i32 %431 to i64
  %433 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %432
  %434 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %433) #8
  %435 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %43, i32 0, i32 0
  store ptr %434, ptr %435, align 8
  br label %436

436:                                              ; preds = %464, %430
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #8
  %437 = load i32, ptr %6, align 4, !tbaa !5
  %438 = sext i32 %437 to i64
  %439 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %438
  %440 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %439) #8
  %441 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %44, i32 0, i32 0
  store ptr %440, ptr %441, align 8
  %442 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull align 8 dereferenceable(8) %44) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #8
  br i1 %442, label %444, label %443

443:                                              ; preds = %436
  store i32 33, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  br label %466

444:                                              ; preds = %436
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #8
  %445 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %43) #8
  %446 = getelementptr inbounds %"struct.std::pair", ptr %445, i32 0, i32 0
  %447 = load i32, ptr %446, align 4, !tbaa !12
  store i32 %447, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #8
  %448 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %43) #8
  %449 = getelementptr inbounds %"struct.std::pair", ptr %448, i32 0, i32 1
  %450 = load i32, ptr %449, align 4, !tbaa !14
  store i32 %450, ptr %46, align 4, !tbaa !5
  %451 = load i32, ptr %45, align 4, !tbaa !5
  %452 = sext i32 %451 to i64
  %453 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %452
  %454 = load i32, ptr %46, align 4, !tbaa !5
  %455 = sext i32 %454 to i64
  %456 = getelementptr inbounds [330 x i32], ptr %453, i64 0, i64 %455
  %457 = load i32, ptr %456, align 4, !tbaa !5
  %458 = load i32, ptr %45, align 4, !tbaa !5
  %459 = sext i32 %458 to i64
  %460 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %459
  %461 = load i32, ptr %46, align 4, !tbaa !5
  %462 = sext i32 %461 to i64
  %463 = getelementptr inbounds [330 x i32], ptr %460, i64 0, i64 %462
  store i32 %457, ptr %463, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  br label %464

464:                                              ; preds = %444
  %465 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %43) #8
  br label %436, !llvm.loop !27

466:                                              ; preds = %443
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  br label %469

467:                                              ; preds = %429, %356
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %468

468:                                              ; preds = %467, %352, %266
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %519

469:                                              ; preds = %466, %203
  br label %470

470:                                              ; preds = %469
  %471 = load i32, ptr %6, align 4, !tbaa !5
  %472 = add nsw i32 %471, 1
  store i32 %472, ptr %6, align 4, !tbaa !5
  br label %108, !llvm.loop !28

473:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  store i32 1, ptr %47, align 4, !tbaa !5
  br label %474

474:                                              ; preds = %511, %473
  %475 = load i32, ptr %47, align 4, !tbaa !5
  %476 = load i32, ptr @n, align 4, !tbaa !5
  %477 = icmp sle i32 %475, %476
  br i1 %477, label %479, label %478

478:                                              ; preds = %474
  store i32 36, ptr %3, align 4
  br label %514

479:                                              ; preds = %474
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #8
  store i32 1, ptr %48, align 4, !tbaa !5
  br label %480

480:                                              ; preds = %505, %479
  %481 = load i32, ptr %48, align 4, !tbaa !5
  %482 = load i32, ptr @m, align 4, !tbaa !5
  %483 = icmp sle i32 %481, %482
  br i1 %483, label %485, label %484

484:                                              ; preds = %480
  store i32 39, ptr %3, align 4
  br label %508

485:                                              ; preds = %480
  %486 = load i32, ptr %47, align 4, !tbaa !5
  %487 = sext i32 %486 to i64
  %488 = getelementptr inbounds [330 x [330 x i32]], ptr @g, i64 0, i64 %487
  %489 = load i32, ptr %48, align 4, !tbaa !5
  %490 = sext i32 %489 to i64
  %491 = getelementptr inbounds [330 x i32], ptr %488, i64 0, i64 %490
  %492 = load i32, ptr %491, align 4, !tbaa !5
  %493 = load i32, ptr @p, align 4, !tbaa !5
  %494 = icmp eq i32 %492, %493
  br i1 %494, label %495, label %504

495:                                              ; preds = %485
  %496 = load i32, ptr %47, align 4, !tbaa !5
  %497 = sext i32 %496 to i64
  %498 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %497
  %499 = load i32, ptr %48, align 4, !tbaa !5
  %500 = sext i32 %499 to i64
  %501 = getelementptr inbounds [330 x i32], ptr %498, i64 0, i64 %500
  %502 = load i32, ptr %501, align 4, !tbaa !5
  %503 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %502)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %508

504:                                              ; preds = %485
  br label %505

505:                                              ; preds = %504
  %506 = load i32, ptr %48, align 4, !tbaa !5
  %507 = add nsw i32 %506, 1
  store i32 %507, ptr %48, align 4, !tbaa !5
  br label %480, !llvm.loop !29

508:                                              ; preds = %495, %484
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #8
  %509 = load i32, ptr %3, align 4
  switch i32 %509, label %514 [
    i32 39, label %510
  ]

510:                                              ; preds = %508
  br label %511

511:                                              ; preds = %510
  %512 = load i32, ptr %47, align 4, !tbaa !5
  %513 = add nsw i32 %512, 1
  store i32 %513, ptr %47, align 4, !tbaa !5
  br label %474, !llvm.loop !30

514:                                              ; preds = %508, %478
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  %515 = load i32, ptr %3, align 4
  switch i32 %515, label %524 [
    i32 36, label %516
    i32 1, label %517
  ]

516:                                              ; preds = %514
  store i32 0, ptr %1, align 4
  br label %517

517:                                              ; preds = %516, %514
  %518 = load i32, ptr %1, align 4
  ret i32 %518

519:                                              ; preds = %468
  %520 = load ptr, ptr %25, align 8
  %521 = load i32, ptr %26, align 4
  %522 = insertvalue { ptr, i32 } poison, ptr %520, 0
  %523 = insertvalue { ptr, i32 } %522, i32 %521, 1
  resume { ptr, i32 } %523

524:                                              ; preds = %514
  unreachable
}

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

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

; 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)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 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)) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

; 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)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) #4

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr, ptr) #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr, ptr) #7

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"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 }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.5" = type { i32, %"struct.std::pair" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@g = external dso_local global [330 x [330 x i32]], align 16
@pts = external dso_local global [108900 x %"class.std::vector"], align 16
@d = external dso_local global [330 x [330 x i32]], align 16
@v = external dso_local global [330 x [330 x i32]], align 16
@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
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z9manhattaniiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4goodii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector.0", align 8
  %8 = alloca %"class.std::vector.0", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.5", align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.5", align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @p)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 1, ptr %1, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %.not112 = icmp slt i32 %22, 1
  %23 = load i32, ptr @m, align 4
  %24 = icmp slt i32 %23, 1
  %or.cond = select i1 %.not112, i1 true, i1 %24
  br i1 %or.cond, label %._crit_edge115, label %.lr.ph114.split

._crit_edge115:                                   ; preds = %._crit_edge, %0
  %25 = phi i32 [ %22, %0 ], [ %30, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %26 = load i32, ptr @p, align 4
  %.not92146 = icmp slt i32 %26, 2
  br i1 %.not92146, label %.preheader105, label %.lr.ph149

.lr.ph149:                                        ; preds = %._crit_edge115
  %.sroa.236.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %17, i64 8
  br label %69

.lr.ph114.split:                                  ; preds = %0, %._crit_edge
  %27 = phi i32 [ %30, %._crit_edge ], [ %22, %0 ]
  %28 = phi i32 [ %33, %._crit_edge ], [ 1, %0 ]
  %29 = phi i32 [ %32, %._crit_edge ], [ %23, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  %.not103110 = icmp slt i32 %29, 1
  br i1 %.not103110, label %._crit_edge, label %.lr.ph

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph114.split
  %30 = phi i32 [ %.pre194, %._crit_edge.loopexit ], [ %27, %.lr.ph114.split ]
  %31 = phi i32 [ %59, %._crit_edge.loopexit ], [ %28, %.lr.ph114.split ]
  %32 = phi i32 [ %63, %._crit_edge.loopexit ], [ %29, %.lr.ph114.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %33 = add nsw i32 %31, 1
  store i32 %33, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %31, %30
  br i1 %.not.not, label %.lr.ph114.split, label %._crit_edge115, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph114.split, %57
  %34 = phi i32 [ %59, %57 ], [ %28, %.lr.ph114.split ]
  %storemerge102111 = phi i32 [ %62, %57 ], [ 1, %.lr.ph114.split ]
  %35 = sext i32 %34 to i64
  %36 = sext i32 %storemerge102111 to i64
  %37 = getelementptr inbounds [330 x [330 x i32]], ptr @g, i64 0, i64 %35, i64 %36
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %37)
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [330 x [330 x i32]], ptr @g, i64 0, i64 %40, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %47 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %47, ptr %3, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [330 x [330 x i32]], ptr @g, i64 0, i64 %49, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 1
  br i1 %54, label %57, label %55

55:                                               ; preds = %.lr.ph
  %56 = call noundef i32 @_Z9manhattaniiii(i32 noundef 1, i32 noundef 1, i32 noundef %48, i32 noundef %50)
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.pre193 = load i32, ptr %2, align 4, !tbaa !5
  %.pre196 = sext i32 %.pre to i64
  %.pre197 = sext i32 %.pre193 to i64
  br label %57

57:                                               ; preds = %.lr.ph, %55
  %.pre-phi198 = phi i64 [ %51, %.lr.ph ], [ %.pre197, %55 ]
  %.pre-phi = phi i64 [ %49, %.lr.ph ], [ %.pre196, %55 ]
  %58 = phi i32 [ %50, %.lr.ph ], [ %.pre193, %55 ]
  %59 = phi i32 [ %48, %.lr.ph ], [ %.pre, %55 ]
  %60 = phi i32 [ 1000000000, %.lr.ph ], [ %56, %55 ]
  %61 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %.pre-phi, i64 %.pre-phi198
  store i32 %60, ptr %61, align 4, !tbaa !5
  %62 = add nsw i32 %58, 1
  store i32 %62, ptr %2, align 4, !tbaa !5
  %63 = load i32, ptr @m, align 4, !tbaa !5
  %.not103.not = icmp slt i32 %58, %63
  br i1 %.not103.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

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

.preheader105:                                    ; preds = %.preheader105.loopexit, %._crit_edge115
  %64 = phi i32 [ %293, %.preheader105.loopexit ], [ %26, %._crit_edge115 ]
  %65 = phi i32 [ %.pre195, %.preheader105.loopexit ], [ %25, %._crit_edge115 ]
  %.not93154 = icmp slt i32 %65, 1
  br i1 %.not93154, label %.loopexit, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader105
  %66 = load i32, ptr @m, align 4, !tbaa !5
  %.not94150 = icmp slt i32 %66, 1
  br i1 %.not94150, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %67 = add nuw i32 %66, 1
  %68 = add nuw i32 %65, 1
  %wide.trip.count191 = zext i32 %68 to i64
  %wide.trip.count186 = zext i32 %67 to i64
  br label %.preheader

69:                                               ; preds = %.lr.ph149, %292
  %indvars.iv180 = phi i64 [ 2, %.lr.ph149 ], [ %indvars.iv.next181, %292 ]
  %70 = add nsw i64 %indvars.iv180, -1
  %71 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %70
  %72 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  %73 = icmp ult i64 %72, 300
  br i1 %73, label %79, label %.preheader108

.preheader108:                                    ; preds = %69
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %.not95121 = icmp slt i32 %74, 1
  br i1 %.not95121, label %._crit_edge123, label %.preheader107.lr.ph

.preheader107.lr.ph:                              ; preds = %.preheader108
  %75 = load i32, ptr @m, align 4, !tbaa !5
  %.not101117 = icmp slt i32 %75, 1
  br i1 %.not101117, label %._crit_edge123, label %.preheader107.preheader

.preheader107.preheader:                          ; preds = %.preheader107.lr.ph
  %76 = add nuw i32 %75, 1
  %77 = add nuw i32 %74, 1
  %wide.trip.count168 = zext i32 %77 to i64
  %wide.trip.count = zext i32 %76 to i64
  %78 = zext nneg i32 %75 to i64
  %min.iters.check = icmp ult i32 %75, 8
  %n.vec = and i64 %78, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %cmp.n = icmp eq i64 %n.vec, %78
  br label %.preheader107

79:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %80 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %indvars.iv180
  %81 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %80) #7
  store ptr %81, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %82 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %80) #7
  store ptr %82, ptr %5, align 8
  %83 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br i1 %83, label %.lr.ph144, label %._crit_edge145

._crit_edge145:                                   ; preds = %._crit_edge142, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %292

.lr.ph144:                                        ; preds = %79, %._crit_edge142
  %84 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %85 = load i32, ptr %84, align 4, !tbaa !13
  %86 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %87 = getelementptr inbounds i8, ptr %86, i64 4
  %88 = load i32, ptr %87, align 4, !tbaa !15
  %89 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  %.not156 = icmp eq i64 %89, 0
  br i1 %.not156, label %._crit_edge142, label %.lr.ph141

.lr.ph141:                                        ; preds = %.lr.ph144
  %90 = sext i32 %85 to i64
  %91 = sext i32 %88 to i64
  %92 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %90, i64 %91
  br label %96

._crit_edge142:                                   ; preds = %96, %.lr.ph144
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %94 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %80) #7
  store ptr %94, ptr %5, align 8
  %95 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br i1 %95, label %.lr.ph144, label %._crit_edge145, !llvm.loop !16

96:                                               ; preds = %.lr.ph141, %96
  %indvars.iv177 = phi i64 [ 0, %.lr.ph141 ], [ %indvars.iv.next178, %96 ]
  %97 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %indvars.iv177) #7
  %98 = load i32, ptr %97, align 4, !tbaa !13
  %99 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %indvars.iv177) #7
  %100 = getelementptr inbounds i8, ptr %99, i64 4
  %101 = load i32, ptr %100, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %102 = sext i32 %98 to i64
  %103 = sext i32 %101 to i64
  %104 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %102, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = call noundef i32 @_Z9manhattaniiii(i32 noundef %85, i32 noundef %88, i32 noundef %98, i32 noundef %101)
  %107 = add nsw i32 %106, %105
  store i32 %107, ptr %6, align 4, !tbaa !5
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %92, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %109 = load i32, ptr %108, align 4, !tbaa !5
  store i32 %109, ptr %92, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1
  %110 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  %111 = icmp ugt i64 %110, %indvars.iv.next178
  br i1 %111, label %96, label %._crit_edge142, !llvm.loop !17

.preheader107:                                    ; preds = %.preheader107.preheader, %._crit_edge120
  %indvars.iv165 = phi i64 [ 1, %.preheader107.preheader ], [ %indvars.iv.next166, %._crit_edge120 ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

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

vector.body:                                      ; preds = %.preheader107, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader107 ]
  %offset.idx = or disjoint i64 %index, 1
  %112 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %indvars.iv165, i64 %offset.idx
  %113 = getelementptr inbounds i8, ptr %112, i64 16
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %112, align 4, !tbaa !5
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %113, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %114 = icmp eq i64 %index.next, %n.vec
  br i1 %114, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge120, label %scalar.ph.preheader

._crit_edge123:                                   ; preds = %._crit_edge120, %.preheader107.lr.ph, %.preheader108
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %115 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  store ptr %115, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %116 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  store ptr %116, ptr %10, align 8
  %117 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %117, label %.lr.ph125, label %._crit_edge126

._crit_edge120:                                   ; preds = %scalar.ph, %middle.block
  %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1
  %exitcond169.not = icmp eq i64 %indvars.iv.next166, %wide.trip.count168
  br i1 %exitcond169.not, label %._crit_edge123, label %.preheader107, !llvm.loop !21

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %118 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %indvars.iv165, i64 %indvars.iv
  store i32 1000000000, ptr %118, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond164.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond164.not, label %._crit_edge120, label %scalar.ph, !llvm.loop !22

._crit_edge126:                                   ; preds = %134, %._crit_edge123
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %119 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %120 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %119, ptr %120)
          to label %140 unwind label %177

.lr.ph125:                                        ; preds = %._crit_edge123, %134
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %121 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %122 = load i32, ptr %121, align 4, !tbaa !13
  store i32 %122, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %123 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %124 = getelementptr inbounds i8, ptr %123, i64 4
  %125 = load i32, ptr %124, align 4, !tbaa !15
  store i32 %125, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #7
  %126 = load i32, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %127 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %128 unwind label %138

128:                                              ; preds = %.lr.ph125
  %129 = sext i32 %125 to i64
  %130 = sext i32 %126 to i64
  %131 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %130, i64 %129
  store i64 %127, ptr %14, align 8
  %132 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %131, ptr noundef nonnull align 4 dereferenceable(8) %14)
          to label %133 unwind label %138

133:                                              ; preds = %128
  %.fca.0.extract33 = extractvalue { i64, i32 } %132, 0
  %.fca.1.extract34 = extractvalue { i64, i32 } %132, 1
  store i64 %.fca.0.extract33, ptr %13, align 8
  store i32 %.fca.1.extract34, ptr %.sroa.236.0..sroa_idx, align 8
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(12) %13)
          to label %134 unwind label %138

134:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %136 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  store ptr %136, ptr %10, align 8
  %137 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %137, label %.lr.ph125, label %._crit_edge126, !llvm.loop !23

138:                                              ; preds = %133, %128, %.lr.ph125
  %139 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %291

140:                                              ; preds = %._crit_edge126
  %141 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %142 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %141, ptr %142)
          to label %143 unwind label %177

143:                                              ; preds = %140
  %144 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(12) %144)
          to label %145 unwind label %179

145:                                              ; preds = %143
  %146 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %147 = load i32, ptr %146, align 4, !tbaa !24
  %148 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %149 = getelementptr inbounds i8, ptr %148, i64 4
  %150 = load i32, ptr %149, align 4, !tbaa !26
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %153 = getelementptr inbounds i8, ptr %152, i64 8
  %154 = load i32, ptr %153, align 4, !tbaa !27
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %151, i64 %155
  store i32 %147, ptr %156, align 4, !tbaa !5
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %157 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  %.not = icmp eq i64 %157, 0
  br i1 %.not, label %._crit_edge135, label %.lr.ph134

.lr.ph134:                                        ; preds = %145, %.loopexit106
  %indvars.iv174 = phi i64 [ %indvars.iv.next175, %.loopexit106 ], [ 0, %145 ]
  %158 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv174) #7
  %159 = getelementptr inbounds i8, ptr %158, i64 4
  %160 = load i32, ptr %159, align 4, !tbaa !26
  %161 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv174) #7
  %162 = getelementptr inbounds i8, ptr %161, i64 8
  %163 = load i32, ptr %162, align 4, !tbaa !27
  %164 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv174) #7
  %165 = load i32, ptr %164, align 4, !tbaa !24
  %indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1
  %166 = sext i32 %160 to i64
  %167 = sext i32 %163 to i64
  %168 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %166, i64 %167
  store i32 %165, ptr %168, align 4, !tbaa !5
  %169 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %.not96127 = icmp eq i64 %169, 0
  br i1 %.not96127, label %.critedge, label %.lr.ph129

.lr.ph129:                                        ; preds = %.lr.ph134, %175
  %170 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %171 = load i32, ptr %170, align 4, !tbaa !24
  %172 = icmp eq i32 %171, %165
  br i1 %172, label %173, label %.critedge

173:                                              ; preds = %.lr.ph129
  %174 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(12) %174)
          to label %175 unwind label %181

175:                                              ; preds = %173
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %176 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %.not96 = icmp eq i64 %176, 0
  br i1 %.not96, label %.critedge, label %.lr.ph129, !llvm.loop !28

177:                                              ; preds = %140, %._crit_edge126
  %178 = landingpad { ptr, i32 }
          cleanup
  br label %291

179:                                              ; preds = %143
  %180 = landingpad { ptr, i32 }
          cleanup
  br label %291

181:                                              ; preds = %173
  %182 = landingpad { ptr, i32 }
          cleanup
  br label %291

.critedge:                                        ; preds = %.lr.ph129, %175, %.lr.ph134
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  %183 = load i32, ptr @dx, align 16, !tbaa !5
  %184 = add nsw i32 %183, %160
  store i32 %184, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  %185 = load i32, ptr @dy, align 16, !tbaa !5
  %186 = add nsw i32 %185, %163
  store i32 %186, ptr %16, align 4, !tbaa !5
  %187 = call noundef zeroext i1 @_Z4goodii(i32 noundef %184, i32 noundef %186)
  br i1 %187, label %188, label %206

188:                                              ; preds = %.critedge
  %189 = load i32, ptr %15, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = load i32, ptr %16, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %190, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = icmp eq i32 %194, 1000000000
  br i1 %195, label %196, label %206

196:                                              ; preds = %188
  %197 = load i32, ptr %168, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %193, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  %199 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %200 unwind label %204

200:                                              ; preds = %196
  store i64 %199, ptr %18, align 8
  %201 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %193, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %202 unwind label %204

202:                                              ; preds = %200
  %.fca.0.extract = extractvalue { i64, i32 } %201, 0
  %.fca.1.extract = extractvalue { i64, i32 } %201, 1
  store i64 %.fca.0.extract, ptr %17, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %203 unwind label %204

203:                                              ; preds = %202
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #7
  br label %206

204:                                              ; preds = %270, %268, %264, %248, %246, %242, %226, %224, %220, %202, %200, %196
  %205 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  br label %291

206:                                              ; preds = %203, %188, %.critedge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  %207 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !5
  %208 = add nsw i32 %207, %160
  store i32 %208, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  %209 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !5
  %210 = add nsw i32 %209, %163
  store i32 %210, ptr %16, align 4, !tbaa !5
  %211 = call noundef zeroext i1 @_Z4goodii(i32 noundef %208, i32 noundef %210)
  br i1 %211, label %212, label %228

212:                                              ; preds = %206
  %213 = load i32, ptr %15, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = load i32, ptr %16, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %214, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = icmp eq i32 %218, 1000000000
  br i1 %219, label %220, label %228

220:                                              ; preds = %212
  %221 = load i32, ptr %168, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %217, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  %223 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %224 unwind label %204

224:                                              ; preds = %220
  store i64 %223, ptr %18, align 8
  %225 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %217, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %226 unwind label %204

226:                                              ; preds = %224
  %.fca.0.extract.1 = extractvalue { i64, i32 } %225, 0
  %.fca.1.extract.1 = extractvalue { i64, i32 } %225, 1
  store i64 %.fca.0.extract.1, ptr %17, align 8
  store i32 %.fca.1.extract.1, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %227 unwind label %204

227:                                              ; preds = %226
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #7
  br label %228

228:                                              ; preds = %227, %212, %206
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  %229 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !5
  %230 = add nsw i32 %229, %160
  store i32 %230, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  %231 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !5
  %232 = add nsw i32 %231, %163
  store i32 %232, ptr %16, align 4, !tbaa !5
  %233 = call noundef zeroext i1 @_Z4goodii(i32 noundef %230, i32 noundef %232)
  br i1 %233, label %234, label %250

234:                                              ; preds = %228
  %235 = load i32, ptr %15, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = load i32, ptr %16, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %236, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = icmp eq i32 %240, 1000000000
  br i1 %241, label %242, label %250

242:                                              ; preds = %234
  %243 = load i32, ptr %168, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %239, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  %245 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %246 unwind label %204

246:                                              ; preds = %242
  store i64 %245, ptr %18, align 8
  %247 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %239, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %248 unwind label %204

248:                                              ; preds = %246
  %.fca.0.extract.2 = extractvalue { i64, i32 } %247, 0
  %.fca.1.extract.2 = extractvalue { i64, i32 } %247, 1
  store i64 %.fca.0.extract.2, ptr %17, align 8
  store i32 %.fca.1.extract.2, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %249 unwind label %204

249:                                              ; preds = %248
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #7
  br label %250

250:                                              ; preds = %249, %234, %228
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  %251 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !5
  %252 = add nsw i32 %251, %160
  store i32 %252, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  %253 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !5
  %254 = add nsw i32 %253, %163
  store i32 %254, ptr %16, align 4, !tbaa !5
  %255 = call noundef zeroext i1 @_Z4goodii(i32 noundef %252, i32 noundef %254)
  br i1 %255, label %256, label %.loopexit106

256:                                              ; preds = %250
  %257 = load i32, ptr %15, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = load i32, ptr %16, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %258, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !5
  %263 = icmp eq i32 %262, 1000000000
  br i1 %263, label %264, label %.loopexit106

264:                                              ; preds = %256
  %265 = load i32, ptr %168, align 4, !tbaa !5
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %261, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  %267 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %268 unwind label %204

268:                                              ; preds = %264
  store i64 %267, ptr %18, align 8
  %269 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %261, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %270 unwind label %204

270:                                              ; preds = %268
  %.fca.0.extract.3 = extractvalue { i64, i32 } %269, 0
  %.fca.1.extract.3 = extractvalue { i64, i32 } %269, 1
  store i64 %.fca.0.extract.3, ptr %17, align 8
  store i32 %.fca.1.extract.3, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %271 unwind label %204

271:                                              ; preds = %270
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #7
  br label %.loopexit106

.loopexit106:                                     ; preds = %271, %256, %250
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  %272 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  %273 = icmp ugt i64 %272, %indvars.iv.next175
  br i1 %273, label %.lr.ph134, label %._crit_edge135, !llvm.loop !29

._crit_edge135:                                   ; preds = %.loopexit106, %145
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #7
  %274 = getelementptr inbounds [108900 x %"class.std::vector"], ptr @pts, i64 0, i64 %indvars.iv180
  %275 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %274) #7
  store ptr %275, ptr %19, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #7
  %276 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %274) #7
  store ptr %276, ptr %20, align 8
  %277 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #7
  br i1 %277, label %.lr.ph137, label %._crit_edge138

._crit_edge138:                                   ; preds = %.lr.ph137, %._crit_edge135
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %292

.lr.ph137:                                        ; preds = %._crit_edge135, %.lr.ph137
  %278 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %279 = load i32, ptr %278, align 4, !tbaa !13
  %280 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %281 = getelementptr inbounds i8, ptr %280, i64 4
  %282 = load i32, ptr %281, align 4, !tbaa !15
  %283 = sext i32 %279 to i64
  %284 = sext i32 %282 to i64
  %285 = getelementptr inbounds [330 x [330 x i32]], ptr @v, i64 0, i64 %283, i64 %284
  %286 = load i32, ptr %285, align 4, !tbaa !5
  %287 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %283, i64 %284
  store i32 %286, ptr %287, align 4, !tbaa !5
  %288 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #7
  %289 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %274) #7
  store ptr %289, ptr %20, align 8
  %290 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #7
  br i1 %290, label %.lr.ph137, label %._crit_edge138, !llvm.loop !30

291:                                              ; preds = %179, %204, %181, %177, %138
  %.pn99 = phi { ptr, i32 } [ %139, %138 ], [ %178, %177 ], [ %180, %179 ], [ %182, %181 ], [ %205, %204 ]
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn99

292:                                              ; preds = %._crit_edge145, %._crit_edge138
  %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
  %293 = load i32, ptr @p, align 4
  %294 = sext i32 %293 to i64
  %.not92.not = icmp slt i64 %indvars.iv180, %294
  br i1 %.not92.not, label %69, label %.preheader105.loopexit, !llvm.loop !31

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge153
  %indvars.iv188 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next189, %._crit_edge153 ]
  br label %296

295:                                              ; preds = %296
  %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
  %exitcond187.not = icmp eq i64 %indvars.iv.next184, %wide.trip.count186
  br i1 %exitcond187.not, label %._crit_edge153, label %296, !llvm.loop !32

296:                                              ; preds = %.preheader, %295
  %indvars.iv183 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next184, %295 ]
  %297 = getelementptr inbounds [330 x [330 x i32]], ptr @g, i64 0, i64 %indvars.iv188, i64 %indvars.iv183
  %298 = load i32, ptr %297, align 4, !tbaa !5
  %299 = icmp eq i32 %298, %64
  br i1 %299, label %300, label %295

300:                                              ; preds = %296
  %301 = getelementptr inbounds [330 x [330 x i32]], ptr @d, i64 0, i64 %indvars.iv188, i64 %indvars.iv183
  %302 = load i32, ptr %301, align 4, !tbaa !5
  %303 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %302)
  br label %.loopexit

._crit_edge153:                                   ; preds = %295
  %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
  %exitcond192.not = icmp eq i64 %indvars.iv.next189, %wide.trip.count191
  br i1 %exitcond192.not, label %.loopexit, label %.preheader, !llvm.loop !33

.loopexit:                                        ; preds = %._crit_edge153, %.preheader.lr.ph, %.preheader105, %300
  ret i32 0
}

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

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

; 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 #4 align 2

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

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 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 #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

; 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 #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr, ptr) local_unnamed_addr #6

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr, ptr) local_unnamed_addr #6

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!15 = !{!14, !6, i64 4}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !20, !19}
!23 = distinct !{!23, !10}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !14, i64 4}
!26 = !{!25, !6, i64 4}
!27 = !{!25, !6, i64 8}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}


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