; LLVM IR from xirc/cp-algorithm :: atcoder/abc175/D/main.ll (Z5solvev)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@C = external dso_local global %"class.std::vector", align 8
@done = external dso_local global %"class.std::vector.0", align 8

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solvev() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i8, align 1
  %2 = alloca i64, align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Bit_reference", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = load i32, ptr @N, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %1) #5
  store i8 0, ptr %1, align 1, !tbaa !9
  call void @_ZNSt6vectorIbSaIbEE6assignEmRKb(ptr noundef nonnull align 8 dereferenceable(40) @done, i64 noundef %26, ptr noundef nonnull align 1 dereferenceable(1) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %27 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @C) #5
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %27, ptr %28, align 8
  %29 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @C) #5
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  %31 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8
  %35 = call ptr @_ZSt11max_elementIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr %32, ptr %34)
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  store i64 %39, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %270, %0
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = load i32, ptr @N, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %274

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @done, i64 noundef %47)
  %49 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  %50 = extractvalue { ptr, i64 } %48, 0
  store ptr %50, ptr %49, align 8
  %51 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  %52 = extractvalue { ptr, i64 } %48, 1
  store i64 %52, ptr %51, align 8
  %53 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  br i1 %53, label %54, label %55

54:                                               ; preds = %45
  br label %270

55:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  %56 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_Z3dfsiRSt6vectorIiSaIiEERi(i32 noundef %56, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %57 unwind label %67

57:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %58 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  %59 = trunc i64 %58 to i32
  store i32 %59, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = call noundef i64 @_Z11cycle_scoreRKSt6vectorIiSaIiEEi(ptr noundef nonnull align 8 dereferenceable(24) %10, i32 noundef %60)
  store i64 %61, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %265, %57
  %63 = load i32, ptr %15, align 4, !tbaa !5
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %71, label %66

66:                                               ; preds = %62
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %269

67:                                               ; preds = %55
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %11, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %12, align 4
  br label %273

71:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %72 = load i32, ptr @K, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  store i32 %73, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %74 = load i32, ptr %15, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %75) #5
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %78) #5
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  store i64 %81, ptr %17, align 8, !tbaa !11
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %83 unwind label %97

83:                                               ; preds = %71
  %84 = load i64, ptr %82, align 8, !tbaa !11
  store i64 %84, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %85 = load i32, ptr %15, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %18, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %117, %83
  %88 = load i32, ptr %18, align 4, !tbaa !5
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %87
  %92 = load i32, ptr %16, align 4, !tbaa !5
  %93 = icmp sgt i32 %92, 0
  br label %94

94:                                               ; preds = %91, %87
  %95 = phi i1 [ false, %87 ], [ %93, %91 ]
  br i1 %95, label %101, label %96

96:                                               ; preds = %94
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %124

97:                                               ; preds = %71
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %11, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %12, align 4
  br label %268

101:                                              ; preds = %94
  %102 = load i32, ptr %18, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %103) #5
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %106) #5
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = load i64, ptr %17, align 8, !tbaa !11
  %111 = add nsw i64 %110, %109
  store i64 %111, ptr %17, align 8, !tbaa !11
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %113 unwind label %120

113:                                              ; preds = %101
  %114 = load i64, ptr %112, align 8, !tbaa !11
  store i64 %114, ptr %2, align 8, !tbaa !11
  %115 = load i32, ptr %16, align 4, !tbaa !5
  %116 = add nsw i32 %115, -1
  store i32 %116, ptr %16, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %113
  %118 = load i32, ptr %18, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %18, align 4, !tbaa !5
  br label %87, !llvm.loop !13

120:                                              ; preds = %101
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %11, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %268

124:                                              ; preds = %96
  %125 = load i64, ptr %14, align 8, !tbaa !11
  %126 = icmp sge i64 %125, 0
  br i1 %126, label %127, label %228

127:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %128 = load i32, ptr %16, align 4, !tbaa !5
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = sdiv i32 %128, %129
  %131 = sub nsw i32 %130, 1
  store i32 %131, ptr %21, align 4, !tbaa !5
  %132 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %133 unwind label %160

133:                                              ; preds = %127
  %134 = load i32, ptr %132, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  store i32 %134, ptr %19, align 4, !tbaa !5
  %135 = load i32, ptr %19, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = load i64, ptr %14, align 8, !tbaa !11
  %138 = mul nsw i64 %136, %137
  %139 = load i64, ptr %17, align 8, !tbaa !11
  %140 = add nsw i64 %139, %138
  store i64 %140, ptr %17, align 8, !tbaa !11
  %141 = load i32, ptr %19, align 4, !tbaa !5
  %142 = load i32, ptr %13, align 4, !tbaa !5
  %143 = mul nsw i32 %141, %142
  %144 = load i32, ptr %16, align 4, !tbaa !5
  %145 = sub nsw i32 %144, %143
  store i32 %145, ptr %16, align 4, !tbaa !5
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %147 unwind label %164

147:                                              ; preds = %133
  %148 = load i64, ptr %146, align 8, !tbaa !11
  store i64 %148, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %149 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %149, ptr %22, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %184, %147
  %151 = load i32, ptr %22, align 4, !tbaa !5
  %152 = load i32, ptr %13, align 4, !tbaa !5
  %153 = icmp slt i32 %151, %152
  br i1 %153, label %154, label %157

154:                                              ; preds = %150
  %155 = load i32, ptr %16, align 4, !tbaa !5
  %156 = icmp sgt i32 %155, 0
  br label %157

157:                                              ; preds = %154, %150
  %158 = phi i1 [ false, %150 ], [ %156, %154 ]
  br i1 %158, label %168, label %159

159:                                              ; preds = %157
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %191

160:                                              ; preds = %127
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %11, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %227

164:                                              ; preds = %133
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %11, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %12, align 4
  br label %227

168:                                              ; preds = %157
  %169 = load i32, ptr %22, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %170) #5
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %173) #5
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = load i64, ptr %17, align 8, !tbaa !11
  %178 = add nsw i64 %177, %176
  store i64 %178, ptr %17, align 8, !tbaa !11
  %179 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %180 unwind label %187

180:                                              ; preds = %168
  %181 = load i64, ptr %179, align 8, !tbaa !11
  store i64 %181, ptr %2, align 8, !tbaa !11
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = add nsw i32 %182, -1
  store i32 %183, ptr %16, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %180
  %185 = load i32, ptr %22, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %22, align 4, !tbaa !5
  br label %150, !llvm.loop !15

187:                                              ; preds = %168
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %11, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %227

191:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %192 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %192, ptr %23, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %219, %191
  %194 = load i32, ptr %23, align 4, !tbaa !5
  %195 = load i32, ptr %13, align 4, !tbaa !5
  %196 = icmp slt i32 %194, %195
  br i1 %196, label %197, label %200

197:                                              ; preds = %193
  %198 = load i32, ptr %16, align 4, !tbaa !5
  %199 = icmp sgt i32 %198, 0
  br label %200

200:                                              ; preds = %197, %193
  %201 = phi i1 [ false, %193 ], [ %199, %197 ]
  br i1 %201, label %203, label %202

202:                                              ; preds = %200
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %226

203:                                              ; preds = %200
  %204 = load i32, ptr %23, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %205) #5
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %208) #5
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = load i64, ptr %17, align 8, !tbaa !11
  %213 = add nsw i64 %212, %211
  store i64 %213, ptr %17, align 8, !tbaa !11
  %214 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %215 unwind label %222

215:                                              ; preds = %203
  %216 = load i64, ptr %214, align 8, !tbaa !11
  store i64 %216, ptr %2, align 8, !tbaa !11
  %217 = load i32, ptr %16, align 4, !tbaa !5
  %218 = add nsw i32 %217, -1
  store i32 %218, ptr %16, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %215
  %220 = load i32, ptr %23, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %23, align 4, !tbaa !5
  br label %193, !llvm.loop !16

222:                                              ; preds = %203
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %11, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %227

226:                                              ; preds = %202
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %264

227:                                              ; preds = %222, %187, %164, %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %268

228:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %229 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %229, ptr %24, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %256, %228
  %231 = load i32, ptr %24, align 4, !tbaa !5
  %232 = load i32, ptr %15, align 4, !tbaa !5
  %233 = icmp slt i32 %231, %232
  br i1 %233, label %234, label %237

234:                                              ; preds = %230
  %235 = load i32, ptr %16, align 4, !tbaa !5
  %236 = icmp sgt i32 %235, 0
  br label %237

237:                                              ; preds = %234, %230
  %238 = phi i1 [ false, %230 ], [ %236, %234 ]
  br i1 %238, label %240, label %239

239:                                              ; preds = %237
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %263

240:                                              ; preds = %237
  %241 = load i32, ptr %24, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %242) #5
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %245) #5
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = load i64, ptr %17, align 8, !tbaa !11
  %250 = add nsw i64 %249, %248
  store i64 %250, ptr %17, align 8, !tbaa !11
  %251 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %252 unwind label %259

252:                                              ; preds = %240
  %253 = load i64, ptr %251, align 8, !tbaa !11
  store i64 %253, ptr %2, align 8, !tbaa !11
  %254 = load i32, ptr %16, align 4, !tbaa !5
  %255 = add nsw i32 %254, -1
  store i32 %255, ptr %16, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %252
  %257 = load i32, ptr %24, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %24, align 4, !tbaa !5
  br label %230, !llvm.loop !17

259:                                              ; preds = %240
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %11, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %268

263:                                              ; preds = %239
  br label %264

264:                                              ; preds = %263, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %15, align 4, !tbaa !5
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %15, align 4, !tbaa !5
  br label %62, !llvm.loop !18

268:                                              ; preds = %259, %227, %120, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %273

269:                                              ; preds = %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %270

270:                                              ; preds = %269, %54
  %271 = load i32, ptr %6, align 4, !tbaa !5
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %6, align 4, !tbaa !5
  br label %40, !llvm.loop !19

273:                                              ; preds = %268, %67
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %276

274:                                              ; preds = %44
  %275 = load i64, ptr %2, align 8, !tbaa !11
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret i64 %275

276:                                              ; preds = %273
  %277 = load ptr, ptr %11, align 8
  %278 = load i32, ptr %12, align 4
  %279 = insertvalue { ptr, i32 } poison, ptr %277, 0
  %280 = insertvalue { ptr, i32 } %279, i32 %278, 1
  resume { ptr, i32 } %280
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEE6assignEmRKb(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11max_elementIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr, ptr) #3

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@N = external dso_local local_unnamed_addr global i32, align 4
@K = external dso_local local_unnamed_addr global i32, align 4
@C = external dso_local global %"class.std::vector", align 8
@done = external dso_local global %"class.std::vector.0", align 8

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solvev() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i8, align 1
  %2 = alloca i64, align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"struct.std::_Bit_reference", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = load i32, ptr @N, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #5
  store i8 0, ptr %1, align 1, !tbaa !9
  call void @_ZNSt6vectorIbSaIbEE6assignEmRKb(ptr noundef nonnull align 8 dereferenceable(40) @done, i64 noundef %11, ptr noundef nonnull align 1 dereferenceable(1) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %12 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @C) #5
  %13 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @C) #5
  %14 = call ptr @_ZSt11max_elementIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr %12, ptr %13)
  store ptr %14, ptr %3, align 8
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  store i64 %17, ptr %2, align 8, !tbaa !11
  %18 = load i32, ptr @N, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph75, label %._crit_edge76

.lr.ph75:                                         ; preds = %0
  %20 = getelementptr inbounds i8, ptr %4, i64 8
  br label %22

._crit_edge76.loopexit:                           ; preds = %160
  %.pre107 = load i64, ptr %2, align 8, !tbaa !11
  br label %._crit_edge76

._crit_edge76:                                    ; preds = %._crit_edge76.loopexit, %0
  %21 = phi i64 [ %.pre107, %._crit_edge76.loopexit ], [ %17, %0 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret i64 %21

22:                                               ; preds = %.lr.ph75, %160
  %indvars.iv104 = phi i64 [ 0, %.lr.ph75 ], [ %indvars.iv.next105, %160 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %23 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @done, i64 noundef %indvars.iv104)
  %24 = extractvalue { ptr, i64 } %23, 0
  store ptr %24, ptr %4, align 8
  %25 = extractvalue { ptr, i64 } %23, 1
  store i64 %25, ptr %20, align 8
  %26 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br i1 %26, label %160, label %27

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %28 = trunc nuw nsw i64 %indvars.iv104 to i32
  invoke void @_Z3dfsiRSt6vectorIiSaIiEERi(i32 noundef %28, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %29 unwind label %113

29:                                               ; preds = %27
  %30 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %31 = trunc i64 %30 to i32
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = call noundef i64 @_Z11cycle_scoreRKSt6vectorIiSaIiEEi(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %32)
  %34 = icmp sgt i32 %31, 0
  br i1 %34, label %.lr.ph71, label %._crit_edge72

.lr.ph71:                                         ; preds = %29
  %35 = icmp sgt i64 %33, -1
  %36 = and i64 %30, 2147483647
  %wide.trip.count102 = and i64 %30, 2147483647
  br i1 %35, label %.lr.ph71.split.us, label %.lr.ph71.split

.lr.ph71.split.us:                                ; preds = %.lr.ph71, %.loopexit.us
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %.loopexit.us ], [ 0, %.lr.ph71 ]
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.loopexit.us ], [ 1, %.lr.ph71 ]
  %37 = load i32, ptr @K, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv99) #5
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %40) #5
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  store i64 %43, ptr %7, align 8, !tbaa !11
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %45 = load i64, ptr %44, align 8, !tbaa !11
  store i64 %45, ptr %2, align 8, !tbaa !11
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %.04752.us = add nsw i32 %37, -1
  %46 = icmp ult i64 %indvars.iv.next100, %36
  %47 = icmp sgt i32 %37, 1
  %48 = select i1 %46, i1 %47, i1 false
  br i1 %48, label %.lr.ph.us, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.lr.ph.us, %.lr.ph71.split.us
  %.047.lcssa.us = phi i32 [ %.04752.us, %.lr.ph71.split.us ], [ %.047.us, %.lr.ph.us ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %49 = sdiv i32 %.047.lcssa.us, %31
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr %9, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %52 = load i32, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %53 = sext i32 %52 to i64
  %54 = mul nsw i64 %33, %53
  %55 = load i64, ptr %7, align 8, !tbaa !11
  %56 = add nsw i64 %55, %54
  store i64 %56, ptr %7, align 8, !tbaa !11
  %57 = mul nsw i32 %52, %31
  %58 = sub nsw i32 %.047.lcssa.us, %57
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %60 = load i64, ptr %59, align 8, !tbaa !11
  store i64 %60, ptr %2, align 8, !tbaa !11
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = icmp slt i32 %61, %31
  %63 = icmp sgt i32 %58, 0
  %64 = select i1 %62, i1 %63, i1 false
  br i1 %64, label %.lr.ph62.us.preheader, label %._crit_edge63.us

.lr.ph62.us.preheader:                            ; preds = %._crit_edge.us
  %65 = sext i32 %61 to i64
  br label %.lr.ph62.us

._crit_edge63.us.loopexit:                        ; preds = %.lr.ph62.us
  %.pre = load i32, ptr %5, align 4, !tbaa !5
  br label %._crit_edge63.us

._crit_edge63.us:                                 ; preds = %._crit_edge63.us.loopexit, %._crit_edge.us
  %66 = phi i32 [ %61, %._crit_edge.us ], [ %.pre, %._crit_edge63.us.loopexit ]
  %.1.lcssa.us = phi i32 [ %58, %._crit_edge.us ], [ %95, %._crit_edge63.us.loopexit ]
  %67 = icmp slt i32 %66, %31
  %68 = icmp sgt i32 %.1.lcssa.us, 0
  %69 = select i1 %67, i1 %68, i1 false
  br i1 %69, label %.lr.ph68.us.preheader, label %.loopexit.us

.lr.ph68.us.preheader:                            ; preds = %._crit_edge63.us
  %70 = sext i32 %66 to i64
  br label %.lr.ph68.us

.lr.ph68.us:                                      ; preds = %.lr.ph68.us.preheader, %.lr.ph68.us
  %indvars.iv96 = phi i64 [ %70, %.lr.ph68.us.preheader ], [ %indvars.iv.next97, %.lr.ph68.us ]
  %.265.us = phi i32 [ %.1.lcssa.us, %.lr.ph68.us.preheader ], [ %81, %.lr.ph68.us ]
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv96) #5
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %73) #5
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = load i64, ptr %7, align 8, !tbaa !11
  %78 = add nsw i64 %77, %76
  store i64 %78, ptr %7, align 8, !tbaa !11
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %80 = load i64, ptr %79, align 8, !tbaa !11
  store i64 %80, ptr %2, align 8, !tbaa !11
  %81 = add nsw i32 %.265.us, -1
  %indvars.iv.next97 = add nsw i64 %indvars.iv96, 1
  %82 = icmp slt i64 %indvars.iv.next97, %36
  %83 = icmp ugt i32 %.265.us, 1
  %84 = select i1 %82, i1 %83, i1 false
  br i1 %84, label %.lr.ph68.us, label %.loopexit.us, !llvm.loop !13

.lr.ph62.us:                                      ; preds = %.lr.ph62.us.preheader, %.lr.ph62.us
  %indvars.iv93 = phi i64 [ %65, %.lr.ph62.us.preheader ], [ %indvars.iv.next94, %.lr.ph62.us ]
  %.159.us = phi i32 [ %58, %.lr.ph62.us.preheader ], [ %95, %.lr.ph62.us ]
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv93) #5
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %87) #5
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = load i64, ptr %7, align 8, !tbaa !11
  %92 = add nsw i64 %91, %90
  store i64 %92, ptr %7, align 8, !tbaa !11
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %94 = load i64, ptr %93, align 8, !tbaa !11
  store i64 %94, ptr %2, align 8, !tbaa !11
  %95 = add nsw i32 %.159.us, -1
  %indvars.iv.next94 = add nsw i64 %indvars.iv93, 1
  %96 = icmp slt i64 %indvars.iv.next94, %36
  %97 = icmp ugt i32 %.159.us, 1
  %98 = select i1 %96, i1 %97, i1 false
  br i1 %98, label %.lr.ph62.us, label %._crit_edge63.us.loopexit, !llvm.loop !15

.lr.ph.us:                                        ; preds = %.lr.ph71.split.us, %.lr.ph.us
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %.lr.ph.us ], [ %indvars.iv88, %.lr.ph71.split.us ]
  %.04754.us = phi i32 [ %.047.us, %.lr.ph.us ], [ %.04752.us, %.lr.ph71.split.us ]
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv90) #5
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %101) #5
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = load i64, ptr %7, align 8, !tbaa !11
  %106 = add nsw i64 %105, %104
  store i64 %106, ptr %7, align 8, !tbaa !11
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %108 = load i64, ptr %107, align 8, !tbaa !11
  store i64 %108, ptr %2, align 8, !tbaa !11
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %.047.us = add nsw i32 %.04754.us, -1
  %109 = trunc nuw i64 %indvars.iv.next91 to i32
  %110 = icmp slt i32 %109, %31
  %111 = icmp ugt i32 %.04754.us, 1
  %112 = select i1 %110, i1 %111, i1 false
  br i1 %112, label %.lr.ph.us, label %._crit_edge.us, !llvm.loop !16

.loopexit.us:                                     ; preds = %.lr.ph68.us, %._crit_edge63.us
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102
  br i1 %exitcond103.not, label %._crit_edge72, label %.lr.ph71.split.us, !llvm.loop !17

._crit_edge72:                                    ; preds = %.loopexit51, %.loopexit.us, %29
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %160

113:                                              ; preds = %27
  %114 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  resume { ptr, i32 } %114

.lr.ph71.split:                                   ; preds = %.lr.ph71, %.loopexit51
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.loopexit51 ], [ 0, %.lr.ph71 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit51 ], [ 1, %.lr.ph71 ]
  %115 = load i32, ptr @K, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv85) #5
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %118) #5
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  store i64 %121, ptr %7, align 8, !tbaa !11
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %123 = load i64, ptr %122, align 8, !tbaa !11
  store i64 %123, ptr %2, align 8, !tbaa !11
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %.04752 = add nsw i32 %115, -1
  %124 = icmp ult i64 %indvars.iv.next86, %36
  %125 = icmp sgt i32 %115, 1
  %126 = select i1 %124, i1 %125, i1 false
  br i1 %126, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph71.split
  %.047.lcssa = phi i32 [ %.04752, %.lr.ph71.split ], [ %.047, %.lr.ph ]
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = icmp sgt i64 %indvars.iv85, %128
  %130 = icmp sgt i32 %.047.lcssa, 0
  %131 = select i1 %129, i1 %130, i1 false
  br i1 %131, label %.lr.ph58, label %.loopexit51

.lr.ph:                                           ; preds = %.lr.ph71.split, %.lr.ph
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %.lr.ph ], [ %indvars.iv, %.lr.ph71.split ]
  %.04754 = phi i32 [ %.047, %.lr.ph ], [ %.04752, %.lr.ph71.split ]
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv79) #5
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %134) #5
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = load i64, ptr %7, align 8, !tbaa !11
  %139 = add nsw i64 %138, %137
  store i64 %139, ptr %7, align 8, !tbaa !11
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %141 = load i64, ptr %140, align 8, !tbaa !11
  store i64 %141, ptr %2, align 8, !tbaa !11
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %.047 = add nsw i32 %.04754, -1
  %142 = trunc nuw i64 %indvars.iv.next80 to i32
  %143 = icmp slt i32 %142, %31
  %144 = icmp ugt i32 %.04754, 1
  %145 = select i1 %143, i1 %144, i1 false
  br i1 %145, label %.lr.ph, label %._crit_edge, !llvm.loop !16

.lr.ph58:                                         ; preds = %._crit_edge, %.lr.ph58
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.lr.ph58 ], [ %128, %._crit_edge ]
  %.355 = phi i32 [ %156, %.lr.ph58 ], [ %.047.lcssa, %._crit_edge ]
  %146 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv82) #5
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @C, i64 noundef %148) #5
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = load i64, ptr %7, align 8, !tbaa !11
  %153 = add nsw i64 %152, %151
  store i64 %153, ptr %7, align 8, !tbaa !11
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %155 = load i64, ptr %154, align 8, !tbaa !11
  store i64 %155, ptr %2, align 8, !tbaa !11
  %156 = add nsw i32 %.355, -1
  %indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
  %157 = icmp slt i64 %indvars.iv.next83, %indvars.iv85
  %158 = icmp ugt i32 %.355, 1
  %159 = select i1 %157, i1 %158, i1 false
  br i1 %159, label %.lr.ph58, label %.loopexit51, !llvm.loop !18

.loopexit51:                                      ; preds = %.lr.ph58, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count102
  br i1 %exitcond.not, label %._crit_edge72, label %.lr.ph71.split, !llvm.loop !17

160:                                              ; preds = %22, %._crit_edge72
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %161 = load i32, ptr @N, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = icmp slt i64 %indvars.iv.next105, %162
  br i1 %163, label %22, label %._crit_edge76.loopexit, !llvm.loop !19
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEE6assignEmRKb(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11max_elementIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr, ptr) local_unnamed_addr #3

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 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

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


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