; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2020-21/Dec/Plat (space)

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

%struct.mint = type { i32 }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"struct.std::pair" = type { i32, i32 }

@dp = external dso_local global [100 x [100 x [100 x %struct.mint]]], align 16
@adj = external dso_local global %"class.std::vector.12", align 8
@ways = external dso_local global [2 x [100 x [100 x %struct.mint]]], align 16
@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4

; 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
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8genWays0St4pairIiiE(i64) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8genWays1St4pairIiiE(i64) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4readv() #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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.mint, align 4
  %7 = alloca %"struct.std::_Bit_reference", align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.mint, align 4
  %10 = alloca %struct.mint, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca %struct.mint, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.mint, align 4
  %20 = alloca %struct.mint, align 4
  store i32 0, ptr %1, align 4
  call void @_Z4readv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %137, %0
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @K, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %140

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

27:                                               ; preds = %133, %26
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr @N, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %136

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

33:                                               ; preds = %129, %32
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = load i32, ptr @N, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %64

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @adj, i64 noundef %43) #6
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %44, i64 noundef %46)
  %48 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %49 = extractvalue { ptr, i64 } %47, 0
  store ptr %49, ptr %48, align 8
  %50 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %51 = extractvalue { ptr, i64 } %47, 1
  store i64 %51, ptr %50, align 8
  %52 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  %53 = zext i1 %52 to i32
  %54 = sext i32 %53 to i64
  call void @_ZN4mintILi1000000007ELi5EEC2Ex(ptr noundef nonnull align 4 dereferenceable(4) %6, i64 noundef %54)
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %56
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr %57, i64 0, i64 %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100 x %struct.mint], ptr %60, i64 0, i64 %62
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %63, ptr align 4 %6, i64 4, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %128

64:                                               ; preds = %38
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr %68, i64 0, i64 %70
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100 x %struct.mint], ptr %71, i64 0, i64 %73
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %76
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr %77, i64 0, i64 %79
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100 x %struct.mint], ptr %80, i64 0, i64 %82
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %83, ptr align 4 %74, i64 4, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %124, %64
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = load i32, ptr @N, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

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

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %92
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr %93, i64 0, i64 %95
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100 x %struct.mint], ptr %96, i64 0, i64 %98
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %99, i64 4, i1 false), !tbaa.struct !9
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sub nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %102
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr %103, i64 0, i64 %105
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100 x %struct.mint], ptr %106, i64 0, i64 %108
  %110 = getelementptr inbounds %struct.mint, ptr %10, i32 0, i32 0
  %111 = load i32, ptr %110, align 4
  %112 = call i32 @_Zml4mintILi1000000007ELi5EERKS0_(i32 %111, ptr noundef nonnull align 4 dereferenceable(4) %109)
  %113 = getelementptr inbounds %struct.mint, ptr %9, i32 0, i32 0
  store i32 %112, ptr %113, align 4
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %115
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100 x %struct.mint], ptr %119, i64 0, i64 %121
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %122, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %124

124:                                              ; preds = %89
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %8, align 4, !tbaa !5
  br label %84, !llvm.loop !10

127:                                              ; preds = %88
  br label %128

128:                                              ; preds = %127, %41
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %5, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %5, align 4, !tbaa !5
  br label %33, !llvm.loop !12

132:                                              ; preds = %37
  br label %133

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

136:                                              ; preds = %31
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %2, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !14

140:                                              ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %237, %140
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = load i32, ptr @Q, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %146, label %145

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

146:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %13)
  call void @_Z2reISt4pairIiiEJS1_EEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %147 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %148 = load i32, ptr %147, align 4, !tbaa !15
  %149 = add nsw i32 %148, -1
  store i32 %149, ptr %147, align 4, !tbaa !15
  %150 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %151 = load i32, ptr %150, align 4, !tbaa !17
  %152 = add nsw i32 %151, -1
  store i32 %152, ptr %150, align 4, !tbaa !17
  %153 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %154 = load i32, ptr %153, align 4, !tbaa !15
  %155 = add nsw i32 %154, -1
  store i32 %155, ptr %153, align 4, !tbaa !15
  %156 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %157 = load i32, ptr %156, align 4, !tbaa !17
  %158 = add nsw i32 %157, -1
  store i32 %158, ptr %156, align 4, !tbaa !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %12, i64 8, i1 false)
  %159 = load i64, ptr %14, align 4
  call void @_Z8genWays0St4pairIiiE(i64 %159)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %13, i64 8, i1 false)
  %160 = load i64, ptr %15, align 4
  call void @_Z8genWays1St4pairIiiE(i64 %160)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %161 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %162 = zext i1 %161 to i64
  call void @_ZN4mintILi1000000007ELi5EEC2Ex(ptr noundef nonnull align 4 dereferenceable(4) %16, i64 noundef %162)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %163 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %164 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %165 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %163, ptr noundef nonnull align 4 dereferenceable(4) %164)
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %17, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %201, %146
  %169 = load i32, ptr %17, align 4, !tbaa !5
  %170 = load i32, ptr @K, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %168
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %204

173:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %197, %173
  %175 = load i32, ptr %18, align 4, !tbaa !5
  %176 = load i32, ptr @N, align 4, !tbaa !5
  %177 = icmp slt i32 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %200

179:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %180 = load i32, ptr %17, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr @ways, i64 0, i64 %181
  %183 = load i32, ptr %18, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [100 x %struct.mint], ptr %182, i64 0, i64 %184
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %185, i64 4, i1 false), !tbaa.struct !9
  %186 = load i32, ptr %17, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds ([2 x [100 x [100 x %struct.mint]]], ptr @ways, i64 0, i64 1), i64 0, i64 %187
  %189 = load i32, ptr %18, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [100 x %struct.mint], ptr %188, i64 0, i64 %190
  %192 = getelementptr inbounds %struct.mint, ptr %20, i32 0, i32 0
  %193 = load i32, ptr %192, align 4
  %194 = call i32 @_Zml4mintILi1000000007ELi5EERKS0_(i32 %193, ptr noundef nonnull align 4 dereferenceable(4) %191)
  %195 = getelementptr inbounds %struct.mint, ptr %19, i32 0, i32 0
  store i32 %194, ptr %195, align 4
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %197

197:                                              ; preds = %179
  %198 = load i32, ptr %18, align 4, !tbaa !5
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %18, align 4, !tbaa !5
  br label %174, !llvm.loop !18

200:                                              ; preds = %178
  br label %201

201:                                              ; preds = %200
  %202 = load i32, ptr %17, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %17, align 4, !tbaa !5
  br label %168, !llvm.loop !19

204:                                              ; preds = %172
  %205 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %206 = load i32, ptr %205, align 4, !tbaa !15
  %207 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %208 = load i32, ptr %207, align 4, !tbaa !15
  %209 = icmp slt i32 %206, %208
  br i1 %209, label %210, label %220

210:                                              ; preds = %204
  %211 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %212 = load i32, ptr %211, align 4, !tbaa !15
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr @ways, i64 0, i64 %213
  %215 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %216 = load i32, ptr %215, align 4, !tbaa !17
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [100 x %struct.mint], ptr %214, i64 0, i64 %217
  %219 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %218)
  br label %220

220:                                              ; preds = %210, %204
  %221 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %222 = load i32, ptr %221, align 4, !tbaa !15
  %223 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %224 = load i32, ptr %223, align 4, !tbaa !15
  %225 = icmp sgt i32 %222, %224
  br i1 %225, label %226, label %236

226:                                              ; preds = %220
  %227 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %228 = load i32, ptr %227, align 4, !tbaa !15
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds ([2 x [100 x [100 x %struct.mint]]], ptr @ways, i64 0, i64 1), i64 0, i64 %229
  %231 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %232 = load i32, ptr %231, align 4, !tbaa !17
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [100 x %struct.mint], ptr %230, i64 0, i64 %233
  %235 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %234)
  br label %236

236:                                              ; preds = %226, %220
  call void @_Z2psI4mintILi1000000007ELi5EEJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %237

237:                                              ; preds = %236
  %238 = load i32, ptr %11, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %11, align 4, !tbaa !5
  br label %141, !llvm.loop !20

240:                                              ; preds = %145
  %241 = load i32, ptr %1, align 4
  ret i32 %241
}

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

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

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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 = !{i64 0, i64 4, !5}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}


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

%struct.mint = type { i32 }
%"class.std::vector.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<bool>, std::allocator<std::vector<bool>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"struct.std::pair" = type { i32, i32 }

@dp = external dso_local global [100 x [100 x [100 x %struct.mint]]], align 16
@adj = external dso_local global %"class.std::vector.12", align 8
@ways = external dso_local global [2 x [100 x [100 x %struct.mint]]], align 16
@N = external dso_local local_unnamed_addr global i32, align 4
@K = external dso_local local_unnamed_addr global i32, align 4
@Q = external dso_local local_unnamed_addr global i32, align 4

; 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
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8genWays0St4pairIiiE(i64) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8genWays1St4pairIiiE(i64) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4readv() local_unnamed_addr #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca %struct.mint, align 4
  %2 = alloca %"struct.std::_Bit_reference", align 8
  %3 = alloca %struct.mint, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %struct.mint, align 4
  %7 = alloca %struct.mint, align 4
  tail call void @_Z4readv()
  %8 = load i32, ptr @K, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.preheader54.lr.ph, label %.preheader51

.preheader54.lr.ph:                               ; preds = %0
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  %11 = load i32, ptr @N, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.preheader54, label %.preheader51

.preheader54:                                     ; preds = %.preheader54.lr.ph, %._crit_edge60
  %13 = phi i32 [ %39, %._crit_edge60 ], [ %8, %.preheader54.lr.ph ]
  %14 = phi i32 [ %40, %._crit_edge60 ], [ %11, %.preheader54.lr.ph ]
  %15 = phi i32 [ %41, %._crit_edge60 ], [ %11, %.preheader54.lr.ph ]
  %16 = phi i32 [ %42, %._crit_edge60 ], [ %11, %.preheader54.lr.ph ]
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %._crit_edge60 ], [ 0, %.preheader54.lr.ph ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader53.lr.ph, label %._crit_edge60

.preheader53.lr.ph:                               ; preds = %.preheader54
  %18 = icmp eq i64 %indvars.iv91, 0
  %19 = add nsw i64 %indvars.iv91, -1
  %20 = icmp sgt i32 %15, 0
  br i1 %20, label %.preheader53, label %._crit_edge60

.preheader51:                                     ; preds = %._crit_edge60, %.preheader54.lr.ph, %0
  %21 = load i32, ptr @Q, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph68, label %._crit_edge69

.lr.ph68:                                         ; preds = %.preheader51
  %23 = getelementptr inbounds i8, ptr %4, i64 4
  %24 = getelementptr inbounds i8, ptr %5, i64 4
  br label %64

.preheader53:                                     ; preds = %.preheader53.lr.ph, %._crit_edge
  %25 = phi i32 [ %45, %._crit_edge ], [ %14, %.preheader53.lr.ph ]
  %26 = phi i32 [ %45, %._crit_edge ], [ %15, %.preheader53.lr.ph ]
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %._crit_edge ], [ 0, %.preheader53.lr.ph ]
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph57, label %._crit_edge

.lr.ph57:                                         ; preds = %.preheader53
  br i1 %18, label %.lr.ph57.split.us, label %.lr.ph57.split.split

.lr.ph57.split.us:                                ; preds = %.lr.ph57, %.lr.ph57.split.us
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph57.split.us ], [ 0, %.lr.ph57 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  %28 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIS_IbSaIbEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @adj, i64 noundef %indvars.iv88) #5
  %29 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %28, i64 noundef %indvars.iv85)
  %30 = extractvalue { ptr, i64 } %29, 0
  store ptr %30, ptr %2, align 8
  %31 = extractvalue { ptr, i64 } %29, 1
  store i64 %31, ptr %10, align 8
  %32 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  %33 = zext i1 %32 to i64
  call void @_ZN4mintILi1000000007ELi5EEC2Ex(ptr noundef nonnull align 4 dereferenceable(4) %1, i64 noundef %33)
  %34 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr @dp, i64 0, i64 %indvars.iv88, i64 %indvars.iv85
  %35 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %35, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %36 = load i32, ptr @N, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next86, %37
  br i1 %38, label %.lr.ph57.split.us, label %._crit_edge, !llvm.loop !9

._crit_edge60.loopexit:                           ; preds = %._crit_edge
  %.pre = load i32, ptr @K, align 4, !tbaa !5
  br label %._crit_edge60

._crit_edge60:                                    ; preds = %.preheader53.lr.ph, %._crit_edge60.loopexit, %.preheader54
  %39 = phi i32 [ %.pre, %._crit_edge60.loopexit ], [ %13, %.preheader54 ], [ %13, %.preheader53.lr.ph ]
  %40 = phi i32 [ %45, %._crit_edge60.loopexit ], [ %14, %.preheader54 ], [ %14, %.preheader53.lr.ph ]
  %41 = phi i32 [ %45, %._crit_edge60.loopexit ], [ %15, %.preheader54 ], [ %15, %.preheader53.lr.ph ]
  %42 = phi i32 [ %45, %._crit_edge60.loopexit ], [ %16, %.preheader54 ], [ %15, %.preheader53.lr.ph ]
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %43 = sext i32 %39 to i64
  %44 = icmp slt i64 %indvars.iv.next92, %43
  br i1 %44, label %.preheader54, label %.preheader51, !llvm.loop !11

._crit_edge:                                      ; preds = %.loopexit52, %.lr.ph57.split.us, %.preheader53
  %45 = phi i32 [ %25, %.preheader53 ], [ %36, %.lr.ph57.split.us ], [ %61, %.loopexit52 ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next89, %46
  br i1 %47, label %.preheader53, label %._crit_edge60.loopexit, !llvm.loop !13

.lr.ph57.split.split:                             ; preds = %.lr.ph57, %.loopexit52
  %48 = phi i32 [ %61, %.loopexit52 ], [ %25, %.lr.ph57 ]
  %49 = phi i32 [ %62, %.loopexit52 ], [ %26, %.lr.ph57 ]
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.loopexit52 ], [ 0, %.lr.ph57 ]
  %50 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %19, i64 %indvars.iv88, i64 %indvars.iv82
  %51 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %indvars.iv91, i64 %indvars.iv88, i64 %indvars.iv82
  %52 = load i32, ptr %50, align 4, !tbaa !5
  store i32 %52, ptr %51, align 4, !tbaa !5
  %53 = icmp sgt i32 %49, 0
  br i1 %53, label %.lr.ph, label %.lr.ph57.split.split..loopexit52_crit_edge

.lr.ph57.split.split..loopexit52_crit_edge:       ; preds = %.lr.ph57.split.split
  %.pre103 = sext i32 %49 to i64
  br label %.loopexit52

.lr.ph:                                           ; preds = %.lr.ph57.split.split, %.lr.ph
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %.lr.ph ], [ 0, %.lr.ph57.split.split ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %54 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %19, i64 %indvars.iv88, i64 %indvars.iv79
  %.sroa.012.0.copyload = load i32, ptr %54, align 4, !tbaa !5
  %55 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %19, i64 %indvars.iv79, i64 %indvars.iv82
  %56 = call i32 @_Zml4mintILi1000000007ELi5EERKS0_(i32 %.sroa.012.0.copyload, ptr noundef nonnull align 4 dereferenceable(4) %55)
  store i32 %56, ptr %3, align 4
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %51, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %58 = load i32, ptr @N, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next80, %59
  br i1 %60, label %.lr.ph, label %.loopexit52, !llvm.loop !14

.loopexit52:                                      ; preds = %.lr.ph, %.lr.ph57.split.split..loopexit52_crit_edge
  %.pre-phi = phi i64 [ %.pre103, %.lr.ph57.split.split..loopexit52_crit_edge ], [ %59, %.lr.ph ]
  %61 = phi i32 [ %48, %.lr.ph57.split.split..loopexit52_crit_edge ], [ %58, %.lr.ph ]
  %62 = phi i32 [ %49, %.lr.ph57.split.split..loopexit52_crit_edge ], [ %58, %.lr.ph ]
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %63 = icmp slt i64 %indvars.iv.next83, %.pre-phi
  br i1 %63, label %.lr.ph57.split.split, label %._crit_edge, !llvm.loop !15

._crit_edge69:                                    ; preds = %112, %.preheader51
  ret i32 0

64:                                               ; preds = %.lr.ph68, %112
  %.04667 = phi i32 [ 0, %.lr.ph68 ], [ %113, %112 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @_Z2reISt4pairIiiEJS1_EEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %65 = load <2 x i32>, ptr %4, align 8, !tbaa !5
  %66 = add nsw <2 x i32> %65, <i32 -1, i32 -1>
  store <2 x i32> %66, ptr %4, align 8, !tbaa !5
  %67 = load <2 x i32>, ptr %5, align 8, !tbaa !5
  %68 = add nsw <2 x i32> %67, <i32 -1, i32 -1>
  store <2 x i32> %68, ptr %5, align 8, !tbaa !5
  %.sroa.09.0.copyload.cast = bitcast <2 x i32> %66 to i64
  call void @_Z8genWays0St4pairIiiE(i64 %.sroa.09.0.copyload.cast)
  %.sroa.08.0.copyload = load i64, ptr %5, align 8
  call void @_Z8genWays1St4pairIiiE(i64 %.sroa.08.0.copyload)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %69 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %70 = zext i1 %69 to i64
  call void @_ZN4mintILi1000000007ELi5EEC2Ex(ptr noundef nonnull align 4 dereferenceable(4) %6, i64 noundef %70)
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %.04464 = add nsw i32 %72, 1
  %73 = load i32, ptr @K, align 4, !tbaa !5
  %74 = icmp slt i32 %.04464, %73
  br i1 %74, label %.preheader.lr.ph, label %._crit_edge66

.preheader.lr.ph:                                 ; preds = %64
  %75 = load i32, ptr @N, align 4, !tbaa !5
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.preheader.preheader, label %._crit_edge66

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %77 = sext i32 %72 to i64
  %78 = add nsw i64 %77, 1
  br label %.preheader

.loopexit.loopexit:                               ; preds = %.lr.ph63
  %.pre100 = load i32, ptr @K, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader
  %79 = phi i32 [ %.pre100, %.loopexit.loopexit ], [ %83, %.preheader ]
  %80 = phi i32 [ %93, %.loopexit.loopexit ], [ %84, %.preheader ]
  %indvars.iv.next98 = add nsw i64 %indvars.iv97, 1
  %81 = sext i32 %79 to i64
  %82 = icmp slt i64 %indvars.iv.next98, %81
  br i1 %82, label %.preheader, label %._crit_edge66, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %83 = phi i32 [ %73, %.preheader.preheader ], [ %79, %.loopexit ]
  %84 = phi i32 [ %75, %.preheader.preheader ], [ %80, %.loopexit ]
  %indvars.iv97 = phi i64 [ %78, %.preheader.preheader ], [ %indvars.iv.next98, %.loopexit ]
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %.lr.ph63, label %.loopexit

._crit_edge66:                                    ; preds = %.loopexit, %.preheader.lr.ph, %64
  %86 = load i32, ptr %4, align 8, !tbaa !17
  %87 = load i32, ptr %5, align 8, !tbaa !17
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %96, label %102

.lr.ph63:                                         ; preds = %.preheader, %.lr.ph63
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph63 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %89 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr @ways, i64 0, i64 %indvars.iv97, i64 %indvars.iv94
  %.sroa.0.0.copyload = load i32, ptr %89, align 4, !tbaa !5
  %90 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds (i8, ptr @ways, i64 40000), i64 0, i64 %indvars.iv97, i64 %indvars.iv94
  %91 = call i32 @_Zml4mintILi1000000007ELi5EERKS0_(i32 %.sroa.0.0.copyload, ptr noundef nonnull align 4 dereferenceable(4) %90)
  store i32 %91, ptr %7, align 4
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %93 = load i32, ptr @N, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = icmp slt i64 %indvars.iv.next95, %94
  br i1 %95, label %.lr.ph63, label %.loopexit.loopexit, !llvm.loop !19

96:                                               ; preds = %._crit_edge66
  %97 = sext i32 %87 to i64
  %98 = load i32, ptr %24, align 4, !tbaa !20
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr @ways, i64 0, i64 %97, i64 %99
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %100)
  %.pre101 = load i32, ptr %4, align 8, !tbaa !17
  %.pre102 = load i32, ptr %5, align 8, !tbaa !17
  br label %102

102:                                              ; preds = %96, %._crit_edge66
  %103 = phi i32 [ %.pre102, %96 ], [ %87, %._crit_edge66 ]
  %104 = phi i32 [ %.pre101, %96 ], [ %86, %._crit_edge66 ]
  %105 = icmp sgt i32 %104, %103
  br i1 %105, label %106, label %112

106:                                              ; preds = %102
  %107 = sext i32 %104 to i64
  %108 = load i32, ptr %23, align 4, !tbaa !20
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds (i8, ptr @ways, i64 40000), i64 0, i64 %107, i64 %109
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %110)
  br label %112

112:                                              ; preds = %106, %102
  call void @_Z2psI4mintILi1000000007ELi5EEJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %113 = add nuw nsw i32 %.04667, 1
  %114 = load i32, ptr @Q, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %64, label %._crit_edge69, !llvm.loop !21
}

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

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

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

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

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

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 = { 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 #4 = { 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 #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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10, !12}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !12}
!16 = distinct !{!16, !10, !12}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!19 = distinct !{!19, !10}
!20 = !{!18, !6, i64 4}
!21 = distinct !{!21, !10}


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