; LLVM IR from eyangch/competitive-programming :: CALICO/2022_fall/5 (5)

; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@D = external dso_local global i64, align 8
@B = external dso_local global [100000 x i64], align 16
@S = external dso_local global [100000 x i64], align 16
@E = external dso_local global [100000 x i64], align 16
@dp = external dso_local global [100001 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %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 i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %23

23:                                               ; preds = %208, %0
  %24 = load i64, ptr @T, align 8, !tbaa !8
  %25 = add nsw i64 %24, -1
  store i64 %25, ptr @T, align 8, !tbaa !8
  %26 = icmp ne i64 %24, 0
  br i1 %26, label %27, label %216

27:                                               ; preds = %23
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(8) @D)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %31

31:                                               ; preds = %40, %27
  %32 = load i64, ptr %2, align 8, !tbaa !8
  %33 = load i64, ptr @N, align 8, !tbaa !8
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %43

36:                                               ; preds = %31
  %37 = load i64, ptr %2, align 8, !tbaa !8
  %38 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %38)
  br label %40

40:                                               ; preds = %36
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = add nsw i64 %41, 1
  store i64 %42, ptr %2, align 8, !tbaa !8
  br label %31, !llvm.loop !11

43:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %44

44:                                               ; preds = %93, %43
  %45 = load i64, ptr %5, align 8, !tbaa !8
  %46 = load i64, ptr @N, align 8, !tbaa !8
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %96

49:                                               ; preds = %44
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %51 = load i64, ptr %50, align 8, !tbaa !8
  store i64 %51, ptr %4, align 8, !tbaa !8
  br label %52

52:                                               ; preds = %69, %49
  %53 = load i64, ptr %4, align 8, !tbaa !8
  %54 = load i64, ptr @N, align 8, !tbaa !8
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %56, label %67

56:                                               ; preds = %52
  %57 = load i64, ptr %4, align 8, !tbaa !8
  %58 = load i64, ptr %5, align 8, !tbaa !8
  %59 = load i64, ptr @D, align 8, !tbaa !8
  %60 = add nsw i64 %58, %59
  %61 = icmp slt i64 %57, %60
  br i1 %61, label %62, label %67

62:                                               ; preds = %56
  %63 = load i64, ptr %4, align 8, !tbaa !8
  %64 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = icmp ne i64 %65, 0
  br label %67

67:                                               ; preds = %62, %56, %52
  %68 = phi i1 [ false, %56 ], [ false, %52 ], [ %66, %62 ]
  br i1 %68, label %69, label %77

69:                                               ; preds = %67
  %70 = load i64, ptr %4, align 8, !tbaa !8
  %71 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = load i64, ptr %3, align 8, !tbaa !8
  %74 = add nsw i64 %73, %72
  store i64 %74, ptr %3, align 8, !tbaa !8
  %75 = load i64, ptr %4, align 8, !tbaa !8
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %4, align 8, !tbaa !8
  br label %52, !llvm.loop !13

77:                                               ; preds = %67
  %78 = load i64, ptr %3, align 8, !tbaa !8
  %79 = load i64, ptr %5, align 8, !tbaa !8
  %80 = getelementptr inbounds [100000 x i64], ptr @S, i64 0, i64 %79
  store i64 %78, ptr %80, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %81 = load i64, ptr %5, align 8, !tbaa !8
  %82 = load i64, ptr @D, align 8, !tbaa !8
  %83 = add nsw i64 %81, %82
  store i64 %83, ptr %6, align 8, !tbaa !8
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @N, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = load i64, ptr %5, align 8, !tbaa !8
  %87 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %86
  store i64 %85, ptr %87, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %88 = load i64, ptr %5, align 8, !tbaa !8
  %89 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !8
  %91 = load i64, ptr %3, align 8, !tbaa !8
  %92 = sub nsw i64 %91, %90
  store i64 %92, ptr %3, align 8, !tbaa !8
  br label %93

93:                                               ; preds = %77
  %94 = load i64, ptr %5, align 8, !tbaa !8
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %5, align 8, !tbaa !8
  br label %44, !llvm.loop !14

96:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %97

97:                                               ; preds = %119, %96
  %98 = load i64, ptr %7, align 8, !tbaa !8
  %99 = load i64, ptr @N, align 8, !tbaa !8
  %100 = icmp sle i64 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %122

102:                                              ; preds = %97
  %103 = load i64, ptr %7, align 8, !tbaa !8
  %104 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %103
  %105 = load i64, ptr @K, align 8, !tbaa !8
  %106 = add nsw i64 %105, 1
  call void @_ZNSt6vectorIxSaIxEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106)
  %107 = load i64, ptr %7, align 8, !tbaa !8
  %108 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %107
  %109 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #7
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %109, ptr %110, align 8
  %111 = load i64, ptr %7, align 8, !tbaa !8
  %112 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %111
  %113 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %112) #7
  %114 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !15
  %115 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8
  %117 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEiEvT_S7_RKT0_(ptr %116, ptr %118, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %119

119:                                              ; preds = %102
  %120 = load i64, ptr %7, align 8, !tbaa !8
  %121 = add nsw i64 %120, 1
  store i64 %121, ptr %7, align 8, !tbaa !8
  br label %97, !llvm.loop !17

122:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %123

123:                                              ; preds = %180, %122
  %124 = load i64, ptr %11, align 8, !tbaa !8
  %125 = load i64, ptr @N, align 8, !tbaa !8
  %126 = icmp slt i64 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 15, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %183

128:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %129

129:                                              ; preds = %176, %128
  %130 = load i64, ptr %13, align 8, !tbaa !8
  %131 = load i64, ptr @K, align 8, !tbaa !8
  %132 = icmp slt i64 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 18, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %179

134:                                              ; preds = %129
  %135 = load i64, ptr %11, align 8, !tbaa !8
  %136 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !8
  %138 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %137
  %139 = load i64, ptr %13, align 8, !tbaa !8
  %140 = add nsw i64 %139, 1
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %138, i64 noundef %140) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %142 = load i64, ptr %11, align 8, !tbaa !8
  %143 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %142
  %144 = load i64, ptr %13, align 8, !tbaa !8
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %143, i64 noundef %144) #7
  %146 = load i64, ptr %145, align 8, !tbaa !8
  %147 = load i64, ptr %11, align 8, !tbaa !8
  %148 = getelementptr inbounds [100000 x i64], ptr @S, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = add nsw i64 %146, %149
  store i64 %150, ptr %14, align 8, !tbaa !8
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %152 = load i64, ptr %151, align 8, !tbaa !8
  %153 = load i64, ptr %11, align 8, !tbaa !8
  %154 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !8
  %156 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %155
  %157 = load i64, ptr %13, align 8, !tbaa !8
  %158 = add nsw i64 %157, 1
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %156, i64 noundef %158) #7
  store i64 %152, ptr %159, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %160 = load i64, ptr %11, align 8, !tbaa !8
  %161 = add nsw i64 %160, 1
  %162 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %161
  %163 = load i64, ptr %13, align 8, !tbaa !8
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %162, i64 noundef %163) #7
  %165 = load i64, ptr %11, align 8, !tbaa !8
  %166 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %165
  %167 = load i64, ptr %13, align 8, !tbaa !8
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %166, i64 noundef %167) #7
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %164, ptr noundef nonnull align 8 dereferenceable(8) %168)
  %170 = load i64, ptr %169, align 8, !tbaa !8
  %171 = load i64, ptr %11, align 8, !tbaa !8
  %172 = add nsw i64 %171, 1
  %173 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %172
  %174 = load i64, ptr %13, align 8, !tbaa !8
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %173, i64 noundef %174) #7
  store i64 %170, ptr %175, align 8, !tbaa !8
  br label %176

176:                                              ; preds = %134
  %177 = load i64, ptr %13, align 8, !tbaa !8
  %178 = add nsw i64 %177, 1
  store i64 %178, ptr %13, align 8, !tbaa !8
  br label %129, !llvm.loop !18

179:                                              ; preds = %133
  br label %180

180:                                              ; preds = %179
  %181 = load i64, ptr %11, align 8, !tbaa !8
  %182 = add nsw i64 %181, 1
  store i64 %182, ptr %11, align 8, !tbaa !8
  br label %123, !llvm.loop !19

183:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 1, ptr %15, align 8, !tbaa !8
  br label %184

184:                                              ; preds = %205, %183
  %185 = load i64, ptr %15, align 8, !tbaa !8
  %186 = load i64, ptr @N, align 8, !tbaa !8
  %187 = icmp sle i64 %185, %186
  br i1 %187, label %189, label %188

188:                                              ; preds = %184
  store i32 21, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %208

189:                                              ; preds = %184
  %190 = load i64, ptr %15, align 8, !tbaa !8
  %191 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %190
  %192 = load i64, ptr @K, align 8, !tbaa !8
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %191, i64 noundef %192) #7
  %194 = load i64, ptr %15, align 8, !tbaa !8
  %195 = sub nsw i64 %194, 1
  %196 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %195
  %197 = load i64, ptr @K, align 8, !tbaa !8
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %196, i64 noundef %197) #7
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %193, ptr noundef nonnull align 8 dereferenceable(8) %198)
  %200 = load i64, ptr %199, align 8, !tbaa !8
  %201 = load i64, ptr %15, align 8, !tbaa !8
  %202 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %201
  %203 = load i64, ptr @K, align 8, !tbaa !8
  %204 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %202, i64 noundef %203) #7
  store i64 %200, ptr %204, align 8, !tbaa !8
  br label %205

205:                                              ; preds = %189
  %206 = load i64, ptr %15, align 8, !tbaa !8
  %207 = add nsw i64 %206, 1
  store i64 %207, ptr %15, align 8, !tbaa !8
  br label %184, !llvm.loop !20

208:                                              ; preds = %188
  %209 = load i64, ptr @N, align 8, !tbaa !8
  %210 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %209
  %211 = load i64, ptr @K, align 8, !tbaa !8
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %210, i64 noundef %211) #7
  %213 = load i64, ptr %212, align 8, !tbaa !8
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %213)
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %214, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %23, !llvm.loop !21

216:                                              ; preds = %23
  %217 = load i32, ptr %1, align 4
  ret i32 %217
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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


; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@D = external dso_local global i64, align 8
@B = external dso_local global [100000 x i64], align 16
@S = external dso_local local_unnamed_addr global [100000 x i64], align 16
@E = external dso_local local_unnamed_addr global [100000 x i64], align 16
@dp = external dso_local global [100001 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %13 = load i64, ptr @T, align 8, !tbaa !8
  %14 = add nsw i64 %13, -1
  store i64 %14, ptr @T, align 8, !tbaa !8
  %.not78 = icmp eq i64 %13, 0
  br i1 %.not78, label %._crit_edge81, label %.lr.ph80

.lr.ph80:                                         ; preds = %0, %._crit_edge76
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) @D)
  %18 = load i64, ptr @N, align 8, !tbaa !8
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store i64 0, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  br label %._crit_edge64

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store i64 0, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  store i64 0, ptr %2, align 8, !tbaa !8
  %20 = icmp sgt i64 %24, 0
  br i1 %20, label %.lr.ph63, label %._crit_edge64

.lr.ph:                                           ; preds = %.lr.ph80, %.lr.ph
  %.03749 = phi i64 [ %23, %.lr.ph ], [ 0, %.lr.ph80 ]
  %21 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %.03749
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %23 = add nuw nsw i64 %.03749, 1
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge64:                                    ; preds = %.critedge, %._crit_edge.thread, %._crit_edge
  %26 = phi i64 [ %24, %._crit_edge ], [ %18, %._crit_edge.thread ], [ %49, %.critedge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  %.not4365 = icmp slt i64 %26, 0
  br i1 %.not4365, label %._crit_edge76, label %.lr.ph68

.lr.ph63:                                         ; preds = %._crit_edge, %.critedge
  %.03861 = phi i64 [ %47, %.critedge ], [ 0, %._crit_edge ]
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %28 = load i64, ptr %27, align 8, !tbaa !8
  %29 = load i64, ptr @N, align 8, !tbaa !8
  %30 = icmp slt i64 %28, %29
  %.pre = load i64, ptr %2, align 8, !tbaa !8
  %.pre84 = load i64, ptr @D, align 8, !tbaa !8
  %31 = add nsw i64 %.pre84, %.pre
  br i1 %30, label %.lr.ph53, label %.critedge

.lr.ph53:                                         ; preds = %.lr.ph63
  %smax = call i64 @llvm.smax.i64(i64 %28, i64 %31)
  br label %32

32:                                               ; preds = %.lr.ph53, %37
  %.151 = phi i64 [ %.03861, %.lr.ph53 ], [ %38, %37 ]
  %storemerge4550 = phi i64 [ %28, %.lr.ph53 ], [ %39, %37 ]
  %33 = icmp slt i64 %storemerge4550, %31
  br i1 %33, label %34, label %.critedge

34:                                               ; preds = %32
  %35 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %storemerge4550
  %36 = load i64, ptr %35, align 8, !tbaa !8
  %.not46 = icmp eq i64 %36, 0
  br i1 %.not46, label %.critedge, label %37

37:                                               ; preds = %34
  %38 = add nsw i64 %36, %.151
  %39 = add nsw i64 %storemerge4550, 1
  %exitcond.not = icmp eq i64 %39, %29
  br i1 %exitcond.not, label %.critedge, label %32, !llvm.loop !13

.critedge:                                        ; preds = %34, %37, %32, %.lr.ph63
  %storemerge45.lcssa = phi i64 [ %28, %.lr.ph63 ], [ %smax, %32 ], [ %29, %37 ], [ %storemerge4550, %34 ]
  %.1.lcssa = phi i64 [ %.03861, %.lr.ph63 ], [ %.151, %32 ], [ %38, %37 ], [ %.151, %34 ]
  store i64 %storemerge45.lcssa, ptr %1, align 8, !tbaa !8
  %40 = getelementptr inbounds [100000 x i64], ptr @S, i64 0, i64 %.pre
  store i64 %.1.lcssa, ptr %40, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store i64 %31, ptr %3, align 8, !tbaa !8
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @N, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %42 = load i64, ptr %41, align 8, !tbaa !8
  %43 = load i64, ptr %2, align 8, !tbaa !8
  %44 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %43
  store i64 %42, ptr %44, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %45 = getelementptr inbounds [100000 x i64], ptr @B, i64 0, i64 %43
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = sub nsw i64 %.1.lcssa, %46
  %48 = add nsw i64 %43, 1
  store i64 %48, ptr %2, align 8, !tbaa !8
  %49 = load i64, ptr @N, align 8, !tbaa !8
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %.lr.ph63, label %._crit_edge64, !llvm.loop !14

.preheader48:                                     ; preds = %.lr.ph68
  %51 = icmp sgt i64 %60, 0
  br i1 %51, label %.preheader.lr.ph, label %._crit_edge76

.preheader.lr.ph:                                 ; preds = %.preheader48
  %52 = load i64, ptr @K, align 8, !tbaa !8
  %53 = icmp sgt i64 %52, 0
  br i1 %53, label %.preheader, label %.lr.ph75.preheader

.lr.ph68:                                         ; preds = %._crit_edge64, %.lr.ph68
  %.03966 = phi i64 [ %59, %.lr.ph68 ], [ 0, %._crit_edge64 ]
  %54 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %.03966
  %55 = load i64, ptr @K, align 8, !tbaa !8
  %56 = add nsw i64 %55, 1
  call void @_ZNSt6vectorIxSaIxEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %56)
  %57 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #8
  %58 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !15
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEiEvT_S7_RKT0_(ptr %57, ptr %58, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %59 = add nuw nsw i64 %.03966, 1
  %60 = load i64, ptr @N, align 8, !tbaa !8
  %.not43.not = icmp slt i64 %.03966, %60
  br i1 %.not43.not, label %.lr.ph68, label %.preheader48, !llvm.loop !17

.preheader47:                                     ; preds = %._crit_edge71
  %.not4473 = icmp slt i64 %69, 1
  br i1 %.not4473, label %._crit_edge76, label %.lr.ph75.preheader

.lr.ph75.preheader:                               ; preds = %.preheader.lr.ph, %.preheader47
  br label %.lr.ph75

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge71
  %61 = phi i64 [ %69, %._crit_edge71 ], [ %60, %.preheader.lr.ph ]
  %62 = phi i64 [ %70, %._crit_edge71 ], [ %52, %.preheader.lr.ph ]
  %.03672 = phi i64 [ %.pre-phi88, %._crit_edge71 ], [ 0, %.preheader.lr.ph ]
  %63 = icmp sgt i64 %62, 0
  br i1 %63, label %.lr.ph70, label %.preheader.._crit_edge71_crit_edge

.preheader.._crit_edge71_crit_edge:               ; preds = %.preheader
  %.pre87 = add nuw nsw i64 %.03672, 1
  br label %._crit_edge71

.lr.ph70:                                         ; preds = %.preheader
  %64 = getelementptr inbounds [100000 x i64], ptr @E, i64 0, i64 %.03672
  %65 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %.03672
  %66 = getelementptr inbounds [100000 x i64], ptr @S, i64 0, i64 %.03672
  %67 = add nuw nsw i64 %.03672, 1
  %68 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %67
  br label %72

._crit_edge71.loopexit:                           ; preds = %72
  %.pre85 = load i64, ptr @N, align 8, !tbaa !8
  br label %._crit_edge71

._crit_edge71:                                    ; preds = %.preheader.._crit_edge71_crit_edge, %._crit_edge71.loopexit
  %.pre-phi88 = phi i64 [ %.pre87, %.preheader.._crit_edge71_crit_edge ], [ %67, %._crit_edge71.loopexit ]
  %69 = phi i64 [ %61, %.preheader.._crit_edge71_crit_edge ], [ %.pre85, %._crit_edge71.loopexit ]
  %70 = phi i64 [ %62, %.preheader.._crit_edge71_crit_edge ], [ %91, %._crit_edge71.loopexit ]
  %71 = icmp slt i64 %.pre-phi88, %69
  br i1 %71, label %.preheader, label %.preheader47, !llvm.loop !18

72:                                               ; preds = %.lr.ph70, %72
  %.03569 = phi i64 [ 0, %.lr.ph70 ], [ %75, %72 ]
  %73 = load i64, ptr %64, align 8, !tbaa !8
  %74 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %73
  %75 = add nuw nsw i64 %.03569, 1
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %75) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %.03569) #8
  %78 = load i64, ptr %77, align 8, !tbaa !8
  %79 = load i64, ptr %66, align 8, !tbaa !8
  %80 = add nsw i64 %79, %78
  store i64 %80, ptr %5, align 8, !tbaa !8
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = load i64, ptr %64, align 8, !tbaa !8
  %84 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %83
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %75) #8
  store i64 %82, ptr %85, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %.03569) #8
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %.03569) #8
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull align 8 dereferenceable(8) %87)
  %89 = load i64, ptr %88, align 8, !tbaa !8
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %.03569) #8
  store i64 %89, ptr %90, align 8, !tbaa !8
  %91 = load i64, ptr @K, align 8, !tbaa !8
  %92 = icmp slt i64 %75, %91
  br i1 %92, label %72, label %._crit_edge71.loopexit, !llvm.loop !20

._crit_edge76:                                    ; preds = %.lr.ph75, %._crit_edge64, %.preheader48, %.preheader47
  %.lcssa = phi i64 [ %69, %.preheader47 ], [ %60, %.preheader48 ], [ %26, %._crit_edge64 ], [ %113, %.lr.ph75 ]
  %93 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %.lcssa
  %94 = load i64, ptr @K, align 8, !tbaa !8
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %94) #8
  %96 = load i64, ptr %95, align 8, !tbaa !8
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %96)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %97, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %99 = load i64, ptr @T, align 8, !tbaa !8
  %100 = add nsw i64 %99, -1
  store i64 %100, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %99, 0
  br i1 %.not, label %._crit_edge81, label %.lr.ph80, !llvm.loop !21

.lr.ph75:                                         ; preds = %.lr.ph75.preheader, %.lr.ph75
  %.074 = phi i64 [ %112, %.lr.ph75 ], [ 1, %.lr.ph75.preheader ]
  %101 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %.074
  %102 = load i64, ptr @K, align 8, !tbaa !8
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef %102) #8
  %104 = add nsw i64 %.074, -1
  %105 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @dp, i64 0, i64 %104
  %106 = load i64, ptr @K, align 8, !tbaa !8
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %106) #8
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef nonnull align 8 dereferenceable(8) %107)
  %109 = load i64, ptr %108, align 8, !tbaa !8
  %110 = load i64, ptr @K, align 8, !tbaa !8
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef %110) #8
  store i64 %109, ptr %111, align 8, !tbaa !8
  %112 = add nuw nsw i64 %.074, 1
  %113 = load i64, ptr @N, align 8, !tbaa !8
  %.not44.not = icmp slt i64 %.074, %113
  br i1 %.not44.not, label %.lr.ph75, label %._crit_edge76, !llvm.loop !22

._crit_edge81:                                    ; preds = %._crit_edge76, %0
  ret i32 0
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

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

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

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

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

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


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