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

@_ZN6QWorld14MAX_WORLD_SIZEE = external dso_local global float, align 4

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10QCollision16PointInPolygonWNE7QVectorSt6vectorIP9QParticleSaIS3_EE(<2 x float> %0, ptr noundef %1) #4 align 2 {
  %3 = alloca %struct.QVector, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %struct.QVector, align 4
  %6 = alloca %struct.QVector, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %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 float, align 4
  %22 = alloca %struct.QVector, align 4
  %23 = alloca %struct.QVector, align 4
  %24 = alloca float, align 4
  %25 = alloca %struct.QVector, align 4
  %26 = alloca %struct.QVector, align 4
  %27 = alloca %struct.QVector, align 4
  store <2 x float> %0, ptr %3, align 4
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %28 = load float, ptr @_ZN6QWorld14MAX_WORLD_SIZEE, align 4, !tbaa !9
  call void @_ZN7QVectorC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %28, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %29 = call <2 x float> @_ZN7QVector4DownEv()
  store <2 x float> %29, ptr %6, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %30 = call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  store i64 %30, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 0, ptr %9, align 8, !tbaa !13
  br label %31

31:                                               ; preds = %116, %2
  %32 = load i64, ptr %9, align 8, !tbaa !13
  %33 = load i64, ptr %8, align 8, !tbaa !13
  %34 = icmp ult i64 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %119

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %37 = load i64, ptr %9, align 8, !tbaa !13
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %37) #8
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %39)
  store <2 x float> %40, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @_ZN7QVectorC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %11)
  %41 = load i64, ptr %9, align 8, !tbaa !13
  %42 = add i64 %41, 1
  %43 = load i64, ptr %8, align 8, !tbaa !13
  %44 = icmp eq i64 %42, %43
  br i1 %44, label %45, label %49

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #8
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %47)
  store <2 x float> %48, ptr %12, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %55

49:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %50 = load i64, ptr %9, align 8, !tbaa !13
  %51 = add i64 %50, 1
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %51) #8
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %53)
  store <2 x float> %54, ptr %13, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %55

55:                                               ; preds = %49, %45
  %56 = getelementptr inbounds %struct.QVector, ptr %3, i32 0, i32 1
  %57 = load float, ptr %56, align 4, !tbaa !16
  %58 = getelementptr inbounds %struct.QVector, ptr %10, i32 0, i32 1
  %59 = load float, ptr %58, align 4, !tbaa !16
  %60 = fcmp ole float %57, %59
  %61 = zext i1 %60 to i32
  %62 = getelementptr inbounds %struct.QVector, ptr %3, i32 0, i32 1
  %63 = load float, ptr %62, align 4, !tbaa !16
  %64 = getelementptr inbounds %struct.QVector, ptr %11, i32 0, i32 1
  %65 = load float, ptr %64, align 4, !tbaa !16
  %66 = fcmp ole float %63, %65
  %67 = zext i1 %66 to i32
  %68 = icmp ne i32 %61, %67
  br i1 %68, label %69, label %115

69:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %10, i64 8, i1 false), !tbaa.struct !15
  %70 = load <2 x float>, ptr %15, align 4
  %71 = load <2 x float>, ptr %16, align 4
  %72 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %70, <2 x float> %71)
  store <2 x float> %72, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %73 = call <2 x float> @_ZNK7QVector13PerpendicularEv(ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %73, ptr %17, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %10, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %3, i64 8, i1 false), !tbaa.struct !15
  %74 = load <2 x float>, ptr %19, align 4
  %75 = load <2 x float>, ptr %20, align 4
  %76 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %74, <2 x float> %75)
  store <2 x float> %76, ptr %18, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !15
  %77 = load <2 x float>, ptr %22, align 4
  %78 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %18, <2 x float> %77)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !15
  %79 = load <2 x float>, ptr %23, align 4
  %80 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %5, <2 x float> %79)
  %81 = fdiv float %78, %80
  store float %81, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %82 = call <2 x float> @_ZNK7QVectorngEv(ptr noundef nonnull align 4 dereferenceable(8) %18)
  store <2 x float> %82, ptr %25, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !15
  %83 = load <2 x float>, ptr %26, align 4
  %84 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %25, <2 x float> %83)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !15
  %85 = load <2 x float>, ptr %27, align 4
  %86 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %14, <2 x float> %85)
  %87 = fdiv float %84, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  store float %87, ptr %24, align 4, !tbaa !9
  %88 = load float, ptr %21, align 4, !tbaa !9
  %89 = fpext float %88 to double
  %90 = fcmp oge double %89, 0.000000e+00
  br i1 %90, label %91, label %114

91:                                               ; preds = %69
  %92 = load float, ptr %21, align 4, !tbaa !9
  %93 = fpext float %92 to double
  %94 = fcmp ole double %93, 1.000000e+00
  br i1 %94, label %95, label %114

95:                                               ; preds = %91
  %96 = load float, ptr %24, align 4, !tbaa !9
  %97 = fpext float %96 to double
  %98 = fcmp oge double %97, 0.000000e+00
  br i1 %98, label %99, label %114

99:                                               ; preds = %95
  %100 = load float, ptr %21, align 4, !tbaa !9
  %101 = fpext float %100 to double
  %102 = fcmp ole double %101, 1.000000e+00
  br i1 %102, label %103, label %114

103:                                              ; preds = %99
  %104 = getelementptr inbounds %struct.QVector, ptr %14, i32 0, i32 1
  %105 = load float, ptr %104, align 4, !tbaa !16
  %106 = fcmp olt float %105, 0.000000e+00
  br i1 %106, label %107, label %110

107:                                              ; preds = %103
  %108 = load i32, ptr %7, align 4, !tbaa !11
  %109 = sub nsw i32 %108, 1
  store i32 %109, ptr %7, align 4, !tbaa !11
  br label %113

110:                                              ; preds = %103
  %111 = load i32, ptr %7, align 4, !tbaa !11
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %7, align 4, !tbaa !11
  br label %113

113:                                              ; preds = %110, %107
  br label %114

114:                                              ; preds = %113, %99, %95, %91, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %115

115:                                              ; preds = %114, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %116

116:                                              ; preds = %115
  %117 = load i64, ptr %9, align 8, !tbaa !13
  %118 = add i64 %117, 1
  store i64 %118, ptr %9, align 8, !tbaa !13
  br label %31, !llvm.loop !18

119:                                              ; preds = %35
  %120 = load i32, ptr %7, align 4, !tbaa !11
  %121 = icmp ne i32 %120, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret i1 %121
}

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

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

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

@_ZN6QWorld14MAX_WORLD_SIZEE = external dso_local local_unnamed_addr global float, align 4

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10QCollision16PointInPolygonWNE7QVectorSt6vectorIP9QParticleSaIS3_EE(<2 x float> %0, ptr noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %struct.QVector, align 4
  %4 = alloca %struct.QVector, align 8
  %5 = alloca %struct.QVector, align 8
  %6 = alloca %struct.QVector, align 8
  %7 = alloca %struct.QVector, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %8 = load float, ptr @_ZN6QWorld14MAX_WORLD_SIZEE, align 4, !tbaa !5
  call void @_ZN7QVectorC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %3, float noundef %8, float noundef 0.000000e+00)
  %9 = call <2 x float> @_ZN7QVector4DownEv()
  %10 = call noundef i64 @_ZNKSt6vectorIP9QParticleSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %.not38 = icmp eq i64 %10, 0
  br i1 %.not38, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %.sroa.028.4.vec.extract = extractelement <2 x float> %0, i64 1
  %11 = getelementptr inbounds i8, ptr %5, i64 4
  br label %13

._crit_edge.loopexit:                             ; preds = %52
  %12 = icmp ne i32 %.2, 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %2
  %.0.lcssa = phi i1 [ false, %2 ], [ %12, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret i1 %.0.lcssa

13:                                               ; preds = %.lr.ph, %52
  %.037 = phi i32 [ 0, %.lr.ph ], [ %.2, %52 ]
  %.03136 = phi i64 [ 0, %.lr.ph ], [ %17, %52 ]
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.03136) #7
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @_ZN7QVectorC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %17 = add nuw i64 %.03136, 1
  %18 = icmp eq i64 %17, %10
  %. = select i1 %18, i64 0, i64 %17
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9QParticleSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.) #7
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = call <2 x float> @_ZN9QParticle17GetGlobalPositionEv(ptr noundef nonnull align 8 dereferenceable(290) %20)
  store <2 x float> %21, ptr %4, align 8
  %.sroa.015.4.vec.extract = extractelement <2 x float> %16, i64 1
  %22 = fcmp ole float %.sroa.028.4.vec.extract, %.sroa.015.4.vec.extract
  %23 = extractelement <2 x float> %21, i64 1
  %24 = fcmp ugt float %.sroa.028.4.vec.extract, %23
  %.not = xor i1 %22, %24
  br i1 %.not, label %52, label %25

25:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %26 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %21, <2 x float> %16)
  store <2 x float> %26, ptr %5, align 8
  %27 = call <2 x float> @_ZNK7QVector13PerpendicularEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %28 = call <2 x float> @_Zmi7QVectorS_(<2 x float> %16, <2 x float> %0)
  store <2 x float> %28, ptr %6, align 8
  %29 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %6, <2 x float> %27)
  %30 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %3, <2 x float> %27)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %31 = call <2 x float> @_ZNK7QVectorngEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %31, ptr %7, align 8
  %32 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %7, <2 x float> %9)
  %33 = call noundef float @_ZNK7QVector3DotES_(ptr noundef nonnull align 4 dereferenceable(8) %5, <2 x float> %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %34 = insertelement <2 x float> poison, float %32, i64 0
  %35 = insertelement <2 x float> %34, float %29, i64 1
  %36 = insertelement <2 x float> poison, float %33, i64 0
  %37 = insertelement <2 x float> %36, float %30, i64 1
  %38 = fdiv <2 x float> %35, %37
  %39 = extractelement <2 x float> %38, i64 1
  %40 = fcmp ugt float %39, 1.000000e+00
  %41 = fcmp ult <2 x float> %38, zeroinitializer
  %42 = extractelement <2 x i1> %41, i64 1
  %or.cond = or i1 %42, %40
  %43 = extractelement <2 x i1> %41, i64 0
  %or.cond35 = or i1 %or.cond, %43
  br i1 %or.cond35, label %51, label %44

44:                                               ; preds = %25
  %45 = load float, ptr %11, align 4, !tbaa !11
  %46 = fcmp olt float %45, 0.000000e+00
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = add nsw i32 %.037, -1
  br label %51

49:                                               ; preds = %44
  %50 = add nsw i32 %.037, 1
  br label %51

51:                                               ; preds = %47, %49, %25
  %.1 = phi i32 [ %48, %47 ], [ %50, %49 ], [ %.037, %25 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %52

52:                                               ; preds = %51, %13
  %.2 = phi i32 [ %.1, %51 ], [ %.037, %13 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %exitcond.not = icmp eq i64 %17, %10
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %13, !llvm.loop !13
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7QVectorC2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #6 align 2

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass