; LLVM IR from erayzesen/QuarkPhysics :: QuarkPhysics/qbody.ll (ZN5QBodyD2Ev)

; 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.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.0", i8, [7 x i8], %"class.std::vector", i32, i8, [3 x i8] }>
%class.QAABB = type { %struct.QVector, %struct.QVector, %struct.QVector, float }
%struct.QVector = type { float, 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.0" = type { %"class.std::_Function_base", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%struct.QMesh = type { %"class.std::vector.2", %struct.QVector, %struct.QVector, float, float, %"class.std::vector.7", %"class.std::vector.12", %"class.std::vector.2", %"class.std::vector.17", %"class.std::vector.22", float, ptr, i32, %"class.std::vector.27", i8, i8, %"class.std::vector.32", float, i8, i8, i8, i8 }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = 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.12" = type { %"struct.std::_Vector_base.13" }
%"struct.std::_Vector_base.13" = 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.2" = type { %"struct.std::_Vector_base.3" }
%"struct.std::_Vector_base.3" = 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.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = 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.22" = type { %"struct.std::_Vector_base.23" }
%"struct.std::_Vector_base.23" = 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.27" = type { %"struct.std::_Vector_base.28" }
%"struct.std::_Vector_base.28" = 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.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = 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 }

@_ZTV5QBody = external dso_local unnamed_addr constant { [12 x ptr] }, align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5QBodyD2Ev(ptr noundef nonnull align 8 dereferenceable(293) %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, 80) ({ [12 x ptr] }, ptr @_ZTV5QBody, i32 0, i32 0, i32 2), ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %5

5:                                                ; preds = %45, %1
  %6 = load i32, ptr %3, align 4, !tbaa !11
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 44
  %9 = call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  %10 = icmp ult i64 %7, %9
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %5
  %13 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 44
  %14 = load i32, ptr %3, align 4, !tbaa !11
  %15 = sext i32 %14 to i64
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %15) #4
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %44

19:                                               ; preds = %12
  %20 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 44
  %21 = load i32, ptr %3, align 4, !tbaa !11
  %22 = sext i32 %21 to i64
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %22) #4
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.QMesh, ptr %24, i32 0, i32 21
  %26 = load i8, ptr %25, align 1, !tbaa !13, !range !47, !noundef !48
  %27 = trunc i8 %26 to i1
  %28 = zext i1 %27 to i32
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %43

30:                                               ; preds = %19
  %31 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 44
  %32 = load i32, ptr %3, align 4, !tbaa !11
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %33) #4
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = icmp eq ptr %35, null
  br i1 %36, label %38, label %37

37:                                               ; preds = %30
  call void @_ZN5QMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %35) #4
  call void @_ZdlPvm(ptr noundef %35, i64 noundef 256) #5
  br label %38

38:                                               ; preds = %37, %30
  %39 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 44
  %40 = load i32, ptr %3, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %41) #4
  store ptr null, ptr %42, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %38, %19
  br label %44

44:                                               ; preds = %43, %12
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %3, align 4, !tbaa !11
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %3, align 4, !tbaa !11
  br label %5, !llvm.loop !49

48:                                               ; preds = %11
  %49 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 44
  call void @_ZNSt6vectorIP5QMeshSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #4
  %50 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 44
  call void @_ZNSt6vectorIP5QMeshSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %50) #4
  %51 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 41
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %51) #4
  %52 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 40
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %52) #4
  %53 = getelementptr inbounds %class.QBody, ptr %4, i32 0, i32 39
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %53) #4
  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 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

; Function Attrs: nounwind
declare void @_ZN5QMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { 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 = !{!"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 = !{!14, !42, i64 255}
!14 = !{!"_ZTS5QMesh", !15, i64 0, !19, i64 24, !19, i64 32, !20, i64 40, !20, i64 44, !21, i64 48, !25, i64 72, !15, i64 96, !29, i64 120, !33, i64 144, !20, i64 168, !6, i64 176, !37, i64 184, !38, i64 192, !42, i64 216, !42, i64 217, !43, i64 224, !20, i64 248, !42, i64 252, !42, i64 253, !42, i64 254, !42, i64 255}
!15 = !{!"_ZTSSt6vectorIP9QParticleSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIP9QParticleSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP9QParticleSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP9QParticleSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTS7QVector", !20, i64 0, !20, i64 4}
!20 = !{!"float", !7, i64 0}
!21 = !{!"_ZTSSt6vectorIP7QSpringSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIP7QSpringSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIP7QSpringSaIS1_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIP7QSpringSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt6vectorIP16QAngleConstraintSaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIP16QAngleConstraintSaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIP16QAngleConstraintSaIS1_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIP16QAngleConstraintSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSSt6vectorIS_IP9QParticleSaIS1_EESaIS3_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9QParticleSaIS2_EESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTSSt6vectorI7QVectorSaIS0_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseI7QVectorSaIS0_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!"_ZTSN5QMesh18CollisionBehaviorsE", !7, i64 0}
!38 = !{!"_ZTSSt6vectorIS_IiSaIiEESaIS1_EE", !39, i64 0}
!39 = !{!"_ZTSSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE12_Vector_implE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!42 = !{!"bool", !7, i64 0}
!43 = !{!"_ZTSSt6vectorIfSaIfEE", !44, i64 0}
!44 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!47 = !{i8 0, i8 2}
!48 = !{}
!49 = distinct !{!49, !50}
!50 = !{!"llvm.loop.mustprogress"}


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

@_ZTV5QBody = external dso_local unnamed_addr constant { [12 x ptr] }, align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5QBodyD2Ev(ptr noundef nonnull align 8 dereferenceable(293) %0) unnamed_addr #0 align 2 {
  store ptr getelementptr inbounds inrange(-16, 80) (i8, ptr @_ZTV5QBody, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 264
  %3 = tail call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %.not9 = icmp eq i64 %3, 0
  br i1 %.not9, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %22, %1
  tail call void @_ZNSt6vectorIP5QMeshSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  tail call void @_ZNSt6vectorIP5QMeshSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %4 = getelementptr inbounds i8, ptr %0, i64 224
  tail call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 192
  tail call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 160
  tail call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #3
  ret void

.lr.ph:                                           ; preds = %1, %22
  %indvars.iv = phi i64 [ %indvars.iv.next, %22 ], [ 0, %1 ]
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %8 = load ptr, ptr %7, align 8, !tbaa !8
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %22, label %9

9:                                                ; preds = %.lr.ph
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %11 = load ptr, ptr %10, align 8, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %11, i64 255
  %13 = load i8, ptr %12, align 1, !tbaa !11, !range !45, !noundef !46
  %14 = icmp eq i8 %13, 0
  br i1 %14, label %15, label %22

15:                                               ; preds = %9
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %17 = load ptr, ptr %16, align 8, !tbaa !8
  %18 = icmp eq ptr %17, null
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  tail call void @_ZN5QMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %17) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %17, i64 noundef 256) #4
  br label %20

20:                                               ; preds = %19, %15
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  store ptr null, ptr %21, align 8, !tbaa !8
  br label %22

22:                                               ; preds = %.lr.ph, %20, %9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = tail call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %24 = icmp ugt i64 %23, %indvars.iv.next
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !47
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_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 @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nounwind
declare void @_ZN5QMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { 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 #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 = { nounwind }
attributes #4 = { 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, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !40, i64 255}
!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, !9, 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", !9, i64 0, !9, i64 8, !9, i64 16}
!17 = !{!"_ZTS7QVector", !18, i64 0, !18, i64 4}
!18 = !{!"float", !10, 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", !9, i64 0, !9, i64 8, !9, 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", !9, i64 0, !9, i64 8, !9, 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", !9, i64 0, !9, i64 8, !9, 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", !9, i64 0, !9, i64 8, !9, i64 16}
!35 = !{!"_ZTSN5QMesh18CollisionBehaviorsE", !10, 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", !9, i64 0, !9, i64 8, !9, i64 16}
!40 = !{!"bool", !10, 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", !9, i64 0, !9, i64 8, !9, i64 16}
!45 = !{i8 0, i8 2}
!46 = !{}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}


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