; LLVM IR from erayzesen/QuarkPhysics :: QuarkPhysics (qmanifold)

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

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZN9QManifold19GetRelativeVelocityEP9QParticleSt6vectorIS1_SaIS1_EE7QVectorS5_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1, ptr noundef %2, <2 x float> %3, <2 x float> %4) #0 align 2 {
  %6 = alloca %struct.QVector, align 4
  %7 = alloca %struct.QVector, align 4
  %8 = alloca %struct.QVector, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %struct.QVector, align 4
  %15 = alloca %struct.QVector, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca %struct.QVector, align 4
  %19 = alloca %struct.QVector, align 4
  %20 = alloca %struct.QVector, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca %struct.QVector, align 4
  %24 = alloca %struct.QVector, align 4
  %25 = alloca %struct.QVector, align 4
  %26 = alloca float, align 4
  %27 = alloca %struct.QVector, align 4
  %28 = alloca %struct.QVector, align 4
  %29 = alloca %struct.QVector, align 4
  %30 = alloca %struct.QVector, align 4
  %31 = alloca %struct.QVector, align 4
  %32 = alloca %struct.QVector, align 4
  %33 = alloca %struct.QVector, align 4
  %34 = alloca %struct.QVector, align 4
  %35 = alloca %struct.QVector, align 4
  %36 = alloca %struct.QVector, align 4
  %37 = alloca %struct.QVector, align 4
  %38 = alloca %struct.QVector, align 4
  %39 = alloca %struct.QVector, align 4
  %40 = alloca %struct.QVector, align 4
  %41 = alloca %struct.QVector, align 4
  %42 = alloca %struct.QVector, align 4
  store <2 x float> %3, ptr %7, align 4
  store <2 x float> %4, ptr %8, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #6
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = call noundef ptr @_ZN9QParticle12GetOwnerMeshEv(ptr noundef nonnull align 8 dereferenceable(290) %45)
  %47 = call noundef ptr @_ZN5QMesh12GetOwnerBodyEv(ptr noundef nonnull align 8 dereferenceable(256) %46)
  store ptr %47, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = call noundef ptr @_ZN9QParticle12GetOwnerMeshEv(ptr noundef nonnull align 8 dereferenceable(290) %48)
  %50 = call noundef ptr @_ZN5QMesh12GetOwnerBodyEv(ptr noundef nonnull align 8 dereferenceable(256) %49)
  store ptr %50, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %51 = call <2 x float> @_ZN7QVector4ZeroEv()
  store <2 x float> %51, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %52 = call <2 x float> @_ZN7QVector4ZeroEv()
  store <2 x float> %52, ptr %15, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store float 0.000000e+00, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store float 0.000000e+00, ptr %17, align 4, !tbaa !9
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = call noundef i32 @_ZN5QBody18GetSimulationModelEv(ptr noundef nonnull align 8 dereferenceable(293) %53)
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %56, label %69

56:                                               ; preds = %5
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  %58 = call noundef float @_ZN5QBody11GetRotationEv(ptr noundef nonnull align 8 dereferenceable(293) %57)
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = call noundef float @_ZN5QBody19GetPreviousRotationEv(ptr noundef nonnull align 8 dereferenceable(293) %59)
  %61 = fsub float %58, %60
  store float %61, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = call <2 x float> @_ZN5QBody11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(293) %62)
  store <2 x float> %63, ptr %19, align 4
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = call <2 x float> @_ZN5QBody19GetPreviousPositionEv(ptr noundef nonnull align 8 dereferenceable(293) %64)
  store <2 x float> %65, ptr %20, align 4
  %66 = load <2 x float>, ptr %19, align 4
  %67 = load <2 x float>, ptr %20, align 4
  %68 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %66, <2 x float> %67)
  store <2 x float> %68, ptr %18, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %18, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %96

69:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !12
  br label %70

70:                                               ; preds = %89, %69
  %71 = load i32, ptr %21, align 4, !tbaa !12
  %72 = sext i32 %71 to i64
  %73 = call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %74 = icmp ult i64 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %92

76:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %77 = load i32, ptr %21, align 4, !tbaa !12
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %78) #6
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  store ptr %80, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %81 = load ptr, ptr %22, align 8, !tbaa !5
  %82 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %81)
  store <2 x float> %82, ptr %24, align 4
  %83 = load ptr, ptr %22, align 8, !tbaa !5
  %84 = call <2 x float> @_ZN9QParticle25GetPreviousGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %83)
  store <2 x float> %84, ptr %25, align 4
  %85 = load <2 x float>, ptr %24, align 4
  %86 = load <2 x float>, ptr %25, align 4
  %87 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %85, <2 x float> %86)
  store <2 x float> %87, ptr %23, align 4
  %88 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7QVectorpLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %23)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %89

89:                                               ; preds = %76
  %90 = load i32, ptr %21, align 4, !tbaa !12
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %21, align 4, !tbaa !12
  br label %70, !llvm.loop !14

92:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %93 = call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %94 = uitofp i64 %93 to float
  store float %94, ptr %26, align 4, !tbaa !9
  %95 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7QVectordVERKf(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(4) %26)
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %96

96:                                               ; preds = %92, %56
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = call noundef i32 @_ZN5QBody18GetSimulationModelEv(ptr noundef nonnull align 8 dereferenceable(293) %97)
  %99 = icmp eq i32 %98, 1
  br i1 %99, label %100, label %113

100:                                              ; preds = %96
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = call noundef float @_ZN5QBody11GetRotationEv(ptr noundef nonnull align 8 dereferenceable(293) %101)
  %103 = load ptr, ptr %13, align 8, !tbaa !5
  %104 = call noundef float @_ZN5QBody19GetPreviousRotationEv(ptr noundef nonnull align 8 dereferenceable(293) %103)
  %105 = fsub float %102, %104
  store float %105, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = call <2 x float> @_ZN5QBody11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(293) %106)
  store <2 x float> %107, ptr %28, align 4
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = call <2 x float> @_ZN5QBody19GetPreviousPositionEv(ptr noundef nonnull align 8 dereferenceable(293) %108)
  store <2 x float> %109, ptr %29, align 4
  %110 = load <2 x float>, ptr %28, align 4
  %111 = load <2 x float>, ptr %29, align 4
  %112 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %110, <2 x float> %111)
  store <2 x float> %112, ptr %27, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %27, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %121

113:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %114)
  store <2 x float> %115, ptr %31, align 4
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = call <2 x float> @_ZN9QParticle25GetPreviousGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %116)
  store <2 x float> %117, ptr %32, align 4
  %118 = load <2 x float>, ptr %31, align 4
  %119 = load <2 x float>, ptr %32, align 4
  %120 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %118, <2 x float> %119)
  store <2 x float> %120, ptr %30, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %30, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %121

121:                                              ; preds = %113, %100
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %122 = load float, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %123 = call <2 x float> @_ZNK7QVector13PerpendicularEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %123, ptr %37, align 4
  %124 = call <2 x float> @_ZNK7QVectorngEv(ptr noundef nonnull align 4 dereferenceable(8) %37)
  store <2 x float> %124, ptr %36, align 4
  %125 = load <2 x float>, ptr %36, align 4
  %126 = call <2 x float> @_Zmlf7QVector(float noundef %122, <2 x float> %125)
  store <2 x float> %126, ptr %35, align 4
  %127 = load <2 x float>, ptr %34, align 4
  %128 = load <2 x float>, ptr %35, align 4
  %129 = call <2 x float> @_Zpl7QVectorS_(<2 x float> %127, <2 x float> %128)
  store <2 x float> %129, ptr %33, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !11
  %130 = load float, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  %131 = call <2 x float> @_ZNK7QVector13PerpendicularEv(ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %131, ptr %42, align 4
  %132 = call <2 x float> @_ZNK7QVectorngEv(ptr noundef nonnull align 4 dereferenceable(8) %42)
  store <2 x float> %132, ptr %41, align 4
  %133 = load <2 x float>, ptr %41, align 4
  %134 = call <2 x float> @_Zmlf7QVector(float noundef %130, <2 x float> %133)
  store <2 x float> %134, ptr %40, align 4
  %135 = load <2 x float>, ptr %39, align 4
  %136 = load <2 x float>, ptr %40, align 4
  %137 = call <2 x float> @_Zpl7QVectorS_(<2 x float> %135, <2 x float> %136)
  store <2 x float> %137, ptr %38, align 4
  %138 = load <2 x float>, ptr %33, align 4
  %139 = load <2 x float>, ptr %38, align 4
  %140 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %138, <2 x float> %139)
  store <2 x float> %140, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %141 = load <2 x float>, ptr %6, align 4
  ret <2 x float> %141
}

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN5QBody19GetPreviousPositionEv(ptr noundef nonnull align 8 dereferenceable(293)) #3 align 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) #4

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

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

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

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

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

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

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

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

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

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

%struct.QVector = type { float, float }

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZN9QManifold19GetRelativeVelocityEP9QParticleSt6vectorIS1_SaIS1_EE7QVectorS5_(ptr nocapture noundef nonnull readnone align 8 dereferenceable(64) %0, ptr noundef %1, ptr noundef nonnull %2, <2 x float> %3, <2 x float> %4) local_unnamed_addr #0 align 2 {
  %6 = alloca %struct.QVector, align 8
  %7 = alloca %struct.QVector, align 8
  %8 = alloca %struct.QVector, align 8
  %9 = alloca %struct.QVector, align 8
  %10 = alloca float, align 4
  %11 = alloca %struct.QVector, align 8
  %12 = alloca %struct.QVector, align 8
  store <2 x float> %3, ptr %6, align 8
  store <2 x float> %4, ptr %7, align 8
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #5
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %15 = tail call noundef ptr @_ZN9QParticle12GetOwnerMeshEv(ptr noundef nonnull align 8 dereferenceable(290) %14)
  %16 = tail call noundef ptr @_ZN5QMesh12GetOwnerBodyEv(ptr noundef nonnull align 8 dereferenceable(256) %15)
  %17 = tail call noundef ptr @_ZN9QParticle12GetOwnerMeshEv(ptr noundef nonnull align 8 dereferenceable(290) %1)
  %18 = tail call noundef ptr @_ZN5QMesh12GetOwnerBodyEv(ptr noundef nonnull align 8 dereferenceable(256) %17)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %19 = tail call <2 x float> @_ZN7QVector4ZeroEv()
  store <2 x float> %19, ptr %8, align 8
  %20 = tail call <2 x float> @_ZN7QVector4ZeroEv()
  %21 = tail call noundef i32 @_ZN5QBody18GetSimulationModelEv(ptr noundef nonnull align 8 dereferenceable(293) %16)
  %22 = icmp eq i32 %21, 1
  br i1 %22, label %24, label %.preheader

.preheader:                                       ; preds = %5
  %23 = tail call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %.not = icmp eq i64 %23, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

24:                                               ; preds = %5
  %25 = tail call noundef float @_ZN5QBody11GetRotationEv(ptr noundef nonnull align 8 dereferenceable(293) %16)
  %26 = tail call noundef float @_ZN5QBody19GetPreviousRotationEv(ptr noundef nonnull align 8 dereferenceable(293) %16)
  %27 = fsub float %25, %26
  %28 = tail call <2 x float> @_ZN5QBody11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(293) %16)
  %29 = tail call <2 x float> @_ZN5QBody19GetPreviousPositionEv(ptr noundef nonnull align 8 dereferenceable(293) %16)
  %30 = tail call <2 x float> @_Zmi7QVectorS_(<2 x float> %28, <2 x float> %29)
  store <2 x float> %30, ptr %8, align 8
  br label %42

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  %31 = call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %32 = uitofp i64 %31 to float
  store float %32, ptr %10, align 4, !tbaa !9
  %33 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7QVectordVERKf(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  br label %42

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #5
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %36 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %35)
  %37 = call <2 x float> @_ZN9QParticle25GetPreviousGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %35)
  %38 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %36, <2 x float> %37)
  store <2 x float> %38, ptr %9, align 8
  %39 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7QVectorpLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %41 = icmp ugt i64 %40, %indvars.iv.next
  br i1 %41, label %.lr.ph, label %._crit_edge, !llvm.loop !11

42:                                               ; preds = %._crit_edge, %24
  %.0 = phi float [ %27, %24 ], [ 0.000000e+00, %._crit_edge ]
  %43 = call noundef i32 @_ZN5QBody18GetSimulationModelEv(ptr noundef nonnull align 8 dereferenceable(293) %18)
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %52

45:                                               ; preds = %42
  %46 = call noundef float @_ZN5QBody11GetRotationEv(ptr noundef nonnull align 8 dereferenceable(293) %18)
  %47 = call noundef float @_ZN5QBody19GetPreviousRotationEv(ptr noundef nonnull align 8 dereferenceable(293) %18)
  %48 = fsub float %46, %47
  %49 = call <2 x float> @_ZN5QBody11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(293) %18)
  %50 = call <2 x float> @_ZN5QBody19GetPreviousPositionEv(ptr noundef nonnull align 8 dereferenceable(293) %18)
  %51 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %49, <2 x float> %50)
  br label %56

52:                                               ; preds = %42
  %53 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %1)
  %54 = call <2 x float> @_ZN9QParticle25GetPreviousGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %1)
  %55 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %53, <2 x float> %54)
  br label %56

56:                                               ; preds = %52, %45
  %.040 = phi float [ %48, %45 ], [ 0.000000e+00, %52 ]
  %.sroa.024.0 = phi <2 x float> [ %51, %45 ], [ %55, %52 ]
  %.sroa.06.0.copyload = load <2 x float>, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %57 = call <2 x float> @_ZNK7QVector13PerpendicularEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %57, ptr %11, align 8
  %58 = call <2 x float> @_ZNK7QVectorngEv(ptr noundef nonnull align 4 dereferenceable(8) %11)
  %59 = call <2 x float> @_Zmlf7QVector(float noundef %.0, <2 x float> %58)
  %60 = call <2 x float> @_Zpl7QVectorS_(<2 x float> %.sroa.06.0.copyload, <2 x float> %59)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %61 = call <2 x float> @_ZNK7QVector13PerpendicularEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %61, ptr %12, align 8
  %62 = call <2 x float> @_ZNK7QVectorngEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  %63 = call <2 x float> @_Zmlf7QVector(float noundef %.040, <2 x float> %62)
  %64 = call <2 x float> @_Zpl7QVectorS_(<2 x float> %.sroa.024.0, <2 x float> %63)
  %65 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %60, <2 x float> %64)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  ret <2 x float> %65
}

; Function Attrs: mustprogress 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 nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress 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 noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290)) 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 #3 align 2

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

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

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

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

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

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

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


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