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

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

; 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 uwtable
define dso_local noundef i64 @_ZN6Partio15ParticlesSimple11addParticleEv(ptr noundef nonnull align 8 dereferenceable(240) %0) unnamed_addr #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  %8 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %7, i32 0, i32 3
  %9 = load i32, ptr %8, align 4, !tbaa !9
  %10 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %7, i32 0, i32 2
  %11 = load i32, ptr %10, align 8, !tbaa !46
  %12 = icmp eq i32 %9, %11
  br i1 %12, label %13, label %55

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 10, ptr %3, align 4, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %14 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %7, i32 0, i32 3
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = mul nsw i32 %15, 3
  %17 = sdiv i32 %16, 2
  store i32 %17, ptr %4, align 4, !tbaa !47
  %18 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %7, i32 0, i32 2
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %21 = load i32, ptr %20, align 4, !tbaa !47
  %22 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %7, i32 0, i32 3
  store i32 %21, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !47
  br label %23

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

29:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %54

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

51:                                               ; preds = %30
  %52 = load i32, ptr %5, align 4, !tbaa !47
  %53 = add i32 %52, 1
  store i32 %53, ptr %5, align 4, !tbaa !47
  br label %23, !llvm.loop !48

54:                                               ; preds = %29
  br label %55

55:                                               ; preds = %54, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %56 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %7, i32 0, i32 2
  %57 = load i32, ptr %56, align 8, !tbaa !46
  %58 = sext i32 %57 to i64
  store i64 %58, ptr %6, align 8, !tbaa !50
  %59 = getelementptr inbounds %"class.Partio::ParticlesSimple", ptr %7, i32 0, i32 2
  %60 = load i32, ptr %59, align 8, !tbaa !46
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %59, align 8, !tbaa !46
  %62 = load i64, ptr %6, align 8, !tbaa !50
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  ret i64 %62
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; 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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i64 -2147483648, 2147483648) i64 @_ZN6Partio15ParticlesSimple11addParticleEv(ptr noundef nonnull align 8 dereferenceable(240) %0) unnamed_addr #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 20
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load i32, ptr %6, align 8, !tbaa !45
  %8 = icmp eq i32 %5, %7
  br i1 %8, label %9, label %.loopexit

9:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 10, ptr %2, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %10 = mul nsw i32 %5, 3
  %11 = sdiv i32 %10, 2
  store i32 %11, ptr %3, align 4, !tbaa !46
  %12 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %14 = load i32, ptr %13, align 4, !tbaa !46
  store i32 %14, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = call noundef i64 @_ZNKSt6vectorIN6Partio17ParticleAttributeESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #4
  %.not = icmp eq i64 %16, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %9
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = getelementptr inbounds i8, ptr %0, i64 120
  br label %19

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

.loopexit:                                        ; preds = %19, %9, %1
  %35 = load i32, ptr %6, align 8, !tbaa !45
  %36 = sext i32 %35 to i64
  %37 = add nsw i32 %35, 1
  store i32 %37, ptr %6, align 8, !tbaa !45
  ret i64 %36
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 #3

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

attributes #0 = { mustprogress 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 = { 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 #3 = { 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 #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, !11, i64 20}
!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 16}
!46 = !{!11, !11, i64 0}
!47 = !{!18, !18, i64 0}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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