; LLVM IR from yuanming-hu/taichi_mpm :: external/partio/src/core/ParticleSimple.ll (ZN6Partio15ParticlesSimpleD2Ev)

; 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.Partio::ParticlesSimple" = type { %"class.Partio::ParticlesDataMutable", %"struct.Partio::Provider", i32, i32, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5", %"class.std::vector.10", %"class.std::vector.15", %"class.std::map", %"class.Partio::PartioMutex", ptr }
%"class.Partio::ParticlesDataMutable" = type { %"class.Partio::ParticlesData" }
%"class.Partio::ParticlesData" = type { %"class.Partio::ParticlesInfo" }
%"class.Partio::ParticlesInfo" = type { ptr }
%"struct.Partio::Provider" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<char *, std::allocator<char *>>::_Vector_impl" }
%"struct.std::_Vector_base<char *, std::allocator<char *>>::_Vector_impl" = type { %"struct.std::_Vector_base<char *, std::allocator<char *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char *, std::allocator<char *>>::_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<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<Partio::ParticlesSimple::IndexedStrTable, std::allocator<Partio::ParticlesSimple::IndexedStrTable>>::_Vector_impl" }
%"struct.std::_Vector_base<Partio::ParticlesSimple::IndexedStrTable, std::allocator<Partio::ParticlesSimple::IndexedStrTable>>::_Vector_impl" = type { %"struct.std::_Vector_base<Partio::ParticlesSimple::IndexedStrTable, std::allocator<Partio::ParticlesSimple::IndexedStrTable>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Partio::ParticlesSimple::IndexedStrTable, std::allocator<Partio::ParticlesSimple::IndexedStrTable>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<Partio::ParticleAttribute, std::allocator<Partio::ParticleAttribute>>::_Vector_impl" }
%"struct.std::_Vector_base<Partio::ParticleAttribute, std::allocator<Partio::ParticleAttribute>>::_Vector_impl" = type { %"struct.std::_Vector_base<Partio::ParticleAttribute, std::allocator<Partio::ParticleAttribute>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Partio::ParticleAttribute, std::allocator<Partio::ParticleAttribute>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = 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.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.Partio::PartioMutex" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@_ZTVN6Partio15ParticlesSimpleE = external dso_local unnamed_addr constant { [28 x ptr], [8 x ptr] }, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN6Partio17ParticleAttributeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPcSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6Partio15ParticlesSimpleD2Ev(ptr noundef nonnull align 8 dereferenceable(240) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  store ptr getelementptr inbounds inrange(-16, 208) ({ [28 x ptr], [8 x ptr] }, ptr @_ZTVN6Partio15ParticlesSimpleE, i32 0, i32 0, i32 2), ptr %4, align 8, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr getelementptr inbounds inrange(-16, 48) ({ [28 x ptr], [8 x ptr] }, ptr @_ZTVN6Partio15ParticlesSimpleE, i32 0, i32 1, i32 2), ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %6

6:                                                ; preds = %19, %1
  %7 = load i32, ptr %3, align 4, !tbaa !11
  %8 = zext i32 %7 to i64
  %9 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 4
  %10 = call noundef i64 @_ZNKSt6vectorIPcSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %11 = icmp ult i64 %8, %10
  br i1 %11, label %13, label %12

12:                                               ; preds = %6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %22

13:                                               ; preds = %6
  %14 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 4
  %15 = load i32, ptr %3, align 4, !tbaa !11
  %16 = zext i32 %15 to i64
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %16) #5
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %18) #5
  br label %19

19:                                               ; preds = %13
  %20 = load i32, ptr %3, align 4, !tbaa !11
  %21 = add i32 %20, 1
  store i32 %21, ptr %3, align 4, !tbaa !11
  br label %6, !llvm.loop !13

22:                                               ; preds = %12
  %23 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 11
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = icmp eq ptr %24, null
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @_ZN6Partio6KdTreeILi3EED2Ev(ptr noundef nonnull align 8 dereferenceable(73) %24) #5
  call void @_ZdlPvm(ptr noundef %24, i64 noundef 80) #6
  br label %27

27:                                               ; preds = %26, %22
  %28 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 10
  call void @_ZN6Partio11PartioMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %28) #5
  %29 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 9
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %29) #5
  %30 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %31 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 7
  call void @_ZNSt6vectorIN6Partio17ParticleAttributeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  %32 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 6
  call void @_ZNSt6vectorIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #5
  %33 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 5
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #5
  %34 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %4, i32 0, i32 4
  call void @_ZNSt6vectorIPcSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %34) #5
  %35 = getelementptr inbounds i8, ptr %4, i64 8
  call void @_ZN6Partio8ProviderD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %35) #5
  call void @_ZN6Partio13ParticlesInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  ret void
}

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Partio6KdTreeILi3EED2Ev(ptr noundef nonnull align 8 dereferenceable(73)) unnamed_addr #0 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync 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 = { nobuiltin 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 = { 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 #5 = { nounwind }
attributes #6 = { builtin 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 232}
!16 = !{!"_ZTSN6Partio15ParticlesSimpleE", !17, i64 0, !20, i64 8, !12, i64 16, !12, i64 20, !21, i64 24, !25, i64 48, !29, i64 72, !33, i64 96, !37, i64 120, !41, i64 144, !50, i64 192, !6, i64 232}
!17 = !{!"_ZTSN6Partio20ParticlesDataMutableE", !18, i64 0}
!18 = !{!"_ZTSN6Partio13ParticlesDataE", !19, i64 0}
!19 = !{!"_ZTSN6Partio13ParticlesInfoE"}
!20 = !{!"_ZTSN6Partio8ProviderE"}
!21 = !{!"_ZTSSt6vectorIPcSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIPcSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIPcSaIS0_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIPcSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt6vectorImSaImEE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseImSaImEE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSSt6vectorIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTSSt6vectorIN6Partio17ParticleAttributeESaIS1_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIN6Partio17ParticleAttributeESaIS1_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIN6Partio17ParticleAttributeESaIS1_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIN6Partio17ParticleAttributeESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!"_ZTSSt6vectorIiSaIiEE", !38, i64 0}
!38 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!41 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEE", !42, i64 0}
!42 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE", !43, i64 0}
!43 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !44, i64 0, !46, i64 8}
!44 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !45, i64 0}
!45 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!46 = !{!"_ZTSSt15_Rb_tree_header", !47, i64 0, !49, i64 32}
!47 = !{!"_ZTSSt18_Rb_tree_node_base", !48, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!48 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!49 = !{!"long", !7, i64 0}
!50 = !{!"_ZTSN6Partio11PartioMutexE", !7, i64 0}


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

@_ZTVN6Partio15ParticlesSimpleE = external dso_local unnamed_addr constant { [28 x ptr], [8 x ptr] }, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN6Partio17ParticleAttributeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPcSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6Partio15ParticlesSimpleD2Ev(ptr noundef nonnull align 8 dereferenceable(240) %0) unnamed_addr #0 align 2 {
  store ptr getelementptr inbounds inrange(-16, 208) (i8, ptr @_ZTVN6Partio15ParticlesSimpleE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr getelementptr inbounds inrange(-16, 48) (i8, ptr @_ZTVN6Partio15ParticlesSimpleE, i64 240), ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = tail call noundef i64 @_ZNKSt6vectorIPcSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %.not = icmp eq i64 %4, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %1
  %5 = getelementptr inbounds i8, ptr %0, i64 232
  %6 = load ptr, ptr %5, align 8, !tbaa !8
  %7 = icmp eq ptr %6, null
  br i1 %7, label %16, label %15

.lr.ph:                                           ; preds = %1, %.lr.ph
  %8 = phi i64 [ %12, %.lr.ph ], [ 0, %1 ]
  %.05 = phi i32 [ %11, %.lr.ph ], [ 0, %1 ]
  %9 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %8) #4
  %10 = load ptr, ptr %9, align 8, !tbaa !47
  tail call void @free(ptr noundef %10) #4
  %11 = add i32 %.05, 1
  %12 = zext i32 %11 to i64
  %13 = tail call noundef i64 @_ZNKSt6vectorIPcSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  %14 = icmp ugt i64 %13, %12
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !48

15:                                               ; preds = %._crit_edge
  tail call void @_ZN6Partio6KdTreeILi3EED2Ev(ptr noundef nonnull align 8 dereferenceable(73) %6) #4
  tail call void @_ZdlPvm(ptr noundef nonnull %6, i64 noundef 80) #5
  br label %16

16:                                               ; preds = %15, %._crit_edge
  %17 = getelementptr inbounds i8, ptr %0, i64 192
  tail call void @_ZN6Partio11PartioMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %17) #4
  %18 = getelementptr inbounds i8, ptr %0, i64 144
  tail call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #4
  %19 = getelementptr inbounds i8, ptr %0, i64 120
  tail call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  %20 = getelementptr inbounds i8, ptr %0, i64 96
  tail call void @_ZNSt6vectorIN6Partio17ParticleAttributeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  %21 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @_ZNSt6vectorIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  %22 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #4
  tail call void @_ZNSt6vectorIPcSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  tail call void @_ZN6Partio8ProviderD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  tail call void @_ZN6Partio13ParticlesInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  ret void
}

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Partio6KdTreeILi3EED2Ev(ptr noundef nonnull align 8 dereferenceable(73)) unnamed_addr #0 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6Partio11PartioMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nobuiltin 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 = { 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 #4 = { nounwind }
attributes #5 = { builtin 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !20, i64 232}
!9 = !{!"_ZTSN6Partio15ParticlesSimpleE", !10, i64 0, !13, i64 8, !14, i64 16, !14, i64 20, !16, i64 24, !21, i64 48, !25, i64 72, !29, i64 96, !33, i64 120, !37, i64 144, !46, i64 192, !20, i64 232}
!10 = !{!"_ZTSN6Partio20ParticlesDataMutableE", !11, i64 0}
!11 = !{!"_ZTSN6Partio13ParticlesDataE", !12, i64 0}
!12 = !{!"_ZTSN6Partio13ParticlesInfoE"}
!13 = !{!"_ZTSN6Partio8ProviderE"}
!14 = !{!"int", !15, i64 0}
!15 = !{!"omnipotent char", !7, i64 0}
!16 = !{!"_ZTSSt6vectorIPcSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIPcSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPcSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPcSaIS0_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!20 = !{!"any pointer", !15, i64 0}
!21 = !{!"_ZTSSt6vectorImSaImEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseImSaImEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!25 = !{!"_ZTSSt6vectorIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN6Partio15ParticlesSimple15IndexedStrTableESaIS2_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!29 = !{!"_ZTSSt6vectorIN6Partio17ParticleAttributeESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN6Partio17ParticleAttributeESaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN6Partio17ParticleAttributeESaIS1_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN6Partio17ParticleAttributeESaIS1_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!33 = !{!"_ZTSSt6vectorIiSaIiEE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!37 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEE", !38, i64 0}
!38 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE", !39, i64 0}
!39 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_iESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EE13_Rb_tree_implISC_Lb1EEE", !40, i64 0, !42, i64 8}
!40 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !41, i64 0}
!41 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!42 = !{!"_ZTSSt15_Rb_tree_header", !43, i64 0, !45, i64 32}
!43 = !{!"_ZTSSt18_Rb_tree_node_base", !44, i64 0, !20, i64 8, !20, i64 16, !20, i64 24}
!44 = !{!"_ZTSSt14_Rb_tree_color", !15, i64 0}
!45 = !{!"long", !15, i64 0}
!46 = !{!"_ZTSN6Partio11PartioMutexE", !15, i64 0}
!47 = !{!20, !20, i64 0}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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