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

; 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.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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::initializer_list" = type { ptr, i64 }
%"class.std::allocator.2" = type { i8 }
%"struct.QObjectPool<QCollision::Contact>::Node" = type { ptr, i32, i32 }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8), <2 x float>) #5 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: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZNK7QVector6LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN11QObjectPoolIN10QCollision7ContactEE6CreateEv(ptr noundef nonnull align 8 dereferenceable(40)) #9 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP9QParticleSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #9 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10QCollision20ClipContactParticlesEPP9QParticleS2_RSt6vectorIPNS_7ContactESaIS5_EE(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.QVector, align 4
  %8 = alloca %struct.QVector, align 4
  %9 = alloca %struct.QVector, align 4
  %10 = alloca float, align 4
  %11 = alloca %struct.QVector, align 4
  %12 = alloca %struct.QVector, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %struct.QVector, align 4
  %16 = alloca %struct.QVector, align 4
  %17 = alloca %struct.QVector, align 4
  %18 = alloca float, align 4
  %19 = alloca %struct.QVector, align 4
  %20 = alloca float, align 4
  %21 = alloca %struct.QVector, align 4
  %22 = alloca ptr, align 8
  %23 = alloca %struct.QVector, align 4
  %24 = alloca %struct.QVector, align 4
  %25 = alloca %"class.std::vector.0", align 8
  %26 = alloca %"class.std::initializer_list", align 8
  %27 = alloca [2 x ptr], align 8
  %28 = alloca %"class.std::allocator.2", align 1
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds ptr, ptr %31, i64 1
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %33)
  store <2 x float> %34, ptr %8, align 4
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds ptr, ptr %35, i64 0
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %37)
  store <2 x float> %38, ptr %9, align 4
  %39 = load <2 x float>, ptr %8, align 4
  %40 = load <2 x float>, ptr %9, align 4
  %41 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %39, <2 x float> %40)
  store <2 x float> %41, ptr %7, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  %42 = call noundef float @_ZNK7QVector6LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  store float %42, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  %43 = call <2 x float> @_ZNK7QVector10NormalizedEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %43, ptr %11, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  %44 = call <2 x float> @_ZNK7QVector13PerpendicularEv(ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %44, ptr %12, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %117, %3
  %46 = load i32, ptr %13, align 4, !tbaa !11
  %47 = icmp ult i32 %46, 2
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %120

49:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load i32, ptr %13, align 4, !tbaa !11
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds ptr, ptr %50, i64 %52
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  store ptr %54, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %55 = load ptr, ptr %14, align 8, !tbaa !5
  %56 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %55)
  store <2 x float> %56, ptr %16, align 4
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds ptr, ptr %57, i64 0
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %59)
  store <2 x float> %60, ptr %17, align 4
  %61 = load <2 x float>, ptr %16, align 4
  %62 = load <2 x float>, ptr %17, align 4
  %63 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %61, <2 x float> %62)
  store <2 x float> %63, ptr %15, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !13
  %64 = load <2 x float>, ptr %19, align 4
  %65 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %15, <2 x float> %64)
  store float %65, ptr %18, align 4, !tbaa !9
  %66 = load float, ptr %18, align 4, !tbaa !9
  %67 = fcmp ole float %66, 0.000000e+00
  br i1 %67, label %68, label %116

68:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !13
  %69 = load <2 x float>, ptr %21, align 4
  %70 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %15, <2 x float> %69)
  store float %70, ptr %20, align 4, !tbaa !9
  %71 = load float, ptr %20, align 4, !tbaa !9
  %72 = fcmp oge float %71, 0.000000e+00
  br i1 %72, label %73, label %115

73:                                               ; preds = %68
  %74 = load float, ptr %20, align 4, !tbaa !9
  %75 = load float, ptr %10, align 4, !tbaa !9
  %76 = fcmp ole float %74, %75
  br i1 %76, label %77, label %115

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %78 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN10QCollision14GetContactPoolEv()
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN11QObjectPoolIN10QCollision7ContactEE6CreateEv(ptr noundef nonnull align 8 dereferenceable(40) %78)
  %80 = getelementptr inbounds %"struct.QObjectPool<QCollision::Contact>::Node", ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !14
  store ptr %81, ptr %22, align 8, !tbaa !5
  %82 = load ptr, ptr %22, align 8, !tbaa !5
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %84)
  store <2 x float> %85, ptr %23, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !13
  %86 = load float, ptr %18, align 4, !tbaa !9
  %87 = call noundef float @_ZSt3absf(float noundef %86)
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #10
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds ptr, ptr %88, i64 0
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  store ptr %90, ptr %27, align 8, !tbaa !5
  %91 = getelementptr inbounds ptr, ptr %27, i64 1
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds ptr, ptr %92, i64 1
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  store ptr %94, ptr %91, align 8, !tbaa !5
  %95 = getelementptr inbounds %"class.std::initializer_list", ptr %26, i32 0, i32 0
  store ptr %27, ptr %95, align 8, !tbaa !16
  %96 = getelementptr inbounds %"class.std::initializer_list", ptr %26, i32 0, i32 1
  store i64 2, ptr %96, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #10
  call void @_ZNSaIP9QParticleEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #10
  %97 = getelementptr inbounds { ptr, i64 }, ptr %26, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8
  %99 = getelementptr inbounds { ptr, i64 }, ptr %26, i32 0, i32 1
  %100 = load i64, ptr %99, align 8
  invoke void @_ZNSt6vectorIP9QParticleSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr %98, i64 %100, ptr noundef nonnull align 1 dereferenceable(1) %28)
          to label %101 unwind label %106

101:                                              ; preds = %77
  %102 = load <2 x float>, ptr %23, align 4
  %103 = load <2 x float>, ptr %24, align 4
  invoke void @_ZN10QCollision7Contact9ConfigureEP9QParticle7QVectorS3_fSt6vectorIS2_SaIS2_EE(ptr noundef nonnull align 8 dereferenceable(57) %82, ptr noundef %83, <2 x float> %102, <2 x float> %103, float noundef %87, ptr noundef %25)
          to label %104 unwind label %110

104:                                              ; preds = %101
  call void @_ZNSt6vectorIP9QParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #10
  call void @_ZNSt15__new_allocatorIP9QParticleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #10
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNSt6vectorIPN10QCollision7ContactESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 8 dereferenceable(8) %22)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %115

106:                                              ; preds = %77
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %29, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %30, align 4
  br label %114

110:                                              ; preds = %101
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %29, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %30, align 4
  call void @_ZNSt6vectorIP9QParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #10
  br label %114

114:                                              ; preds = %110, %106
  call void @_ZNSt15__new_allocatorIP9QParticleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  br label %121

115:                                              ; preds = %104, %73, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  br label %116

116:                                              ; preds = %115, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %13, align 4, !tbaa !11
  %119 = add i32 %118, 1
  store i32 %119, ptr %13, align 4, !tbaa !11
  br label %45, !llvm.loop !20

120:                                              ; preds = %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  ret void

121:                                              ; preds = %114
  %122 = load ptr, ptr %29, align 8
  %123 = load i32, ptr %30, align 4
  %124 = insertvalue { ptr, i32 } poison, ptr %122, 0
  %125 = insertvalue { ptr, i32 } %124, i32 %123, 1
  resume { ptr, i32 } %125
}

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { inlinehint 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 #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 = { 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 = { 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 #10 = { 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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSN11QObjectPoolIN10QCollision7ContactEE4NodeE", !6, i64 0, !12, i64 8, !12, i64 12}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSSt16initializer_listIP9QParticleE", !6, i64 0, !18, i64 8}
!18 = !{!"long", !7, i64 0}
!19 = !{!17, !18, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"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 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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::allocator.2" = type { i8 }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8), <2 x float>) local_unnamed_addr #4 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: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZNK7QVector6LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN11QObjectPoolIN10QCollision7ContactEE6CreateEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #8 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10QCollision7Contact9ConfigureEP9QParticle7QVectorS3_fSt6vectorIS2_SaIS2_EE(ptr noundef nonnull align 8 dereferenceable(57), ptr noundef, <2 x float>, <2 x float>, float noundef, ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIP9QParticleEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP9QParticleSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #8 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10QCollision20ClipContactParticlesEPP9QParticleS2_RSt6vectorIPNS_7ContactESaIS5_EE(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.QVector, align 8
  %5 = alloca %struct.QVector, align 8
  %6 = alloca %struct.QVector, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::vector.0", align 8
  %9 = alloca [2 x ptr], align 16
  %10 = alloca %"class.std::allocator.2", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %12)
  %14 = load ptr, ptr %0, align 8, !tbaa !5
  %15 = tail call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %14)
  %16 = tail call <2 x float> @_Zmi7QVectorS_(<2 x float> %13, <2 x float> %15)
  store <2 x float> %16, ptr %4, align 8
  %17 = call noundef float @_ZNK7QVector6LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %18 = call <2 x float> @_ZNK7QVector10NormalizedEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  store <2 x float> %18, ptr %5, align 8
  %19 = call <2 x float> @_ZNK7QVector13PerpendicularEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  %20 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %21 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %20)
  %22 = load ptr, ptr %0, align 8, !tbaa !5
  %23 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %22)
  %24 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %21, <2 x float> %23)
  store <2 x float> %24, ptr %6, align 8
  %25 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %6, <2 x float> %19)
  %26 = fcmp ugt float %25, 0.000000e+00
  br i1 %26, label %45, label %27

27:                                               ; preds = %3
  %.sroa.03.0.copyload = load <2 x float>, ptr %5, align 8
  %28 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %6, <2 x float> %.sroa.03.0.copyload)
  %29 = fcmp ult float %28, 0.000000e+00
  %30 = fcmp ugt float %28, %17
  %or.cond = or i1 %29, %30
  br i1 %or.cond, label %45, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %32 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN10QCollision14GetContactPoolEv()
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN11QObjectPoolIN10QCollision7ContactEE6CreateEv(ptr noundef nonnull align 8 dereferenceable(40) %32)
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  store ptr %34, ptr %7, align 8, !tbaa !5
  %35 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %20)
  %36 = call noundef float @_ZSt3absf(float noundef %25)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #9
  %37 = load <2 x ptr>, ptr %0, align 8, !tbaa !5
  store <2 x ptr> %37, ptr %9, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #9
  call void @_ZNSaIP9QParticleEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  invoke void @_ZNSt6vectorIP9QParticleSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr nonnull %9, i64 2, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %38 unwind label %40

38:                                               ; preds = %31
  invoke void @_ZN10QCollision7Contact9ConfigureEP9QParticle7QVectorS3_fSt6vectorIS2_SaIS2_EE(ptr noundef nonnull align 8 dereferenceable(57) %34, ptr noundef nonnull %20, <2 x float> %35, <2 x float> %19, float noundef %36, ptr noundef nonnull %8)
          to label %39 unwind label %42

39:                                               ; preds = %38
  call void @_ZNSt6vectorIP9QParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  call void @_ZNSt15__new_allocatorIP9QParticleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #9
  call void @_ZNSt6vectorIPN10QCollision7ContactESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  br label %45

40:                                               ; preds = %58, %31
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

42:                                               ; preds = %65, %38
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIP9QParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  br label %44

44:                                               ; preds = %42, %40
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ]
  call void @_ZNSt15__new_allocatorIP9QParticleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  resume { ptr, i32 } %.pn

45:                                               ; preds = %27, %39, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %46 = getelementptr inbounds i8, ptr %1, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %48 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %47)
  %49 = load ptr, ptr %0, align 8, !tbaa !5
  %50 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %49)
  %51 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %48, <2 x float> %50)
  store <2 x float> %51, ptr %6, align 8
  %52 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %6, <2 x float> %19)
  %53 = fcmp ugt float %52, 0.000000e+00
  br i1 %53, label %67, label %54

54:                                               ; preds = %45
  %.sroa.03.0.copyload.1 = load <2 x float>, ptr %5, align 8
  %55 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %6, <2 x float> %.sroa.03.0.copyload.1)
  %56 = fcmp ult float %55, 0.000000e+00
  %57 = fcmp ugt float %55, %17
  %or.cond.1 = or i1 %56, %57
  br i1 %or.cond.1, label %67, label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %59 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN10QCollision14GetContactPoolEv()
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN11QObjectPoolIN10QCollision7ContactEE6CreateEv(ptr noundef nonnull align 8 dereferenceable(40) %59)
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  store ptr %61, ptr %7, align 8, !tbaa !5
  %62 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %47)
  %63 = call noundef float @_ZSt3absf(float noundef %52)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #9
  %64 = load <2 x ptr>, ptr %0, align 8, !tbaa !5
  store <2 x ptr> %64, ptr %9, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #9
  call void @_ZNSaIP9QParticleEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  invoke void @_ZNSt6vectorIP9QParticleSaIS1_EEC2ESt16initializer_listIS1_ERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr nonnull %9, i64 2, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %65 unwind label %40

65:                                               ; preds = %58
  invoke void @_ZN10QCollision7Contact9ConfigureEP9QParticle7QVectorS3_fSt6vectorIS2_SaIS2_EE(ptr noundef nonnull align 8 dereferenceable(57) %61, ptr noundef nonnull %47, <2 x float> %62, <2 x float> %19, float noundef %63, ptr noundef nonnull %8)
          to label %66 unwind label %42

66:                                               ; preds = %65
  call void @_ZNSt6vectorIP9QParticleSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #9
  call void @_ZNSt15__new_allocatorIP9QParticleED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #9
  call void @_ZNSt6vectorIPN10QCollision7ContactESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  br label %67

67:                                               ; preds = %66, %54, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIP9QParticleED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #7 align 2

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 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 #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 = { 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 = { 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 #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, !6, i64 0}
!10 = !{!"_ZTSN11QObjectPoolIN10QCollision7ContactEE4NodeE", !6, i64 0, !11, i64 8, !11, i64 12}
!11 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass