; LLVM IR from VeloxChem/VeloxChem :: src/dft_func/GridPartitioner.ll (ZNK16CGridPartitioner9bisectBoxB5cxx11ERK8CGridBox)

; 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::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<CGridBox, std::allocator<CGridBox>>::_List_impl" }
%"struct.std::__cxx11::_List_base<CGridBox, std::allocator<CGridBox>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"struct.std::array" = type { [6 x double] }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<const double *, std::allocator<const double *>>::_Vector_impl" }
%"struct.std::_Vector_base<const double *, std::allocator<const double *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const double *, std::allocator<const double *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const double *, std::allocator<const double *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::allocator.5" = type { i8 }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::array<double, 6>, std::allocator<std::array<double, 6>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<double, 6>, std::allocator<std::array<double, 6>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<double, 6>, std::allocator<std::array<double, 6>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<double, 6>, std::allocator<std::array<double, 6>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<CDenseMatrix, std::allocator<CDenseMatrix>>::_Vector_impl" }
%"struct.std::_Vector_base<CDenseMatrix, std::allocator<CDenseMatrix>>::_Vector_impl" = type { %"struct.std::_Vector_base<CDenseMatrix, std::allocator<CDenseMatrix>>::_Vector_impl_data" }
%"struct.std::_Vector_base<CDenseMatrix, std::allocator<CDenseMatrix>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = 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.CDenseMatrix = 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.CGridBox = type { %"struct.std::array", %class.CDenseMatrix }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80)) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16CGridPartitioner9bisectBoxB5cxx11ERK8CGridBox(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::list") align 8 %0, ptr noundef nonnull align 8 dereferenceable(28) %1, ptr noundef nonnull align 8 dereferenceable(80) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.std::array", align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca %"class.std::vector.3", align 8
  %24 = alloca %"class.std::initializer_list", align 8
  %25 = alloca [3 x ptr], align 8
  %26 = alloca %"class.std::allocator.5", align 1
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca double, align 8
  %30 = alloca %"class.std::vector.8", align 8
  %31 = alloca %"class.std::vector.13", align 8
  %32 = alloca %"class.std::vector.18", align 8
  %33 = alloca i32, align 4
  %34 = alloca %"struct.std::array", align 8
  %35 = alloca %class.CDenseMatrix, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i1, align 1
  %41 = alloca i64, align 8
  %42 = alloca i32, align 4
  %43 = alloca %class.CGridBox, align 8
  %44 = alloca %class.CDenseMatrix, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #6
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK8CGridBox15getBoxDimensionEv(ptr dead_on_unwind writable sret(%"struct.std::array") align 8 %7, ptr noundef nonnull align 8 dereferenceable(80) %46)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %7, i64 noundef 0) #6
  %48 = load double, ptr %47, align 8, !tbaa !9
  store double %48, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %7, i64 noundef 1) #6
  %50 = load double, ptr %49, align 8, !tbaa !9
  store double %50, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %7, i64 noundef 2) #6
  %52 = load double, ptr %51, align 8, !tbaa !9
  store double %52, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %7, i64 noundef 3) #6
  %54 = load double, ptr %53, align 8, !tbaa !9
  store double %54, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %7, i64 noundef 4) #6
  %56 = load double, ptr %55, align 8, !tbaa !9
  store double %56, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %7, i64 noundef 5) #6
  %58 = load double, ptr %57, align 8, !tbaa !9
  store double %58, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %59 = load double, ptr %11, align 8, !tbaa !9
  %60 = load double, ptr %8, align 8, !tbaa !9
  %61 = fsub double %59, %60
  store double %61, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %62 = load double, ptr %12, align 8, !tbaa !9
  %63 = load double, ptr %9, align 8, !tbaa !9
  %64 = fsub double %62, %63
  store double %64, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %65 = load double, ptr %13, align 8, !tbaa !9
  %66 = load double, ptr %10, align 8, !tbaa !9
  %67 = fsub double %65, %66
  store double %67, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !11
  %68 = load double, ptr %15, align 8, !tbaa !9
  %69 = load double, ptr %14, align 8, !tbaa !9
  %70 = fcmp oge double %68, %69
  br i1 %70, label %71, label %76

71:                                               ; preds = %3
  %72 = load double, ptr %15, align 8, !tbaa !9
  %73 = load double, ptr %16, align 8, !tbaa !9
  %74 = fcmp oge double %72, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %71
  store i32 1, ptr %17, align 4, !tbaa !11
  br label %86

76:                                               ; preds = %71, %3
  %77 = load double, ptr %16, align 8, !tbaa !9
  %78 = load double, ptr %14, align 8, !tbaa !9
  %79 = fcmp oge double %77, %78
  br i1 %79, label %80, label %85

80:                                               ; preds = %76
  %81 = load double, ptr %16, align 8, !tbaa !9
  %82 = load double, ptr %15, align 8, !tbaa !9
  %83 = fcmp oge double %81, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %80
  store i32 2, ptr %17, align 4, !tbaa !11
  br label %85

85:                                               ; preds = %84, %80, %76
  br label %86

86:                                               ; preds = %85, %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = call noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80) %87)
  store i32 %88, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = call noundef ptr @_ZNK8CGridBox15getCoordinatesXEv(ptr noundef nonnull align 8 dereferenceable(80) %89)
  store ptr %90, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call noundef ptr @_ZNK8CGridBox15getCoordinatesYEv(ptr noundef nonnull align 8 dereferenceable(80) %91)
  store ptr %92, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = call noundef ptr @_ZNK8CGridBox15getCoordinatesZEv(ptr noundef nonnull align 8 dereferenceable(80) %93)
  store ptr %94, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = call noundef ptr @_ZNK8CGridBox10getWeightsEv(ptr noundef nonnull align 8 dereferenceable(80) %95)
  store ptr %96, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #6
  %97 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %97, ptr %25, align 8, !tbaa !5
  %98 = getelementptr inbounds ptr, ptr %25, i64 1
  %99 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %99, ptr %98, align 8, !tbaa !5
  %100 = getelementptr inbounds ptr, ptr %25, i64 2
  %101 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %101, ptr %100, align 8, !tbaa !5
  %102 = getelementptr inbounds %"class.std::initializer_list", ptr %24, i32 0, i32 0
  store ptr %25, ptr %102, align 8, !tbaa !13
  %103 = getelementptr inbounds %"class.std::initializer_list", ptr %24, i32 0, i32 1
  store i64 3, ptr %103, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #6
  call void @_ZNSaIPKdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  %104 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8
  %106 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %107 = load i64, ptr %106, align 8
  invoke void @_ZNSt6vectorIPKdSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr %105, i64 %107, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %108 unwind label %120

108:                                              ; preds = %86
  call void @_ZNSt15__new_allocatorIPKdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %109 = load i32, ptr %17, align 4, !tbaa !11
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKdSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %110) #6
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = load i32, ptr %18, align 4, !tbaa !11
  %114 = invoke noundef double @_ZNK16CGridPartitioner20findDividingPositionEPKdi(ptr noundef nonnull align 8 dereferenceable(28) %45, ptr noundef %112, i32 noundef %113)
          to label %115 unwind label %124

115:                                              ; preds = %108
  store double %114, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #6
  call void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #6
  call void @_ZNSt6vectorI12CDenseMatrixSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %32) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  store i32 0, ptr %33, align 4, !tbaa !11
  br label %116

116:                                              ; preds = %134, %115
  %117 = load i32, ptr %33, align 4, !tbaa !11
  %118 = icmp slt i32 %117, 2
  br i1 %118, label %128, label %119

119:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  br label %155

120:                                              ; preds = %86
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %27, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %28, align 4
  call void @_ZNSt15__new_allocatorIPKdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  br label %298

124:                                              ; preds = %108
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %27, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %28, align 4
  br label %297

128:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 48, ptr %34) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %7, i64 48, i1 false), !tbaa.struct !17
  invoke void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(48) %34)
          to label %129 unwind label %137

129:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 48, ptr %34) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %35) #6
  %130 = load i32, ptr %18, align 4, !tbaa !11
  invoke void @_ZN12CDenseMatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(32) %35, i32 noundef 4, i32 noundef %130)
          to label %131 unwind label %141

131:                                              ; preds = %129
  invoke void @_ZNSt6vectorI12CDenseMatrixSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(32) %35)
          to label %132 unwind label %145

132:                                              ; preds = %131
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %35) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %35) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  store i32 0, ptr %36, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 4 dereferenceable(4) %36)
          to label %133 unwind label %150

133:                                              ; preds = %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %33, align 4, !tbaa !11
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %33, align 4, !tbaa !11
  br label %116, !llvm.loop !19

137:                                              ; preds = %128
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %27, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 48, ptr %34) #6
  br label %154

141:                                              ; preds = %129
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %27, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %28, align 4
  br label %149

145:                                              ; preds = %131
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %27, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %28, align 4
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %35) #6
  br label %149

149:                                              ; preds = %145, %141
  call void @llvm.lifetime.end.p0(i64 32, ptr %35) #6
  br label %154

150:                                              ; preds = %132
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %27, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  br label %154

154:                                              ; preds = %150, %149, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  br label %296

155:                                              ; preds = %119
  %156 = load double, ptr %29, align 8, !tbaa !9
  %157 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef 0) #6
  %158 = load i32, ptr %17, align 4, !tbaa !11
  %159 = add nsw i32 3, %158
  %160 = sext i32 %159 to i64
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %157, i64 noundef %160) #6
  store double %156, ptr %161, align 8, !tbaa !9
  %162 = load double, ptr %29, align 8, !tbaa !9
  %163 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef 1) #6
  %164 = load i32, ptr %17, align 4, !tbaa !11
  %165 = sext i32 %164 to i64
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %163, i64 noundef %165) #6
  store double %162, ptr %166, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #6
  store i32 0, ptr %37, align 4, !tbaa !11
  br label %167

167:                                              ; preds = %246, %155
  %168 = load i32, ptr %37, align 4, !tbaa !11
  %169 = load i32, ptr %18, align 4, !tbaa !11
  %170 = icmp slt i32 %168, %169
  br i1 %170, label %172, label %171

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

172:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #6
  %173 = load i32, ptr %17, align 4, !tbaa !11
  %174 = sext i32 %173 to i64
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKdSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %174) #6
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = load i32, ptr %37, align 4, !tbaa !11
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds double, ptr %176, i64 %178
  %180 = load double, ptr %179, align 8, !tbaa !9
  %181 = load double, ptr %29, align 8, !tbaa !9
  %182 = fcmp olt double %180, %181
  %183 = zext i1 %182 to i64
  %184 = select i1 %182, i32 0, i32 1
  store i32 %184, ptr %38, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  %185 = load i32, ptr %38, align 4, !tbaa !11
  %186 = sext i32 %185 to i64
  %187 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %186) #6
  %188 = load i32, ptr %187, align 4, !tbaa !11
  store i32 %188, ptr %39, align 4, !tbaa !11
  %189 = load ptr, ptr %19, align 8, !tbaa !5
  %190 = load i32, ptr %37, align 4, !tbaa !11
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds double, ptr %189, i64 %191
  %193 = load double, ptr %192, align 8, !tbaa !9
  %194 = load i32, ptr %38, align 4, !tbaa !11
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %195) #6
  %197 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %196, i32 noundef 0)
          to label %198 unwind label %249

198:                                              ; preds = %172
  %199 = load i32, ptr %39, align 4, !tbaa !11
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds double, ptr %197, i64 %200
  store double %193, ptr %201, align 8, !tbaa !9
  %202 = load ptr, ptr %20, align 8, !tbaa !5
  %203 = load i32, ptr %37, align 4, !tbaa !11
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds double, ptr %202, i64 %204
  %206 = load double, ptr %205, align 8, !tbaa !9
  %207 = load i32, ptr %38, align 4, !tbaa !11
  %208 = sext i32 %207 to i64
  %209 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %208) #6
  %210 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %209, i32 noundef 1)
          to label %211 unwind label %249

211:                                              ; preds = %198
  %212 = load i32, ptr %39, align 4, !tbaa !11
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds double, ptr %210, i64 %213
  store double %206, ptr %214, align 8, !tbaa !9
  %215 = load ptr, ptr %21, align 8, !tbaa !5
  %216 = load i32, ptr %37, align 4, !tbaa !11
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds double, ptr %215, i64 %217
  %219 = load double, ptr %218, align 8, !tbaa !9
  %220 = load i32, ptr %38, align 4, !tbaa !11
  %221 = sext i32 %220 to i64
  %222 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %221) #6
  %223 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %222, i32 noundef 2)
          to label %224 unwind label %249

224:                                              ; preds = %211
  %225 = load i32, ptr %39, align 4, !tbaa !11
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds double, ptr %223, i64 %226
  store double %219, ptr %227, align 8, !tbaa !9
  %228 = load ptr, ptr %22, align 8, !tbaa !5
  %229 = load i32, ptr %37, align 4, !tbaa !11
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds double, ptr %228, i64 %230
  %232 = load double, ptr %231, align 8, !tbaa !9
  %233 = load i32, ptr %38, align 4, !tbaa !11
  %234 = sext i32 %233 to i64
  %235 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %234) #6
  %236 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %235, i32 noundef 3)
          to label %237 unwind label %249

237:                                              ; preds = %224
  %238 = load i32, ptr %39, align 4, !tbaa !11
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds double, ptr %236, i64 %239
  store double %232, ptr %240, align 8, !tbaa !9
  %241 = load i32, ptr %38, align 4, !tbaa !11
  %242 = sext i32 %241 to i64
  %243 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %242) #6
  %244 = load i32, ptr %243, align 4, !tbaa !11
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %243, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #6
  br label %246

246:                                              ; preds = %237
  %247 = load i32, ptr %37, align 4, !tbaa !11
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %37, align 4, !tbaa !11
  br label %167, !llvm.loop !21

249:                                              ; preds = %224, %211, %198, %172
  %250 = landingpad { ptr, i32 }
          cleanup
  %251 = extractvalue { ptr, i32 } %250, 0
  store ptr %251, ptr %27, align 8
  %252 = extractvalue { ptr, i32 } %250, 1
  store i32 %252, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  br label %296

253:                                              ; preds = %171
  store i1 false, ptr %40, align 1
  call void @_ZNSt7__cxx114listI8CGridBoxSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #6
  store i64 0, ptr %41, align 8, !tbaa !22
  br label %254

254:                                              ; preds = %289, %253
  %255 = load i64, ptr %41, align 8, !tbaa !22
  %256 = call noundef i64 @_ZNKSt6vectorISt5arrayIdLm6EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  %257 = icmp ult i64 %255, %256
  br i1 %257, label %259, label %258

258:                                              ; preds = %254
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  br label %292

259:                                              ; preds = %254
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #6
  %260 = load i64, ptr %41, align 8, !tbaa !22
  %261 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %260) #6
  %262 = load i32, ptr %261, align 4, !tbaa !11
  store i32 %262, ptr %42, align 4, !tbaa !11
  %263 = load i32, ptr %42, align 4, !tbaa !11
  %264 = icmp sgt i32 %263, 0
  br i1 %264, label %265, label %288

265:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 80, ptr %43) #6
  %266 = load i64, ptr %41, align 8, !tbaa !22
  %267 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %266) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %44) #6
  %268 = load i64, ptr %41, align 8, !tbaa !22
  %269 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %268) #6
  %270 = load i32, ptr %42, align 4, !tbaa !11
  invoke void @_ZNK12CDenseMatrix5sliceEii(ptr dead_on_unwind writable sret(%class.CDenseMatrix) align 8 %44, ptr noundef nonnull align 8 dereferenceable(32) %269, i32 noundef 0, i32 noundef %270)
          to label %271 unwind label %274

271:                                              ; preds = %265
  invoke void @_ZN8CGridBoxC1ERKSt5arrayIdLm6EERK12CDenseMatrix(ptr noundef nonnull align 8 dereferenceable(80) %43, ptr noundef nonnull align 8 dereferenceable(48) %267, ptr noundef nonnull align 8 dereferenceable(32) %44)
          to label %272 unwind label %278

272:                                              ; preds = %271
  invoke void @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(80) %43)
          to label %273 unwind label %282

273:                                              ; preds = %272
  call void @_ZN8CGridBoxD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %43) #6
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %44) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %43) #6
  br label %288

274:                                              ; preds = %265
  %275 = landingpad { ptr, i32 }
          cleanup
  %276 = extractvalue { ptr, i32 } %275, 0
  store ptr %276, ptr %27, align 8
  %277 = extractvalue { ptr, i32 } %275, 1
  store i32 %277, ptr %28, align 4
  br label %287

278:                                              ; preds = %271
  %279 = landingpad { ptr, i32 }
          cleanup
  %280 = extractvalue { ptr, i32 } %279, 0
  store ptr %280, ptr %27, align 8
  %281 = extractvalue { ptr, i32 } %279, 1
  store i32 %281, ptr %28, align 4
  br label %286

282:                                              ; preds = %272
  %283 = landingpad { ptr, i32 }
          cleanup
  %284 = extractvalue { ptr, i32 } %283, 0
  store ptr %284, ptr %27, align 8
  %285 = extractvalue { ptr, i32 } %283, 1
  store i32 %285, ptr %28, align 4
  call void @_ZN8CGridBoxD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %43) #6
  br label %286

286:                                              ; preds = %282, %278
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %44) #6
  br label %287

287:                                              ; preds = %286, %274
  call void @llvm.lifetime.end.p0(i64 32, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  call void @_ZNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %296

288:                                              ; preds = %273, %259
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #6
  br label %289

289:                                              ; preds = %288
  %290 = load i64, ptr %41, align 8, !tbaa !22
  %291 = add i64 %290, 1
  store i64 %291, ptr %41, align 8, !tbaa !22
  br label %254, !llvm.loop !23

292:                                              ; preds = %258
  store i1 true, ptr %40, align 1
  %293 = load i1, ptr %40, align 1
  br i1 %293, label %295, label %294

294:                                              ; preds = %292
  call void @_ZNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %295

295:                                              ; preds = %294, %292
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #6
  call void @_ZNSt6vectorI12CDenseMatrixSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #6
  call void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @_ZNSt6vectorIPKdSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #6
  ret void

296:                                              ; preds = %287, %249, %154
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #6
  call void @_ZNSt6vectorI12CDenseMatrixSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #6
  call void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #6
  br label %297

297:                                              ; preds = %296, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @_ZNSt6vectorIPKdSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  br label %298

298:                                              ; preds = %297, %120
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #6
  br label %299

299:                                              ; preds = %298
  %300 = load ptr, ptr %27, align 8
  %301 = load i32, ptr %28, align 4
  %302 = insertvalue { ptr, i32 } poison, ptr %300, 0
  %303 = insertvalue { ptr, i32 } %302, i32 %301, 1
  resume { ptr, i32 } %303
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @_ZNK8CGridBox15getBoxDimensionEv(ptr dead_on_unwind writable sret(%"struct.std::array") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #2

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

declare noundef ptr @_ZNK8CGridBox15getCoordinatesXEv(ptr noundef nonnull align 8 dereferenceable(80)) #2

declare noundef ptr @_ZNK8CGridBox15getCoordinatesYEv(ptr noundef nonnull align 8 dereferenceable(80)) #2

declare noundef ptr @_ZNK8CGridBox15getCoordinatesZEv(ptr noundef nonnull align 8 dereferenceable(80)) #2

declare noundef ptr @_ZNK8CGridBox10getWeightsEv(ptr noundef nonnull align 8 dereferenceable(80)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK16CGridPartitioner20findDividingPositionEPKdi(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, i32 noundef) #3 align 2

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

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

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

; 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 uwtable
declare dso_local void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

declare void @_ZN12CDenseMatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #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 nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

declare noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #2

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

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

declare void @_ZNK12CDenseMatrix5sliceEii(ptr dead_on_unwind writable sret(%class.CDenseMatrix) align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #2

declare void @_ZN8CGridBoxC1ERKSt5arrayIdLm6EERK12CDenseMatrix(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN8CGridBoxD1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorI12CDenseMatrixSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

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

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

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

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


; 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::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<CGridBox, std::allocator<CGridBox>>::_List_impl" }
%"struct.std::__cxx11::_List_base<CGridBox, std::allocator<CGridBox>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"struct.std::array" = type { [6 x double] }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<const double *, std::allocator<const double *>>::_Vector_impl" }
%"struct.std::_Vector_base<const double *, std::allocator<const double *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const double *, std::allocator<const double *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const double *, std::allocator<const double *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.5" = type { i8 }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::array<double, 6>, std::allocator<std::array<double, 6>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::array<double, 6>, std::allocator<std::array<double, 6>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::array<double, 6>, std::allocator<std::array<double, 6>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::array<double, 6>, std::allocator<std::array<double, 6>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<CDenseMatrix, std::allocator<CDenseMatrix>>::_Vector_impl" }
%"struct.std::_Vector_base<CDenseMatrix, std::allocator<CDenseMatrix>>::_Vector_impl" = type { %"struct.std::_Vector_base<CDenseMatrix, std::allocator<CDenseMatrix>>::_Vector_impl_data" }
%"struct.std::_Vector_base<CDenseMatrix, std::allocator<CDenseMatrix>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = 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.CDenseMatrix = 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.CGridBox = type { %"struct.std::array", %class.CDenseMatrix }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16CGridPartitioner9bisectBoxB5cxx11ERK8CGridBox(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::list") align 8 %0, ptr noundef nonnull align 8 dereferenceable(28) %1, ptr noundef nonnull align 8 dereferenceable(80) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.std::array", align 8
  %5 = alloca %"class.std::vector.3", align 8
  %6 = alloca [3 x ptr], align 8
  %7 = alloca %"class.std::allocator.5", align 1
  %8 = alloca %"class.std::vector.8", align 8
  %9 = alloca %"class.std::vector.13", align 8
  %10 = alloca %"class.std::vector.18", align 8
  %11 = alloca %"struct.std::array", align 8
  %12 = alloca %class.CDenseMatrix, align 8
  %13 = alloca i32, align 4
  %14 = alloca %class.CGridBox, align 8
  %15 = alloca %class.CDenseMatrix, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #6
  call void @_ZNK8CGridBox15getBoxDimensionEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::array") align 8 %4, ptr noundef nonnull align 8 dereferenceable(80) %2)
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %4, i64 noundef 0) #6
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %4, i64 noundef 1) #6
  %19 = load double, ptr %18, align 8, !tbaa !5
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %4, i64 noundef 2) #6
  %21 = load double, ptr %20, align 8, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %4, i64 noundef 3) #6
  %23 = load double, ptr %22, align 8, !tbaa !5
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %4, i64 noundef 4) #6
  %25 = load double, ptr %24, align 8, !tbaa !5
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %4, i64 noundef 5) #6
  %27 = load double, ptr %26, align 8, !tbaa !5
  %28 = fsub double %23, %17
  %29 = fsub double %25, %19
  %30 = fsub double %27, %21
  %31 = fcmp ult double %29, %28
  %32 = fcmp ult double %29, %30
  %or.cond = select i1 %31, i1 true, i1 %32
  %33 = fcmp ult double %30, %28
  %34 = fcmp ult double %30, %29
  %or.cond89 = or i1 %33, %34
  %spec.select = select i1 %or.cond89, i32 0, i32 2
  %.0 = select i1 %or.cond, i32 %spec.select, i32 1
  %35 = call noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %36 = call noundef ptr @_ZNK8CGridBox15getCoordinatesXEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %37 = call noundef ptr @_ZNK8CGridBox15getCoordinatesYEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %38 = call noundef ptr @_ZNK8CGridBox15getCoordinatesZEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %39 = call noundef ptr @_ZNK8CGridBox10getWeightsEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  store ptr %36, ptr %6, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %37, ptr %40, align 8, !tbaa !9
  %41 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %38, ptr %41, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  call void @_ZNSaIPKdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt6vectorIPKdSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr nonnull %6, i64 3, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %42 unwind label %48

42:                                               ; preds = %3
  call void @_ZNSt15__new_allocatorIPKdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  %43 = zext nneg i32 %.0 to i64
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKdSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %43) #6
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = invoke noundef double @_ZNK16CGridPartitioner20findDividingPositionEPKdi(ptr noundef nonnull align 8 dereferenceable(28) %1, ptr noundef %45, i32 noundef %35)
          to label %47 unwind label %50

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @_ZNSt6vectorI12CDenseMatrixSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(48) %4, i64 48, i1 false), !tbaa.struct !11
  invoke void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(48) %11)
          to label %52 unwind label %67

.lr.ph.preheader:                                 ; preds = %59
  %wide.trip.count = zext nneg i32 %35 to i64
  br label %.lr.ph

48:                                               ; preds = %3
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIPKdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %138

50:                                               ; preds = %42
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %137

52:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #6
  invoke void @_ZN12CDenseMatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef 4, i32 noundef %35)
          to label %53 unwind label %69

53:                                               ; preds = %52
  invoke void @_ZNSt6vectorI12CDenseMatrixSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %54 unwind label %71

54:                                               ; preds = %53
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  store i32 0, ptr %13, align 4, !tbaa !13
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %55 unwind label %74

55:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(48) %4, i64 48, i1 false), !tbaa.struct !11
  invoke void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(48) %11)
          to label %56 unwind label %67

56:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #6
  invoke void @_ZN12CDenseMatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(32) %12, i32 noundef 4, i32 noundef %35)
          to label %57 unwind label %69

57:                                               ; preds = %56
  invoke void @_ZNSt6vectorI12CDenseMatrixSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %58 unwind label %71

58:                                               ; preds = %57
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  store i32 0, ptr %13, align 4, !tbaa !13
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %59 unwind label %74

59:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  %60 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #6
  %61 = add nuw nsw i32 %.0, 3
  %62 = zext nneg i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %60, i64 noundef %62) #6
  store double %46, ptr %63, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 1) #6
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIdLm6EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %64, i64 noundef %43) #6
  store double %46, ptr %65, align 8, !tbaa !5
  %66 = icmp sgt i32 %35, 0
  br i1 %66, label %.lr.ph.preheader, label %._crit_edge

67:                                               ; preds = %55, %47
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #6
  br label %136

69:                                               ; preds = %56, %52
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %73

71:                                               ; preds = %57, %53
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  br label %73

73:                                               ; preds = %71, %69
  %.pn82 = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #6
  br label %136

74:                                               ; preds = %58, %54
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %136

._crit_edge:                                      ; preds = %108, %59
  call void @_ZNSt7__cxx114listI8CGridBoxSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %76 = call noundef i64 @_ZNKSt6vectorISt5arrayIdLm6EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %.not = icmp eq i64 %76, 0
  br i1 %.not, label %._crit_edge95, label %.lr.ph94

.lr.ph:                                           ; preds = %.lr.ph.preheader, %108
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %108 ]
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKdSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %43) #6
  %78 = load ptr, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds double, ptr %78, i64 %indvars.iv
  %80 = load double, ptr %79, align 8, !tbaa !5
  %81 = fcmp uge double %80, %46
  %82 = zext i1 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %82) #6
  %84 = load i32, ptr %83, align 4, !tbaa !13
  %85 = getelementptr inbounds double, ptr %36, i64 %indvars.iv
  %86 = load double, ptr %85, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %82) #6
  %88 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %87, i32 noundef 0)
          to label %89 unwind label %113

89:                                               ; preds = %.lr.ph
  %90 = sext i32 %84 to i64
  %91 = getelementptr inbounds double, ptr %88, i64 %90
  store double %86, ptr %91, align 8, !tbaa !5
  %92 = getelementptr inbounds double, ptr %37, i64 %indvars.iv
  %93 = load double, ptr %92, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %82) #6
  %95 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %94, i32 noundef 1)
          to label %96 unwind label %113

96:                                               ; preds = %89
  %97 = getelementptr inbounds double, ptr %95, i64 %90
  store double %93, ptr %97, align 8, !tbaa !5
  %98 = getelementptr inbounds double, ptr %38, i64 %indvars.iv
  %99 = load double, ptr %98, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %82) #6
  %101 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %100, i32 noundef 2)
          to label %102 unwind label %113

102:                                              ; preds = %96
  %103 = getelementptr inbounds double, ptr %101, i64 %90
  store double %99, ptr %103, align 8, !tbaa !5
  %104 = getelementptr inbounds double, ptr %39, i64 %indvars.iv
  %105 = load double, ptr %104, align 8, !tbaa !5
  %106 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %82) #6
  %107 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %106, i32 noundef 3)
          to label %108 unwind label %113

108:                                              ; preds = %102
  %109 = getelementptr inbounds double, ptr %107, i64 %90
  store double %105, ptr %109, align 8, !tbaa !5
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %82) #6
  %111 = load i32, ptr %110, align 4, !tbaa !13
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %110, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

113:                                              ; preds = %102, %96, %89, %.lr.ph
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %136

.lr.ph94:                                         ; preds = %._crit_edge, %132
  %.06692 = phi i64 [ %133, %132 ], [ 0, %._crit_edge ]
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.06692) #6
  %116 = load i32, ptr %115, align 4, !tbaa !13
  %117 = icmp sgt i32 %116, 0
  br i1 %117, label %118, label %132

118:                                              ; preds = %.lr.ph94
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %14) #6
  %119 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %.06692) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #6
  %120 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.06692) #6
  invoke void @_ZNK12CDenseMatrix5sliceEii(ptr dead_on_unwind nonnull writable sret(%class.CDenseMatrix) align 8 %15, ptr noundef nonnull align 8 dereferenceable(32) %120, i32 noundef 0, i32 noundef %116)
          to label %121 unwind label %124

121:                                              ; preds = %118
  invoke void @_ZN8CGridBoxC1ERKSt5arrayIdLm6EERK12CDenseMatrix(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 8 dereferenceable(48) %119, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %122 unwind label %126

122:                                              ; preds = %121
  invoke void @_ZNSt7__cxx114listI8CGridBoxSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %123 unwind label %128

123:                                              ; preds = %122
  call void @_ZN8CGridBoxD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #6
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %14) #6
  br label %132

124:                                              ; preds = %118
  %125 = landingpad { ptr, i32 }
          cleanup
  br label %131

126:                                              ; preds = %121
  %127 = landingpad { ptr, i32 }
          cleanup
  br label %130

128:                                              ; preds = %122
  %129 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8CGridBoxD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #6
  br label %130

130:                                              ; preds = %128, %126
  %.pn = phi { ptr, i32 } [ %129, %128 ], [ %127, %126 ]
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  br label %131

131:                                              ; preds = %130, %124
  %.pn.pn = phi { ptr, i32 } [ %.pn, %130 ], [ %125, %124 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %14) #6
  call void @_ZNSt7__cxx1110_List_baseI8CGridBoxSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %136

132:                                              ; preds = %123, %.lr.ph94
  %133 = add nuw i64 %.06692, 1
  %134 = call noundef i64 @_ZNKSt6vectorISt5arrayIdLm6EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %135 = icmp ult i64 %133, %134
  br i1 %135, label %.lr.ph94, label %._crit_edge95, !llvm.loop !17

._crit_edge95:                                    ; preds = %132, %._crit_edge
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @_ZNSt6vectorI12CDenseMatrixSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @_ZNSt6vectorIPKdSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #6
  ret void

136:                                              ; preds = %67, %73, %74, %131, %113
  %.pn84.pn = phi { ptr, i32 } [ %114, %113 ], [ %.pn.pn, %131 ], [ %75, %74 ], [ %.pn82, %73 ], [ %68, %67 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @_ZNSt6vectorI12CDenseMatrixSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %137

137:                                              ; preds = %136, %50
  %.pn84.pn.pn = phi { ptr, i32 } [ %.pn84.pn, %136 ], [ %51, %50 ]
  call void @_ZNSt6vectorIPKdSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %138

138:                                              ; preds = %137, %48
  %.pn84.pn.pn.pn = phi { ptr, i32 } [ %.pn84.pn.pn, %137 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn84.pn.pn.pn
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @_ZNK8CGridBox15getBoxDimensionEv(ptr dead_on_unwind writable sret(%"struct.std::array") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

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

declare noundef ptr @_ZNK8CGridBox15getCoordinatesXEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

declare noundef ptr @_ZNK8CGridBox15getCoordinatesYEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

declare noundef ptr @_ZNK8CGridBox15getCoordinatesZEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

declare noundef ptr @_ZNK8CGridBox10getWeightsEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK16CGridPartitioner20findDividingPositionEPKdi(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, i32 noundef) local_unnamed_addr #3 align 2

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

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

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

; 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 uwtable
declare dso_local void @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

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

declare void @_ZN12CDenseMatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt5arrayIdLm6EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) 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 nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI12CDenseMatrixSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

declare noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #2

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

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

declare void @_ZNK12CDenseMatrix5sliceEii(ptr dead_on_unwind writable sret(%class.CDenseMatrix) align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @_ZN8CGridBoxC1ERKSt5arrayIdLm6EERK12CDenseMatrix(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN8CGridBoxD1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorI12CDenseMatrixSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass