; LLVM IR from jrouwe/JoltPhysics :: 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::CollideSoftBodyVertexIterator" = type { %"class.JPH::StridedPtr", %"class.JPH::StridedPtr.7", %"class.JPH::StridedPtr.9", %"class.JPH::StridedPtr.11", %"class.JPH::StridedPtr.13" }
%"class.JPH::StridedPtr" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::StridedPtr.7" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::StridedPtr.9" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::StridedPtr.11" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::StridedPtr.13" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.5 }
%union.anon.5 = type { <4 x 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_4Vec3ERKNS_29CollideSoftBodyVertexIteratorEji(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 16 dereferenceable(64) %1, double %2, double %3, ptr noundef nonnull align 8 dereferenceable(80) %4, i32 noundef %5, i32 noundef %6) unnamed_addr #5 align 2 {
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca float, align 4
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::CollideSoftBodyVertexIterator", align 8
  %18 = alloca %"class.JPH::CollideSoftBodyVertexIterator", align 8
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca %"class.JPH::Vec3", align 16
  %28 = alloca %"class.JPH::Plane", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  store double %2, ptr %31, align 16
  %32 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  store double %3, ptr %32, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !9
  store i32 %6, ptr %13, align 4, !tbaa !9
  %33 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %34)
  %36 = getelementptr inbounds %"class.JPH::Vec3", ptr %14, i32 0, i32 0
  %37 = getelementptr inbounds %union.anon.4, ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 0
  %39 = extractvalue { double, double } %35, 0
  store double %39, ptr %38, align 16
  %40 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 1
  %41 = extractvalue { double, double } %35, 1
  store double %41, ptr %40, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %8, i64 16, i1 false), !tbaa.struct !11
  %42 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %43 = load double, ptr %42, align 16
  %44 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %45 = load double, ptr %44, align 8
  %46 = call noundef float @_ZNK3JPH11SphereShape15GetScaledRadiusENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(48) %33, double %43, double %45)
  store float %46, ptr %15, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 80, ptr %17) #6
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %47, i64 80, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.start.p0(i64 80, ptr %18) #6
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = load i32, ptr %12, align 4, !tbaa !9
  call void @_ZNK3JPH29CollideSoftBodyVertexIteratorplEi(ptr dead_on_unwind writable sret(%"class.JPH::CollideSoftBodyVertexIterator") align 8 %18, ptr noundef nonnull align 8 dereferenceable(80) %48, i32 noundef %49)
  br label %50

50:                                               ; preds = %144, %7
  %51 = call noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIteratorneERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %17, ptr noundef nonnull align 8 dereferenceable(80) %18)
  br i1 %51, label %53, label %52

52:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 80, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %17) #6
  br label %146

53:                                               ; preds = %50
  %54 = call noundef float @_ZNK3JPH29CollideSoftBodyVertexIterator10GetInvMassEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
  %55 = fcmp ogt float %54, 0.000000e+00
  br i1 %55, label %56, label %143

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  %57 = call { double, double } @_ZNK3JPH29CollideSoftBodyVertexIterator11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
  %58 = getelementptr inbounds %"class.JPH::Vec3", ptr %20, i32 0, i32 0
  %59 = getelementptr inbounds %union.anon.4, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 0
  %61 = extractvalue { double, double } %57, 0
  store double %61, ptr %60, align 16
  %62 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 1
  %63 = extractvalue { double, double } %57, 1
  store double %63, ptr %62, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 %14, i64 16, i1 false), !tbaa.struct !11
  %64 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %65 = load double, ptr %64, align 16
  %66 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %67 = load double, ptr %66, align 8
  %68 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %20, double %65, double %67)
  %69 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %70 = getelementptr inbounds %union.anon.4, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds { double, double }, ptr %70, i32 0, i32 0
  %72 = extractvalue { double, double } %68, 0
  store double %72, ptr %71, align 16
  %73 = getelementptr inbounds { double, double }, ptr %70, i32 0, i32 1
  %74 = extractvalue { double, double } %68, 1
  store double %74, ptr %73, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %75 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %19)
  store float %75, ptr %22, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %76 = load float, ptr %15, align 4, !tbaa !13
  %77 = load float, ptr %22, align 4, !tbaa !13
  %78 = fsub float %76, %77
  store float %78, ptr %23, align 4, !tbaa !13
  %79 = load float, ptr %23, align 4, !tbaa !13
  %80 = call noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIterator17UpdatePenetrationEf(ptr noundef nonnull align 8 dereferenceable(80) %17, float noundef %79)
  br i1 %80, label %81, label %142

81:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  %82 = load float, ptr %22, align 4, !tbaa !13
  %83 = fcmp ogt float %82, 0.000000e+00
  br i1 %83, label %84, label %93

84:                                               ; preds = %81
  %85 = load float, ptr %22, align 4, !tbaa !13
  %86 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %19, float noundef %85)
  %87 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %88 = getelementptr inbounds %union.anon.4, ptr %87, i32 0, i32 0
  %89 = getelementptr inbounds { double, double }, ptr %88, i32 0, i32 0
  %90 = extractvalue { double, double } %86, 0
  store double %90, ptr %89, align 16
  %91 = getelementptr inbounds { double, double }, ptr %88, i32 0, i32 1
  %92 = extractvalue { double, double } %86, 1
  store double %92, ptr %91, align 8
  br label %101

93:                                               ; preds = %81
  %94 = call { double, double } @_ZN3JPH4Vec36sAxisYEv()
  %95 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %96 = getelementptr inbounds %union.anon.4, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds { double, double }, ptr %96, i32 0, i32 0
  %98 = extractvalue { double, double } %94, 0
  store double %98, ptr %97, align 16
  %99 = getelementptr inbounds { double, double }, ptr %96, i32 0, i32 1
  %100 = extractvalue { double, double } %94, 1
  store double %100, ptr %99, align 8
  br label %101

101:                                              ; preds = %93, %84
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  %102 = load float, ptr %15, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 16 %24, i64 16, i1 false), !tbaa.struct !11
  %103 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %104 = load double, ptr %103, align 16
  %105 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %106 = load double, ptr %105, align 8
  %107 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %102, double %104, double %106)
  %108 = getelementptr inbounds %"class.JPH::Vec3", ptr %26, 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
  %114 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %115 = load double, ptr %114, align 16
  %116 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %117 = load double, ptr %116, align 8
  %118 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %14, double %115, double %117)
  %119 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %120 = getelementptr inbounds %union.anon.4, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds { double, double }, ptr %120, i32 0, i32 0
  %122 = extractvalue { double, double } %118, 0
  store double %122, ptr %121, align 16
  %123 = getelementptr inbounds { double, double }, ptr %120, i32 0, i32 1
  %124 = extractvalue { double, double } %118, 1
  store double %124, ptr %123, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %29, ptr align 16 %25, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %30, ptr align 16 %24, i64 16, i1 false), !tbaa.struct !11
  %125 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %126 = load double, ptr %125, align 16
  %127 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %128 = load double, ptr %127, align 8
  %129 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %130 = load double, ptr %129, align 16
  %131 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %132 = load double, ptr %131, align 8
  %133 = call { double, double } @_ZN3JPH5Plane19sFromPointAndNormalENS_4Vec3ES1_(double %126, double %128, double %130, double %132)
  %134 = getelementptr inbounds %"class.JPH::Plane", ptr %28, i32 0, i32 0
  %135 = getelementptr inbounds %"class.JPH::Vec4", ptr %134, i32 0, i32 0
  %136 = getelementptr inbounds %union.anon.5, ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds { double, double }, ptr %136, i32 0, i32 0
  %138 = extractvalue { double, double } %133, 0
  store double %138, ptr %137, align 16
  %139 = getelementptr inbounds { double, double }, ptr %136, i32 0, i32 1
  %140 = extractvalue { double, double } %133, 1
  store double %140, ptr %139, align 8
  %141 = load i32, ptr %13, align 4, !tbaa !9
  call void @_ZNK3JPH29CollideSoftBodyVertexIterator12SetCollisionERKNS_5PlaneEi(ptr noundef nonnull align 8 dereferenceable(80) %17, ptr noundef nonnull align 16 dereferenceable(16) %28, i32 noundef %141)
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  br label %142

142:                                              ; preds = %101, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %143

143:                                              ; preds = %142, %53
  br label %144

144:                                              ; preds = %143
  %145 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZN3JPH29CollideSoftBodyVertexIteratorppEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
  br label %50, !llvm.loop !16

146:                                              ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH29CollideSoftBodyVertexIteratorplEi(ptr dead_on_unwind noalias writable sret(%"class.JPH::CollideSoftBodyVertexIterator") align 8, ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIteratorneERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH29CollideSoftBodyVertexIterator10GetInvMassEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH29CollideSoftBodyVertexIterator11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIterator17UpdatePenetrationEf(ptr noundef nonnull align 8 dereferenceable(80), float noundef) #5 align 2

; 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 void @_ZNK3JPH29CollideSoftBodyVertexIterator12SetCollisionERKNS_5PlaneEi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 16 dereferenceable(16), i32 noundef) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZN3JPH29CollideSoftBodyVertexIteratorppEv(ptr noundef nonnull align 8 dereferenceable(80)) #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 = !{i64 0, i64 16, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{i64 0, i64 8, !5, i64 8, i64 4, !9, i64 16, i64 8, !5, i64 24, i64 4, !9, i64 32, i64 8, !5, i64 40, i64 4, !9, i64 48, i64 8, !5, i64 56, i64 4, !9, i64 64, i64 8, !5, i64 72, i64 4, !9}
!16 = distinct !{!16, !17}
!17 = !{!"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::CollideSoftBodyVertexIterator" = type { %"class.JPH::StridedPtr", %"class.JPH::StridedPtr.7", %"class.JPH::StridedPtr.9", %"class.JPH::StridedPtr.11", %"class.JPH::StridedPtr.13" }
%"class.JPH::StridedPtr" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::StridedPtr.7" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::StridedPtr.9" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::StridedPtr.11" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::StridedPtr.13" = type <{ ptr, i32, [4 x i8] }>
%"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: mustprogress 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) local_unnamed_addr #2 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #3 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 #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec36sAxisYEv() local_unnamed_addr #3 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 #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH11SphereShape23CollideSoftBodyVerticesERKNS_5Mat44ENS_4Vec3ERKNS_29CollideSoftBodyVertexIteratorEji(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 16 dereferenceable(64) %1, double %2, double %3, ptr noundef nonnull align 8 dereferenceable(80) %4, i32 noundef %5, i32 noundef %6) unnamed_addr #5 align 2 {
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::CollideSoftBodyVertexIterator", align 8
  %10 = alloca %"class.JPH::CollideSoftBodyVertexIterator", align 8
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Plane", align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %14 = tail call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %1)
  %15 = extractvalue { double, double } %14, 0
  store double %15, ptr %8, align 16
  %16 = getelementptr inbounds i8, ptr %8, i64 8
  %17 = extractvalue { double, double } %14, 1
  store double %17, ptr %16, align 8
  %18 = tail call noundef float @_ZNK3JPH11SphereShape15GetScaledRadiusENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(48) %0, double %2, double %3)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %9) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 8 dereferenceable(80) %4, i64 80, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %10) #6
  call void @_ZNK3JPH29CollideSoftBodyVertexIteratorplEi(ptr dead_on_unwind nonnull writable sret(%"class.JPH::CollideSoftBodyVertexIterator") align 8 %10, ptr noundef nonnull align 8 dereferenceable(80) %4, i32 noundef %5)
  %19 = call noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIteratorneERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 8 dereferenceable(80) %10)
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7
  %20 = getelementptr inbounds i8, ptr %12, i64 8
  %21 = getelementptr inbounds i8, ptr %11, i64 8
  %22 = getelementptr inbounds i8, ptr %13, i64 8
  br label %23

._crit_edge:                                      ; preds = %53, %7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  ret void

23:                                               ; preds = %.lr.ph, %53
  %24 = call noundef float @_ZNK3JPH29CollideSoftBodyVertexIterator10GetInvMassEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
  %25 = fcmp ogt float %24, 0.000000e+00
  br i1 %25, label %26, label %53

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  %27 = call { double, double } @_ZNK3JPH29CollideSoftBodyVertexIterator11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
  %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
  %.sroa.012.0.copyload = load double, ptr %8, align 16
  %.sroa.213.0.copyload = load double, ptr %16, align 8, !tbaa !12
  %30 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %.sroa.012.0.copyload, double %.sroa.213.0.copyload)
  %31 = extractvalue { double, double } %30, 0
  store double %31, ptr %11, align 16
  %32 = extractvalue { double, double } %30, 1
  store double %32, ptr %21, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  %33 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %11)
  %34 = fsub float %18, %33
  %35 = call noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIterator17UpdatePenetrationEf(ptr noundef nonnull align 8 dereferenceable(80) %9, float noundef %34)
  br i1 %35, label %36, label %52

36:                                               ; preds = %26
  %37 = fcmp ogt float %33, 0.000000e+00
  br i1 %37, label %38, label %40

38:                                               ; preds = %36
  %39 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %11, float noundef %33)
  br label %42

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

42:                                               ; preds = %40, %38
  %.pn = phi { double, double } [ %39, %38 ], [ %41, %40 ]
  %.sroa.6.0 = extractvalue { double, double } %.pn, 1
  %.sroa.08.0 = extractvalue { double, double } %.pn, 0
  %43 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %18, double %.sroa.08.0, double %.sroa.6.0)
  %44 = extractvalue { double, double } %43, 0
  %45 = extractvalue { double, double } %43, 1
  %46 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %44, double %45)
  %47 = extractvalue { double, double } %46, 0
  %48 = extractvalue { double, double } %46, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  %49 = call { double, double } @_ZN3JPH5Plane19sFromPointAndNormalENS_4Vec3ES1_(double %47, double %48, double %.sroa.08.0, double %.sroa.6.0)
  %50 = extractvalue { double, double } %49, 0
  store double %50, ptr %13, align 16
  %51 = extractvalue { double, double } %49, 1
  store double %51, ptr %22, align 8
  call void @_ZNK3JPH29CollideSoftBodyVertexIterator12SetCollisionERKNS_5PlaneEi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 16 dereferenceable(16) %13, i32 noundef %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  br label %52

52:                                               ; preds = %42, %26
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %53

53:                                               ; preds = %23, %52
  %54 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZN3JPH29CollideSoftBodyVertexIteratorppEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
  %55 = call noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIteratorneERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 8 dereferenceable(80) %10)
  br i1 %55, label %23, label %._crit_edge, !llvm.loop !13
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH29CollideSoftBodyVertexIteratorplEi(ptr dead_on_unwind noalias writable sret(%"class.JPH::CollideSoftBodyVertexIterator") align 8, ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIteratorneERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH29CollideSoftBodyVertexIterator10GetInvMassEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH29CollideSoftBodyVertexIterator11GetPositionEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH29CollideSoftBodyVertexIterator17UpdatePenetrationEf(ptr noundef nonnull align 8 dereferenceable(80), float noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH29CollideSoftBodyVertexIterator12SetCollisionERKNS_5PlaneEi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 16 dereferenceable(16), i32 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZN3JPH29CollideSoftBodyVertexIteratorppEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = !{i64 0, i64 8, !6, i64 8, i64 4, !10, i64 16, i64 8, !6, i64 24, i64 4, !10, i64 32, i64 8, !6, i64 40, i64 4, !10, i64 48, i64 8, !6, i64 56, i64 4, !10, i64 64, i64 8, !6, i64 72, i64 4, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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