; 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.TriangleMesh = type { %"class.std::vector.24", %"class.std::vector.24", %"class.std::vector.24", %"class.std::vector.29", i32, i32, i32, double, %"class.std::vector.34", %"class.std::vector.39", %class.Array3d.44 }
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.29" = type { %"struct.std::_Vector_base.30" }
%"struct.std::_Vector_base.30" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.39" = type { %"struct.std::_Vector_base.40" }
%"struct.std::_Vector_base.40" = 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.Array3d.44 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.0", i32, [4 x i8] }>
%"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.vmath::vec3" = type { float, float, float }
%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.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
declare dso_local void @_ZN25AnisotropicParticleMesher14_polygonizeAllER16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind noalias writable sret(%class.TriangleMesh) align 8, ptr noundef nonnull align 8 dereferenceable(784), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(448), ptr noundef nonnull align 8 dereferenceable(88)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN25AnisotropicParticleMesher17_polygonizeSlicesER16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind noalias writable sret(%class.TriangleMesh) align 8 %0, ptr noundef nonnull align 8 dereferenceable(784) %1, ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(448) %3, ptr noundef nonnull align 8 dereferenceable(88) %4) #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i1, align 1
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %class.TriangleMesh, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca %"class.vmath::vec3", align 4
  %26 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @_ZN25AnisotropicParticleMesher28_getSubdividedGridDimensionsEPiS0_S0_Pd(ptr noundef nonnull align 8 dereferenceable(784) %27, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %28 = load i32, ptr %11, align 4, !tbaa !9
  %29 = sitofp i32 %28 to double
  %30 = getelementptr inbounds %class.AnisotropicParticleMesher, ptr %27, i32 0, i32 26
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = sitofp i32 %31 to double
  %33 = fdiv double %29, %32
  %34 = call double @llvm.ceil.f64(double %33)
  %35 = fptosi double %34 to i32
  store i32 %35, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = sitofp i32 %36 to double
  %38 = load i32, ptr %15, align 4, !tbaa !9
  %39 = sitofp i32 %38 to double
  %40 = fdiv double %37, %39
  %41 = call double @llvm.ceil.f64(double %40)
  %42 = fptosi double %41 to i32
  store i32 %42, ptr %16, align 4, !tbaa !9
  %43 = load i32, ptr %16, align 4, !tbaa !9
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %49

45:                                               ; preds = %5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN25AnisotropicParticleMesher14_polygonizeAllER16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind writable sret(%class.TriangleMesh) align 8 %0, ptr noundef nonnull align 8 dereferenceable(784) %27, ptr noundef nonnull align 8 dereferenceable(48) %46, ptr noundef nonnull align 8 dereferenceable(448) %47, ptr noundef nonnull align 8 dereferenceable(88) %48)
  store i32 1, ptr %17, align 4
  br label %110

49:                                               ; preds = %5
  store i1 false, ptr %18, align 1
  call void @_ZN12TriangleMeshC1Ev(ptr noundef nonnull align 8 dereferenceable(232) %0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %84, %49
  %51 = load i32, ptr %19, align 4, !tbaa !9
  %52 = load i32, ptr %16, align 4, !tbaa !9
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %106

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %56 = load i32, ptr %19, align 4, !tbaa !9
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = mul nsw i32 %56, %57
  store i32 %58, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %59 = load i32, ptr %20, align 4, !tbaa !9
  %60 = load i32, ptr %15, align 4, !tbaa !9
  %61 = add nsw i32 %59, %60
  %62 = sub nsw i32 %61, 1
  store i32 %62, ptr %21, align 4, !tbaa !9
  %63 = load i32, ptr %21, align 4, !tbaa !9
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %66, label %68

66:                                               ; preds = %55
  %67 = load i32, ptr %21, align 4, !tbaa !9
  br label %71

68:                                               ; preds = %55
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = sub nsw i32 %69, 1
  br label %71

71:                                               ; preds = %68, %66
  %72 = phi i32 [ %67, %66 ], [ %70, %68 ]
  store i32 %72, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 232, ptr %22) #7
  %73 = load i32, ptr %20, align 4, !tbaa !9
  %74 = load i32, ptr %21, align 4, !tbaa !9
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN25AnisotropicParticleMesher16_polygonizeSliceEiiR16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind writable sret(%class.TriangleMesh) align 8 %22, ptr noundef nonnull align 8 dereferenceable(784) %27, i32 noundef %73, i32 noundef %74, ptr noundef nonnull align 8 dereferenceable(48) %75, ptr noundef nonnull align 8 dereferenceable(448) %76, ptr noundef nonnull align 8 dereferenceable(88) %77)
          to label %78 unwind label %87

78:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #7
  %79 = load i32, ptr %20, align 4, !tbaa !9
  %80 = load i32, ptr %21, align 4, !tbaa !9
  invoke void @_ZN25AnisotropicParticleMesher27_getSliceGridPositionOffsetEii(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %25, ptr noundef nonnull align 8 dereferenceable(784) %27, i32 noundef %79, i32 noundef %80)
          to label %81 unwind label %91

81:                                               ; preds = %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %25, i64 12, i1 false), !tbaa.struct !47
  invoke void @_ZN12TriangleMesh9translateEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232) %22, ptr noundef %26)
          to label %82 unwind label %95

82:                                               ; preds = %81
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %26) #7
  invoke void @_ZN12TriangleMesh4joinERS_(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(232) %22)
          to label %83 unwind label %99

83:                                               ; preds = %82
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %25) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #7
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %22) #7
  call void @llvm.lifetime.end.p0(i64 232, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %19, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %19, align 4, !tbaa !9
  br label %50, !llvm.loop !49

87:                                               ; preds = %71
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %23, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %24, align 4
  br label %105

91:                                               ; preds = %78
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %23, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %24, align 4
  br label %104

95:                                               ; preds = %81
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %23, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %24, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %26) #7
  br label %103

99:                                               ; preds = %82
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %23, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %24, align 4
  br label %103

103:                                              ; preds = %99, %95
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %25) #7
  br label %104

104:                                              ; preds = %103, %91
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #7
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %22) #7
  br label %105

105:                                              ; preds = %104, %87
  call void @llvm.lifetime.end.p0(i64 232, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %0) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %111

106:                                              ; preds = %54
  store i1 true, ptr %18, align 1
  store i32 1, ptr %17, align 4
  %107 = load i1, ptr %18, align 1
  br i1 %107, label %109, label %108

108:                                              ; preds = %106
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %0) #7
  br label %109

109:                                              ; preds = %108, %106
  br label %110

110:                                              ; preds = %109, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  ret void

111:                                              ; preds = %105
  %112 = load ptr, ptr %23, align 8
  %113 = load i32, ptr %24, align 4
  %114 = insertvalue { ptr, i32 } poison, ptr %112, 0
  %115 = insertvalue { ptr, i32 } %114, i32 %113, 1
  resume { ptr, i32 } %115
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #5

declare void @_ZN12TriangleMeshC1Ev(ptr noundef nonnull align 8 dereferenceable(232)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher16_polygonizeSliceEiiR16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind noalias writable sret(%class.TriangleMesh) align 8, ptr noundef nonnull align 8 dereferenceable(784), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(448), ptr noundef nonnull align 8 dereferenceable(88)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher27_getSliceGridPositionOffsetEii(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(784), i32 noundef, i32 noundef) #1 align 2

declare void @_ZN12TriangleMesh9translateEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) #6

declare void @_ZN12TriangleMesh4joinERS_(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(232)) #6

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

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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { "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 = !{!12, !10, i64 736}
!12 = !{!"_ZTS25AnisotropicParticleMesher", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !10, i64 64, !13, i64 72, !10, i64 80, !13, i64 88, !10, i64 96, !10, i64 100, !10, i64 104, !13, i64 112, !10, i64 120, !13, i64 128, !14, i64 136, !29, i64 288, !34, i64 336, !34, i64 384, !39, i64 432, !44, i64 480, !10, i64 728, !10, i64 732, !10, i64 736, !45, i64 744}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS16SpatialPointGrid", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !15, i64 24, !19, i64 48, !23, i64 72, !26, i64 112}
!15 = !{!"_ZTSSt6vectorI9GridPointSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseI9GridPointSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTS7Array3dIN16SpatialPointGrid8CellNodeEE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !24, i64 24, !25, i64 28, !10, i64 36}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSN16SpatialPointGrid8CellNodeE", !10, i64 0, !10, i64 4}
!26 = !{!"_ZTS4AABB", !27, i64 0, !13, i64 16, !13, i64 24, !13, i64 32}
!27 = !{!"_ZTSN5vmath4vec3E", !28, i64 0, !28, i64 4, !28, i64 8}
!28 = !{!"float", !7, i64 0}
!29 = !{!"_ZTS16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE", !30, i64 0, !10, i64 24, !10, i64 28, !13, i64 32, !10, i64 40, !10, i64 44}
!30 = !{!"_ZTSSt6vectorIN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE10VectorNodeESaIS4_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE10VectorNodeESaIS4_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE10VectorNodeESaIS4_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE10VectorNodeESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"_ZTS16FragmentedVectorI18GridPointReferenceE", !35, i64 0, !10, i64 24, !10, i64 28, !13, i64 32, !10, i64 40, !10, i64 44}
!35 = !{!"_ZTSSt6vectorIN16FragmentedVectorI18GridPointReferenceE10VectorNodeESaIS3_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIN16FragmentedVectorI18GridPointReferenceE10VectorNodeESaIS3_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorI18GridPointReferenceE10VectorNodeESaIS3_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorI18GridPointReferenceE10VectorNodeESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{!"_ZTS16FragmentedVectorIN5vmath4vec3EE", !40, i64 0, !10, i64 24, !10, i64 28, !13, i64 32, !10, i64 40, !10, i64 44}
!40 = !{!"_ZTSSt6vectorIN16FragmentedVectorIN5vmath4vec3EE10VectorNodeESaIS4_EE", !41, i64 0}
!41 = !{!"_ZTSSt12_Vector_baseIN16FragmentedVectorIN5vmath4vec3EE10VectorNodeESaIS4_EE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorIN5vmath4vec3EE10VectorNodeESaIS4_EE12_Vector_implE", !43, i64 0}
!43 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorIN5vmath4vec3EE10VectorNodeESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!44 = !{!"_ZTS11ScalarField", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !24, i64 80, !45, i64 88, !46, i64 128, !45, i64 160, !46, i64 200, !24, i64 232, !27, i64 236}
!45 = !{!"_ZTS7Array3dIfE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !24, i64 24, !28, i64 28, !10, i64 32}
!46 = !{!"_ZTS7Array3dIbE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !24, i64 24, !24, i64 25, !10, i64 28}
!47 = !{i64 0, i64 4, !48, i64 4, i64 4, !48, i64 8, i64 4, !48}
!48 = !{!28, !28, i64 0}
!49 = distinct !{!49, !50}
!50 = !{!"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.TriangleMesh = type { %"class.std::vector.24", %"class.std::vector.24", %"class.std::vector.24", %"class.std::vector.29", i32, i32, i32, double, %"class.std::vector.34", %"class.std::vector.39", %class.Array3d.44 }
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.29" = type { %"struct.std::_Vector_base.30" }
%"struct.std::_Vector_base.30" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.39" = type { %"struct.std::_Vector_base.40" }
%"struct.std::_Vector_base.40" = 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.Array3d.44 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.0", i32, [4 x i8] }>
%"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.vmath::vec3" = type { float, float, float }

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
declare dso_local void @_ZN25AnisotropicParticleMesher14_polygonizeAllER16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind noalias writable sret(%class.TriangleMesh) align 8, ptr noundef nonnull align 8 dereferenceable(784), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(448), ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN25AnisotropicParticleMesher17_polygonizeSlicesER16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind noalias writable sret(%class.TriangleMesh) align 8 %0, ptr noundef nonnull align 8 dereferenceable(784) %1, ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(448) %3, ptr noundef nonnull align 8 dereferenceable(88) %4) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca %class.TriangleMesh, align 8
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca %"class.vmath::vec3", align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  call void @_ZN25AnisotropicParticleMesher28_getSubdividedGridDimensionsEPiS0_S0_Pd(ptr noundef nonnull align 8 dereferenceable(784) %1, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %13 = load i32, ptr %6, align 4, !tbaa !5
  %14 = sitofp i32 %13 to double
  %15 = getelementptr inbounds i8, ptr %1, i64 736
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = sitofp i32 %16 to double
  %18 = fdiv double %14, %17
  %19 = call double @llvm.ceil.f64(double %18)
  %20 = fptosi double %19 to i32
  %21 = sitofp i32 %20 to double
  %22 = fdiv double %14, %21
  %23 = call double @llvm.ceil.f64(double %22)
  %24 = fptosi double %23 to i32
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %27

26:                                               ; preds = %5
  call void @_ZN25AnisotropicParticleMesher14_polygonizeAllER16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind writable sret(%class.TriangleMesh) align 8 %0, ptr noundef nonnull align 8 dereferenceable(784) %1, ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(448) %3, ptr noundef nonnull align 8 dereferenceable(88) %4)
  br label %.loopexit

27:                                               ; preds = %5
  call void @_ZN12TriangleMeshC1Ev(ptr noundef nonnull align 8 dereferenceable(232) %0)
  %28 = icmp sgt i32 %24, 0
  br i1 %28, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %27, %36
  %.02732 = phi i32 [ %37, %36 ], [ 0, %27 ]
  %29 = mul nsw i32 %.02732, %20
  %30 = add nsw i32 %29, %20
  %31 = load i32, ptr %6, align 4
  %.v = call i32 @llvm.smin.i32(i32 %30, i32 %31)
  %32 = add nsw i32 %.v, -1
  call void @llvm.lifetime.start.p0(i64 232, ptr nonnull %10) #8
  invoke void @_ZN25AnisotropicParticleMesher16_polygonizeSliceEiiR16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind nonnull writable sret(%class.TriangleMesh) align 8 %10, ptr noundef nonnull align 8 dereferenceable(784) %1, i32 noundef %29, i32 noundef %32, ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(448) %3, ptr noundef nonnull align 8 dereferenceable(88) %4)
          to label %33 unwind label %38

33:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #8
  invoke void @_ZN25AnisotropicParticleMesher27_getSliceGridPositionOffsetEii(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %11, ptr noundef nonnull align 8 dereferenceable(784) %1, i32 noundef %29, i32 noundef %32)
          to label %34 unwind label %40

34:                                               ; preds = %33
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %11, i64 12, i1 false), !tbaa.struct !46
  invoke void @_ZN12TriangleMesh9translateEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232) %10, ptr noundef nonnull %12)
          to label %35 unwind label %42

35:                                               ; preds = %34
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #8
  invoke void @_ZN12TriangleMesh4joinERS_(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef nonnull align 8 dereferenceable(232) %10)
          to label %36 unwind label %44

36:                                               ; preds = %35
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %10) #8
  call void @llvm.lifetime.end.p0(i64 232, ptr nonnull %10) #8
  %37 = add nuw nsw i32 %.02732, 1
  %exitcond.not = icmp eq i32 %37, %24
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !48

38:                                               ; preds = %.lr.ph
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %48

40:                                               ; preds = %33
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %47

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

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

46:                                               ; preds = %44, %42
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %43, %42 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #8
  br label %47

47:                                               ; preds = %46, %40
  %.pn.pn = phi { ptr, i32 } [ %.pn, %46 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %10) #8
  br label %48

48:                                               ; preds = %47, %38
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %47 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 232, ptr nonnull %10) #8
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %0) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  resume { ptr, i32 } %.pn.pn.pn

.loopexit:                                        ; preds = %36, %27, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  ret void
}

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #5

declare void @_ZN12TriangleMeshC1Ev(ptr noundef nonnull align 8 dereferenceable(232)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher16_polygonizeSliceEiiR16FragmentedVectorIN5vmath4vec3EER8LevelSetR17FluidMaterialGrid(ptr dead_on_unwind noalias writable sret(%class.TriangleMesh) align 8, ptr noundef nonnull align 8 dereferenceable(784), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(448), ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN25AnisotropicParticleMesher27_getSliceGridPositionOffsetEii(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(784), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

declare void @_ZN12TriangleMesh9translateEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) local_unnamed_addr #6

declare void @_ZN12TriangleMesh4joinERS_(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #6

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { "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 nosync nounwind speculatable willreturn memory(none) }
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 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 736}
!10 = !{!"_ZTS25AnisotropicParticleMesher", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !6, i64 64, !11, i64 72, !6, i64 80, !11, i64 88, !6, i64 96, !6, i64 100, !6, i64 104, !11, i64 112, !6, i64 120, !11, i64 128, !12, i64 136, !28, i64 288, !33, i64 336, !33, i64 384, !38, i64 432, !43, i64 480, !6, i64 728, !6, i64 732, !6, i64 736, !44, i64 744}
!11 = !{!"double", !7, i64 0}
!12 = !{!"_ZTS16SpatialPointGrid", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16, !13, i64 24, !18, i64 48, !22, i64 72, !25, i64 112}
!13 = !{!"_ZTSSt6vectorI9GridPointSaIS0_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseI9GridPointSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI9GridPointSaIS0_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"_ZTSSt6vectorIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!22 = !{!"_ZTS7Array3dIN16SpatialPointGrid8CellNodeEE", !6, i64 0, !6, i64 4, !6, i64 8, !17, i64 16, !23, i64 24, !24, i64 28, !6, i64 36}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSN16SpatialPointGrid8CellNodeE", !6, i64 0, !6, i64 4}
!25 = !{!"_ZTS4AABB", !26, i64 0, !11, i64 16, !11, i64 24, !11, i64 32}
!26 = !{!"_ZTSN5vmath4vec3E", !27, i64 0, !27, i64 4, !27, i64 8}
!27 = !{!"float", !7, i64 0}
!28 = !{!"_ZTS16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE", !29, i64 0, !6, i64 24, !6, i64 28, !11, i64 32, !6, i64 40, !6, i64 44}
!29 = !{!"_ZTSSt6vectorIN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE10VectorNodeESaIS4_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE10VectorNodeESaIS4_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE10VectorNodeESaIS4_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorIN25AnisotropicParticleMesher15SurfaceParticleEE10VectorNodeESaIS4_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!33 = !{!"_ZTS16FragmentedVectorI18GridPointReferenceE", !34, i64 0, !6, i64 24, !6, i64 28, !11, i64 32, !6, i64 40, !6, i64 44}
!34 = !{!"_ZTSSt6vectorIN16FragmentedVectorI18GridPointReferenceE10VectorNodeESaIS3_EE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseIN16FragmentedVectorI18GridPointReferenceE10VectorNodeESaIS3_EE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorI18GridPointReferenceE10VectorNodeESaIS3_EE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorI18GridPointReferenceE10VectorNodeESaIS3_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!38 = !{!"_ZTS16FragmentedVectorIN5vmath4vec3EE", !39, i64 0, !6, i64 24, !6, i64 28, !11, i64 32, !6, i64 40, !6, i64 44}
!39 = !{!"_ZTSSt6vectorIN16FragmentedVectorIN5vmath4vec3EE10VectorNodeESaIS4_EE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseIN16FragmentedVectorIN5vmath4vec3EE10VectorNodeESaIS4_EE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorIN5vmath4vec3EE10VectorNodeESaIS4_EE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIN16FragmentedVectorIN5vmath4vec3EE10VectorNodeESaIS4_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!43 = !{!"_ZTS11ScalarField", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !23, i64 80, !44, i64 88, !45, i64 128, !44, i64 160, !45, i64 200, !23, i64 232, !26, i64 236}
!44 = !{!"_ZTS7Array3dIfE", !6, i64 0, !6, i64 4, !6, i64 8, !17, i64 16, !23, i64 24, !27, i64 28, !6, i64 32}
!45 = !{!"_ZTS7Array3dIbE", !6, i64 0, !6, i64 4, !6, i64 8, !17, i64 16, !23, i64 24, !23, i64 25, !6, i64 28}
!46 = !{i64 0, i64 4, !47, i64 4, i64 4, !47, i64 8, i64 4, !47}
!47 = !{!27, !27, i64 0}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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