; LLVM IR from erayzesen/QuarkPhysics :: QuarkPhysics/qsoftbody.ll (ZN9QSoftBody6UpdateEv)

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

%struct.QVector = type { float, float }
%"class.__gnu_cxx::__normal_iterator.109" = type { 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.30", i8, [7 x i8], %"class.std::vector.33", 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.30" = type { %"class.std::_Function_base", ptr }
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = 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 }
%class.QParticle = type <{ float, %struct.QVector, %struct.QVector, %struct.QVector, float, ptr, i8, [3 x i8], %struct.QVector, [4 x i8], %"class.std::vector.0", i8, i8, [2 x i8], %class.QAABB, i8, [7 x i8], %"class.std::unordered_set", %"class.std::unordered_set.10", %"class.std::unordered_set.10", i8, i8, [6 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::unordered_set.10" = type { %"class.std::_Hashtable.11" }
%"class.std::_Hashtable.11" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%class.QSoftBody = type { %class.QBody.base, float, float, float, float, float, float, i8, float, i8, i8, i8, float, i8, float, i8, i8, %struct.QVector, float }
%class.QBody.base = 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.30", i8, [7 x i8], %"class.std::vector.33", i32, i8 }>

; 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 <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290)) #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 uwtable
declare dso_local <2 x float> @_Zmi7QVectorS_(<2 x float>, <2 x float>) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZN7QVector4ZeroEv() #2 align 2

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

declare noundef i32 @_ZN5QMesh16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(256)) #5

declare noundef ptr @_ZN5QMesh13GetParticleAtEi(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9QParticle10GetEnabledEv(ptr noundef nonnull align 8 dereferenceable(290)) #4 align 2

declare noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290), <2 x float>) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9QSoftBody6UpdateEv(ptr noundef nonnull align 8 dereferenceable(360) %0) unnamed_addr #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca float, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %struct.QVector, align 4
  %10 = alloca %struct.QVector, align 4
  %11 = alloca %struct.QVector, align 4
  %12 = alloca %struct.QVector, align 4
  %13 = alloca %struct.QVector, align 4
  %14 = alloca %struct.QVector, align 4
  %15 = alloca %struct.QVector, align 4
  %16 = alloca %struct.QVector, align 4
  %17 = alloca %struct.QVector, align 4
  %18 = alloca %struct.QVector, align 4
  %19 = alloca %struct.QVector, align 4
  %20 = alloca %struct.QVector, align 4
  %21 = alloca %struct.QVector, align 4
  %22 = alloca %struct.QVector, align 4
  %23 = alloca %struct.QVector, align 4
  %24 = alloca %struct.QVector, align 4
  %25 = alloca ptr, align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %28 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %29 = load ptr, ptr %2, align 8
  call void @_ZN5QBody6UpdateEv(ptr noundef nonnull align 8 dereferenceable(293) %29)
  %30 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 9
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %33, label %34

33:                                               ; preds = %1
  br label %221

34:                                               ; preds = %1
  %35 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 32
  %36 = load i8, ptr %35, align 2, !tbaa !26, !range !27, !noundef !28
  %37 = trunc i8 %36 to i1
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  br label %221

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store float 1.000000e+00, ptr %3, align 4, !tbaa !29
  %40 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 12
  %41 = load i8, ptr %40, align 2, !tbaa !30, !range !27, !noundef !28
  %42 = trunc i8 %41 to i1
  %43 = zext i1 %42 to i32
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %48

45:                                               ; preds = %39
  %46 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 14
  %47 = load float, ptr %46, align 4, !tbaa !31
  store float %47, ptr %3, align 4, !tbaa !29
  br label %57

48:                                               ; preds = %39
  %49 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 3
  %50 = load ptr, ptr %49, align 8, !tbaa !32
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %56

52:                                               ; preds = %48
  %53 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !32
  %55 = call noundef float @_ZN6QWorld12GetTimeScaleEv(ptr noundef nonnull align 8 dereferenceable(272) %54)
  store float %55, ptr %3, align 4, !tbaa !29
  br label %56

56:                                               ; preds = %52, %48
  br label %57

57:                                               ; preds = %56, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 0, ptr %4, align 4, !tbaa !33
  br label %58

58:                                               ; preds = %189, %57
  %59 = load i32, ptr %4, align 4, !tbaa !33
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 44
  %62 = call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #9
  %63 = icmp ult i64 %60, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %58
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %192

65:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %66 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 44
  %67 = load i32, ptr %4, align 4, !tbaa !33
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %68) #9
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  store ptr %70, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !33
  br label %71

71:                                               ; preds = %185, %65
  %72 = load i32, ptr %7, align 4, !tbaa !33
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = call noundef i32 @_ZN5QMesh16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(256) %73)
  %75 = icmp slt i32 %72, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %71
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %188

77:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = load i32, ptr %7, align 4, !tbaa !33
  %80 = call noundef ptr @_ZN5QMesh13GetParticleAtEi(ptr noundef nonnull align 8 dereferenceable(256) %78, i32 noundef %79)
  store ptr %80, ptr %8, align 8, !tbaa !5
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = call noundef zeroext i1 @_ZN9QParticle10GetEnabledEv(ptr noundef nonnull align 8 dereferenceable(290) %81)
  %83 = zext i1 %82 to i32
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %77
  store i32 7, ptr %5, align 4
  br label %182

86:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %87)
  store <2 x float> %88, ptr %10, align 4
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = call <2 x float> @_ZN9QParticle25GetPreviousGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %89)
  store <2 x float> %90, ptr %11, align 4
  %91 = load <2 x float>, ptr %10, align 4
  %92 = load <2 x float>, ptr %11, align 4
  %93 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %91, <2 x float> %92)
  store <2 x float> %93, ptr %9, align 4
  %94 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 18
  %95 = load float, ptr %94, align 8, !tbaa !34
  %96 = fcmp ogt float %95, 0.000000e+00
  br i1 %96, label %97, label %108

97:                                               ; preds = %86
  %98 = call noundef float @_ZNK7QVector6LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  %99 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 18
  %100 = load float, ptr %99, align 8, !tbaa !34
  %101 = fcmp ogt float %98, %100
  br i1 %101, label %102, label %108

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %103 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 18
  %104 = load float, ptr %103, align 8, !tbaa !34
  %105 = call <2 x float> @_ZNK7QVector10NormalizedEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %105, ptr %13, align 4
  %106 = load <2 x float>, ptr %13, align 4
  %107 = call <2 x float> @_Zmlf7QVector(float noundef %104, <2 x float> %106)
  store <2 x float> %107, ptr %12, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %108

108:                                              ; preds = %102, %97, %86
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %110)
  store <2 x float> %111, ptr %14, align 4
  %112 = load <2 x float>, ptr %14, align 4
  %113 = call noundef ptr @_ZN9QParticle25SetPreviousGlobalPositionE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %109, <2 x float> %112)
  %114 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 19
  %115 = load i8, ptr %114, align 4, !tbaa !36, !range !27, !noundef !28
  %116 = trunc i8 %115 to i1
  %117 = zext i1 %116 to i32
  %118 = icmp eq i32 %117, 1
  br i1 %118, label %119, label %172

119:                                              ; preds = %108
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !35
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !35
  %121 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 25
  %122 = load float, ptr %121, align 8, !tbaa !37
  %123 = load <2 x float>, ptr %18, align 4
  %124 = call <2 x float> @_Zml7QVectorf(<2 x float> %123, float noundef %122)
  store <2 x float> %124, ptr %17, align 4
  %125 = load <2 x float>, ptr %16, align 4
  %126 = load <2 x float>, ptr %17, align 4
  %127 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %125, <2 x float> %126)
  store <2 x float> %127, ptr %15, align 4
  %128 = load <2 x float>, ptr %15, align 4
  %129 = call noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %120, <2 x float> %128)
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = getelementptr inbounds %class.QParticle, ptr %130, i32 0, i32 20
  %132 = load i8, ptr %131, align 8, !tbaa !38, !range !27, !noundef !28
  %133 = trunc i8 %132 to i1
  %134 = zext i1 %133 to i32
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %136, label %171

136:                                              ; preds = %119
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = call noundef zeroext i1 @_ZN9QParticle13GetIsInternalEv(ptr noundef nonnull align 8 dereferenceable(290) %137)
  %139 = zext i1 %138 to i32
  %140 = icmp eq i32 %139, 1
  br i1 %140, label %141, label %147

141:                                              ; preds = %136
  %142 = getelementptr inbounds %class.QSoftBody, ptr %29, i32 0, i32 10
  %143 = load i8, ptr %142, align 1, !tbaa !51, !range !27, !noundef !28
  %144 = trunc i8 %143 to i1
  %145 = zext i1 %144 to i32
  %146 = icmp eq i32 %145, 1
  br i1 %146, label %170, label %147

147:                                              ; preds = %141, %136
  %148 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 20
  %149 = load i8, ptr %148, align 1, !tbaa !53, !range !27, !noundef !28
  %150 = trunc i8 %149 to i1
  br i1 %150, label %151, label %159

151:                                              ; preds = %147
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 22
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 8 %153, i64 8, i1 false), !tbaa.struct !35
  %154 = load float, ptr %3, align 4, !tbaa !29
  %155 = load <2 x float>, ptr %20, align 4
  %156 = call <2 x float> @_Zml7QVectorf(<2 x float> %155, float noundef %154)
  store <2 x float> %156, ptr %19, align 4
  %157 = load <2 x float>, ptr %19, align 4
  %158 = call noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %152, <2 x float> %157)
  br label %169

159:                                              ; preds = %147
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 3
  %162 = load ptr, ptr %161, align 8, !tbaa !32
  %163 = call <2 x float> @_ZN6QWorld10GetGravityEv(ptr noundef nonnull align 8 dereferenceable(272) %162)
  store <2 x float> %163, ptr %22, align 4
  %164 = load float, ptr %3, align 4, !tbaa !29
  %165 = load <2 x float>, ptr %22, align 4
  %166 = call <2 x float> @_Zml7QVectorf(<2 x float> %165, float noundef %164)
  store <2 x float> %166, ptr %21, align 4
  %167 = load <2 x float>, ptr %21, align 4
  %168 = call noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %160, <2 x float> %167)
  br label %169

169:                                              ; preds = %159, %151
  br label %170

170:                                              ; preds = %169, %141
  br label %171

171:                                              ; preds = %170, %119
  br label %172

172:                                              ; preds = %171, %108
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = call <2 x float> @_ZN9QParticle8GetForceEv(ptr noundef nonnull align 8 dereferenceable(290) %174)
  store <2 x float> %175, ptr %23, align 4
  %176 = load <2 x float>, ptr %23, align 4
  %177 = call noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %173, <2 x float> %176)
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  %179 = call <2 x float> @_ZN7QVector4ZeroEv()
  store <2 x float> %179, ptr %24, align 4
  %180 = load <2 x float>, ptr %24, align 4
  %181 = call noundef ptr @_ZN9QParticle8SetForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %178, <2 x float> %180)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  store i32 0, ptr %5, align 4
  br label %182

182:                                              ; preds = %172, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  %183 = load i32, ptr %5, align 4
  switch i32 %183, label %222 [
    i32 0, label %184
    i32 7, label %185
  ]

184:                                              ; preds = %182
  br label %185

185:                                              ; preds = %184, %182
  %186 = load i32, ptr %7, align 4, !tbaa !33
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %7, align 4, !tbaa !33
  br label %71, !llvm.loop !54

188:                                              ; preds = %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %4, align 4, !tbaa !33
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %4, align 4, !tbaa !33
  br label %58, !llvm.loop !56

192:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %193 = getelementptr inbounds %class.QBody, ptr %29, i32 0, i32 44
  store ptr %193, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %194 = load ptr, ptr %25, align 8, !tbaa !5
  %195 = call ptr @_ZNSt6vectorIP5QMeshSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %194) #9
  %196 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.109", ptr %26, i32 0, i32 0
  store ptr %195, ptr %196, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %197 = load ptr, ptr %25, align 8, !tbaa !5
  %198 = call ptr @_ZNSt6vectorIP5QMeshSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %197) #9
  %199 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.109", ptr %27, i32 0, i32 0
  store ptr %198, ptr %199, align 8
  br label %200

200:                                              ; preds = %213, %192
  %201 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5QMeshSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #9
  br i1 %201, label %203, label %202

202:                                              ; preds = %200
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %215

203:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %204 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP5QMeshSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #9
  %205 = load ptr, ptr %204, align 8, !tbaa !5
  store ptr %205, ptr %28, align 8, !tbaa !5
  %206 = load ptr, ptr %28, align 8, !tbaa !5
  %207 = call noundef zeroext i1 @_ZN5QMesh31GetPolygonForCollisionsDisabledEv(ptr noundef nonnull align 8 dereferenceable(256) %206)
  %208 = zext i1 %207 to i32
  %209 = icmp eq i32 %208, 0
  br i1 %209, label %210, label %212

210:                                              ; preds = %203
  %211 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZN5QMesh30ApplyAngleConstraintsToPolygonEv(ptr noundef nonnull align 8 dereferenceable(256) %211)
  br label %212

212:                                              ; preds = %210, %203
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  br label %213

213:                                              ; preds = %212
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP5QMeshSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #9
  br label %200

215:                                              ; preds = %202
  %216 = getelementptr inbounds %class.QSoftBody, ptr %29, i32 0, i32 2
  %217 = load float, ptr %216, align 4, !tbaa !57
  %218 = fcmp une float %217, 0.000000e+00
  br i1 %218, label %219, label %220

219:                                              ; preds = %215
  call void @_ZN9QSoftBody13PreserveAreasEv(ptr noundef nonnull align 8 dereferenceable(360) %29)
  br label %220

220:                                              ; preds = %219, %215
  call void @_ZN5QBody10UpdateAABBEv(ptr noundef nonnull align 8 dereferenceable(293) %29)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %221

221:                                              ; preds = %220, %38, %33
  ret void

222:                                              ; preds = %182
  unreachable
}

declare void @_ZN5QBody6UpdateEv(ptr noundef nonnull align 8 dereferenceable(293)) unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN6QWorld12GetTimeScaleEv(ptr noundef nonnull align 8 dereferenceable(272)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN9QParticle25GetPreviousGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZNK7QVector6LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_Zmlf7QVector(float noundef, <2 x float>) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZNK7QVector10NormalizedEv(ptr noundef nonnull align 4 dereferenceable(8)) #7 align 2

declare noundef ptr @_ZN9QParticle25SetPreviousGlobalPositionE7QVector(ptr noundef nonnull align 8 dereferenceable(290), <2 x float>) #5

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_Zml7QVectorf(<2 x float>, float noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9QParticle13GetIsInternalEv(ptr noundef nonnull align 8 dereferenceable(290)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN6QWorld10GetGravityEv(ptr noundef nonnull align 8 dereferenceable(272)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN9QParticle8GetForceEv(ptr noundef nonnull align 8 dereferenceable(290)) #1 align 2

declare noundef ptr @_ZN9QParticle8SetForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290), <2 x float>) #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPP5QMeshSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5QMesh31GetPolygonForCollisionsDisabledEv(ptr noundef nonnull align 8 dereferenceable(256)) #4 align 2

declare void @_ZN5QMesh30ApplyAngleConstraintsToPolygonEv(ptr noundef nonnull align 8 dereferenceable(256)) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9QSoftBody13PreserveAreasEv(ptr noundef nonnull align 8 dereferenceable(360)) #2 align 2

declare void @_ZN5QBody10UpdateAABBEv(ptr noundef nonnull align 8 dereferenceable(293)) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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"="64" "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 #6 = { inlinehint 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 #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 #8 = { 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 #9 = { 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, !14, i64 76}
!10 = !{!"_ZTS5QBody", !11, i64 8, !11, i64 12, !6, i64 16, !12, i64 24, !12, i64 32, !11, i64 40, !11, i64 44, !13, i64 48, !14, i64 76, !15, i64 80, !15, i64 81, !15, i64 82, !11, i64 84, !16, i64 88, !15, i64 92, !11, i64 96, !15, i64 100, !15, i64 101, !12, i64 104, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !17, i64 132, !17, i64 136, !15, i64 140, !15, i64 141, !15, i64 142, !17, i64 144, !17, i64 148, !17, i64 152, !15, i64 156, !18, i64 160, !18, i64 192, !20, i64 224, !15, i64 256, !21, i64 264, !25, i64 288, !15, i64 292}
!11 = !{!"float", !7, i64 0}
!12 = !{!"_ZTS7QVector", !11, i64 0, !11, i64 4}
!13 = !{!"_ZTS5QAABB", !12, i64 0, !12, i64 8, !12, i64 16, !11, i64 24}
!14 = !{!"_ZTSN5QBody5ModesE", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN5QBody9BodyTypesE", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSSt8functionIFvP5QBodyEE", !19, i64 0, !6, i64 24}
!19 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!20 = !{!"_ZTSSt8functionIFbP5QBodyNS0_13CollisionInfoEEE", !19, i64 0, !6, i64 24}
!21 = !{!"_ZTSSt6vectorIP5QMeshSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIP5QMeshSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIP5QMeshSaIS1_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIP5QMeshSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSN5QBody16SimulationModelsE", !7, i64 0}
!26 = !{!10, !15, i64 142}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!11, !11, i64 0}
!30 = !{!10, !15, i64 82}
!31 = !{!10, !11, i64 84}
!32 = !{!10, !6, i64 16}
!33 = !{!17, !17, i64 0}
!34 = !{!10, !11, i64 96}
!35 = !{i64 0, i64 4, !29, i64 4, i64 4, !29}
!36 = !{!10, !15, i64 100}
!37 = !{!10, !11, i64 120}
!38 = !{!39, !15, i64 288}
!39 = !{!"_ZTS9QParticle", !11, i64 0, !12, i64 4, !12, i64 12, !12, i64 20, !11, i64 28, !6, i64 32, !15, i64 40, !12, i64 44, !40, i64 56, !15, i64 80, !15, i64 81, !13, i64 84, !15, i64 112, !44, i64 120, !49, i64 176, !49, i64 232, !15, i64 288, !15, i64 289}
!40 = !{!"_ZTSSt6vectorI7QVectorSaIS0_EE", !41, i64 0}
!41 = !{!"_ZTSSt12_Vector_baseI7QVectorSaIS0_EE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE12_Vector_implE", !43, i64 0}
!43 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!44 = !{!"_ZTSSt13unordered_setIP9QParticleSt4hashIS1_ESt8equal_toIS1_ESaIS1_EE", !45, i64 0}
!45 = !{!"_ZTSSt10_HashtableIP9QParticleS1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE", !6, i64 0, !46, i64 8, !47, i64 16, !46, i64 24, !48, i64 32, !6, i64 48}
!46 = !{!"long", !7, i64 0}
!47 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!48 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !11, i64 0, !46, i64 8}
!49 = !{!"_ZTSSt13unordered_setIP5QBodySt4hashIS1_ESt8equal_toIS1_ESaIS1_EE", !50, i64 0}
!50 = !{!"_ZTSSt10_HashtableIP5QBodyS1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE", !6, i64 0, !46, i64 8, !47, i64 16, !46, i64 24, !48, i64 32, !6, i64 48}
!51 = !{!52, !15, i64 329}
!52 = !{!"_ZTS9QSoftBody", !10, i64 0, !11, i64 296, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !11, i64 316, !15, i64 320, !11, i64 324, !15, i64 328, !15, i64 329, !15, i64 330, !11, i64 332, !15, i64 336, !11, i64 340, !15, i64 344, !15, i64 345, !12, i64 348, !11, i64 356}
!53 = !{!10, !15, i64 101}
!54 = distinct !{!54, !55}
!55 = !{!"llvm.loop.mustprogress"}
!56 = distinct !{!56, !55}
!57 = !{!52, !11, i64 300}


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

%struct.QVector = type { float, float }
%"class.__gnu_cxx::__normal_iterator.109" = 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 <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290)) 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 uwtable
declare dso_local <2 x float> @_Zmi7QVectorS_(<2 x float>, <2 x float>) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZN7QVector4ZeroEv() local_unnamed_addr #2 align 2

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

declare noundef i32 @_ZN5QMesh16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #4

declare noundef ptr @_ZN5QMesh13GetParticleAtEi(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9QParticle10GetEnabledEv(ptr noundef nonnull align 8 dereferenceable(290)) local_unnamed_addr #3 align 2

declare noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290), <2 x float>) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9QSoftBody6UpdateEv(ptr noundef nonnull align 8 dereferenceable(360) %0) unnamed_addr #2 align 2 {
  %2 = alloca %struct.QVector, align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.109", align 8
  tail call void @_ZN5QBody6UpdateEv(ptr noundef nonnull align 8 dereferenceable(293) %0)
  %5 = getelementptr inbounds i8, ptr %0, i64 76
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %107, label %8

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 142
  %10 = load i8, ptr %9, align 2, !tbaa !25, !range !26, !noundef !27
  %11 = trunc nuw i8 %10 to i1
  br i1 %11, label %107, label %12

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %0, i64 82
  %14 = load i8, ptr %13, align 2, !tbaa !28, !range !26, !noundef !27
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %16, label %19

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 84
  %18 = load float, ptr %17, align 4, !tbaa !29
  br label %24

19:                                               ; preds = %12
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  %21 = load ptr, ptr %20, align 8, !tbaa !30
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %24, label %22

22:                                               ; preds = %19
  %23 = tail call noundef float @_ZN6QWorld12GetTimeScaleEv(ptr noundef nonnull align 8 dereferenceable(272) %21)
  br label %24

24:                                               ; preds = %19, %22, %16
  %.0 = phi float [ %18, %16 ], [ %23, %22 ], [ 1.000000e+00, %19 ]
  %25 = getelementptr inbounds i8, ptr %0, i64 264
  %26 = tail call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  %.not54 = icmp eq i64 %26, 0
  br i1 %.not54, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %24
  %27 = getelementptr inbounds i8, ptr %0, i64 96
  %28 = getelementptr inbounds i8, ptr %0, i64 100
  %29 = getelementptr inbounds i8, ptr %0, i64 120
  %30 = getelementptr inbounds i8, ptr %0, i64 329
  %31 = getelementptr inbounds i8, ptr %0, i64 101
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  %33 = getelementptr inbounds i8, ptr %0, i64 104
  br label %37

._crit_edge50:                                    ; preds = %._crit_edge, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %34 = call ptr @_ZNSt6vectorIP5QMeshSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  store ptr %34, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %35 = call ptr @_ZNSt6vectorIP5QMeshSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  store ptr %35, ptr %4, align 8
  %36 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5QMeshSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %36, label %.lr.ph52, label %._crit_edge53

37:                                               ; preds = %.lr.ph49, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.lr.ph49 ], [ %indvars.iv.next, %._crit_edge ]
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP5QMeshSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %indvars.iv) #8
  %39 = load ptr, ptr %38, align 8, !tbaa !31
  %40 = call noundef i32 @_ZN5QMesh16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(256) %39)
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %91, %37
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = call noundef i64 @_ZNKSt6vectorIP5QMeshSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  %43 = icmp ugt i64 %42, %indvars.iv.next
  br i1 %43, label %37, label %._crit_edge50, !llvm.loop !32

.lr.ph:                                           ; preds = %37, %91
  %.04246 = phi i32 [ %92, %91 ], [ 0, %37 ]
  %44 = call noundef ptr @_ZN5QMesh13GetParticleAtEi(ptr noundef nonnull align 8 dereferenceable(256) %39, i32 noundef %.04246)
  %45 = call noundef zeroext i1 @_ZN9QParticle10GetEnabledEv(ptr noundef nonnull align 8 dereferenceable(290) %44)
  br i1 %45, label %46, label %91

46:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %47 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %44)
  %48 = call <2 x float> @_ZN9QParticle25GetPreviousGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %44)
  %49 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %47, <2 x float> %48)
  store <2 x float> %49, ptr %2, align 8
  %50 = load float, ptr %27, align 8, !tbaa !34
  %51 = fcmp ogt float %50, 0.000000e+00
  br i1 %51, label %52, label %59

52:                                               ; preds = %46
  %53 = call noundef float @_ZNK7QVector6LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  %54 = load float, ptr %27, align 8, !tbaa !34
  %55 = fcmp ogt float %53, %54
  br i1 %55, label %56, label %59

56:                                               ; preds = %52
  %57 = call <2 x float> @_ZNK7QVector10NormalizedEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  %58 = call <2 x float> @_Zmlf7QVector(float noundef %54, <2 x float> %57)
  store <2 x float> %58, ptr %2, align 8
  br label %59

59:                                               ; preds = %56, %52, %46
  %60 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %44)
  %61 = call noundef ptr @_ZN9QParticle25SetPreviousGlobalPositionE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %44, <2 x float> %60)
  %62 = load i8, ptr %28, align 4, !tbaa !35, !range !26, !noundef !27
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %64, label %86

64:                                               ; preds = %59
  %.sroa.011.0.copyload = load <2 x float>, ptr %2, align 8
  %65 = load float, ptr %29, align 8, !tbaa !36
  %66 = call <2 x float> @_Zml7QVectorf(<2 x float> %.sroa.011.0.copyload, float noundef %65)
  %67 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %.sroa.011.0.copyload, <2 x float> %66)
  %68 = call noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %44, <2 x float> %67)
  %69 = getelementptr inbounds i8, ptr %44, i64 288
  %70 = load i8, ptr %69, align 8, !tbaa !37, !range !26, !noundef !27
  %71 = icmp eq i8 %70, 0
  br i1 %71, label %72, label %86

72:                                               ; preds = %64
  %73 = call noundef zeroext i1 @_ZN9QParticle13GetIsInternalEv(ptr noundef nonnull align 8 dereferenceable(290) %44)
  br i1 %73, label %74, label %77

74:                                               ; preds = %72
  %75 = load i8, ptr %30, align 1, !tbaa !50, !range !26, !noundef !27
  %76 = trunc nuw i8 %75 to i1
  br i1 %76, label %86, label %77

77:                                               ; preds = %74, %72
  %78 = load i8, ptr %31, align 1, !tbaa !52, !range !26, !noundef !27
  %79 = trunc nuw i8 %78 to i1
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  %.sroa.07.0.copyload = load <2 x float>, ptr %33, align 8
  br label %.sink.split

81:                                               ; preds = %77
  %82 = load ptr, ptr %32, align 8, !tbaa !30
  %83 = call <2 x float> @_ZN6QWorld10GetGravityEv(ptr noundef nonnull align 8 dereferenceable(272) %82)
  br label %.sink.split

.sink.split:                                      ; preds = %81, %80
  %.sroa.07.0.copyload.sink = phi <2 x float> [ %.sroa.07.0.copyload, %80 ], [ %83, %81 ]
  %84 = call <2 x float> @_Zml7QVectorf(<2 x float> %.sroa.07.0.copyload.sink, float noundef %.0)
  %85 = call noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %44, <2 x float> %84)
  br label %86

86:                                               ; preds = %.sink.split, %64, %74, %59
  %87 = call <2 x float> @_ZN9QParticle8GetForceEv(ptr noundef nonnull align 8 dereferenceable(290) %44)
  %88 = call noundef ptr @_ZN9QParticle10ApplyForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %44, <2 x float> %87)
  %89 = call <2 x float> @_ZN7QVector4ZeroEv()
  %90 = call noundef ptr @_ZN9QParticle8SetForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290) %44, <2 x float> %89)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  br label %91

91:                                               ; preds = %.lr.ph, %86
  %92 = add nuw nsw i32 %.04246, 1
  %93 = call noundef i32 @_ZN5QMesh16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(256) %39)
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %.lr.ph, label %._crit_edge, !llvm.loop !53

._crit_edge53:                                    ; preds = %102, %._crit_edge50
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %95 = getelementptr inbounds i8, ptr %0, i64 300
  %96 = load float, ptr %95, align 4, !tbaa !54
  %97 = fcmp une float %96, 0.000000e+00
  br i1 %97, label %105, label %106

.lr.ph52:                                         ; preds = %._crit_edge50, %102
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP5QMeshSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %99 = load ptr, ptr %98, align 8, !tbaa !31
  %100 = call noundef zeroext i1 @_ZN5QMesh31GetPolygonForCollisionsDisabledEv(ptr noundef nonnull align 8 dereferenceable(256) %99)
  br i1 %100, label %102, label %101

101:                                              ; preds = %.lr.ph52
  call void @_ZN5QMesh30ApplyAngleConstraintsToPolygonEv(ptr noundef nonnull align 8 dereferenceable(256) %99)
  br label %102

102:                                              ; preds = %101, %.lr.ph52
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP5QMeshSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %104 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP5QMeshSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %104, label %.lr.ph52, label %._crit_edge53

105:                                              ; preds = %._crit_edge53
  call void @_ZN9QSoftBody13PreserveAreasEv(ptr noundef nonnull align 8 dereferenceable(360) %0)
  br label %106

106:                                              ; preds = %105, %._crit_edge53
  call void @_ZN5QBody10UpdateAABBEv(ptr noundef nonnull align 8 dereferenceable(293) %0)
  br label %107

107:                                              ; preds = %8, %1, %106
  ret void
}

declare void @_ZN5QBody6UpdateEv(ptr noundef nonnull align 8 dereferenceable(293)) unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN6QWorld12GetTimeScaleEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN9QParticle25GetPreviousGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZNK7QVector6LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_Zmlf7QVector(float noundef, <2 x float>) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZNK7QVector10NormalizedEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6 align 2

declare noundef ptr @_ZN9QParticle25SetPreviousGlobalPositionE7QVector(ptr noundef nonnull align 8 dereferenceable(290), <2 x float>) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_Zml7QVectorf(<2 x float>, float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9QParticle13GetIsInternalEv(ptr noundef nonnull align 8 dereferenceable(290)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN6QWorld10GetGravityEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN9QParticle8GetForceEv(ptr noundef nonnull align 8 dereferenceable(290)) local_unnamed_addr #1 align 2

declare noundef ptr @_ZN9QParticle8SetForceE7QVector(ptr noundef nonnull align 8 dereferenceable(290), <2 x float>) local_unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPP5QMeshSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #7

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5QMesh31GetPolygonForCollisionsDisabledEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #3 align 2

declare void @_ZN5QMesh30ApplyAngleConstraintsToPolygonEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9QSoftBody13PreserveAreasEv(ptr noundef nonnull align 8 dereferenceable(360)) local_unnamed_addr #2 align 2

declare void @_ZN5QBody10UpdateAABBEv(ptr noundef nonnull align 8 dereferenceable(293)) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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"="64" "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 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 = { "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 = { inlinehint 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 #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 #7 = { 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 #8 = { 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, !13, i64 76}
!6 = !{!"_ZTS5QBody", !7, i64 8, !7, i64 12, !10, i64 16, !11, i64 24, !11, i64 32, !7, i64 40, !7, i64 44, !12, i64 48, !13, i64 76, !14, i64 80, !14, i64 81, !14, i64 82, !7, i64 84, !15, i64 88, !14, i64 92, !7, i64 96, !14, i64 100, !14, i64 101, !11, i64 104, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !16, i64 132, !16, i64 136, !14, i64 140, !14, i64 141, !14, i64 142, !16, i64 144, !16, i64 148, !16, i64 152, !14, i64 156, !17, i64 160, !17, i64 192, !19, i64 224, !14, i64 256, !20, i64 264, !24, i64 288, !14, i64 292}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTS7QVector", !7, i64 0, !7, i64 4}
!12 = !{!"_ZTS5QAABB", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24}
!13 = !{!"_ZTSN5QBody5ModesE", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!"_ZTSN5QBody9BodyTypesE", !8, i64 0}
!16 = !{!"int", !8, i64 0}
!17 = !{!"_ZTSSt8functionIFvP5QBodyEE", !18, i64 0, !10, i64 24}
!18 = !{!"_ZTSSt14_Function_base", !8, i64 0, !10, i64 16}
!19 = !{!"_ZTSSt8functionIFbP5QBodyNS0_13CollisionInfoEEE", !18, i64 0, !10, i64 24}
!20 = !{!"_ZTSSt6vectorIP5QMeshSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIP5QMeshSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP5QMeshSaIS1_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIP5QMeshSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!24 = !{!"_ZTSN5QBody16SimulationModelsE", !8, i64 0}
!25 = !{!6, !14, i64 142}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!6, !14, i64 82}
!29 = !{!6, !7, i64 84}
!30 = !{!6, !10, i64 16}
!31 = !{!10, !10, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!6, !7, i64 96}
!35 = !{!6, !14, i64 100}
!36 = !{!6, !7, i64 120}
!37 = !{!38, !14, i64 288}
!38 = !{!"_ZTS9QParticle", !7, i64 0, !11, i64 4, !11, i64 12, !11, i64 20, !7, i64 28, !10, i64 32, !14, i64 40, !11, i64 44, !39, i64 56, !14, i64 80, !14, i64 81, !12, i64 84, !14, i64 112, !43, i64 120, !48, i64 176, !48, i64 232, !14, i64 288, !14, i64 289}
!39 = !{!"_ZTSSt6vectorI7QVectorSaIS0_EE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseI7QVectorSaIS0_EE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseI7QVectorSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!43 = !{!"_ZTSSt13unordered_setIP9QParticleSt4hashIS1_ESt8equal_toIS1_ESaIS1_EE", !44, i64 0}
!44 = !{!"_ZTSSt10_HashtableIP9QParticleS1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE", !10, i64 0, !45, i64 8, !46, i64 16, !45, i64 24, !47, i64 32, !10, i64 48}
!45 = !{!"long", !8, i64 0}
!46 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !10, i64 0}
!47 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !7, i64 0, !45, i64 8}
!48 = !{!"_ZTSSt13unordered_setIP5QBodySt4hashIS1_ESt8equal_toIS1_ESaIS1_EE", !49, i64 0}
!49 = !{!"_ZTSSt10_HashtableIP5QBodyS1_SaIS1_ENSt8__detail9_IdentityESt8equal_toIS1_ESt4hashIS1_ENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb1EEEE", !10, i64 0, !45, i64 8, !46, i64 16, !45, i64 24, !47, i64 32, !10, i64 48}
!50 = !{!51, !14, i64 329}
!51 = !{!"_ZTS9QSoftBody", !6, i64 0, !7, i64 296, !7, i64 300, !7, i64 304, !7, i64 308, !7, i64 312, !7, i64 316, !14, i64 320, !7, i64 324, !14, i64 328, !14, i64 329, !14, i64 330, !7, i64 332, !14, i64 336, !7, i64 340, !14, i64 344, !14, i64 345, !11, i64 348, !7, i64 356}
!52 = !{!6, !14, i64 101}
!53 = distinct !{!53, !33}
!54 = !{!51, !7, i64 300}


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