; LLVM IR from bqi343/cp-notebook :: Contests/Other Solutions/UCF HSPT/2018/slayer.ll (Z5solvev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@q = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@v = external dso_local global [4 x %"class.std::vector"], align 16
@dp = external dso_local global [105 x [105 x i32]], align 16
@DP = external dso_local global [105 x [105 x i32]], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"struct.std::pair", align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca %"struct.std::pair", align 4
  %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
  call void @_ZN2io2reIiJiiiiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @q, ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m, ptr noundef nonnull align 4 dereferenceable(4) @p, ptr noundef nonnull align 4 dereferenceable(4) @a)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %45, %0
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = icmp slt i32 %38, 4
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %48

41:                                               ; preds = %37
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [4 x %"class.std::vector"], ptr @v, i64 0, i64 %43
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #6
  br label %45

45:                                               ; preds = %41
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %1, align 4, !tbaa !5
  br label %37, !llvm.loop !9

48:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %58, %48
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @_ZN2io2reIiJiiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [4 x %"class.std::vector"], ptr @v, i64 0, i64 %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %58

58:                                               ; preds = %54
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %2, align 4, !tbaa !5
  br label %49, !llvm.loop !11

61:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %88, %61
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 105
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %91

66:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %84, %66
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = icmp slt i32 %68, 105
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %87

71:                                               ; preds = %67
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %73
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [105 x i32], ptr %74, i64 0, i64 %76
  store i32 1000000007, ptr %77, align 4, !tbaa !5
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %79
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [105 x i32], ptr %80, i64 0, i64 %82
  store i32 1000000007, ptr %83, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %71
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %9, align 4, !tbaa !5
  br label %67, !llvm.loop !12

87:                                               ; preds = %70
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %7, align 4, !tbaa !5
  br label %62, !llvm.loop !13

91:                                               ; preds = %65
  %92 = load i32, ptr @q, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %93
  %95 = load i32, ptr @p, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [105 x i32], ptr %94, i64 0, i64 %96
  store i32 0, ptr %97, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr getelementptr (i8, ptr @v, i64 48), ptr %10, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %98 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr (i8, ptr @v, i64 48)) #6
  %99 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %100 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr (i8, ptr @v, i64 48)) #6
  %101 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %100, ptr %101, align 8
  br label %102

102:                                              ; preds = %146, %91
  %103 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br i1 %103, label %105, label %104

104:                                              ; preds = %102
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %148

105:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %106 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %106, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 104, ptr %14, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %142, %105
  %108 = load i32, ptr %14, align 4, !tbaa !5
  %109 = icmp sge i32 %108, 0
  br i1 %109, label %111, label %110

110:                                              ; preds = %107
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %145

111:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 104, ptr %15, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %138, %111
  %113 = load i32, ptr %15, align 4, !tbaa !5
  %114 = icmp sge i32 %113, 0
  br i1 %114, label %116, label %115

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

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %117 = load i32, ptr %14, align 4, !tbaa !5
  %118 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %119 = load i32, ptr %118, align 4, !tbaa !16
  %120 = add nsw i32 %117, %119
  store i32 %120, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 104, ptr %17, align 4, !tbaa !5
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %123
  %125 = load i32, ptr %15, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [105 x i32], ptr %124, i64 0, i64 %126
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %129
  %131 = load i32, ptr %15, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [105 x i32], ptr %130, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %136 = load i32, ptr %135, align 4, !tbaa !18
  %137 = add nsw i32 %134, %136
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %127, i32 noundef %137)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %138

138:                                              ; preds = %116
  %139 = load i32, ptr %15, align 4, !tbaa !5
  %140 = add nsw i32 %139, -1
  store i32 %140, ptr %15, align 4, !tbaa !5
  br label %112, !llvm.loop !19

141:                                              ; preds = %115
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = add nsw i32 %143, -1
  store i32 %144, ptr %14, align 4, !tbaa !5
  br label %107, !llvm.loop !20

145:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %146

146:                                              ; preds = %145
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  br label %102

148:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store ptr getelementptr (i8, ptr @v, i64 72), ptr %18, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %149 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr (i8, ptr @v, i64 72)) #6
  %150 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %151 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr (i8, ptr @v, i64 72)) #6
  %152 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  br label %153

153:                                              ; preds = %197, %148
  %154 = 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) #6
  br i1 %154, label %156, label %155

155:                                              ; preds = %153
  store i32 22, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %199

156:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %157 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %157, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 104, ptr %22, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %193, %156
  %159 = load i32, ptr %22, align 4, !tbaa !5
  %160 = icmp sge i32 %159, 0
  br i1 %160, label %162, label %161

161:                                              ; preds = %158
  store i32 24, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %196

162:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %189, %162
  %164 = load i32, ptr %23, align 4, !tbaa !5
  %165 = icmp slt i32 %164, 105
  br i1 %165, label %167, label %166

166:                                              ; preds = %163
  store i32 27, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %192

167:                                              ; preds = %163
  %168 = load i32, ptr %22, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %171 = load i32, ptr %23, align 4, !tbaa !5
  %172 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %173 = load i32, ptr %172, align 4, !tbaa !16
  %174 = sub nsw i32 %171, %173
  store i32 %174, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !5
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [105 x i32], ptr %170, i64 0, i64 %177
  %179 = load i32, ptr %22, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %180
  %182 = load i32, ptr %23, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [105 x i32], ptr %181, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %187 = load i32, ptr %186, align 4, !tbaa !18
  %188 = add nsw i32 %185, %187
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %178, i32 noundef %188)
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %189

189:                                              ; preds = %167
  %190 = load i32, ptr %23, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %23, align 4, !tbaa !5
  br label %163, !llvm.loop !21

192:                                              ; preds = %166
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %22, align 4, !tbaa !5
  %195 = add nsw i32 %194, -1
  store i32 %195, ptr %22, align 4, !tbaa !5
  br label %158, !llvm.loop !22

196:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %197

197:                                              ; preds = %196
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  br label %153

199:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %252, %199
  %201 = load i32, ptr %26, align 4, !tbaa !5
  %202 = icmp slt i32 %201, 105
  br i1 %202, label %204, label %203

203:                                              ; preds = %200
  store i32 30, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %255

204:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %205

205:                                              ; preds = %248, %204
  %206 = load i32, ptr %27, align 4, !tbaa !5
  %207 = icmp slt i32 %206, 105
  br i1 %207, label %209, label %208

208:                                              ; preds = %205
  store i32 33, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %251

209:                                              ; preds = %205
  %210 = load i32, ptr %27, align 4, !tbaa !5
  %211 = icmp eq i32 %210, 0
  br i1 %211, label %212, label %226

212:                                              ; preds = %209
  %213 = load i32, ptr %26, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %214
  %216 = load i32, ptr %27, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [105 x i32], ptr %215, i64 0, i64 %217
  %219 = load i32, ptr %26, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %220
  %222 = load i32, ptr %27, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [105 x i32], ptr %221, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %218, i32 noundef %225)
  br label %247

226:                                              ; preds = %209
  %227 = load i32, ptr %26, align 4, !tbaa !5
  %228 = load i32, ptr @a, align 4, !tbaa !5
  %229 = icmp sgt i32 %227, %228
  br i1 %229, label %230, label %246

230:                                              ; preds = %226
  %231 = load i32, ptr %26, align 4, !tbaa !5
  %232 = load i32, ptr @a, align 4, !tbaa !5
  %233 = sub nsw i32 %231, %232
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %234
  %236 = load i32, ptr %27, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [105 x i32], ptr %235, i64 0, i64 %237
  %239 = load i32, ptr %26, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %240
  %242 = load i32, ptr %27, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [105 x i32], ptr %241, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %238, i32 noundef %245)
  br label %246

246:                                              ; preds = %230, %226
  br label %247

247:                                              ; preds = %246, %212
  br label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %27, align 4, !tbaa !5
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %27, align 4, !tbaa !5
  br label %205, !llvm.loop !23

251:                                              ; preds = %208
  br label %252

252:                                              ; preds = %251
  %253 = load i32, ptr %26, align 4, !tbaa !5
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %26, align 4, !tbaa !5
  br label %200, !llvm.loop !24

255:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  store ptr getelementptr (i8, ptr @v, i64 24), ptr %28, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %256 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr (i8, ptr @v, i64 24)) #6
  %257 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %256, ptr %257, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %258 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr (i8, ptr @v, i64 24)) #6
  %259 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %258, ptr %259, align 8
  br label %260

260:                                              ; preds = %304, %255
  %261 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #6
  br i1 %261, label %263, label %262

262:                                              ; preds = %260
  store i32 36, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %306

263:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %264 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %264, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  store i32 104, ptr %32, align 4, !tbaa !5
  br label %265

265:                                              ; preds = %300, %263
  %266 = load i32, ptr %32, align 4, !tbaa !5
  %267 = icmp sge i32 %266, 0
  br i1 %267, label %269, label %268

268:                                              ; preds = %265
  store i32 38, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %303

269:                                              ; preds = %265
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %270

270:                                              ; preds = %296, %269
  %271 = load i32, ptr %33, align 4, !tbaa !5
  %272 = icmp slt i32 %271, 105
  br i1 %272, label %274, label %273

273:                                              ; preds = %270
  store i32 41, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  br label %299

274:                                              ; preds = %270
  %275 = load i32, ptr %32, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %276
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #6
  %278 = load i32, ptr %33, align 4, !tbaa !5
  %279 = getelementptr inbounds %"struct.std::pair", ptr %31, i32 0, i32 0
  %280 = load i32, ptr %279, align 4, !tbaa !16
  %281 = sub nsw i32 %278, %280
  store i32 %281, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #6
  store i32 0, ptr %35, align 4, !tbaa !5
  %282 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %34, ptr noundef nonnull align 4 dereferenceable(4) %35)
  %283 = load i32, ptr %282, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [105 x i32], ptr %277, i64 0, i64 %284
  %286 = load i32, ptr %32, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %287
  %289 = load i32, ptr %33, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [105 x i32], ptr %288, i64 0, i64 %290
  %292 = load i32, ptr %291, align 4, !tbaa !5
  %293 = getelementptr inbounds %"struct.std::pair", ptr %31, i32 0, i32 1
  %294 = load i32, ptr %293, align 4, !tbaa !18
  %295 = add nsw i32 %292, %294
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %285, i32 noundef %295)
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #6
  br label %296

296:                                              ; preds = %274
  %297 = load i32, ptr %33, align 4, !tbaa !5
  %298 = add nsw i32 %297, 1
  store i32 %298, ptr %33, align 4, !tbaa !5
  br label %270, !llvm.loop !25

299:                                              ; preds = %273
  br label %300

300:                                              ; preds = %299
  %301 = load i32, ptr %32, align 4, !tbaa !5
  %302 = add nsw i32 %301, -1
  store i32 %302, ptr %32, align 4, !tbaa !5
  br label %265, !llvm.loop !26

303:                                              ; preds = %268
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  br label %304

304:                                              ; preds = %303
  %305 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #6
  br label %260

306:                                              ; preds = %262
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  store i32 0, ptr %36, align 4, !tbaa !5
  br label %307

307:                                              ; preds = %322, %306
  %308 = load i32, ptr %36, align 4, !tbaa !5
  %309 = icmp slt i32 %308, 105
  br i1 %309, label %311, label %310

310:                                              ; preds = %307
  store i32 44, ptr %8, align 4
  br label %325

311:                                              ; preds = %307
  %312 = load i32, ptr %36, align 4, !tbaa !5
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %313
  %315 = getelementptr inbounds [105 x i32], ptr %314, i64 0, i64 0
  %316 = load i32, ptr %315, align 4, !tbaa !5
  %317 = load i32, ptr @m, align 4, !tbaa !5
  %318 = icmp sle i32 %316, %317
  br i1 %318, label %319, label %321

319:                                              ; preds = %311
  %320 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
  store i32 1, ptr %8, align 4
  br label %325

321:                                              ; preds = %311
  br label %322

322:                                              ; preds = %321
  %323 = load i32, ptr %36, align 4, !tbaa !5
  %324 = add nsw i32 %323, 1
  store i32 %324, ptr %36, align 4, !tbaa !5
  br label %307, !llvm.loop !27

325:                                              ; preds = %319, %310
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  %326 = load i32, ptr %8, align 4
  switch i32 %326, label %330 [
    i32 44, label %327
    i32 1, label %329
  ]

327:                                              ; preds = %325
  %328 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.7)
  br label %329

329:                                              ; preds = %327, %325
  ret void

330:                                              ; preds = %325
  unreachable
}

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

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

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

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

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

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

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

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

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

; Function Attrs: 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) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #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)) #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!18 = !{!17, !6, i64 4}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@q = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@v = external dso_local global [4 x %"class.std::vector"], align 16
@dp = external dso_local global [105 x [105 x i32]], align 16
@DP = external dso_local global [105 x [105 x i32]], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #1 {
.preheader81:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 4
  %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 i32, align 4
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  tail call void @_ZN2io2reIiJiiiiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @q, ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m, ptr noundef nonnull align 4 dereferenceable(4) @p, ptr noundef nonnull align 4 dereferenceable(4) @a)
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #5
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 24)) #5
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 48)) #5
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 72)) #5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %vector.ph.preheader

.lr.ph:                                           ; preds = %.preheader81, %.lr.ph
  %.06283 = phi i32 [ %21, %.lr.ph ], [ 0, %.preheader81 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @_ZN2io2reIiJiiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = load i32, ptr %0, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [4 x %"class.std::vector"], ptr @v, i64 0, i64 %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #5
  %21 = add nuw nsw i32 %.06283, 1
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %.lr.ph, label %vector.ph.preheader, !llvm.loop !9

vector.ph.preheader:                              ; preds = %.lr.ph, %.preheader81
  br label %vector.ph

vector.ph:                                        ; preds = %vector.ph.preheader, %vector.ph
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %vector.ph ], [ 0, %vector.ph.preheader ]
  %24 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 0
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %24, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %25, align 4, !tbaa !5
  %26 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 0
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %26, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %27, align 4, !tbaa !5
  %28 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 8
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %28, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 8
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %30, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %31, align 4, !tbaa !5
  %32 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 16
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %32, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %33, align 4, !tbaa !5
  %34 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 16
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %34, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %35, align 4, !tbaa !5
  %36 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 24
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %36, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %37, align 4, !tbaa !5
  %38 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 24
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %38, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %39, align 4, !tbaa !5
  %40 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 32
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %40, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %41, align 4, !tbaa !5
  %42 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 32
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %42, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %43, align 4, !tbaa !5
  %44 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 40
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %44, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %45, align 4, !tbaa !5
  %46 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 40
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %46, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %47, align 4, !tbaa !5
  %48 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 48
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %48, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %49, align 4, !tbaa !5
  %50 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 48
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %50, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %51, align 4, !tbaa !5
  %52 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 56
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %52, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %53, align 4, !tbaa !5
  %54 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 56
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %54, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %55, align 4, !tbaa !5
  %56 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 64
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %56, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %57, align 4, !tbaa !5
  %58 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 64
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %58, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %59, align 4, !tbaa !5
  %60 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 72
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %60, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %61, align 4, !tbaa !5
  %62 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 72
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %62, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %63, align 4, !tbaa !5
  %64 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 80
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %64, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %65, align 4, !tbaa !5
  %66 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 80
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %66, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %67, align 4, !tbaa !5
  %68 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 88
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %68, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %69, align 4, !tbaa !5
  %70 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 88
  %71 = getelementptr inbounds i8, ptr %70, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %70, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %71, align 4, !tbaa !5
  %72 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 96
  %73 = getelementptr inbounds i8, ptr %72, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %72, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %73, align 4, !tbaa !5
  %74 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 96
  %75 = getelementptr inbounds i8, ptr %74, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %74, align 4, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %75, align 4, !tbaa !5
  %76 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv104, i64 104
  store i32 1000000007, ptr %76, align 4, !tbaa !5
  %77 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv104, i64 104
  store i32 1000000007, ptr %77, align 4, !tbaa !5
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next105, 105
  br i1 %exitcond107.not, label %78, label %vector.ph, !llvm.loop !11

78:                                               ; preds = %vector.ph
  %79 = load i32, ptr @q, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = load i32, ptr @p, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %80, i64 %82
  store i32 0, ptr %83, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %84 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 48)) #5
  store ptr %84, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %85 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 48)) #5
  store ptr %85, ptr %5, align 8
  %86 = 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) #5
  br i1 %86, label %.lr.ph88, label %._crit_edge

._crit_edge:                                      ; preds = %93, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %87 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 72)) #5
  store ptr %87, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %88 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 72)) #5
  store ptr %88, ptr %9, align 8
  %89 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %89, label %.lr.ph92, label %._crit_edge93

.lr.ph88:                                         ; preds = %78, %93
  %90 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %.sroa.043.0.copyload = load i32, ptr %90, align 4
  %.sroa.444.0..sroa_idx = getelementptr inbounds i8, ptr %90, i64 4
  %.sroa.444.0.copyload = load i32, ptr %.sroa.444.0..sroa_idx, align 4
  br label %.preheader78

.preheader78:                                     ; preds = %.lr.ph88, %96
  %indvars.iv111 = phi i64 [ 104, %.lr.ph88 ], [ %indvars.iv.next112, %96 ]
  %91 = trunc i64 %indvars.iv111 to i32
  %92 = add i32 %.sroa.043.0.copyload, %91
  br label %97

93:                                               ; preds = %96
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %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) #5
  br i1 %95, label %.lr.ph88, label %._crit_edge

96:                                               ; preds = %97
  %indvars.iv.next112 = add nsw i64 %indvars.iv111, -1
  %.not144 = icmp eq i64 %indvars.iv111, 0
  br i1 %.not144, label %93, label %.preheader78, !llvm.loop !12

97:                                               ; preds = %.preheader78, %97
  %indvars.iv108 = phi i64 [ 104, %.preheader78 ], [ %indvars.iv.next109, %97 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store i32 %92, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 104, ptr %7, align 4, !tbaa !5
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %100, i64 %indvars.iv108
  %102 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv111, i64 %indvars.iv108
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = add nsw i32 %103, %.sroa.444.0.copyload
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %101, i32 noundef %104)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %indvars.iv.next109 = add nsw i64 %indvars.iv108, -1
  %.not143 = icmp eq i64 %indvars.iv108, 0
  br i1 %.not143, label %96, label %97, !llvm.loop !13

._crit_edge93:                                    ; preds = %106, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %.peel.next

.lr.ph92:                                         ; preds = %._crit_edge, %106
  %105 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %.sroa.033.0.copyload = load i32, ptr %105, align 4
  %.sroa.434.0..sroa_idx = getelementptr inbounds i8, ptr %105, i64 4
  %.sroa.434.0.copyload = load i32, ptr %.sroa.434.0..sroa_idx, align 4
  br label %.preheader77

.preheader77:                                     ; preds = %.lr.ph92, %109
  %indvars.iv118 = phi i64 [ 104, %.lr.ph92 ], [ %indvars.iv.next119, %109 ]
  br label %110

106:                                              ; preds = %109
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %108 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %108, label %.lr.ph92, label %._crit_edge93

109:                                              ; preds = %110
  %indvars.iv.next119 = add nsw i64 %indvars.iv118, -1
  %.not145 = icmp eq i64 %indvars.iv118, 0
  br i1 %.not145, label %106, label %.preheader77, !llvm.loop !14

110:                                              ; preds = %.preheader77, %110
  %indvars.iv114 = phi i64 [ 0, %.preheader77 ], [ %indvars.iv.next115, %110 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  %111 = trunc i64 %indvars.iv114 to i32
  %112 = sub i32 %111, %.sroa.033.0.copyload
  store i32 %112, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv118, i64 %115
  %117 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv118, i64 %indvars.iv114
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = add nsw i32 %118, %.sroa.434.0.copyload
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %116, i32 noundef %119)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %exitcond117.not = icmp eq i64 %indvars.iv.next115, 105
  br i1 %exitcond117.not, label %109, label %110, !llvm.loop !15

.peel.next:                                       ; preds = %.loopexit, %._crit_edge93
  %indvars.iv126 = phi i64 [ 0, %._crit_edge93 ], [ %indvars.iv.next127, %.loopexit ]
  %120 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv126
  %121 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv126
  %122 = load i32, ptr %120, align 4, !tbaa !5
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %121, i32 noundef %122)
  %123 = trunc nuw nsw i64 %indvars.iv126 to i32
  br label %128

124:                                              ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %125 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 24)) #5
  store ptr %125, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %126 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @v, i64 24)) #5
  store ptr %126, ptr %13, align 8
  %127 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %127, label %.lr.ph99, label %._crit_edge100

.loopexit:                                        ; preds = %138
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %exitcond129.not = icmp eq i64 %indvars.iv.next127, 105
  br i1 %exitcond129.not, label %124, label %.peel.next, !llvm.loop !16

128:                                              ; preds = %138, %.peel.next
  %indvars.iv121 = phi i64 [ 1, %.peel.next ], [ %indvars.iv.next122, %138 ]
  %129 = load i32, ptr @a, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = icmp sgt i64 %indvars.iv126, %130
  br i1 %131, label %132, label %138

132:                                              ; preds = %128
  %133 = sub nsw i32 %123, %129
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %134, i64 %indvars.iv121
  %136 = getelementptr inbounds [105 x [105 x i32]], ptr @dp, i64 0, i64 %indvars.iv126, i64 %indvars.iv121
  %137 = load i32, ptr %136, align 4, !tbaa !5
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %135, i32 noundef %137)
  br label %138

138:                                              ; preds = %132, %128
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond124.not = icmp eq i64 %indvars.iv.next122, 105
  br i1 %exitcond124.not, label %.loopexit, label %128, !llvm.loop !17

._crit_edge100:                                   ; preds = %141, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %139 = load i32, ptr @m, align 4, !tbaa !5
  br label %168

.lr.ph99:                                         ; preds = %124, %141
  %140 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %.sroa.0.0.copyload = load i32, ptr %140, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %140, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 4
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph99, %144
  %indvars.iv134 = phi i64 [ 104, %.lr.ph99 ], [ %indvars.iv.next135, %144 ]
  br label %145

141:                                              ; preds = %144
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %143 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %143, label %.lr.ph99, label %._crit_edge100

144:                                              ; preds = %145
  %indvars.iv.next135 = add nsw i64 %indvars.iv134, -1
  %.not146 = icmp eq i64 %indvars.iv134, 0
  br i1 %.not146, label %141, label %.preheader, !llvm.loop !19

145:                                              ; preds = %.preheader, %145
  %indvars.iv130 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next131, %145 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #5
  %146 = trunc i64 %indvars.iv130 to i32
  %147 = sub i32 %146, %.sroa.0.0.copyload
  store i32 %147, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv134, i64 %150
  %152 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv134, i64 %indvars.iv130
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = add nsw i32 %153, %.sroa.4.0.copyload
  call void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %151, i32 noundef %154)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %exitcond133.not = icmp eq i64 %indvars.iv.next131, 105
  br i1 %exitcond133.not, label %144, label %145, !llvm.loop !20

155:                                              ; preds = %168
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %156 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv.next138
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %.not.1 = icmp sgt i32 %157, %139
  br i1 %.not.1, label %158, label %171

158:                                              ; preds = %155
  %indvars.iv.next138.1 = add nuw nsw i64 %indvars.iv137, 2
  %159 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv.next138.1
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %.not.2 = icmp sgt i32 %160, %139
  br i1 %.not.2, label %161, label %171

161:                                              ; preds = %158
  %indvars.iv.next138.2 = add nuw nsw i64 %indvars.iv137, 3
  %162 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv.next138.2
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %.not.3 = icmp sgt i32 %163, %139
  br i1 %.not.3, label %164, label %171

164:                                              ; preds = %161
  %indvars.iv.next138.3 = add nuw nsw i64 %indvars.iv137, 4
  %165 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv.next138.3
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %.not.4 = icmp sgt i32 %166, %139
  br i1 %.not.4, label %167, label %171

167:                                              ; preds = %164
  %indvars.iv.next138.4 = add nuw nsw i64 %indvars.iv137, 5
  %exitcond140.not.4 = icmp eq i64 %indvars.iv.next138.4, 105
  br i1 %exitcond140.not.4, label %171, label %168, !llvm.loop !21

168:                                              ; preds = %167, %._crit_edge100
  %indvars.iv137 = phi i64 [ 0, %._crit_edge100 ], [ %indvars.iv.next138.4, %167 ]
  %169 = getelementptr inbounds [105 x [105 x i32]], ptr @DP, i64 0, i64 %indvars.iv137
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %.not = icmp sgt i32 %170, %139
  br i1 %.not, label %155, label %171

171:                                              ; preds = %167, %164, %161, %158, %155, %168
  %.str.6.sink = phi ptr [ @.str.6, %168 ], [ @.str.6, %155 ], [ @.str.6, %158 ], [ @.str.6, %161 ], [ @.str.6, %164 ], [ @.str.7, %167 ]
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.6.sink)
  ret void
}

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5ckminIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #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 #3

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

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

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

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

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass