; LLVM IR from QUILL-PIC/Quill :: src/balancing.ll (Z27calculate_optimal_partitionRKSt6vectorIdSaIdEEii)

; 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.139" = type { %"struct.std::_Vector_base.140" }
%"struct.std::_Vector_base.140" = 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::initializer_list" = type { ptr, i64 }
%"class.std::allocator.141" = type { i8 }
%class.array2d.144 = type { i32, i32, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.array2d = type { i32, i32, %"class.std::vector.139" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

; 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 void @_Z18retrieve_partitionRK7array2dIiEiii(ptr dead_on_unwind noalias writable sret(%"class.std::vector.139") align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z27calculate_optimal_partitionRKSt6vectorIdSaIdEEii(ptr dead_on_unwind noalias writable sret(%"class.std::vector.139") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, i32 noundef %3) #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::initializer_list", align 8
  %10 = alloca [1 x i32], align 4
  %11 = alloca %"class.std::allocator.141", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %class.array2d.144, align 8
  %16 = alloca %class.array2d, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca double, align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %32 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca double, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca double, align 8
  %40 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %41 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %42 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %43 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca double, align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %49, label %61

49:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  %50 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 0
  store ptr %10, ptr %50, align 8, !tbaa !11
  %51 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 1
  store i64 1, ptr %51, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  %52 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %55 = load i64, ptr %54, align 8
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %53, i64 %55, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %56 unwind label %57

56:                                               ; preds = %49
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %429

57:                                               ; preds = %49
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %12, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %13, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %430

61:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #4
  %64 = trunc i64 %63 to i32
  store i32 %64, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = load i32, ptr %14, align 4, !tbaa !9
  call void @_ZN7array2dIdEC2Eii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %65, i32 noundef %66)
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #4
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = load i32, ptr %14, align 4, !tbaa !9
  invoke void @_ZN7array2dIiEC2Eii(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef %67, i32 noundef %68)
          to label %69 unwind label %99

69:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %70 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %70, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = mul nsw i32 2, %71
  store i32 %72, ptr %18, align 4, !tbaa !9
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #4
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #4
  %78 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %77, ptr %78, align 8
  %79 = load i32, ptr %17, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %21, i64 noundef %80) #4
  %82 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %81, ptr %82, align 8
  %83 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8
  %87 = invoke noundef double @_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET0_T_S9_S8_(ptr %84, ptr %86, double noundef 0.000000e+00)
          to label %88 unwind label %103

88:                                               ; preds = %69
  %89 = load i32, ptr %17, align 4, !tbaa !9
  %90 = sub nsw i32 %89, 1
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 0, i32 noundef %90)
          to label %92 unwind label %103

92:                                               ; preds = %88
  store double %87, ptr %91, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %93 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %93, ptr %22, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %284, %92
  %95 = load i32, ptr %22, align 4, !tbaa !9
  %96 = load i32, ptr %14, align 4, !tbaa !9
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %107, label %98

98:                                               ; preds = %94
  store i32 2, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %288

99:                                               ; preds = %61
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %12, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %13, align 4
  br label %428

103:                                              ; preds = %88, %69
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %12, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %427

107:                                              ; preds = %94
  %108 = load i32, ptr %22, align 4, !tbaa !9
  %109 = sub nsw i32 %108, 1
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 0, i32 noundef %109)
          to label %111 unwind label %128

111:                                              ; preds = %107
  %112 = load double, ptr %110, align 8, !tbaa !15
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = load i32, ptr %22, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %113, i64 noundef %115) #4
  %117 = load double, ptr %116, align 8, !tbaa !15
  %118 = fadd double %112, %117
  %119 = load i32, ptr %22, align 4, !tbaa !9
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 0, i32 noundef %119)
          to label %121 unwind label %128

121:                                              ; preds = %111
  store double %118, ptr %120, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 1, ptr %24, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %277, %121
  %123 = load i32, ptr %24, align 4, !tbaa !9
  %124 = load i32, ptr %7, align 4, !tbaa !9
  %125 = sub nsw i32 %124, 1
  %126 = icmp slt i32 %123, %125
  br i1 %126, label %132, label %127

127:                                              ; preds = %122
  store i32 5, ptr %23, align 4
  br label %282

128:                                              ; preds = %111, %107
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %12, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %13, align 4
  br label %287

132:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %133 = load i32, ptr %24, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  %135 = load i32, ptr %8, align 4, !tbaa !9
  %136 = mul nsw i32 %134, %135
  %137 = sub nsw i32 %136, 1
  store i32 %137, ptr %25, align 4, !tbaa !9
  %138 = load i32, ptr %22, align 4, !tbaa !9
  %139 = load i32, ptr %25, align 4, !tbaa !9
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %141, label %142

141:                                              ; preds = %132
  store i32 5, ptr %23, align 4
  br label %274

142:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %143 = load i32, ptr %22, align 4, !tbaa !9
  %144 = load i32, ptr %18, align 4, !tbaa !9
  %145 = sub nsw i32 %143, %144
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %147) #4
  %149 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %148, ptr %149, align 8
  %150 = load i32, ptr %26, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %29, i64 noundef %151) #4
  %153 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %152, ptr %153, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %154) #4
  %156 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %32, i32 0, i32 0
  store ptr %155, ptr %156, align 8
  %157 = load i32, ptr %22, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %32, i64 noundef %158) #4
  %160 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  store ptr %159, ptr %160, align 8
  %161 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %31, i64 noundef 1) #4
  %162 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %161, ptr %162, align 8
  %163 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8
  %165 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8
  %167 = invoke noundef double @_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET0_T_S9_S8_(ptr %164, ptr %166, double noundef 0.000000e+00)
          to label %168 unwind label %204

168:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  store double %167, ptr %27, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #4
  %169 = load i32, ptr %24, align 4, !tbaa !9
  %170 = sub nsw i32 %169, 1
  %171 = load i32, ptr %8, align 4, !tbaa !9
  %172 = mul nsw i32 %170, %171
  store i32 %172, ptr %33, align 4, !tbaa !9
  %173 = load i32, ptr %24, align 4, !tbaa !9
  %174 = sub nsw i32 %173, 1
  %175 = load i32, ptr %26, align 4, !tbaa !9
  %176 = load i32, ptr %8, align 4, !tbaa !9
  %177 = add nsw i32 %175, %176
  %178 = sub nsw i32 %177, 1
  %179 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %174, i32 noundef %178)
          to label %180 unwind label %208

180:                                              ; preds = %168
  %181 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %179)
          to label %182 unwind label %208

182:                                              ; preds = %180
  %183 = load double, ptr %181, align 8, !tbaa !15
  %184 = load i32, ptr %24, align 4, !tbaa !9
  %185 = load i32, ptr %22, align 4, !tbaa !9
  %186 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %184, i32 noundef %185)
          to label %187 unwind label %208

187:                                              ; preds = %182
  store double %183, ptr %186, align 8, !tbaa !15
  %188 = load i32, ptr %26, align 4, !tbaa !9
  %189 = load i32, ptr %8, align 4, !tbaa !9
  %190 = add nsw i32 %188, %189
  %191 = sub nsw i32 %190, 1
  %192 = load i32, ptr %24, align 4, !tbaa !9
  %193 = load i32, ptr %22, align 4, !tbaa !9
  %194 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7array2dIiEclEii(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef %192, i32 noundef %193)
          to label %195 unwind label %208

195:                                              ; preds = %187
  store i32 %191, ptr %194, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #4
  %196 = load i32, ptr %26, align 4, !tbaa !9
  %197 = sub nsw i32 %196, 1
  store i32 %197, ptr %34, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %269, %195
  %199 = load i32, ptr %34, align 4, !tbaa !9
  %200 = load i32, ptr %33, align 4, !tbaa !9
  %201 = sub nsw i32 %200, 1
  %202 = icmp sgt i32 %199, %201
  br i1 %202, label %212, label %203

203:                                              ; preds = %198
  store i32 8, ptr %23, align 4
  br label %272

204:                                              ; preds = %142
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %12, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  br label %281

208:                                              ; preds = %187, %182, %180, %168
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %12, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %13, align 4
  br label %280

212:                                              ; preds = %198
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = load i32, ptr %34, align 4, !tbaa !9
  %215 = sext i32 %214 to i64
  %216 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %213, i64 noundef %215) #4
  %217 = load double, ptr %216, align 8, !tbaa !15
  %218 = load double, ptr %27, align 8, !tbaa !15
  %219 = fadd double %218, %217
  store double %219, ptr %27, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #4
  %220 = load i32, ptr %24, align 4, !tbaa !9
  %221 = sub nsw i32 %220, 1
  %222 = load i32, ptr %34, align 4, !tbaa !9
  %223 = load i32, ptr %8, align 4, !tbaa !9
  %224 = add nsw i32 %222, %223
  %225 = sub nsw i32 %224, 1
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %221, i32 noundef %225)
          to label %227 unwind label %252

227:                                              ; preds = %212
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %226)
          to label %229 unwind label %252

229:                                              ; preds = %227
  %230 = load double, ptr %228, align 8, !tbaa !15
  store double %230, ptr %35, align 8, !tbaa !15
  %231 = load double, ptr %35, align 8, !tbaa !15
  %232 = load i32, ptr %24, align 4, !tbaa !9
  %233 = load i32, ptr %22, align 4, !tbaa !9
  %234 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %232, i32 noundef %233)
          to label %235 unwind label %252

235:                                              ; preds = %229
  %236 = load double, ptr %234, align 8, !tbaa !15
  %237 = fcmp olt double %231, %236
  br i1 %237, label %238, label %256

238:                                              ; preds = %235
  %239 = load double, ptr %35, align 8, !tbaa !15
  %240 = load i32, ptr %24, align 4, !tbaa !9
  %241 = load i32, ptr %22, align 4, !tbaa !9
  %242 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %240, i32 noundef %241)
          to label %243 unwind label %252

243:                                              ; preds = %238
  store double %239, ptr %242, align 8, !tbaa !15
  %244 = load i32, ptr %34, align 4, !tbaa !9
  %245 = load i32, ptr %8, align 4, !tbaa !9
  %246 = add nsw i32 %244, %245
  %247 = sub nsw i32 %246, 1
  %248 = load i32, ptr %24, align 4, !tbaa !9
  %249 = load i32, ptr %22, align 4, !tbaa !9
  %250 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7array2dIiEclEii(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef %248, i32 noundef %249)
          to label %251 unwind label %252

251:                                              ; preds = %243
  store i32 %247, ptr %250, align 4, !tbaa !9
  br label %256

252:                                              ; preds = %256, %243, %238, %229, %227, %212
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %12, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #4
  br label %280

256:                                              ; preds = %251, %235
  %257 = load double, ptr %27, align 8, !tbaa !15
  %258 = load i32, ptr %24, align 4, !tbaa !9
  %259 = load i32, ptr %22, align 4, !tbaa !9
  %260 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %258, i32 noundef %259)
          to label %261 unwind label %252

261:                                              ; preds = %256
  %262 = load double, ptr %260, align 8, !tbaa !15
  %263 = fcmp ogt double %257, %262
  br i1 %263, label %264, label %265

264:                                              ; preds = %261
  store i32 8, ptr %23, align 4
  br label %266

265:                                              ; preds = %261
  store i32 0, ptr %23, align 4
  br label %266

266:                                              ; preds = %265, %264
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #4
  %267 = load i32, ptr %23, align 4
  switch i32 %267, label %272 [
    i32 0, label %268
  ]

268:                                              ; preds = %266
  br label %269

269:                                              ; preds = %268
  %270 = load i32, ptr %34, align 4, !tbaa !9
  %271 = add nsw i32 %270, -1
  store i32 %271, ptr %34, align 4, !tbaa !9
  br label %198, !llvm.loop !17

272:                                              ; preds = %266, %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #4
  br label %273

273:                                              ; preds = %272
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  store i32 0, ptr %23, align 4
  br label %274

274:                                              ; preds = %273, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  %275 = load i32, ptr %23, align 4
  switch i32 %275, label %282 [
    i32 0, label %276
  ]

276:                                              ; preds = %274
  br label %277

277:                                              ; preds = %276
  %278 = load i32, ptr %24, align 4, !tbaa !9
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %24, align 4, !tbaa !9
  br label %122, !llvm.loop !19

280:                                              ; preds = %252, %208
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  br label %281

281:                                              ; preds = %280, %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %287

282:                                              ; preds = %274, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %283

283:                                              ; preds = %282
  br label %284

284:                                              ; preds = %283
  %285 = load i32, ptr %22, align 4, !tbaa !9
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %22, align 4, !tbaa !9
  br label %94, !llvm.loop !20

287:                                              ; preds = %281, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %427

288:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #4
  %289 = load i32, ptr %7, align 4, !tbaa !9
  %290 = sub nsw i32 %289, 1
  store i32 %290, ptr %36, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #4
  %291 = load i32, ptr %14, align 4, !tbaa !9
  %292 = sub nsw i32 %291, 1
  store i32 %292, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #4
  %293 = load i32, ptr %14, align 4, !tbaa !9
  %294 = load i32, ptr %17, align 4, !tbaa !9
  %295 = sub nsw i32 %293, %294
  store i32 %295, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #4
  %296 = load ptr, ptr %6, align 8, !tbaa !5
  %297 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %296) #4
  %298 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %41, i32 0, i32 0
  store ptr %297, ptr %298, align 8
  %299 = load i32, ptr %38, align 4, !tbaa !9
  %300 = sext i32 %299 to i64
  %301 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %41, i64 noundef %300) #4
  %302 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %40, i32 0, i32 0
  store ptr %301, ptr %302, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #4
  %303 = load ptr, ptr %6, align 8, !tbaa !5
  %304 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %303) #4
  %305 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %43, i32 0, i32 0
  store ptr %304, ptr %305, align 8
  %306 = load i32, ptr %14, align 4, !tbaa !9
  %307 = sext i32 %306 to i64
  %308 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %43, i64 noundef %307) #4
  %309 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %42, i32 0, i32 0
  store ptr %308, ptr %309, align 8
  %310 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %40, i32 0, i32 0
  %311 = load ptr, ptr %310, align 8
  %312 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %42, i32 0, i32 0
  %313 = load ptr, ptr %312, align 8
  %314 = invoke noundef double @_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET0_T_S9_S8_(ptr %311, ptr %313, double noundef 0.000000e+00)
          to label %315 unwind label %351

315:                                              ; preds = %288
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #4
  store double %314, ptr %39, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #4
  %316 = load i32, ptr %7, align 4, !tbaa !9
  %317 = sub nsw i32 %316, 2
  %318 = load i32, ptr %8, align 4, !tbaa !9
  %319 = mul nsw i32 %317, %318
  store i32 %319, ptr %44, align 4, !tbaa !9
  %320 = load i32, ptr %36, align 4, !tbaa !9
  %321 = sub nsw i32 %320, 1
  %322 = load i32, ptr %38, align 4, !tbaa !9
  %323 = load i32, ptr %8, align 4, !tbaa !9
  %324 = add nsw i32 %322, %323
  %325 = sub nsw i32 %324, 1
  %326 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %321, i32 noundef %325)
          to label %327 unwind label %355

327:                                              ; preds = %315
  %328 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %326)
          to label %329 unwind label %355

329:                                              ; preds = %327
  %330 = load double, ptr %328, align 8, !tbaa !15
  %331 = load i32, ptr %36, align 4, !tbaa !9
  %332 = load i32, ptr %37, align 4, !tbaa !9
  %333 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %331, i32 noundef %332)
          to label %334 unwind label %355

334:                                              ; preds = %329
  store double %330, ptr %333, align 8, !tbaa !15
  %335 = load i32, ptr %38, align 4, !tbaa !9
  %336 = load i32, ptr %8, align 4, !tbaa !9
  %337 = add nsw i32 %335, %336
  %338 = sub nsw i32 %337, 1
  %339 = load i32, ptr %36, align 4, !tbaa !9
  %340 = load i32, ptr %37, align 4, !tbaa !9
  %341 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7array2dIiEclEii(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef %339, i32 noundef %340)
          to label %342 unwind label %355

342:                                              ; preds = %334
  store i32 %338, ptr %341, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #4
  %343 = load i32, ptr %38, align 4, !tbaa !9
  %344 = sub nsw i32 %343, 1
  store i32 %344, ptr %45, align 4, !tbaa !9
  br label %345

345:                                              ; preds = %416, %342
  %346 = load i32, ptr %45, align 4, !tbaa !9
  %347 = load i32, ptr %44, align 4, !tbaa !9
  %348 = sub nsw i32 %347, 1
  %349 = icmp sgt i32 %346, %348
  br i1 %349, label %359, label %350

350:                                              ; preds = %345
  store i32 11, ptr %23, align 4
  br label %419

351:                                              ; preds = %288
  %352 = landingpad { ptr, i32 }
          cleanup
  %353 = extractvalue { ptr, i32 } %352, 0
  store ptr %353, ptr %12, align 8
  %354 = extractvalue { ptr, i32 } %352, 1
  store i32 %354, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #4
  br label %426

355:                                              ; preds = %420, %334, %329, %327, %315
  %356 = landingpad { ptr, i32 }
          cleanup
  %357 = extractvalue { ptr, i32 } %356, 0
  store ptr %357, ptr %12, align 8
  %358 = extractvalue { ptr, i32 } %356, 1
  store i32 %358, ptr %13, align 4
  br label %425

359:                                              ; preds = %345
  %360 = load ptr, ptr %6, align 8, !tbaa !5
  %361 = load i32, ptr %45, align 4, !tbaa !9
  %362 = sext i32 %361 to i64
  %363 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %360, i64 noundef %362) #4
  %364 = load double, ptr %363, align 8, !tbaa !15
  %365 = load double, ptr %39, align 8, !tbaa !15
  %366 = fadd double %365, %364
  store double %366, ptr %39, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #4
  %367 = load i32, ptr %36, align 4, !tbaa !9
  %368 = sub nsw i32 %367, 1
  %369 = load i32, ptr %45, align 4, !tbaa !9
  %370 = load i32, ptr %8, align 4, !tbaa !9
  %371 = add nsw i32 %369, %370
  %372 = sub nsw i32 %371, 1
  %373 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %368, i32 noundef %372)
          to label %374 unwind label %399

374:                                              ; preds = %359
  %375 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %373)
          to label %376 unwind label %399

376:                                              ; preds = %374
  %377 = load double, ptr %375, align 8, !tbaa !15
  store double %377, ptr %46, align 8, !tbaa !15
  %378 = load double, ptr %46, align 8, !tbaa !15
  %379 = load i32, ptr %36, align 4, !tbaa !9
  %380 = load i32, ptr %37, align 4, !tbaa !9
  %381 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %379, i32 noundef %380)
          to label %382 unwind label %399

382:                                              ; preds = %376
  %383 = load double, ptr %381, align 8, !tbaa !15
  %384 = fcmp olt double %378, %383
  br i1 %384, label %385, label %403

385:                                              ; preds = %382
  %386 = load double, ptr %46, align 8, !tbaa !15
  %387 = load i32, ptr %36, align 4, !tbaa !9
  %388 = load i32, ptr %37, align 4, !tbaa !9
  %389 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %387, i32 noundef %388)
          to label %390 unwind label %399

390:                                              ; preds = %385
  store double %386, ptr %389, align 8, !tbaa !15
  %391 = load i32, ptr %45, align 4, !tbaa !9
  %392 = load i32, ptr %8, align 4, !tbaa !9
  %393 = add nsw i32 %391, %392
  %394 = sub nsw i32 %393, 1
  %395 = load i32, ptr %36, align 4, !tbaa !9
  %396 = load i32, ptr %37, align 4, !tbaa !9
  %397 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7array2dIiEclEii(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef %395, i32 noundef %396)
          to label %398 unwind label %399

398:                                              ; preds = %390
  store i32 %394, ptr %397, align 4, !tbaa !9
  br label %403

399:                                              ; preds = %403, %390, %385, %376, %374, %359
  %400 = landingpad { ptr, i32 }
          cleanup
  %401 = extractvalue { ptr, i32 } %400, 0
  store ptr %401, ptr %12, align 8
  %402 = extractvalue { ptr, i32 } %400, 1
  store i32 %402, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #4
  br label %425

403:                                              ; preds = %398, %382
  %404 = load double, ptr %39, align 8, !tbaa !15
  %405 = load i32, ptr %36, align 4, !tbaa !9
  %406 = load i32, ptr %37, align 4, !tbaa !9
  %407 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %405, i32 noundef %406)
          to label %408 unwind label %399

408:                                              ; preds = %403
  %409 = load double, ptr %407, align 8, !tbaa !15
  %410 = fcmp ogt double %404, %409
  br i1 %410, label %411, label %412

411:                                              ; preds = %408
  store i32 11, ptr %23, align 4
  br label %413

412:                                              ; preds = %408
  store i32 0, ptr %23, align 4
  br label %413

413:                                              ; preds = %412, %411
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #4
  %414 = load i32, ptr %23, align 4
  switch i32 %414, label %419 [
    i32 0, label %415
  ]

415:                                              ; preds = %413
  br label %416

416:                                              ; preds = %415
  %417 = load i32, ptr %45, align 4, !tbaa !9
  %418 = add nsw i32 %417, -1
  store i32 %418, ptr %45, align 4, !tbaa !9
  br label %345, !llvm.loop !21

419:                                              ; preds = %413, %350
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #4
  br label %420

420:                                              ; preds = %419
  %421 = load i32, ptr %36, align 4, !tbaa !9
  %422 = load i32, ptr %37, align 4, !tbaa !9
  %423 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @_Z18retrieve_partitionRK7array2dIiEiii(ptr dead_on_unwind writable sret(%"class.std::vector.139") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef %421, i32 noundef %422, i32 noundef %423)
          to label %424 unwind label %355

424:                                              ; preds = %420
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @_ZN7array2dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  call void @_ZN7array2dIdED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %429

425:                                              ; preds = %399, %355
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #4
  br label %426

426:                                              ; preds = %425, %351
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #4
  br label %427

427:                                              ; preds = %426, %287, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @_ZN7array2dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  br label %428

428:                                              ; preds = %427, %99
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  call void @_ZN7array2dIdED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %430

429:                                              ; preds = %424, %56
  ret void

430:                                              ; preds = %428, %57
  %431 = load ptr, ptr %12, align 8
  %432 = load i32, ptr %13, align 4
  %433 = insertvalue { ptr, i32 } poison, ptr %431, 0
  %434 = insertvalue { ptr, i32 } %433, i32 %432, 1
  resume { ptr, i32 } %434
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7array2dIdEC2Eii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7array2dIiEC2Eii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET0_T_S9_S8_(ptr, ptr, double noundef) #3

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7array2dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7array2dIdED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

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


; 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.139" = type { %"struct.std::_Vector_base.140" }
%"struct.std::_Vector_base.140" = 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::allocator.141" = type { i8 }
%class.array2d.144 = type { i32, i32, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.array2d = type { i32, i32, %"class.std::vector.139" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

; 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 void @_Z18retrieve_partitionRK7array2dIiEiii(ptr dead_on_unwind noalias writable sret(%"class.std::vector.139") align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z27calculate_optimal_partitionRKSt6vectorIdSaIdEEii(ptr dead_on_unwind noalias writable sret(%"class.std::vector.139") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca [1 x i32], align 4
  %6 = alloca %"class.std::allocator.141", align 1
  %7 = alloca %class.array2d.144, align 8
  %8 = alloca %class.array2d, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca double, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca double, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = icmp eq i32 %2, 1
  br i1 %17, label %18, label %22

18:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #4
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr nonnull %5, i64 1, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %19 unwind label %20

19:                                               ; preds = %18
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %148

20:                                               ; preds = %18
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %149

22:                                               ; preds = %4
  %23 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %24 = trunc i64 %23 to i32
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @_ZN7array2dIdEC2Eii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %2, i32 noundef %24)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #4
  invoke void @_ZN7array2dIiEC2Eii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %2, i32 noundef %24)
          to label %25 unwind label %109

25:                                               ; preds = %22
  %26 = shl nsw i32 %3, 1
  %27 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %28 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  store ptr %28, ptr %9, align 8
  %29 = sext i32 %3 to i64
  %30 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef %29) #4
  %31 = call noundef double @_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET0_T_S9_S8_(ptr %27, ptr %30, double noundef 0.000000e+00)
  %32 = add i32 %3, -1
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 0, i32 noundef %32)
  store double %31, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  %34 = icmp sgt i32 %24, %3
  %35 = add i32 %2, -1
  br i1 %34, label %.lr.ph145, label %._crit_edge146

.lr.ph145:                                        ; preds = %25
  %36 = icmp sgt i32 %2, 2
  br i1 %36, label %.lr.ph141.us.preheader, label %.critedge

.lr.ph141.us.preheader:                           ; preds = %.lr.ph145
  %37 = sub i32 0, %3
  %38 = sext i32 %26 to i64
  %wide.trip.count = zext i32 %35 to i64
  br label %.lr.ph141.us

.lr.ph141.us:                                     ; preds = %.lr.ph141.us.preheader, %.critedge.us
  %indvars.iv158 = phi i64 [ %29, %.lr.ph141.us.preheader ], [ %indvars.iv.next159, %.critedge.us ]
  %indvars.iv149 = phi i32 [ %37, %.lr.ph141.us.preheader ], [ %indvars.iv.next150, %.critedge.us ]
  %39 = sext i32 %indvars.iv149 to i64
  %40 = trunc i64 %indvars.iv158 to i32
  %41 = add i32 %40, -1
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 0, i32 noundef %41)
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv158) #4
  %45 = load double, ptr %44, align 8, !tbaa !9
  %46 = fadd double %43, %45
  %47 = trunc nsw i64 %indvars.iv158 to i32
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 0, i32 noundef %47)
  store double %46, ptr %48, align 8, !tbaa !9
  %49 = sub nsw i64 %indvars.iv158, %38
  %50 = add nsw i64 %49, 1
  %51 = trunc nsw i64 %49 to i32
  %52 = add i32 %51, %3
  br label %53

53:                                               ; preds = %.lr.ph141.us, %._crit_edge.us
  %indvars.iv154 = phi i64 [ 1, %.lr.ph141.us ], [ %indvars.iv.next155, %._crit_edge.us ]
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %54 = mul nsw i64 %indvars.iv.next155, %29
  %55 = add nsw i64 %54, -1
  %.not133.us = icmp slt i64 %indvars.iv158, %55
  br i1 %.not133.us, label %.critedge.us, label %56

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %57 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  store ptr %57, ptr %11, align 8
  %58 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef %50) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %59 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  store ptr %59, ptr %13, align 8
  %60 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %13, i64 noundef %indvars.iv158) #4
  store ptr %60, ptr %12, align 8
  %61 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef 1) #4
  %62 = call noundef double @_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET0_T_S9_S8_(ptr %58, ptr %61, double noundef 0.000000e+00)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  store double %62, ptr %10, align 8, !tbaa !9
  %63 = add nsw i64 %indvars.iv154, -1
  %64 = mul nsw i64 %63, %29
  %65 = trunc nuw nsw i64 %63 to i32
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %65, i32 noundef %52)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %66)
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = trunc nuw nsw i64 %indvars.iv154 to i32
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %69, i32 noundef %47)
  store double %68, ptr %70, align 8, !tbaa !9
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7array2dIiEclEii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %69, i32 noundef %47)
  store i32 %52, ptr %71, align 4, !tbaa !5
  %.not136.us = icmp slt i64 %49, %64
  br i1 %.not136.us, label %._crit_edge.us, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %56, %87
  %indvars.iv151 = phi i64 [ %indvars.iv.next152, %87 ], [ %39, %56 ]
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv151) #4
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = load double, ptr %10, align 8, !tbaa !9
  %75 = fadd double %73, %74
  store double %75, ptr %10, align 8, !tbaa !9
  %76 = trunc nsw i64 %indvars.iv151 to i32
  %77 = add i32 %32, %76
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %65, i32 noundef %77)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %78)
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %69, i32 noundef %47)
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = fcmp olt double %80, %82
  br i1 %83, label %84, label %87

84:                                               ; preds = %.lr.ph.us
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %69, i32 noundef %47)
  store double %80, ptr %85, align 8, !tbaa !9
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7array2dIiEclEii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %69, i32 noundef %47)
  store i32 %77, ptr %86, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %84, %.lr.ph.us
  %88 = load double, ptr %10, align 8, !tbaa !9
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %69, i32 noundef %47)
  %90 = load double, ptr %89, align 8, !tbaa !9
  %91 = fcmp ogt double %88, %90
  %indvars.iv.next152 = add nsw i64 %indvars.iv151, -1
  %.not.us = icmp sle i64 %indvars.iv151, %64
  %or.cond = select i1 %91, i1 true, i1 %.not.us
  br i1 %or.cond, label %._crit_edge.us, label %.lr.ph.us, !llvm.loop !11

._crit_edge.us:                                   ; preds = %87, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  %exitcond157.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count
  br i1 %exitcond157.not, label %.critedge.us, label %53, !llvm.loop !13

.critedge.us:                                     ; preds = %._crit_edge.us, %53
  %indvars.iv.next159 = add nsw i64 %indvars.iv158, 1
  %indvars.iv.next150 = add i32 %indvars.iv149, 1
  %lftr.wideiv161 = trunc i64 %indvars.iv.next159 to i32
  %exitcond162.not = icmp eq i32 %lftr.wideiv161, %24
  br i1 %exitcond162.not, label %._crit_edge146, label %.lr.ph141.us, !llvm.loop !14

._crit_edge146:                                   ; preds = %.critedge, %.critedge.us, %25
  %92 = add nsw i32 %24, -1
  %93 = sub i32 %24, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  %94 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  store ptr %94, ptr %15, align 8
  %95 = sext i32 %93 to i64
  %96 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef %95) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  %97 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  store ptr %97, ptr %16, align 8
  %sext = shl i64 %23, 32
  %98 = ashr exact i64 %sext, 32
  %99 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef %98) #4
  %100 = call noundef double @_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET0_T_S9_S8_(ptr %96, ptr %99, double noundef 0.000000e+00)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  store double %100, ptr %14, align 8, !tbaa !9
  %101 = add nsw i32 %2, -2
  %102 = mul nsw i32 %101, %3
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %101, i32 noundef %92)
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %103)
  %105 = load double, ptr %104, align 8, !tbaa !9
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %35, i32 noundef %92)
  store double %105, ptr %106, align 8, !tbaa !9
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7array2dIiEclEii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %35, i32 noundef %92)
  store i32 %92, ptr %107, align 4, !tbaa !5
  %108 = sext i32 %102 to i64
  br label %120

109:                                              ; preds = %22
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %147

.critedge:                                        ; preds = %.lr.ph145, %.critedge
  %indvars.iv = phi i64 [ %indvars.iv.next, %.critedge ], [ %29, %.lr.ph145 ]
  %111 = trunc i64 %indvars.iv to i32
  %112 = add i32 %111, -1
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 0, i32 noundef %112)
  %114 = load double, ptr %113, align 8, !tbaa !9
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %116 = load double, ptr %115, align 8, !tbaa !9
  %117 = fadd double %114, %116
  %118 = trunc nsw i64 %indvars.iv to i32
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 0, i32 noundef %118)
  store double %117, ptr %119, align 8, !tbaa !9
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %lftr.wideiv, %24
  br i1 %exitcond.not, label %._crit_edge146, label %.critedge, !llvm.loop !14

120:                                              ; preds = %140, %._crit_edge146
  %indvars.iv163 = phi i64 [ %indvars.iv.next164, %140 ], [ %95, %._crit_edge146 ]
  %indvars.iv.next164 = add nsw i64 %indvars.iv163, -1
  %121 = icmp sgt i64 %indvars.iv163, %108
  br i1 %121, label %124, label %145

122:                                              ; preds = %145
  %123 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @_ZN7array2dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  br label %147

124:                                              ; preds = %120
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv.next164) #4
  %126 = load double, ptr %125, align 8, !tbaa !9
  %127 = load double, ptr %14, align 8, !tbaa !9
  %128 = fadd double %126, %127
  store double %128, ptr %14, align 8, !tbaa !9
  %129 = trunc nsw i64 %indvars.iv.next164 to i32
  %130 = add i32 %32, %129
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %101, i32 noundef %130)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %131)
  %133 = load double, ptr %132, align 8, !tbaa !9
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %35, i32 noundef %92)
  %135 = load double, ptr %134, align 8, !tbaa !9
  %136 = fcmp olt double %133, %135
  br i1 %136, label %137, label %140

137:                                              ; preds = %124
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %35, i32 noundef %92)
  store double %133, ptr %138, align 8, !tbaa !9
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7array2dIiEclEii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %35, i32 noundef %92)
  store i32 %130, ptr %139, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %137, %124
  %141 = load double, ptr %14, align 8, !tbaa !9
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7array2dIdEclEii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %35, i32 noundef %92)
  %143 = load double, ptr %142, align 8, !tbaa !9
  %144 = fcmp ule double %141, %143
  br i1 %144, label %120, label %145, !llvm.loop !15

145:                                              ; preds = %120, %140
  invoke void @_Z18retrieve_partitionRK7array2dIiEiii(ptr dead_on_unwind writable sret(%"class.std::vector.139") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %35, i32 noundef %92, i32 noundef %3)
          to label %146 unwind label %122

146:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @_ZN7array2dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #4
  call void @_ZN7array2dIdED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  br label %148

147:                                              ; preds = %122, %109
  %.pn = phi { ptr, i32 } [ %123, %122 ], [ %110, %109 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #4
  call void @_ZN7array2dIdED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  br label %149

148:                                              ; preds = %146, %19
  ret void

149:                                              ; preds = %147, %20
  %.pn134 = phi { ptr, i32 } [ %21, %20 ], [ %.pn, %147 ]
  resume { ptr, i32 } %.pn134
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7array2dIdEC2Eii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7array2dIiEC2Eii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt10accumulateIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET0_T_S9_S8_(ptr, ptr, double noundef) local_unnamed_addr #3

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7array2dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7array2dIdED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

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


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