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

; 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.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 }
%"struct.std::_List_const_iterator" = type { ptr }
%class.CGridPartitioner = type <{ %"class.std::__cxx11::list", i32, [4 x i8] }>
%"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 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK16CGridPartitioner26getTotalNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(28)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16CGridPartitioner16getAllGridPointsEv(ptr dead_on_unwind noalias writable sret(%class.CDenseMatrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(28) %1) #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_List_const_iterator", align 8
  %8 = alloca %"struct.std::_List_const_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  %17 = call noundef i32 @_ZNK16CGridPartitioner26getTotalNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(28) %16)
  call void @_ZN12CDenseMatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 4, i32 noundef %17)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %18 = getelementptr inbounds %class.CGridPartitioner, ptr %16, i32 0, i32 0
  %19 = call ptr @_ZNKSt7__cxx114listI8CGridBoxSaIS1_EE6cbeginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %20 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %7, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  br label %21

21:                                               ; preds = %82, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %22 = getelementptr inbounds %class.CGridPartitioner, ptr %16, i32 0, i32 0
  %23 = call ptr @_ZNKSt7__cxx114listI8CGridBoxSaIS1_EE4cendEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #6
  %24 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %8, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  %25 = call noundef zeroext i1 @_ZStneRKSt20_List_const_iteratorI8CGridBoxES3_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br i1 %25, label %27, label %26

26:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %108

27:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %28 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %29 = invoke noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80) %28)
          to label %30 unwind label %84

30:                                               ; preds = %27
  store i32 %29, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %31 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %32 = invoke noundef ptr @_ZNK8CGridBox15getCoordinatesXEv(ptr noundef nonnull align 8 dereferenceable(80) %31)
          to label %33 unwind label %88

33:                                               ; preds = %30
  store ptr %32, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %34 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %35 = invoke noundef ptr @_ZNK8CGridBox15getCoordinatesYEv(ptr noundef nonnull align 8 dereferenceable(80) %34)
          to label %36 unwind label %92

36:                                               ; preds = %33
  store ptr %35, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %37 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %38 = invoke noundef ptr @_ZNK8CGridBox15getCoordinatesZEv(ptr noundef nonnull align 8 dereferenceable(80) %37)
          to label %39 unwind label %96

39:                                               ; preds = %36
  store ptr %38, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %40 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %41 = invoke noundef ptr @_ZNK8CGridBox10getWeightsEv(ptr noundef nonnull align 8 dereferenceable(80) %40)
          to label %42 unwind label %100

42:                                               ; preds = %39
  store ptr %41, ptr %15, align 8, !tbaa !5
  %43 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 0)
          to label %44 unwind label %100

44:                                               ; preds = %42
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds double, ptr %43, i64 %46
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = mul i64 %50, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 8 %48, i64 %51, i1 false)
  %52 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 1)
          to label %53 unwind label %100

53:                                               ; preds = %44
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds double, ptr %52, i64 %55
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = mul i64 %59, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %56, ptr align 8 %57, i64 %60, i1 false)
  %61 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 2)
          to label %62 unwind label %100

62:                                               ; preds = %53
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %61, i64 %64
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = mul i64 %68, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %65, ptr align 8 %66, i64 %69, i1 false)
  %70 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 3)
          to label %71 unwind label %100

71:                                               ; preds = %62
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %70, i64 %73
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = mul i64 %77, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %74, ptr align 8 %75, i64 %78, i1 false)
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = add nsw i32 %80, %79
  store i32 %81, ptr %6, align 4, !tbaa !9
  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 4, ptr %9) #6
  br label %82

82:                                               ; preds = %71
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt20_List_const_iteratorI8CGridBoxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br label %21, !llvm.loop !11

84:                                               ; preds = %27
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %10, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %11, align 4
  br label %107

88:                                               ; preds = %30
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %10, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %11, align 4
  br label %106

92:                                               ; preds = %33
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %10, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %11, align 4
  br label %105

96:                                               ; preds = %36
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %10, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %11, align 4
  br label %104

100:                                              ; preds = %62, %53, %44, %42, %39
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %10, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %104

104:                                              ; preds = %100, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %105

105:                                              ; preds = %104, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %106

106:                                              ; preds = %105, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %107

107:                                              ; preds = %106, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  br label %112

108:                                              ; preds = %26
  store i1 true, ptr %5, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %109 = load i1, ptr %5, align 1
  br i1 %109, label %111, label %110

110:                                              ; preds = %108
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  br label %111

111:                                              ; preds = %110, %108
  ret void

112:                                              ; preds = %107
  %113 = load ptr, ptr %10, align 8
  %114 = load i32, ptr %11, align 4
  %115 = insertvalue { ptr, i32 } poison, ptr %113, 0
  %116 = insertvalue { ptr, i32 } %115, i32 %114, 1
  resume { ptr, i32 } %116
}

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


; 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.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 }
%"struct.std::_List_const_iterator" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK16CGridPartitioner26getTotalNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16CGridPartitioner16getAllGridPointsEv(ptr dead_on_unwind noalias writable sret(%class.CDenseMatrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(28) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.std::_List_const_iterator", align 8
  %4 = alloca %"struct.std::_List_const_iterator", align 8
  %5 = tail call noundef i32 @_ZNK16CGridPartitioner26getTotalNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(28) %1)
  tail call void @_ZN12CDenseMatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 4, i32 noundef %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %6 = tail call ptr @_ZNKSt7__cxx114listI8CGridBoxSaIS1_EE6cbeginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %6, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %7 = tail call ptr @_ZNKSt7__cxx114listI8CGridBoxSaIS1_EE4cendEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %7, ptr %4, align 8
  %8 = call noundef zeroext i1 @_ZStneRKSt20_List_const_iteratorI8CGridBoxES3_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %37, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret void

.lr.ph:                                           ; preds = %2, %37
  %.026 = phi i32 [ %39, %37 ], [ 0, %2 ]
  %9 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %10 = invoke noundef i32 @_ZNK8CGridBox21getNumberOfGridPointsEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %11 unwind label %43

11:                                               ; preds = %.lr.ph
  %12 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %13 = invoke noundef ptr @_ZNK8CGridBox15getCoordinatesXEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
          to label %14 unwind label %45

14:                                               ; preds = %11
  %15 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %16 = invoke noundef ptr @_ZNK8CGridBox15getCoordinatesYEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %17 unwind label %47

17:                                               ; preds = %14
  %18 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %19 = invoke noundef ptr @_ZNK8CGridBox15getCoordinatesZEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %20 unwind label %49

20:                                               ; preds = %17
  %21 = call noundef ptr @_ZNKSt20_List_const_iteratorI8CGridBoxEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %22 = invoke noundef ptr @_ZNK8CGridBox10getWeightsEv(ptr noundef nonnull align 8 dereferenceable(80) %21)
          to label %23 unwind label %51

23:                                               ; preds = %20
  %24 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 0)
          to label %25 unwind label %51

25:                                               ; preds = %23
  %26 = sext i32 %.026 to i64
  %27 = getelementptr inbounds double, ptr %24, i64 %26
  %28 = sext i32 %10 to i64
  %29 = shl nsw i64 %28, 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %13, i64 %29, i1 false)
  %30 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 1)
          to label %31 unwind label %51

31:                                               ; preds = %25
  %32 = getelementptr inbounds double, ptr %30, i64 %26
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %16, i64 %29, i1 false)
  %33 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 2)
          to label %34 unwind label %51

34:                                               ; preds = %31
  %35 = getelementptr inbounds double, ptr %33, i64 %26
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %19, i64 %29, i1 false)
  %36 = invoke noundef ptr @_ZN12CDenseMatrix3rowEi(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 3)
          to label %37 unwind label %51

37:                                               ; preds = %34
  %38 = getelementptr inbounds double, ptr %36, i64 %26
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %22, i64 %29, i1 false)
  %39 = add nsw i32 %10, %.026
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt20_List_const_iteratorI8CGridBoxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %41 = call ptr @_ZNKSt7__cxx114listI8CGridBoxSaIS1_EE4cendEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %41, ptr %4, align 8
  %42 = call noundef zeroext i1 @_ZStneRKSt20_List_const_iteratorI8CGridBoxES3_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !5

43:                                               ; preds = %.lr.ph
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %53

45:                                               ; preds = %11
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %53

47:                                               ; preds = %14
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %53

49:                                               ; preds = %17
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %53

51:                                               ; preds = %34, %31, %25, %23, %20
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %53

53:                                               ; preds = %45, %49, %51, %47, %43
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %44, %43 ], [ %46, %45 ], [ %48, %47 ], [ %52, %51 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @_ZN12CDenseMatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass