; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src (anisotropicparticlemesher)

; 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.vmath::vec3" = type { float, float, float }
%"struct.AnisotropicParticleMesher::SurfaceParticle" = type { %"class.vmath::vec3", %struct.GridPointReference, i32 }
%struct.GridPointReference = type { i32 }
%class.AnisotropicParticleMesher = type { double, double, double, double, double, double, double, double, i32, double, i32, double, i32, i32, i32, double, i32, double, %class.SpatialPointGrid, %class.FragmentedVector, %class.FragmentedVector.10, %class.FragmentedVector.10, %class.FragmentedVector.16, %class.ScalarField, i32, i32, i32, [4 x i8], %class.Array3d.22 }
%class.SpatialPointGrid = type { i32, i32, i32, double, %"class.std::vector", %"class.std::vector.0", %class.Array3d, %class.AABB }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl" }
%"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl" = type { %"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GridPoint, std::allocator<GridPoint>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.Array3d = type { i32, i32, i32, ptr, i8, %"struct.SpatialPointGrid::CellNode", i32 }
%"struct.SpatialPointGrid::CellNode" = type { i32, i32 }
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%class.FragmentedVector = type { %"class.std::vector.5", i32, i32, double, i32, i32 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<FragmentedVector<AnisotropicParticleMesher::SurfaceParticle>::VectorNode, std::allocator<FragmentedVector<AnisotropicParticleMesher::SurfaceParticle>::VectorNode>>::_Vector_impl" }
%"struct.std::_Vector_base<FragmentedVector<AnisotropicParticleMesher::SurfaceParticle>::VectorNode, std::allocator<FragmentedVector<AnisotropicParticleMesher::SurfaceParticle>::VectorNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<FragmentedVector<AnisotropicParticleMesher::SurfaceParticle>::VectorNode, std::allocator<FragmentedVector<AnisotropicParticleMesher::SurfaceParticle>::VectorNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FragmentedVector<AnisotropicParticleMesher::SurfaceParticle>::VectorNode, std::allocator<FragmentedVector<AnisotropicParticleMesher::SurfaceParticle>::VectorNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.FragmentedVector.10 = type { %"class.std::vector.11", i32, i32, double, i32, i32 }
%"class.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<FragmentedVector<GridPointReference>::VectorNode, std::allocator<FragmentedVector<GridPointReference>::VectorNode>>::_Vector_impl" }
%"struct.std::_Vector_base<FragmentedVector<GridPointReference>::VectorNode, std::allocator<FragmentedVector<GridPointReference>::VectorNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<FragmentedVector<GridPointReference>::VectorNode, std::allocator<FragmentedVector<GridPointReference>::VectorNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FragmentedVector<GridPointReference>::VectorNode, std::allocator<FragmentedVector<GridPointReference>::VectorNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.FragmentedVector.16 = type { %"class.std::vector.17", i32, i32, double, i32, i32 }
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<FragmentedVector<vmath::vec3>::VectorNode, std::allocator<FragmentedVector<vmath::vec3>::VectorNode>>::_Vector_impl" }
%"struct.std::_Vector_base<FragmentedVector<vmath::vec3>::VectorNode, std::allocator<FragmentedVector<vmath::vec3>::VectorNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<FragmentedVector<vmath::vec3>::VectorNode, std::allocator<FragmentedVector<vmath::vec3>::VectorNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FragmentedVector<vmath::vec3>::VectorNode, std::allocator<FragmentedVector<vmath::vec3>::VectorNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.ScalarField = type { i32, i32, i32, double, double, double, double, double, double, double, double, i8, [7 x i8], %class.Array3d.22, %class.Array3d.23, %class.Array3d.22, %class.Array3d.23, i8, %"class.vmath::vec3" }
%class.Array3d.23 = type { i32, i32, i32, ptr, i8, i8, i32 }
%class.Array3d.22 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, i32, [4 x i8] }>

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: mustprogress uwtable
define dso_local void @_ZN25AnisotropicParticleMesher27_initializeSurfaceParticlesER16FragmentedVectorIN5vmath4vec3EER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(448) %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca %"struct.AnisotropicParticleMesher::SurfaceParticle", align 4
  %13 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #7
  call void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %52, %3
  %16 = load i32, ptr %8, align 4, !tbaa !9
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = invoke noundef i32 @_ZN16FragmentedVectorIN5vmath4vec3EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %17)
          to label %19 unwind label %22

19:                                               ; preds = %15
  %20 = icmp ult i32 %16, %18
  br i1 %20, label %26, label %21

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

22:                                               ; preds = %26, %15
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %9, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %10, align 4
  br label %55

26:                                               ; preds = %19
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN16FragmentedVectorIN5vmath4vec3EEixEi(ptr noundef nonnull align 8 dereferenceable(48) %27, i32 noundef %28)
          to label %30 unwind label %22

30:                                               ; preds = %26
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %29, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %7, i64 12, i1 false), !tbaa.struct !11
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = invoke noundef zeroext i1 @_ZN25AnisotropicParticleMesher18_isSurfaceParticleEN5vmath4vec3ER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784) %14, ptr noundef %11, ptr noundef nonnull align 8 dereferenceable(448) %31)
          to label %33 unwind label %38

33:                                               ; preds = %30
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  br i1 %32, label %34, label %51

34:                                               ; preds = %33
  %35 = getelementptr inbounds %class.AnisotropicParticleMesher, ptr %14, i32 0, i32 19
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %7, i64 12, i1 false), !tbaa.struct !11
  invoke void @_ZN25AnisotropicParticleMesher15SurfaceParticleC2EN5vmath4vec3E(ptr noundef nonnull align 4 dereferenceable(20) %12, ptr noundef %13)
          to label %36 unwind label %42

36:                                               ; preds = %34
  invoke void @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE9push_backES1_(ptr noundef nonnull align 8 dereferenceable(48) %35, ptr noundef %12)
          to label %37 unwind label %46

37:                                               ; preds = %36
  call void @_ZN25AnisotropicParticleMesher15SurfaceParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(20) %12) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #7
  br label %51

38:                                               ; preds = %30
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %9, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %10, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  br label %55

42:                                               ; preds = %34
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %9, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %10, align 4
  br label %50

46:                                               ; preds = %36
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %9, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %10, align 4
  call void @_ZN25AnisotropicParticleMesher15SurfaceParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(20) %12) #7
  br label %50

50:                                               ; preds = %46, %42
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #7
  br label %55

51:                                               ; preds = %37, %33
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = add i32 %53, 1
  store i32 %54, ptr %8, align 4, !tbaa !9
  br label %15, !llvm.loop !14

55:                                               ; preds = %50, %38, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %66

56:                                               ; preds = %21
  invoke void @_ZN25AnisotropicParticleMesher37_initializeSurfaceParticleSpatialGridEv(ptr noundef nonnull align 8 dereferenceable(784) %14)
          to label %57 unwind label %62

57:                                               ; preds = %56
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN25AnisotropicParticleMesher39_updateNearFarSurfaceParticleReferencesER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784) %14, ptr noundef nonnull align 8 dereferenceable(448) %58)
          to label %59 unwind label %62

59:                                               ; preds = %57
  invoke void @_ZN25AnisotropicParticleMesher34_updateSurfaceParticleComponentIDsEv(ptr noundef nonnull align 8 dereferenceable(784) %14)
          to label %60 unwind label %62

60:                                               ; preds = %59
  invoke void @_ZN25AnisotropicParticleMesher31_smoothSurfaceParticlePositionsEv(ptr noundef nonnull align 8 dereferenceable(784) %14)
          to label %61 unwind label %62

61:                                               ; preds = %60
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  ret void

62:                                               ; preds = %60, %59, %57, %56
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %9, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %10, align 4
  br label %66

66:                                               ; preds = %62, %55
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  br label %67

67:                                               ; preds = %66
  %68 = load ptr, ptr %9, align 8
  %69 = load i32, ptr %10, align 4
  %70 = insertvalue { ptr, i32 } poison, ptr %68, 0
  %71 = insertvalue { ptr, i32 } %70, i32 %69, 1
  resume { ptr, i32 } %71
}

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN16FragmentedVectorIN5vmath4vec3EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN16FragmentedVectorIN5vmath4vec3EEixEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN25AnisotropicParticleMesher18_isSurfaceParticleEN5vmath4vec3ER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784), ptr noundef, ptr noundef nonnull align 8 dereferenceable(448)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE9push_backES1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher15SurfaceParticleC2EN5vmath4vec3E(ptr noundef nonnull align 4 dereferenceable(20), ptr noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher15SurfaceParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(20)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher37_initializeSurfaceParticleSpatialGridEv(ptr noundef nonnull align 8 dereferenceable(784)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher39_updateNearFarSurfaceParticleReferencesER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784), ptr noundef nonnull align 8 dereferenceable(448)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher34_updateSurfaceParticleComponentIDsEv(ptr noundef nonnull align 8 dereferenceable(784)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher31_smoothSurfaceParticlePositionsEv(ptr noundef nonnull align 8 dereferenceable(784)) #1 align 2

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

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 uwtable
define dso_local void @_ZN25AnisotropicParticleMesher27_initializeSurfaceParticlesER16FragmentedVectorIN5vmath4vec3EER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(448) %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.vmath::vec3", align 4
  %5 = alloca %"class.vmath::vec3", align 4
  %6 = alloca %"struct.AnisotropicParticleMesher::SurfaceParticle", align 4
  %7 = alloca %"class.vmath::vec3", align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #8
  call void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4)
  %8 = call noundef i32 @_ZN16FragmentedVectorIN5vmath4vec3EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 288
  br label %12

._crit_edge:                                      ; preds = %27, %3
  invoke void @_ZN25AnisotropicParticleMesher37_initializeSurfaceParticleSpatialGridEv(ptr noundef nonnull align 8 dereferenceable(784) %0)
          to label %31 unwind label %35

10:                                               ; preds = %12
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %37

12:                                               ; preds = %.lr.ph, %27
  %.01216 = phi i32 [ 0, %.lr.ph ], [ %28, %27 ]
  %13 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN16FragmentedVectorIN5vmath4vec3EEixEi(ptr noundef nonnull align 8 dereferenceable(48) %1, i32 noundef %.01216)
          to label %14 unwind label %10

14:                                               ; preds = %12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %13, i64 12, i1 false), !tbaa.struct !5
  call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %13, i64 12, i1 false)
  %15 = invoke noundef zeroext i1 @_ZN25AnisotropicParticleMesher18_isSurfaceParticleEN5vmath4vec3ER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784) %0, ptr noundef nonnull %5, ptr noundef nonnull align 8 dereferenceable(448) %2)
          to label %16 unwind label %20

16:                                               ; preds = %14
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #8
  br i1 %15, label %17, label %27

17:                                               ; preds = %16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %4, i64 12, i1 false), !tbaa.struct !5
  invoke void @_ZN25AnisotropicParticleMesher15SurfaceParticleC2EN5vmath4vec3E(ptr noundef nonnull align 4 dereferenceable(20) %6, ptr noundef nonnull %7)
          to label %18 unwind label %22

18:                                               ; preds = %17
  invoke void @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE9push_backES1_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull %6)
          to label %19 unwind label %24

19:                                               ; preds = %18
  call void @_ZN25AnisotropicParticleMesher15SurfaceParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(20) %6) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #8
  br label %27

20:                                               ; preds = %14
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #8
  br label %37

22:                                               ; preds = %17
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %26

24:                                               ; preds = %18
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN25AnisotropicParticleMesher15SurfaceParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(20) %6) #8
  br label %26

26:                                               ; preds = %24, %22
  %.pn = phi { ptr, i32 } [ %25, %24 ], [ %23, %22 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #8
  br label %37

27:                                               ; preds = %16, %19
  %28 = add nuw i32 %.01216, 1
  %29 = call noundef i32 @_ZN16FragmentedVectorIN5vmath4vec3EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %30 = icmp ult i32 %28, %29
  br i1 %30, label %12, label %._crit_edge, !llvm.loop !10

31:                                               ; preds = %._crit_edge
  invoke void @_ZN25AnisotropicParticleMesher39_updateNearFarSurfaceParticleReferencesER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784) %0, ptr noundef nonnull align 8 dereferenceable(448) %2)
          to label %32 unwind label %35

32:                                               ; preds = %31
  invoke void @_ZN25AnisotropicParticleMesher34_updateSurfaceParticleComponentIDsEv(ptr noundef nonnull align 8 dereferenceable(784) %0)
          to label %33 unwind label %35

33:                                               ; preds = %32
  invoke void @_ZN25AnisotropicParticleMesher31_smoothSurfaceParticlePositionsEv(ptr noundef nonnull align 8 dereferenceable(784) %0)
          to label %34 unwind label %35

34:                                               ; preds = %33
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  ret void

35:                                               ; preds = %33, %32, %31, %._crit_edge
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %37

37:                                               ; preds = %10, %20, %26, %35
  %.pn.pn.pn = phi { ptr, i32 } [ %36, %35 ], [ %.pn, %26 ], [ %21, %20 ], [ %11, %10 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn.pn.pn
}

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN16FragmentedVectorIN5vmath4vec3EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN16FragmentedVectorIN5vmath4vec3EEixEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN25AnisotropicParticleMesher18_isSurfaceParticleEN5vmath4vec3ER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784), ptr noundef, ptr noundef nonnull align 8 dereferenceable(448)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE9push_backES1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher15SurfaceParticleC2EN5vmath4vec3E(ptr noundef nonnull align 4 dereferenceable(20), ptr noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher15SurfaceParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(20)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher37_initializeSurfaceParticleSpatialGridEv(ptr noundef nonnull align 8 dereferenceable(784)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher39_updateNearFarSurfaceParticleReferencesER8LevelSet(ptr noundef nonnull align 8 dereferenceable(784), ptr noundef nonnull align 8 dereferenceable(448)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher34_updateSurfaceParticleComponentIDsEv(ptr noundef nonnull align 8 dereferenceable(784)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher31_smoothSurfaceParticlePositionsEv(ptr noundef nonnull align 8 dereferenceable(784)) local_unnamed_addr #1 align 2

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass