; 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.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.vmath::vec3" = type { float, float, float }
%"struct.AnisotropicParticleMesher::AnisotropicParticle" = type { %"class.vmath::vec3", %"class.vmath::mat3" }
%"class.vmath::mat3" = type { [9 x float] }
%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.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] }>
%"struct.AnisotropicParticleMesher::SurfaceParticle" = type { %"class.vmath::vec3", %struct.GridPointReference, i32 }

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEEixEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher13_getSliceAABBEii(ptr dead_on_unwind noalias writable sret(%class.AABB) align 8, ptr noundef nonnull align 8 dereferenceable(784), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: nounwind
declare void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2

declare noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher27_computeAnisotropicParticleE18GridPointReference(ptr dead_on_unwind noalias writable sret(%"struct.AnisotropicParticleMesher::AnisotropicParticle") align 4, ptr noundef nonnull align 8 dereferenceable(784), i32) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher19AnisotropicParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN25AnisotropicParticleMesher40_computeRangeOfSliceAnisotropicParticlesEiiiiRSt6vectorINS_19AnisotropicParticleESaIS1_EE(ptr noundef nonnull align 8 dereferenceable(784) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5) #3 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %class.AABB, align 8
  %14 = alloca %struct.GridPointReference, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.vmath::vec3", align 4
  %19 = alloca %"struct.AnisotropicParticleMesher::AnisotropicParticle", align 4
  %20 = alloca %struct.GridPointReference, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  %21 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #7
  %22 = load i32, ptr %10, align 4, !tbaa !9
  %23 = load i32, ptr %11, align 4, !tbaa !9
  call void @_ZN25AnisotropicParticleMesher13_getSliceAABBEii(ptr dead_on_unwind writable sret(%class.AABB) align 8 %13, ptr noundef nonnull align 8 dereferenceable(784) %21, i32 noundef %22, i32 noundef %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  invoke void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %24 unwind label %31

24:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %25 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %25, ptr %17, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %82, %24
  %27 = load i32, ptr %17, align 4, !tbaa !9
  %28 = load i32, ptr %9, align 4, !tbaa !9
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %35, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %86

31:                                               ; preds = %6
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %15, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %16, align 4
  br label %87

35:                                               ; preds = %26
  %36 = getelementptr inbounds %class.AnisotropicParticleMesher, ptr %21, i32 0, i32 20
  %37 = load i32, ptr %17, align 4, !tbaa !9
  %38 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN16FragmentedVectorI18GridPointReferenceEixEi(ptr noundef nonnull align 8 dereferenceable(48) %36, i32 noundef %37)
          to label %39 unwind label %49

39:                                               ; preds = %35
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %38, i64 4, i1 false), !tbaa.struct !11
  %40 = getelementptr inbounds %class.AnisotropicParticleMesher, ptr %21, i32 0, i32 19
  %41 = getelementptr inbounds %struct.GridPointReference, ptr %14, i32 0, i32 0
  %42 = load i32, ptr %41, align 4, !tbaa !12
  %43 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEEixEi(ptr noundef nonnull align 8 dereferenceable(48) %40, i32 noundef %42)
          to label %44 unwind label %49

44:                                               ; preds = %39
  %45 = getelementptr inbounds %"struct.AnisotropicParticleMesher::SurfaceParticle", ptr %43, i32 0, i32 2
  %46 = load i32, ptr %45, align 4, !tbaa !14
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %48, label %53

48:                                               ; preds = %44
  br label %82

49:                                               ; preds = %53, %39, %35
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %15, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %16, align 4
  br label %85

53:                                               ; preds = %44
  %54 = getelementptr inbounds %class.AnisotropicParticleMesher, ptr %21, i32 0, i32 19
  %55 = getelementptr inbounds %struct.GridPointReference, ptr %14, i32 0, i32 0
  %56 = load i32, ptr %55, align 4, !tbaa !12
  %57 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEEixEi(ptr noundef nonnull align 8 dereferenceable(48) %54, i32 noundef %56)
          to label %58 unwind label %49

58:                                               ; preds = %53
  %59 = getelementptr inbounds %"struct.AnisotropicParticleMesher::SurfaceParticle", ptr %57, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %59, i64 12, i1 false), !tbaa.struct !18
  %60 = invoke noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40) %13, ptr noundef %18)
          to label %61 unwind label %68

61:                                               ; preds = %58
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #7
  br i1 %60, label %62, label %81

62:                                               ; preds = %61
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %19) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %14, i64 4, i1 false), !tbaa.struct !11
  %64 = getelementptr inbounds %struct.GridPointReference, ptr %20, i32 0, i32 0
  %65 = load i32, ptr %64, align 4
  invoke void @_ZN25AnisotropicParticleMesher27_computeAnisotropicParticleE18GridPointReference(ptr dead_on_unwind writable sret(%"struct.AnisotropicParticleMesher::AnisotropicParticle") align 4 %19, ptr noundef nonnull align 8 dereferenceable(784) %21, i32 %65)
          to label %66 unwind label %72

66:                                               ; preds = %62
  invoke void @_ZNSt6vectorIN25AnisotropicParticleMesher19AnisotropicParticleESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 4 dereferenceable(48) %19)
          to label %67 unwind label %76

67:                                               ; preds = %66
  call void @_ZN25AnisotropicParticleMesher19AnisotropicParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(48) %19) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #7
  br label %81

68:                                               ; preds = %58
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %15, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %16, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #7
  br label %85

72:                                               ; preds = %62
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %15, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %16, align 4
  br label %80

76:                                               ; preds = %66
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %15, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %16, align 4
  call void @_ZN25AnisotropicParticleMesher19AnisotropicParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(48) %19) #7
  br label %80

80:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #7
  br label %85

81:                                               ; preds = %67, %61
  br label %82

82:                                               ; preds = %81, %48
  %83 = load i32, ptr %17, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %17, align 4, !tbaa !9
  br label %26, !llvm.loop !20

85:                                               ; preds = %80, %68, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %87

86:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #7
  ret void

87:                                               ; preds = %85, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #7
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %15, align 8
  %90 = load i32, ptr %16, align 4
  %91 = insertvalue { ptr, i32 } poison, ptr %89, 0
  %92 = insertvalue { ptr, i32 } %91, i32 %90, 1
  resume { ptr, i32 } %92
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 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 = { "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 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 #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, !9}
!12 = !{!13, !10, i64 0}
!13 = !{!"_ZTS18GridPointReference", !10, i64 0}
!14 = !{!15, !10, i64 16}
!15 = !{!"_ZTSN25AnisotropicParticleMesher15SurfaceParticleE", !16, i64 0, !13, i64 12, !10, i64 16}
!16 = !{!"_ZTSN5vmath4vec3E", !17, i64 0, !17, i64 4, !17, i64 8}
!17 = !{!"float", !7, i64 0}
!18 = !{i64 0, i64 4, !19, i64 4, i64 4, !19, i64 8, i64 4, !19}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.vmath::vec3" = type { float, float, float }
%"struct.AnisotropicParticleMesher::AnisotropicParticle" = type { %"class.vmath::vec3", %"class.vmath::mat3" }
%"class.vmath::mat3" = type { [9 x float] }
%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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher13_getSliceAABBEii(ptr dead_on_unwind noalias writable sret(%class.AABB) align 8, ptr noundef nonnull align 8 dereferenceable(784), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: nounwind
declare void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2

declare noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher27_computeAnisotropicParticleE18GridPointReference(ptr dead_on_unwind noalias writable sret(%"struct.AnisotropicParticleMesher::AnisotropicParticle") align 4, ptr noundef nonnull align 8 dereferenceable(784), i32) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher19AnisotropicParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN25AnisotropicParticleMesher40_computeRangeOfSliceAnisotropicParticlesEiiiiRSt6vectorINS_19AnisotropicParticleESaIS1_EE(ptr noundef nonnull align 8 dereferenceable(784) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %class.AABB, align 8
  %8 = alloca %struct.GridPointReference, align 4
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %"struct.AnisotropicParticleMesher::AnisotropicParticle", align 4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #7
  call void @_ZN25AnisotropicParticleMesher13_getSliceAABBEii(ptr dead_on_unwind nonnull writable sret(%class.AABB) align 8 %7, ptr noundef nonnull align 8 dereferenceable(784) %0, i32 noundef %3, i32 noundef %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @_ZN18GridPointReferenceC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %8)
  %.not15 = icmp sgt i32 %1, %2
  br i1 %.not15, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 336
  %12 = getelementptr inbounds i8, ptr %0, i64 288
  br label %13

._crit_edge:                                      ; preds = %40, %6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  ret void

13:                                               ; preds = %.lr.ph, %40
  %.01016 = phi i32 [ %1, %.lr.ph ], [ %41, %40 ]
  %14 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN16FragmentedVectorI18GridPointReferenceEixEi(ptr noundef nonnull align 8 dereferenceable(48) %11, i32 noundef %.01016)
          to label %15 unwind label %22

15:                                               ; preds = %13
  %16 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %16, ptr %8, align 4, !tbaa !5
  %17 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEEixEi(ptr noundef nonnull align 8 dereferenceable(48) %12, i32 noundef %16)
          to label %18 unwind label %22

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %17, i64 16
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = icmp eq i32 %20, -1
  br i1 %21, label %40, label %24

22:                                               ; preds = %24, %15, %13
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %42

24:                                               ; preds = %18
  %25 = load i32, ptr %8, align 4, !tbaa !14
  %26 = invoke noundef nonnull align 4 dereferenceable(20) ptr @_ZN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEEixEi(ptr noundef nonnull align 8 dereferenceable(48) %12, i32 noundef %25)
          to label %27 unwind label %22

27:                                               ; preds = %24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %26, i64 12, i1 false), !tbaa.struct !15
  %28 = invoke noundef zeroext i1 @_ZN4AABB13isPointInsideEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull %9)
          to label %29 unwind label %33

29:                                               ; preds = %27
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #7
  br i1 %28, label %30, label %40

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %10) #7
  %.sroa.0.0.copyload = load i32, ptr %8, align 4, !tbaa !5
  invoke void @_ZN25AnisotropicParticleMesher27_computeAnisotropicParticleE18GridPointReference(ptr dead_on_unwind nonnull writable sret(%"struct.AnisotropicParticleMesher::AnisotropicParticle") align 4 %10, ptr noundef nonnull align 8 dereferenceable(784) %0, i32 %.sroa.0.0.copyload)
          to label %31 unwind label %35

31:                                               ; preds = %30
  invoke void @_ZNSt6vectorIN25AnisotropicParticleMesher19AnisotropicParticleESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(48) %10)
          to label %32 unwind label %37

32:                                               ; preds = %31
  call void @_ZN25AnisotropicParticleMesher19AnisotropicParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(48) %10) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #7
  br label %40

33:                                               ; preds = %27
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #7
  br label %42

35:                                               ; preds = %30
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %39

37:                                               ; preds = %31
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN25AnisotropicParticleMesher19AnisotropicParticleD2Ev(ptr noundef nonnull align 4 dereferenceable(48) %10) #7
  br label %39

39:                                               ; preds = %37, %35
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #7
  br label %42

40:                                               ; preds = %29, %32, %18
  %41 = add i32 %.01016, 1
  %exitcond.not = icmp eq i32 %.01016, %2
  br i1 %exitcond.not, label %._crit_edge, label %13, !llvm.loop !17

42:                                               ; preds = %39, %33, %22
  %.pn.pn = phi { ptr, i32 } [ %.pn, %39 ], [ %34, %33 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn.pn
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 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 = { "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 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTSN25AnisotropicParticleMesher15SurfaceParticleE", !11, i64 0, !13, i64 12, !6, i64 16}
!11 = !{!"_ZTSN5vmath4vec3E", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"float", !7, i64 0}
!13 = !{!"_ZTS18GridPointReference", !6, i64 0}
!14 = !{!13, !6, i64 0}
!15 = !{i64 0, i64 4, !16, i64 4, i64 4, !16, i64 8, i64 4, !16}
!16 = !{!12, !12, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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