; 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.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.vmath::vec3" = type { float, float, float }
%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] }>
%class.FluidMaterialGrid = type { i32, i32, i32, %class.SubdividedArray3d }
%class.SubdividedArray3d = type { i32, i32, i32, i32, i32, i32, %class.Array3d.46, i32, double }
%class.Array3d.46 = type { i32, i32, i32, ptr, i8, i8, i32 }

; 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: mustprogress uwtable
define dso_local void @_ZN25AnisotropicParticleMesher21_getSliceMaterialGridEiiR17FluidMaterialGridS1_(ptr noundef nonnull align 8 dereferenceable(784) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(88) %3, ptr noundef nonnull align 8 dereferenceable(88) %4) #1 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = call noundef i32 @_ZN17FluidMaterialGrid19getSubdivisionLevelEv(ptr noundef nonnull align 8 dereferenceable(88) %18)
  store i32 %19, ptr %11, align 4, !tbaa !9
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.AnisotropicParticleMesher, ptr %17, i32 0, i32 25
  %22 = load i32, ptr %21, align 4, !tbaa !11
  call void @_ZN17FluidMaterialGrid19setSubdivisionLevelEi(ptr noundef nonnull align 8 dereferenceable(88) %20, i32 noundef %22)
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %67, %5
  %24 = load i32, ptr %13, align 4, !tbaa !9
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = getelementptr inbounds %class.FluidMaterialGrid, ptr %25, i32 0, i32 2
  %27 = load i32, ptr %26, align 8, !tbaa !47
  %28 = icmp slt i32 %24, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %23
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %70

30:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %63, %30
  %32 = load i32, ptr %15, align 4, !tbaa !9
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.FluidMaterialGrid, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !52
  %36 = icmp slt i32 %32, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %66

38:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %59, %38
  %40 = load i32, ptr %16, align 4, !tbaa !9
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = getelementptr inbounds %class.FluidMaterialGrid, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !53
  %44 = icmp slt i32 %40, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %39
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %62

46:                                               ; preds = %39
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = load i32, ptr %16, align 4, !tbaa !9
  %50 = add nsw i32 %48, %49
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %52 = load i32, ptr %13, align 4, !tbaa !9
  %53 = call noundef signext i8 @_ZN17FluidMaterialGridclEiii(ptr noundef nonnull align 8 dereferenceable(88) %47, i32 noundef %50, i32 noundef %51, i32 noundef %52)
  store i8 %53, ptr %12, align 1, !tbaa !54
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = load i32, ptr %16, align 4, !tbaa !9
  %56 = load i32, ptr %15, align 4, !tbaa !9
  %57 = load i32, ptr %13, align 4, !tbaa !9
  %58 = load i8, ptr %12, align 1, !tbaa !54
  call void @_ZN17FluidMaterialGrid3setEiii8Material(ptr noundef nonnull align 8 dereferenceable(88) %54, i32 noundef %55, i32 noundef %56, i32 noundef %57, i8 noundef signext %58)
  br label %59

59:                                               ; preds = %46
  %60 = load i32, ptr %16, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %16, align 4, !tbaa !9
  br label %39, !llvm.loop !55

62:                                               ; preds = %45
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %15, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %15, align 4, !tbaa !9
  br label %31, !llvm.loop !57

66:                                               ; preds = %37
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %13, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %13, align 4, !tbaa !9
  br label %23, !llvm.loop !58

70:                                               ; preds = %29
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = load i32, ptr %11, align 4, !tbaa !9
  call void @_ZN17FluidMaterialGrid19setSubdivisionLevelEi(ptr noundef nonnull align 8 dereferenceable(88) %71, i32 noundef %72)
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

declare noundef i32 @_ZN17FluidMaterialGrid19getSubdivisionLevelEv(ptr noundef nonnull align 8 dereferenceable(88)) #2

declare void @_ZN17FluidMaterialGrid19setSubdivisionLevelEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) #2

declare noundef signext i8 @_ZN17FluidMaterialGridclEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) #2

declare void @_ZN17FluidMaterialGrid3setEiii8Material(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef, i8 noundef signext) #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 = { 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 732}
!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 = !{!48, !10, i64 8}
!48 = !{!"_ZTS17FluidMaterialGrid", !10, i64 0, !10, i64 4, !10, i64 8, !49, i64 16}
!49 = !{!"_ZTS17SubdividedArray3dI8MaterialE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !50, i64 24, !10, i64 56, !13, i64 64}
!50 = !{!"_ZTS7Array3dI8MaterialE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !24, i64 24, !51, i64 25, !10, i64 28}
!51 = !{!"_ZTS8Material", !7, i64 0}
!52 = !{!48, !10, i64 4}
!53 = !{!48, !10, i64 0}
!54 = !{!51, !51, i64 0}
!55 = distinct !{!55, !56}
!56 = !{!"llvm.loop.mustprogress"}
!57 = distinct !{!57, !56}
!58 = distinct !{!58, !56}


; 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"

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN25AnisotropicParticleMesher21_getSliceMaterialGridEiiR17FluidMaterialGridS1_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(784) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(88) %3, ptr noundef nonnull align 8 dereferenceable(88) %4) local_unnamed_addr #0 align 2 {
  %6 = tail call noundef i32 @_ZN17FluidMaterialGrid19getSubdivisionLevelEv(ptr noundef nonnull align 8 dereferenceable(88) %3)
  %7 = getelementptr inbounds i8, ptr %0, i64 732
  %8 = load i32, ptr %7, align 4, !tbaa !5
  tail call void @_ZN17FluidMaterialGrid19setSubdivisionLevelEi(ptr noundef nonnull align 8 dereferenceable(88) %3, i32 noundef %8)
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !45
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.preheader25.lr.ph, label %._crit_edge31

.preheader25.lr.ph:                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %4, i64 4
  %13 = load i32, ptr %12, align 4, !tbaa !50
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.preheader25, label %._crit_edge31

.preheader25:                                     ; preds = %.preheader25.lr.ph, %._crit_edge28
  %15 = phi i32 [ %24, %._crit_edge28 ], [ %10, %.preheader25.lr.ph ]
  %16 = phi i32 [ %25, %._crit_edge28 ], [ %13, %.preheader25.lr.ph ]
  %17 = phi i32 [ %26, %._crit_edge28 ], [ %13, %.preheader25.lr.ph ]
  %.02429 = phi i32 [ %27, %._crit_edge28 ], [ 0, %.preheader25.lr.ph ]
  %18 = icmp sgt i32 %17, 0
  %19 = load i32, ptr %4, align 8
  %20 = icmp sgt i32 %19, 0
  %or.cond = select i1 %18, i1 %20, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge28

._crit_edge31:                                    ; preds = %._crit_edge28, %.preheader25.lr.ph, %5
  tail call void @_ZN17FluidMaterialGrid19setSubdivisionLevelEi(ptr noundef nonnull align 8 dereferenceable(88) %3, i32 noundef %6)
  ret void

.preheader:                                       ; preds = %.preheader25, %._crit_edge
  %21 = phi i32 [ %29, %._crit_edge ], [ %16, %.preheader25 ]
  %22 = phi i32 [ %30, %._crit_edge ], [ %19, %.preheader25 ]
  %.02327 = phi i32 [ %31, %._crit_edge ], [ 0, %.preheader25 ]
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %._crit_edge

._crit_edge28.loopexit:                           ; preds = %._crit_edge
  %.pre34 = load i32, ptr %9, align 8, !tbaa !45
  br label %._crit_edge28

._crit_edge28:                                    ; preds = %._crit_edge28.loopexit, %.preheader25
  %24 = phi i32 [ %.pre34, %._crit_edge28.loopexit ], [ %15, %.preheader25 ]
  %25 = phi i32 [ %29, %._crit_edge28.loopexit ], [ %16, %.preheader25 ]
  %26 = phi i32 [ %29, %._crit_edge28.loopexit ], [ %17, %.preheader25 ]
  %27 = add nuw nsw i32 %.02429, 1
  %28 = icmp slt i32 %27, %24
  br i1 %28, label %.preheader25, label %._crit_edge31, !llvm.loop !51

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %12, align 4, !tbaa !50
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %29 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %21, %.preheader ]
  %30 = phi i32 [ %36, %._crit_edge.loopexit ], [ %22, %.preheader ]
  %31 = add nuw nsw i32 %.02327, 1
  %32 = icmp slt i32 %31, %29
  br i1 %32, label %.preheader, label %._crit_edge28.loopexit, !llvm.loop !54

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.026 = phi i32 [ %35, %.lr.ph ], [ 0, %.preheader ]
  %33 = add nsw i32 %.026, %1
  %34 = tail call noundef signext i8 @_ZN17FluidMaterialGridclEiii(ptr noundef nonnull align 8 dereferenceable(88) %3, i32 noundef %33, i32 noundef %.02327, i32 noundef %.02429)
  tail call void @_ZN17FluidMaterialGrid3setEiii8Material(ptr noundef nonnull align 8 dereferenceable(88) %4, i32 noundef %.026, i32 noundef %.02327, i32 noundef %.02429, i8 noundef signext %34)
  %35 = add nuw nsw i32 %.026, 1
  %36 = load i32, ptr %4, align 8, !tbaa !55
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !56
}

declare noundef i32 @_ZN17FluidMaterialGrid19getSubdivisionLevelEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #1

declare void @_ZN17FluidMaterialGrid19setSubdivisionLevelEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) local_unnamed_addr #1

declare noundef signext i8 @_ZN17FluidMaterialGridclEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN17FluidMaterialGrid3setEiii8Material(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef, i8 noundef signext) local_unnamed_addr #1

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass