; LLVM IR from zig-gamedev/zphysics :: libs/Jolt/Physics/Collision/Shape (SphereShape)

; 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.JPH::Vec3" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.5 }
%union.anon.5 = type { <4 x float> }
%"class.JPH::SoftBodyVertex" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Plane", i32, i8, float, float }

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

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

; 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) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH11SphereShape15GetScaledRadiusENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(48), double, double) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64)) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16)) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec36sAxisYEv() #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH11SphereShape23CollideSoftBodyVerticesERKNS_5Mat44ENS_4Vec3EPNS_14SoftBodyVertexEjfS4_i(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 16 dereferenceable(64) %1, double %2, double %3, ptr noundef %4, i32 noundef %5, float noundef %6, double %7, double %8, i32 noundef %9) unnamed_addr #5 align 2 {
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca float, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca float, align 4
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca %"class.JPH::Vec3", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca %"class.JPH::Plane", align 16
  %33 = alloca %"class.JPH::Vec3", align 16
  %34 = alloca %"class.JPH::Vec3", align 16
  %35 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  store double %2, ptr %35, align 16
  %36 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  store double %3, ptr %36, align 8
  %37 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  store double %7, ptr %37, align 16
  %38 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  store double %8, ptr %38, align 8
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  store ptr %4, ptr %15, align 8, !tbaa !5
  store i32 %5, ptr %16, align 4, !tbaa !9
  store float %6, ptr %17, align 4, !tbaa !11
  store i32 %9, ptr %18, align 4, !tbaa !9
  %39 = load ptr, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %40)
  %42 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %43 = getelementptr inbounds %union.anon.4, ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds { double, double }, ptr %43, i32 0, i32 0
  %45 = extractvalue { double, double } %41, 0
  store double %45, ptr %44, align 16
  %46 = getelementptr inbounds { double, double }, ptr %43, i32 0, i32 1
  %47 = extractvalue { double, double } %41, 1
  store double %47, ptr %46, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !13
  %48 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %49 = load double, ptr %48, align 16
  %50 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %51 = load double, ptr %50, align 8
  %52 = call noundef float @_ZNK3JPH11SphereShape15GetScaledRadiusENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(48) %39, double %49, double %51)
  store float %52, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %53, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = load i32, ptr %16, align 4, !tbaa !9
  %56 = zext i32 %55 to i64
  %57 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %54, i64 %56
  store ptr %57, ptr %23, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %161, %10
  %59 = load ptr, ptr %22, align 8, !tbaa !5
  %60 = load ptr, ptr %23, align 8, !tbaa !5
  %61 = icmp ult ptr %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %164

63:                                               ; preds = %58
  %64 = load ptr, ptr %22, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %64, i32 0, i32 7
  %66 = load float, ptr %65, align 4, !tbaa !15
  %67 = fcmp ogt float %66, 0.000000e+00
  br i1 %67, label %68, label %160

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  %69 = load ptr, ptr %22, align 8, !tbaa !5
  %70 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %69, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %19, i64 16, i1 false), !tbaa.struct !13
  %71 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %72 = load double, ptr %71, align 16
  %73 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %74 = load double, ptr %73, align 8
  %75 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %70, double %72, double %74)
  %76 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %77 = getelementptr inbounds %union.anon.4, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds { double, double }, ptr %77, i32 0, i32 0
  %79 = extractvalue { double, double } %75, 0
  store double %79, ptr %78, align 16
  %80 = getelementptr inbounds { double, double }, ptr %77, i32 0, i32 1
  %81 = extractvalue { double, double } %75, 1
  store double %81, ptr %80, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %82 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %24)
  store float %82, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %83 = load float, ptr %20, align 4, !tbaa !11
  %84 = load float, ptr %26, align 4, !tbaa !11
  %85 = fsub float %83, %84
  store float %85, ptr %27, align 4, !tbaa !11
  %86 = load float, ptr %27, align 4, !tbaa !11
  %87 = load ptr, ptr %22, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %87, i32 0, i32 6
  %89 = load float, ptr %88, align 8, !tbaa !21
  %90 = fcmp ogt float %86, %89
  br i1 %90, label %91, label %159

91:                                               ; preds = %68
  %92 = load float, ptr %27, align 4, !tbaa !11
  %93 = load ptr, ptr %22, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %93, i32 0, i32 6
  store float %92, ptr %94, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  %95 = load float, ptr %26, align 4, !tbaa !11
  %96 = fcmp ogt float %95, 0.000000e+00
  br i1 %96, label %97, label %106

97:                                               ; preds = %91
  %98 = load float, ptr %26, align 4, !tbaa !11
  %99 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %24, float noundef %98)
  %100 = getelementptr inbounds %"class.JPH::Vec3", ptr %28, i32 0, i32 0
  %101 = getelementptr inbounds %union.anon.4, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds { double, double }, ptr %101, i32 0, i32 0
  %103 = extractvalue { double, double } %99, 0
  store double %103, ptr %102, align 16
  %104 = getelementptr inbounds { double, double }, ptr %101, i32 0, i32 1
  %105 = extractvalue { double, double } %99, 1
  store double %105, ptr %104, align 8
  br label %114

106:                                              ; preds = %91
  %107 = call { double, double } @_ZN3JPH4Vec36sAxisYEv()
  %108 = getelementptr inbounds %"class.JPH::Vec3", ptr %28, i32 0, i32 0
  %109 = getelementptr inbounds %union.anon.4, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds { double, double }, ptr %109, i32 0, i32 0
  %111 = extractvalue { double, double } %107, 0
  store double %111, ptr %110, align 16
  %112 = getelementptr inbounds { double, double }, ptr %109, i32 0, i32 1
  %113 = extractvalue { double, double } %107, 1
  store double %113, ptr %112, align 8
  br label %114

114:                                              ; preds = %106, %97
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  %115 = load float, ptr %20, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %31, ptr align 16 %28, i64 16, i1 false), !tbaa.struct !13
  %116 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %117 = load double, ptr %116, align 16
  %118 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %119 = load double, ptr %118, align 8
  %120 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %115, double %117, double %119)
  %121 = getelementptr inbounds %"class.JPH::Vec3", ptr %30, i32 0, i32 0
  %122 = getelementptr inbounds %union.anon.4, ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds { double, double }, ptr %122, i32 0, i32 0
  %124 = extractvalue { double, double } %120, 0
  store double %124, ptr %123, align 16
  %125 = getelementptr inbounds { double, double }, ptr %122, i32 0, i32 1
  %126 = extractvalue { double, double } %120, 1
  store double %126, ptr %125, align 8
  %127 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %128 = load double, ptr %127, align 16
  %129 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %130 = load double, ptr %129, align 8
  %131 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %19, double %128, double %130)
  %132 = getelementptr inbounds %"class.JPH::Vec3", ptr %29, i32 0, i32 0
  %133 = getelementptr inbounds %union.anon.4, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds { double, double }, ptr %133, i32 0, i32 0
  %135 = extractvalue { double, double } %131, 0
  store double %135, ptr %134, align 16
  %136 = getelementptr inbounds { double, double }, ptr %133, i32 0, i32 1
  %137 = extractvalue { double, double } %131, 1
  store double %137, ptr %136, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %33, ptr align 16 %29, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %34, ptr align 16 %28, i64 16, i1 false), !tbaa.struct !13
  %138 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 0
  %139 = load double, ptr %138, align 16
  %140 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 1
  %141 = load double, ptr %140, align 8
  %142 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 0
  %143 = load double, ptr %142, align 16
  %144 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 1
  %145 = load double, ptr %144, align 8
  %146 = call { double, double } @_ZN3JPH5Plane19sFromPointAndNormalENS_4Vec3ES1_(double %139, double %141, double %143, double %145)
  %147 = getelementptr inbounds %"class.JPH::Plane", ptr %32, i32 0, i32 0
  %148 = getelementptr inbounds %"class.JPH::Vec4", ptr %147, i32 0, i32 0
  %149 = getelementptr inbounds %union.anon.5, ptr %148, i32 0, i32 0
  %150 = getelementptr inbounds { double, double }, ptr %149, i32 0, i32 0
  %151 = extractvalue { double, double } %146, 0
  store double %151, ptr %150, align 16
  %152 = getelementptr inbounds { double, double }, ptr %149, i32 0, i32 1
  %153 = extractvalue { double, double } %146, 1
  store double %153, ptr %152, align 8
  %154 = load ptr, ptr %22, align 8, !tbaa !5
  %155 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %154, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %155, ptr align 16 %32, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  %156 = load i32, ptr %18, align 4, !tbaa !9
  %157 = load ptr, ptr %22, align 8, !tbaa !5
  %158 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %157, i32 0, i32 4
  store i32 %156, ptr %158, align 16, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br label %159

159:                                              ; preds = %114, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  br label %160

160:                                              ; preds = %159, %63
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %22, align 8, !tbaa !5
  %163 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %162, i32 1
  store ptr %163, ptr %22, align 8, !tbaa !5
  br label %58, !llvm.loop !23

164:                                              ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH5Plane19sFromPointAndNormalENS_4Vec3ES1_(double, double, double, double) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { alwaysinline 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 #4 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{i64 0, i64 16, !14}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !12, i64 76}
!16 = !{!"_ZTSN3JPH14SoftBodyVertexE", !17, i64 0, !17, i64 16, !17, i64 32, !18, i64 48, !10, i64 64, !20, i64 68, !12, i64 72, !12, i64 76}
!17 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!18 = !{!"_ZTSN3JPH5PlaneE", !19, i64 0}
!19 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!16, !12, i64 72}
!22 = !{!16, !10, i64 64}
!23 = distinct !{!23, !24}
!24 = !{!"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"

%"class.JPH::Vec3" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }
%"class.JPH::SoftBodyVertex" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Plane", i32, i8, float, float }
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.5 }
%union.anon.5 = type { <4 x float> }

; 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 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 @_ZNK3JPH11SphereShape15GetScaledRadiusENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(48), double, double) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec36sAxisYEv() local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH11SphereShape23CollideSoftBodyVerticesERKNS_5Mat44ENS_4Vec3EPNS_14SoftBodyVertexEjfS4_i(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 16 dereferenceable(64) %1, double %2, double %3, ptr noundef %4, i32 noundef %5, float noundef %6, double %7, double %8, i32 noundef %9) unnamed_addr #4 align 2 {
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #5
  %13 = tail call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %1)
  %14 = extractvalue { double, double } %13, 0
  store double %14, ptr %11, align 16
  %15 = getelementptr inbounds i8, ptr %11, i64 8
  %16 = extractvalue { double, double } %13, 1
  store double %16, ptr %15, align 8
  %17 = tail call noundef float @_ZNK3JPH11SphereShape15GetScaledRadiusENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(48) %0, double %2, double %3)
  %18 = zext i32 %5 to i64
  %19 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %4, i64 %18
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %10
  %20 = getelementptr inbounds i8, ptr %12, i64 8
  br label %21

._crit_edge:                                      ; preds = %54, %10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  ret void

21:                                               ; preds = %.lr.ph, %54
  %.041 = phi ptr [ %4, %.lr.ph ], [ %55, %54 ]
  %22 = getelementptr inbounds i8, ptr %.041, i64 76
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = fcmp ogt float %23, 0.000000e+00
  br i1 %24, label %25, label %54

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %26 = getelementptr inbounds i8, ptr %.041, i64 16
  %.sroa.015.0.copyload = load double, ptr %11, align 16
  %.sroa.216.0.copyload = load double, ptr %15, align 8, !tbaa !15
  %27 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %26, double %.sroa.015.0.copyload, double %.sroa.216.0.copyload)
  %28 = extractvalue { double, double } %27, 0
  store double %28, ptr %12, align 16
  %29 = extractvalue { double, double } %27, 1
  store double %29, ptr %20, align 8
  %30 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %12)
  %31 = fsub float %17, %30
  %32 = getelementptr inbounds i8, ptr %.041, i64 72
  %33 = load float, ptr %32, align 8, !tbaa !16
  %34 = fcmp ogt float %31, %33
  br i1 %34, label %35, label %53

35:                                               ; preds = %25
  store float %31, ptr %32, align 8, !tbaa !16
  %36 = fcmp ogt float %30, 0.000000e+00
  br i1 %36, label %37, label %39

37:                                               ; preds = %35
  %38 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %12, float noundef %30)
  br label %41

39:                                               ; preds = %35
  %40 = call { double, double } @_ZN3JPH4Vec36sAxisYEv()
  br label %41

41:                                               ; preds = %39, %37
  %.pn = phi { double, double } [ %38, %37 ], [ %40, %39 ]
  %.sroa.6.0 = extractvalue { double, double } %.pn, 1
  %.sroa.010.0 = extractvalue { double, double } %.pn, 0
  %42 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %17, double %.sroa.010.0, double %.sroa.6.0)
  %43 = extractvalue { double, double } %42, 0
  %44 = extractvalue { double, double } %42, 1
  %45 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %11, double %43, double %44)
  %46 = extractvalue { double, double } %45, 0
  %47 = extractvalue { double, double } %45, 1
  %48 = call { double, double } @_ZN3JPH5Plane19sFromPointAndNormalENS_4Vec3ES1_(double %46, double %47, double %.sroa.010.0, double %.sroa.6.0)
  %49 = extractvalue { double, double } %48, 0
  %50 = extractvalue { double, double } %48, 1
  %51 = getelementptr inbounds i8, ptr %.041, i64 48
  store double %49, ptr %51, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %.041, i64 56
  store double %50, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !15
  %52 = getelementptr inbounds i8, ptr %.041, i64 64
  store i32 %9, ptr %52, align 16, !tbaa !17
  br label %53

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

54:                                               ; preds = %21, %53
  %55 = getelementptr inbounds i8, ptr %.041, i64 80
  %56 = icmp ult ptr %55, %19
  br i1 %56, label %21, label %._crit_edge, !llvm.loop !18
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH5Plane19sFromPointAndNormalENS_4Vec3ES1_(double, double, double, double) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { alwaysinline 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 #3 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !14, i64 76}
!6 = !{!"_ZTSN3JPH14SoftBodyVertexE", !7, i64 0, !7, i64 16, !7, i64 32, !10, i64 48, !12, i64 64, !13, i64 68, !14, i64 72, !14, i64 76}
!7 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3JPH5PlaneE", !11, i64 0}
!11 = !{!"_ZTSN3JPH4Vec4E", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"bool", !8, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = !{!8, !8, i64 0}
!16 = !{!6, !14, i64 72}
!17 = !{!6, !12, i64 64}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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