; LLVM IR from erayzesen/QuarkPhysics :: QuarkPhysics/qmesh.ll (ZN5QMesh16RemoveParticleAtEi)

; 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.__gnu_cxx::__normal_iterator.63" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.QMesh = type { %"class.std::vector", %struct.QVector, %struct.QVector, float, float, %"class.std::vector.0", %"class.std::vector.5", %"class.std::vector", %"class.std::vector.10", %"class.std::vector.15", float, ptr, i32, %"class.std::vector.20", i8, i8, %"class.std::vector.25", float, i8, i8, i8, i8 }
%struct.QVector = type { float, float }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<QSpring *, std::allocator<QSpring *>>::_Vector_impl" }
%"struct.std::_Vector_base<QSpring *, std::allocator<QSpring *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QSpring *, std::allocator<QSpring *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QSpring *, std::allocator<QSpring *>>::_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<QAngleConstraint *, std::allocator<QAngleConstraint *>>::_Vector_impl" }
%"struct.std::_Vector_base<QAngleConstraint *, std::allocator<QAngleConstraint *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QAngleConstraint *, std::allocator<QAngleConstraint *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QAngleConstraint *, std::allocator<QAngleConstraint *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<QParticle *, std::allocator<QParticle *>>::_Vector_impl" }
%"struct.std::_Vector_base<QParticle *, std::allocator<QParticle *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QParticle *, std::allocator<QParticle *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QParticle *, std::allocator<QParticle *>>::_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<std::vector<QParticle *>, std::allocator<std::vector<QParticle *>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<QParticle *>, std::allocator<std::vector<QParticle *>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<QParticle *>, std::allocator<std::vector<QParticle *>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<QParticle *>, std::allocator<std::vector<QParticle *>>>::_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<QVector, std::allocator<QVector>>::_Vector_impl" }
%"struct.std::_Vector_base<QVector, std::allocator<QVector>>::_Vector_impl" = type { %"struct.std::_Vector_base<QVector, std::allocator<QVector>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QVector, std::allocator<QVector>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.20" = type { %"struct.std::_Vector_base.21" }
%"struct.std::_Vector_base.21" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.25" = type { %"struct.std::_Vector_base.26" }
%"struct.std::_Vector_base.26" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.QBody = type <{ ptr, float, float, ptr, %struct.QVector, %struct.QVector, float, float, %class.QAABB, i32, i8, i8, i8, i8, float, i32, i8, [3 x i8], float, i8, i8, [2 x i8], %struct.QVector, float, float, float, float, float, i32, i32, i8, i8, i8, i8, i32, i32, i32, i8, [3 x i8], %"class.std::function", %"class.std::function", %"class.std::function.55", i8, [7 x i8], %"class.std::vector.58", i32, i8, [3 x i8] }>
%class.QAABB = type { %struct.QVector, %struct.QVector, %struct.QVector, float }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::function.55" = type { %"class.std::_Function_base", ptr }
%"class.std::vector.58" = type { %"struct.std::_Vector_base.59" }
%"struct.std::_Vector_base.59" = type { %"struct.std::_Vector_base<QMesh *, std::allocator<QMesh *>>::_Vector_impl" }
%"struct.std::_Vector_base<QMesh *, std::allocator<QMesh *>>::_Vector_impl" = type { %"struct.std::_Vector_base<QMesh *, std::allocator<QMesh *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<QMesh *, std::allocator<QMesh *>>::_Vector_impl_data" = type { ptr, 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 @_ZNSt6vectorIP9QParticleSaIS1_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

declare void @_ZN5QBody20UpdateMeshTransformsEv(ptr noundef nonnull align 8 dereferenceable(293)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5QMesh16RemoveParticleAtEi(ptr noundef nonnull align 8 dereferenceable(256) %0, i32 noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.63", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %10 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %11 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 0
  %12 = load i32, ptr %4, align 4, !tbaa !9
  %13 = sext i32 %12 to i64
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %13) #4
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %15, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call noundef ptr @_ZN5QMesh25RemoveParticleFromPolygonEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256) %10, ptr noundef %16)
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call noundef ptr @_ZN5QMesh21RemoveMatchingSpringsEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256) %10, ptr noundef %18)
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = call noundef ptr @_ZN5QMesh20RemoveMatchingUVMapsEi(ptr noundef nonnull align 8 dereferenceable(256) %10, i32 noundef %20)
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call noundef ptr @_ZN5QMesh30RemoveMatchingAngleConstraintsEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256) %10, ptr noundef %22)
  %24 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %25 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 0
  %26 = call ptr @_ZNSt6vectorIP9QParticleSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #4
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9QParticleSt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %29) #4
  %31 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %30, ptr %31, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKP9QParticleSt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %32 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.63", ptr %6, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8
  %34 = call ptr @_ZNSt6vectorIP9QParticleSaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS1_S3_EE(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr %33)
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %36 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 11
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %55

39:                                               ; preds = %2
  %40 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 11
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  %42 = getelementptr inbounds %class.QBody, ptr %41, i32 0, i32 9
  %43 = load i32, ptr %42, align 4, !tbaa !45
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %48

45:                                               ; preds = %39
  %46 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 11
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  call void @_ZN5QBody20UpdateMeshTransformsEv(ptr noundef nonnull align 8 dereferenceable(293) %47)
  br label %48

48:                                               ; preds = %45, %39
  %49 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 11
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = getelementptr inbounds %class.QBody, ptr %50, i32 0, i32 10
  store i8 1, ptr %51, align 8, !tbaa !58
  %52 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 11
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds %class.QBody, ptr %53, i32 0, i32 11
  store i8 1, ptr %54, align 1, !tbaa !59
  br label %55

55:                                               ; preds = %48, %2
  %56 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 15
  store i8 1, ptr %56, align 1, !tbaa !60
  %57 = getelementptr inbounds %struct.QMesh, ptr %10, i32 0, i32 19
  store i8 1, ptr %57, align 1, !tbaa !61
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret ptr %10
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5QMesh25RemoveParticleFromPolygonEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5QMesh21RemoveMatchingSpringsEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5QMesh20RemoveMatchingUVMapsEi(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5QMesh30RemoveMatchingAngleConstraintsEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt6vectorIP9QParticleSaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS1_S3_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9__gnu_cxx17__normal_iteratorIPKP9QParticleSt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #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 = { "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 }

!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, !6, i64 176}
!12 = !{!"_ZTS5QMesh", !13, i64 0, !17, i64 24, !17, i64 32, !18, i64 40, !18, i64 44, !19, i64 48, !23, i64 72, !13, i64 96, !27, i64 120, !31, i64 144, !18, i64 168, !6, i64 176, !35, i64 184, !36, i64 192, !40, i64 216, !40, i64 217, !41, i64 224, !18, i64 248, !40, i64 252, !40, i64 253, !40, i64 254, !40, i64 255}
!13 = !{!"_ZTSSt6vectorIP9QParticleSaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIP9QParticleSaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIP9QParticleSaIS1_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIP9QParticleSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTS7QVector", !18, i64 0, !18, i64 4}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSSt6vectorIP7QSpringSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIP7QSpringSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP7QSpringSaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP7QSpringSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt6vectorIP16QAngleConstraintSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIP16QAngleConstraintSaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIP16QAngleConstraintSaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIP16QAngleConstraintSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSSt6vectorIS_IP9QParticleSaIS1_EESaIS3_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTSSt6vectorI7QVectorSaIS0_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseI7QVectorSaIS0_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = !{!"_ZTSN5QMesh18CollisionBehaviorsE", !7, i64 0}
!36 = !{!"_ZTSSt6vectorIS_IiSaIiEESaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!"bool", !7, i64 0}
!41 = !{!"_ZTSSt6vectorIfSaIfEE", !42, i64 0}
!42 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !43, i64 0}
!43 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !44, i64 0}
!44 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!45 = !{!46, !48, i64 76}
!46 = !{!"_ZTS5QBody", !18, i64 8, !18, i64 12, !6, i64 16, !17, i64 24, !17, i64 32, !18, i64 40, !18, i64 44, !47, i64 48, !48, i64 76, !40, i64 80, !40, i64 81, !40, i64 82, !18, i64 84, !49, i64 88, !40, i64 92, !18, i64 96, !40, i64 100, !40, i64 101, !17, i64 104, !18, i64 112, !18, i64 116, !18, i64 120, !18, i64 124, !18, i64 128, !10, i64 132, !10, i64 136, !40, i64 140, !40, i64 141, !40, i64 142, !10, i64 144, !10, i64 148, !10, i64 152, !40, i64 156, !50, i64 160, !50, i64 192, !52, i64 224, !40, i64 256, !53, i64 264, !57, i64 288, !40, i64 292}
!47 = !{!"_ZTS5QAABB", !17, i64 0, !17, i64 8, !17, i64 16, !18, i64 24}
!48 = !{!"_ZTSN5QBody5ModesE", !7, i64 0}
!49 = !{!"_ZTSN5QBody9BodyTypesE", !7, i64 0}
!50 = !{!"_ZTSSt8functionIFvP5QBodyEE", !51, i64 0, !6, i64 24}
!51 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!52 = !{!"_ZTSSt8functionIFbP5QBodyNS0_13CollisionInfoEEE", !51, i64 0, !6, i64 24}
!53 = !{!"_ZTSSt6vectorIP5QMeshSaIS1_EE", !54, i64 0}
!54 = !{!"_ZTSSt12_Vector_baseIP5QMeshSaIS1_EE", !55, i64 0}
!55 = !{!"_ZTSNSt12_Vector_baseIP5QMeshSaIS1_EE12_Vector_implE", !56, i64 0}
!56 = !{!"_ZTSNSt12_Vector_baseIP5QMeshSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!57 = !{!"_ZTSN5QBody16SimulationModelsE", !7, i64 0}
!58 = !{!46, !40, i64 80}
!59 = !{!46, !40, i64 81}
!60 = !{!12, !40, i64 217}
!61 = !{!12, !40, i64 253}


; 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.__gnu_cxx::__normal_iterator.63" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; 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 @_ZNSt6vectorIP9QParticleSaIS1_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

declare void @_ZN5QBody20UpdateMeshTransformsEv(ptr noundef nonnull align 8 dereferenceable(293)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull ptr @_ZN5QMesh16RemoveParticleAtEi(ptr noundef nonnull returned align 8 dereferenceable(256) %0, i32 noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.63", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = sext i32 %1 to i64
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %6) #4
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call noundef ptr @_ZN5QMesh25RemoveParticleFromPolygonEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %8)
  %10 = tail call noundef ptr @_ZN5QMesh21RemoveMatchingSpringsEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %8)
  %11 = tail call noundef ptr @_ZN5QMesh20RemoveMatchingUVMapsEi(ptr noundef nonnull align 8 dereferenceable(256) %0, i32 noundef %1)
  %12 = tail call noundef ptr @_ZN5QMesh30RemoveMatchingAngleConstraintsEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %13 = tail call ptr @_ZNSt6vectorIP9QParticleSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  store ptr %13, ptr %5, align 8
  %14 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP9QParticleSt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %6) #4
  store ptr %14, ptr %4, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKP9QParticleSt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %15 = load ptr, ptr %3, align 8
  %16 = call ptr @_ZNSt6vectorIP9QParticleSaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS1_S3_EE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  %17 = getelementptr inbounds i8, ptr %0, i64 176
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %.not = icmp eq ptr %18, null
  br i1 %.not, label %28, label %19

19:                                               ; preds = %2
  %20 = getelementptr inbounds i8, ptr %18, i64 76
  %21 = load i32, ptr %20, align 4, !tbaa !43
  %22 = icmp eq i32 %21, 1
  br i1 %22, label %23, label %24

23:                                               ; preds = %19
  call void @_ZN5QBody20UpdateMeshTransformsEv(ptr noundef nonnull align 8 dereferenceable(293) %18)
  %.pre = load ptr, ptr %17, align 8, !tbaa !9
  br label %24

24:                                               ; preds = %23, %19
  %25 = phi ptr [ %.pre, %23 ], [ %18, %19 ]
  %26 = getelementptr inbounds i8, ptr %25, i64 80
  store i8 1, ptr %26, align 8, !tbaa !57
  %27 = getelementptr inbounds i8, ptr %25, i64 81
  store i8 1, ptr %27, align 1, !tbaa !58
  br label %28

28:                                               ; preds = %24, %2
  %29 = getelementptr inbounds i8, ptr %0, i64 217
  store i8 1, ptr %29, align 1, !tbaa !59
  %30 = getelementptr inbounds i8, ptr %0, i64 253
  store i8 1, ptr %30, align 1, !tbaa !60
  ret ptr %0
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5QMesh25RemoveParticleFromPolygonEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5QMesh21RemoveMatchingSpringsEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5QMesh20RemoveMatchingUVMapsEi(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5QMesh30RemoveMatchingAngleConstraintsEP9QParticle(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt6vectorIP9QParticleSaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS1_S3_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9__gnu_cxx17__normal_iteratorIPKP9QParticleSt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) 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 = { "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 }

!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, !6, i64 176}
!10 = !{!"_ZTS5QMesh", !11, i64 0, !15, i64 24, !15, i64 32, !16, i64 40, !16, i64 44, !17, i64 48, !21, i64 72, !11, i64 96, !25, i64 120, !29, i64 144, !16, i64 168, !6, i64 176, !33, i64 184, !34, i64 192, !38, i64 216, !38, i64 217, !39, i64 224, !16, i64 248, !38, i64 252, !38, i64 253, !38, i64 254, !38, i64 255}
!11 = !{!"_ZTSSt6vectorIP9QParticleSaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIP9QParticleSaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIP9QParticleSaIS1_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIP9QParticleSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"_ZTS7QVector", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTSSt6vectorIP7QSpringSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIP7QSpringSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIP7QSpringSaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIP7QSpringSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt6vectorIP16QAngleConstraintSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIP16QAngleConstraintSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIP16QAngleConstraintSaIS1_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIP16QAngleConstraintSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt6vectorIS_IP9QParticleSaIS1_EESaIS3_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSSt6vectorI7QVectorSaIS0_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseI7QVectorSaIS0_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTSN5QMesh18CollisionBehaviorsE", !7, i64 0}
!34 = !{!"_ZTSSt6vectorIS_IiSaIiEESaIS1_EE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!38 = !{!"bool", !7, i64 0}
!39 = !{!"_ZTSSt6vectorIfSaIfEE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!43 = !{!44, !46, i64 76}
!44 = !{!"_ZTS5QBody", !16, i64 8, !16, i64 12, !6, i64 16, !15, i64 24, !15, i64 32, !16, i64 40, !16, i64 44, !45, i64 48, !46, i64 76, !38, i64 80, !38, i64 81, !38, i64 82, !16, i64 84, !47, i64 88, !38, i64 92, !16, i64 96, !38, i64 100, !38, i64 101, !15, i64 104, !16, i64 112, !16, i64 116, !16, i64 120, !16, i64 124, !16, i64 128, !48, i64 132, !48, i64 136, !38, i64 140, !38, i64 141, !38, i64 142, !48, i64 144, !48, i64 148, !48, i64 152, !38, i64 156, !49, i64 160, !49, i64 192, !51, i64 224, !38, i64 256, !52, i64 264, !56, i64 288, !38, i64 292}
!45 = !{!"_ZTS5QAABB", !15, i64 0, !15, i64 8, !15, i64 16, !16, i64 24}
!46 = !{!"_ZTSN5QBody5ModesE", !7, i64 0}
!47 = !{!"_ZTSN5QBody9BodyTypesE", !7, i64 0}
!48 = !{!"int", !7, i64 0}
!49 = !{!"_ZTSSt8functionIFvP5QBodyEE", !50, i64 0, !6, i64 24}
!50 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!51 = !{!"_ZTSSt8functionIFbP5QBodyNS0_13CollisionInfoEEE", !50, i64 0, !6, i64 24}
!52 = !{!"_ZTSSt6vectorIP5QMeshSaIS1_EE", !53, i64 0}
!53 = !{!"_ZTSSt12_Vector_baseIP5QMeshSaIS1_EE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIP5QMeshSaIS1_EE12_Vector_implE", !55, i64 0}
!55 = !{!"_ZTSNSt12_Vector_baseIP5QMeshSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!56 = !{!"_ZTSN5QBody16SimulationModelsE", !7, i64 0}
!57 = !{!44, !38, i64 80}
!58 = !{!44, !38, i64 81}
!59 = !{!10, !38, i64 217}
!60 = !{!10, !38, i64 253}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass