; LLVM IR from idmillington/cyclone-physics :: src/pcontacts.ll (ZN7cyclone15ParticleContact15resolveVelocityEd)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.cyclone::Vector3" = type { double, double, double, double }
%"class.cyclone::ParticleContact" = type { [2 x ptr], double, %"class.cyclone::Vector3", double, [2 x %"class.cyclone::Vector3"] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cyclone15ParticleContact15resolveVelocityEd(ptr noundef nonnull align 8 dereferenceable(128) %0, double noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca %"class.cyclone::Vector3", align 8
  %9 = alloca %"class.cyclone::Vector3", align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca %"class.cyclone::Vector3", align 8
  %15 = alloca %"class.cyclone::Vector3", align 8
  %16 = alloca %"class.cyclone::Vector3", align 8
  %17 = alloca %"class.cyclone::Vector3", align 8
  %18 = alloca %"class.cyclone::Vector3", align 8
  %19 = alloca %"class.cyclone::Vector3", align 8
  %20 = alloca %"class.cyclone::Vector3", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %21 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %22 = call noundef double @_ZNK7cyclone15ParticleContact27calculateSeparatingVelocityEv(ptr noundef nonnull align 8 dereferenceable(128) %21)
  store double %22, ptr %5, align 8, !tbaa !9
  %23 = load double, ptr %5, align 8, !tbaa !9
  %24 = fcmp ogt double %23, 0.000000e+00
  br i1 %24, label %25, label %26

25:                                               ; preds = %2
  store i32 1, ptr %6, align 4
  br label %117

26:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %27 = load double, ptr %5, align 8, !tbaa !9
  %28 = fneg double %27
  %29 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 1
  %30 = load double, ptr %29, align 8, !tbaa !11
  %31 = fmul double %28, %30
  store double %31, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  %32 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %33 = getelementptr inbounds [2 x ptr], ptr %32, i64 0, i64 0
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  call void @_ZNK7cyclone8Particle15getAccelerationEv(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %8, ptr noundef nonnull align 8 dereferenceable(144) %34)
  %35 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %36 = getelementptr inbounds [2 x ptr], ptr %35, i64 0, i64 1
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %43

39:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  %40 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %41 = getelementptr inbounds [2 x ptr], ptr %40, i64 0, i64 1
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  call void @_ZNK7cyclone8Particle15getAccelerationEv(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %9, ptr noundef nonnull align 8 dereferenceable(144) %42)
  call void @_ZN7cyclone7Vector3mIERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %9)
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  br label %43

43:                                               ; preds = %39, %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %44 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 2
  %45 = call noundef double @_ZNK7cyclone7Vector3mlERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %44)
  %46 = load double, ptr %4, align 8, !tbaa !9
  %47 = fmul double %45, %46
  store double %47, ptr %10, align 8, !tbaa !9
  %48 = load double, ptr %10, align 8, !tbaa !9
  %49 = fcmp olt double %48, 0.000000e+00
  br i1 %49, label %50, label %60

50:                                               ; preds = %43
  %51 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 1
  %52 = load double, ptr %51, align 8, !tbaa !11
  %53 = load double, ptr %10, align 8, !tbaa !9
  %54 = load double, ptr %7, align 8, !tbaa !9
  %55 = call double @llvm.fmuladd.f64(double %52, double %53, double %54)
  store double %55, ptr %7, align 8, !tbaa !9
  %56 = load double, ptr %7, align 8, !tbaa !9
  %57 = fcmp olt double %56, 0.000000e+00
  br i1 %57, label %58, label %59

58:                                               ; preds = %50
  store double 0.000000e+00, ptr %7, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %58, %50
  br label %60

60:                                               ; preds = %59, %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %61 = load double, ptr %7, align 8, !tbaa !9
  %62 = load double, ptr %5, align 8, !tbaa !9
  %63 = fsub double %61, %62
  store double %63, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %64 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %65 = getelementptr inbounds [2 x ptr], ptr %64, i64 0, i64 0
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = call noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144) %66)
  store double %67, ptr %12, align 8, !tbaa !9
  %68 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %69 = getelementptr inbounds [2 x ptr], ptr %68, i64 0, i64 1
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %79

72:                                               ; preds = %60
  %73 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %74 = getelementptr inbounds [2 x ptr], ptr %73, i64 0, i64 1
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = call noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144) %75)
  %77 = load double, ptr %12, align 8, !tbaa !9
  %78 = fadd double %77, %76
  store double %78, ptr %12, align 8, !tbaa !9
  br label %79

79:                                               ; preds = %72, %60
  %80 = load double, ptr %12, align 8, !tbaa !9
  %81 = fcmp ole double %80, 0.000000e+00
  br i1 %81, label %82, label %83

82:                                               ; preds = %79
  store i32 1, ptr %6, align 4
  br label %116

83:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %84 = load double, ptr %11, align 8, !tbaa !9
  %85 = load double, ptr %12, align 8, !tbaa !9
  %86 = fdiv double %84, %85
  store double %86, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #5
  %87 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 2
  %88 = load double, ptr %13, align 8, !tbaa !9
  call void @_ZNK7cyclone7Vector3mlEd(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %14, ptr noundef nonnull align 8 dereferenceable(32) %87, double noundef %88)
  %89 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %90 = getelementptr inbounds [2 x ptr], ptr %89, i64 0, i64 0
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #5
  %92 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %93 = getelementptr inbounds [2 x ptr], ptr %92, i64 0, i64 0
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  call void @_ZNK7cyclone8Particle11getVelocityEv(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %16, ptr noundef nonnull align 8 dereferenceable(144) %94)
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #5
  %95 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %96 = getelementptr inbounds [2 x ptr], ptr %95, i64 0, i64 0
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %98 = call noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144) %97)
  call void @_ZNK7cyclone7Vector3mlEd(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %17, ptr noundef nonnull align 8 dereferenceable(32) %14, double noundef %98)
  call void @_ZNK7cyclone7Vector3plERKS0_(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %15, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(32) %17)
  call void @_ZN7cyclone8Particle11setVelocityERKNS_7Vector3E(ptr noundef nonnull align 8 dereferenceable(144) %91, ptr noundef nonnull align 8 dereferenceable(32) %15)
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  %99 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %100 = getelementptr inbounds [2 x ptr], ptr %99, i64 0, i64 1
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %115

103:                                              ; preds = %83
  %104 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %105 = getelementptr inbounds [2 x ptr], ptr %104, i64 0, i64 1
  %106 = load ptr, ptr %105, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  %107 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %108 = getelementptr inbounds [2 x ptr], ptr %107, i64 0, i64 1
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  call void @_ZNK7cyclone8Particle11getVelocityEv(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %19, ptr noundef nonnull align 8 dereferenceable(144) %109)
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #5
  %110 = getelementptr inbounds %"class.cyclone::ParticleContact", ptr %21, i32 0, i32 0
  %111 = getelementptr inbounds [2 x ptr], ptr %110, i64 0, i64 1
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = call noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144) %112)
  %114 = fneg double %113
  call void @_ZNK7cyclone7Vector3mlEd(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %20, ptr noundef nonnull align 8 dereferenceable(32) %14, double noundef %114)
  call void @_ZNK7cyclone7Vector3plERKS0_(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8 %18, ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(32) %20)
  call void @_ZN7cyclone8Particle11setVelocityERKNS_7Vector3E(ptr noundef nonnull align 8 dereferenceable(144) %106, ptr noundef nonnull align 8 dereferenceable(32) %18)
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  br label %115

115:                                              ; preds = %103, %83
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  store i32 0, ptr %6, align 4
  br label %116

116:                                              ; preds = %115, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %117

117:                                              ; preds = %116, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %118 = load i32, ptr %6, align 4
  switch i32 %118, label %120 [
    i32 0, label %119
    i32 1, label %119
  ]

119:                                              ; preds = %117, %117
  ret void

120:                                              ; preds = %117
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK7cyclone15ParticleContact27calculateSeparatingVelocityEv(ptr noundef nonnull align 8 dereferenceable(128)) #0 align 2

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

declare void @_ZNK7cyclone8Particle11getVelocityEv(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(144)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7cyclone7Vector3mIERKS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; 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 double @_ZNK7cyclone7Vector3mlERKS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

declare void @_ZNK7cyclone8Particle15getAccelerationEv(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(144)) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

declare noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7cyclone7Vector3mlEd(ptr dead_on_unwind noalias writable sret(%"class.cyclone::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(32), double noundef) #0 align 2

declare void @_ZN7cyclone8Particle11setVelocityERKNS_7Vector3E(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(32)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7cyclone7Vector3plERKS0_(ptr dead_on_unwind noalias writable sret(%"class.cyclone::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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


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

%"class.cyclone::Vector3" = type { double, double, double, double }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cyclone15ParticleContact15resolveVelocityEd(ptr noundef nonnull align 8 dereferenceable(128) %0, double noundef %1) local_unnamed_addr #0 align 2 {
  %3 = alloca %"class.cyclone::Vector3", align 8
  %4 = alloca %"class.cyclone::Vector3", align 8
  %5 = alloca %"class.cyclone::Vector3", align 8
  %6 = alloca %"class.cyclone::Vector3", align 8
  %7 = alloca %"class.cyclone::Vector3", align 8
  %8 = alloca %"class.cyclone::Vector3", align 8
  %9 = alloca %"class.cyclone::Vector3", align 8
  %10 = alloca %"class.cyclone::Vector3", align 8
  %11 = alloca %"class.cyclone::Vector3", align 8
  %12 = tail call noundef double @_ZNK7cyclone15ParticleContact27calculateSeparatingVelocityEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %13 = fcmp ogt double %12, 0.000000e+00
  br i1 %13, label %55, label %14

14:                                               ; preds = %2
  %15 = fneg double %12
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = fmul double %17, %15
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %19 = load ptr, ptr %0, align 8, !tbaa !11
  call void @_ZNK7cyclone8Particle15getAccelerationEv(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %3, ptr noundef nonnull align 8 dereferenceable(144) %19)
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %23, label %22

22:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @_ZNK7cyclone8Particle15getAccelerationEv(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %4, ptr noundef nonnull align 8 dereferenceable(144) %21)
  call void @_ZN7cyclone7Vector3mIERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %4)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  br label %23

23:                                               ; preds = %22, %14
  %24 = getelementptr inbounds i8, ptr %0, i64 24
  %25 = call noundef double @_ZNK7cyclone7Vector3mlERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %24)
  %26 = fmul double %25, %1
  %27 = fcmp olt double %26, 0.000000e+00
  br i1 %27, label %28, label %33

28:                                               ; preds = %23
  %29 = load double, ptr %16, align 8, !tbaa !5
  %30 = call double @llvm.fmuladd.f64(double %29, double %26, double %18)
  %31 = fcmp olt double %30, 0.000000e+00
  br i1 %31, label %32, label %33

32:                                               ; preds = %28
  br label %33

33:                                               ; preds = %28, %32, %23
  %.015 = phi double [ 0.000000e+00, %32 ], [ %30, %28 ], [ %18, %23 ]
  %34 = fsub double %.015, %12
  %35 = load ptr, ptr %0, align 8, !tbaa !11
  %36 = call noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144) %35)
  %37 = load ptr, ptr %20, align 8, !tbaa !11
  %.not21 = icmp eq ptr %37, null
  br i1 %.not21, label %41, label %38

38:                                               ; preds = %33
  %39 = call noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144) %37)
  %40 = fadd double %36, %39
  br label %41

41:                                               ; preds = %38, %33
  %.0 = phi double [ %40, %38 ], [ %36, %33 ]
  %42 = fcmp ugt double %.0, 0.000000e+00
  br i1 %42, label %43, label %54

43:                                               ; preds = %41
  %44 = fdiv double %34, %.0
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @_ZNK7cyclone7Vector3mlEd(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %24, double noundef %44)
  %45 = load ptr, ptr %0, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @_ZNK7cyclone8Particle11getVelocityEv(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %7, ptr noundef nonnull align 8 dereferenceable(144) %45)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  %46 = load ptr, ptr %0, align 8, !tbaa !11
  %47 = call noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144) %46)
  call void @_ZNK7cyclone7Vector3mlEd(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %5, double noundef %47)
  call void @_ZNK7cyclone7Vector3plERKS0_(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %8)
  call void @_ZN7cyclone8Particle11setVelocityERKNS_7Vector3E(ptr noundef nonnull align 8 dereferenceable(144) %45, ptr noundef nonnull align 8 dereferenceable(32) %6)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  %48 = load ptr, ptr %20, align 8, !tbaa !11
  %.not22 = icmp eq ptr %48, null
  br i1 %.not22, label %53, label %49

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @_ZNK7cyclone8Particle11getVelocityEv(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %10, ptr noundef nonnull align 8 dereferenceable(144) %48)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  %50 = load ptr, ptr %20, align 8, !tbaa !11
  %51 = call noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144) %50)
  %52 = fneg double %51
  call void @_ZNK7cyclone7Vector3mlEd(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %11, ptr noundef nonnull align 8 dereferenceable(32) %5, double noundef %52)
  call void @_ZNK7cyclone7Vector3plERKS0_(ptr dead_on_unwind nonnull writable sret(%"class.cyclone::Vector3") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %11)
  call void @_ZN7cyclone8Particle11setVelocityERKNS_7Vector3E(ptr noundef nonnull align 8 dereferenceable(144) %48, ptr noundef nonnull align 8 dereferenceable(32) %9)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %53

53:                                               ; preds = %49, %43
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %54

54:                                               ; preds = %41, %53
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br label %55

55:                                               ; preds = %2, %54
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK7cyclone15ParticleContact27calculateSeparatingVelocityEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #0 align 2

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

declare void @_ZNK7cyclone8Particle11getVelocityEv(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7cyclone7Vector3mIERKS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) 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 double @_ZNK7cyclone7Vector3mlERKS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

declare void @_ZNK7cyclone8Particle15getAccelerationEv(ptr dead_on_unwind writable sret(%"class.cyclone::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

declare noundef double @_ZNK7cyclone8Particle14getInverseMassEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7cyclone7Vector3mlEd(ptr dead_on_unwind noalias writable sret(%"class.cyclone::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(32), double noundef) local_unnamed_addr #0 align 2

declare void @_ZN7cyclone8Particle11setVelocityERKNS_7Vector3E(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7cyclone7Vector3plERKS0_(ptr dead_on_unwind noalias writable sret(%"class.cyclone::Vector3") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass