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

; 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::ParticleIterator" = type { ptr, i64, i64, ptr }
%"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 }

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

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

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

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

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Partio15ParticlesSimple12addParticlesEi(ptr dead_on_unwind noalias writable sret(%"class.Partio::ParticleIterator") align 8 %0, ptr noundef nonnull align 8 dereferenceable(240) %1, i32 noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %8 = load ptr, ptr %5, align 8
  %9 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 2
  %10 = load i32, ptr %9, align 8, !tbaa !11
  %11 = load i32, ptr %6, align 4, !tbaa !9
  %12 = add nsw i32 %10, %11
  %13 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 3
  %14 = load i32, ptr %13, align 4, !tbaa !47
  %15 = icmp sgt i32 %12, %14
  br i1 %15, label %16, label %65

16:                                               ; preds = %3
  %17 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 3
  %18 = load i32, ptr %17, align 4, !tbaa !47
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = add nsw i32 %18, %19
  %21 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 3
  store i32 %20, ptr %21, align 4, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %61, %16
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 7
  %26 = call noundef i64 @_ZNKSt6vectorIN6Partio17ParticleAttributeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #4
  %27 = icmp ult i64 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %64

29:                                               ; preds = %22
  %30 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 4
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %32) #4
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 8
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %37) #4
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 3
  %42 = load i32, ptr %41, align 4, !tbaa !47
  %43 = sext i32 %42 to i64
  %44 = mul i64 %40, %43
  %45 = call ptr @realloc(ptr noundef %34, i64 noundef %44) #5
  %46 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 4
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = zext i32 %47 to i64
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %48) #4
  store ptr %45, ptr %49, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 4
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %52) #4
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  %55 = ptrtoint ptr %54 to i64
  %56 = sub i64 %55, 0
  %57 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 5
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %59) #4
  store i64 %56, ptr %60, align 8, !tbaa !48
  br label %61

61:                                               ; preds = %29
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = add i32 %62, 1
  store i32 %63, ptr %7, align 4, !tbaa !9
  br label %22, !llvm.loop !49

64:                                               ; preds = %28
  br label %65

65:                                               ; preds = %64, %3
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %8, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !11
  %69 = add nsw i32 %68, %66
  store i32 %69, ptr %67, align 8, !tbaa !11
  %70 = load ptr, ptr %8, align 8, !tbaa !51
  %71 = getelementptr inbounds ptr, ptr %70, i64 21
  %72 = load ptr, ptr %71, align 8
  call void %72(ptr dead_on_unwind writable sret(%"class.Partio::ParticleIterator") align 8 %0, ptr noundef nonnull align 8 dereferenceable(240) %8)
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind allocsize(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" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(1) }

!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 16}
!12 = !{!"_ZTSN6Partio15ParticlesSimpleE", !13, i64 0, !16, i64 8, !10, i64 16, !10, i64 20, !17, i64 24, !21, i64 48, !25, i64 72, !29, i64 96, !33, i64 120, !37, i64 144, !46, i64 192, !6, i64 232}
!13 = !{!"_ZTSN6Partio20ParticlesDataMutableE", !14, i64 0}
!14 = !{!"_ZTSN6Partio13ParticlesDataE", !15, i64 0}
!15 = !{!"_ZTSN6Partio13ParticlesInfoE"}
!16 = !{!"_ZTSN6Partio8ProviderE"}
!17 = !{!"_ZTSSt6vectorIPcSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIPcSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPcSaIS0_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIPcSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!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", !6, i64 0, !6, i64 8, !6, 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", !6, i64 0, !6, i64 8, !6, 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", !6, i64 0, !6, i64 8, !6, 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", !6, i64 0, !6, i64 8, !6, 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, !6, i64 8, !6, i64 16, !6, i64 24}
!44 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!45 = !{!"long", !7, i64 0}
!46 = !{!"_ZTSN6Partio11PartioMutexE", !7, i64 0}
!47 = !{!12, !10, i64 20}
!48 = !{!45, !45, i64 0}
!49 = distinct !{!49, !50}
!50 = !{!"llvm.loop.mustprogress"}
!51 = !{!52, !52, i64 0}
!52 = !{!"vtable pointer", !8, 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"

%"class.Partio::ParticleIterator" = type { ptr, i64, i64, ptr }

; 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 noundef i64 @_ZNKSt6vectorIN6Partio17ParticleAttributeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Partio15ParticlesSimple12addParticlesEi(ptr dead_on_unwind noalias writable sret(%"class.Partio::ParticleIterator") align 8 %0, ptr noundef nonnull align 8 dereferenceable(240) %1, i32 noundef %2) unnamed_addr #2 align 2 {
  %4 = getelementptr inbounds i8, ptr %1, i64 16
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = add nsw i32 %5, %2
  %7 = getelementptr inbounds i8, ptr %1, i64 20
  %8 = load i32, ptr %7, align 4, !tbaa !45
  %9 = icmp sgt i32 %6, %8
  br i1 %9, label %10, label %.loopexit

10:                                               ; preds = %3
  %11 = add nsw i32 %8, %2
  store i32 %11, ptr %7, align 4, !tbaa !45
  %12 = getelementptr inbounds i8, ptr %1, i64 96
  %13 = tail call noundef i64 @_ZNKSt6vectorIN6Partio17ParticleAttributeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %10
  %14 = getelementptr inbounds i8, ptr %1, i64 24
  %15 = getelementptr inbounds i8, ptr %1, i64 120
  %16 = getelementptr inbounds i8, ptr %1, i64 48
  br label %17

17:                                               ; preds = %.lr.ph, %17
  %18 = phi i64 [ 0, %.lr.ph ], [ %34, %17 ]
  %.012 = phi i32 [ 0, %.lr.ph ], [ %33, %17 ]
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %18) #3
  %20 = load ptr, ptr %19, align 8, !tbaa !46
  %21 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %18) #3
  %22 = load i32, ptr %21, align 4, !tbaa !47
  %23 = sext i32 %22 to i64
  %24 = load i32, ptr %7, align 4, !tbaa !45
  %25 = sext i32 %24 to i64
  %26 = mul nsw i64 %25, %23
  %27 = tail call ptr @realloc(ptr noundef %20, i64 noundef %26) #4
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %18) #3
  store ptr %27, ptr %28, align 8, !tbaa !46
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPcSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %18) #3
  %30 = load ptr, ptr %29, align 8, !tbaa !46
  %31 = ptrtoint ptr %30 to i64
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %18) #3
  store i64 %31, ptr %32, align 8, !tbaa !48
  %33 = add i32 %.012, 1
  %34 = zext i32 %33 to i64
  %35 = tail call noundef i64 @_ZNKSt6vectorIN6Partio17ParticleAttributeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  %36 = icmp ugt i64 %35, %34
  br i1 %36, label %17, label %.loopexit, !llvm.loop !49

.loopexit:                                        ; preds = %17, %10, %3
  %37 = load i32, ptr %4, align 8, !tbaa !5
  %38 = add nsw i32 %37, %2
  store i32 %38, ptr %4, align 8, !tbaa !5
  %39 = load ptr, ptr %1, align 8, !tbaa !51
  %40 = getelementptr inbounds i8, ptr %39, i64 168
  %41 = load ptr, ptr %40, align 8
  tail call void %41(ptr dead_on_unwind writable sret(%"class.Partio::ParticleIterator") align 8 %0, ptr noundef nonnull align 8 dereferenceable(240) %1)
  ret void
}

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("realloc") allocsize(1) 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 = { 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 #3 = { nounwind }
attributes #4 = { nounwind allocsize(1) }

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


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