; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/Shape (CompoundShape)

; 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::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.8 }
%union.anon.8 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon.7 }
%union.anon.7 = type { <4 x float> }
%"class.JPH::CompoundShape" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::Vec3", %"class.JPH::AABox", %"class.JPH::Array.11", float, [4 x i8] }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.10", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.10" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Array.11" = type { i64, i64, ptr }
%"struct.JPH::CompoundShape::SubShape" = type <{ %"class.JPH::RefConst.9", %"class.JPH::Float3", %"class.JPH::Float3", i32, i8, [3 x i8] }>
%"class.JPH::RefConst.9" = type { ptr }
%"class.JPH::Float3" = type { float, 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64)) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH13CompoundShape8SubShape24GetLocalTransformNoScaleENS_4Vec3E(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 8 dereferenceable(37), double, double) #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH13CompoundShape18GetSubmergedVolumeERKNS_5Mat44ENS_4Vec3ERKNS_5PlaneERfS8_RS4_(ptr noundef nonnull align 16 dereferenceable(108) %0, ptr noundef nonnull align 16 dereferenceable(64) %1, double %2, double %3, ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 16 dereferenceable(16) %7) unnamed_addr #6 align 2 {
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca %"class.JPH::Mat44", align 16
  %22 = alloca %"class.JPH::Mat44", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca %"class.JPH::Vec3", align 16
  %28 = alloca %"class.JPH::Vec3", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  store double %2, ptr %31, align 16
  %32 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  store double %3, ptr %32, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  store ptr %7, ptr %15, align 8, !tbaa !5
  %33 = load ptr, ptr %10, align 8
  %34 = load ptr, ptr %13, align 8, !tbaa !5
  store float 0.000000e+00, ptr %34, align 4, !tbaa !9
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  store float 0.000000e+00, ptr %35, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  %36 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %37 = getelementptr inbounds %"class.JPH::Vec3", ptr %16, i32 0, i32 0
  %38 = getelementptr inbounds %union.anon.7, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 0
  %40 = extractvalue { double, double } %36, 0
  store double %40, ptr %39, align 16
  %41 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 1
  %42 = extractvalue { double, double } %36, 1
  store double %42, ptr %41, align 8
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %43, ptr align 16 %16, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %44 = getelementptr inbounds %"class.JPH::CompoundShape", ptr %33, i32 0, i32 4
  store ptr %44, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %45 = load ptr, ptr %17, align 8, !tbaa !5
  %46 = call noundef ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %45)
  store ptr %46, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %47 = load ptr, ptr %17, align 8, !tbaa !5
  %48 = call noundef ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47)
  store ptr %48, ptr %19, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %111, %8
  %50 = load ptr, ptr %18, align 8, !tbaa !5
  %51 = load ptr, ptr %19, align 8, !tbaa !5
  %52 = icmp ne ptr %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %114

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %55 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %55, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %21) #8
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %22) #8
  %57 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !11
  %58 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %59 = load double, ptr %58, align 16
  %60 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %61 = load double, ptr %60, align 8
  call void @_ZNK3JPH13CompoundShape8SubShape24GetLocalTransformNoScaleENS_4Vec3E(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %22, ptr noundef nonnull align 8 dereferenceable(37) %57, double %59, double %61)
  call void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %21, ptr noundef nonnull align 16 dereferenceable(64) %56, ptr noundef nonnull align 16 dereferenceable(64) %22)
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #8
  %62 = load ptr, ptr %20, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.JPH::CompoundShape::SubShape", ptr %62, i32 0, i32 0
  %64 = call noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %63)
  %65 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %28, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !11
  %66 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %67 = load double, ptr %66, align 16
  %68 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %69 = load double, ptr %68, align 8
  %70 = call { double, double } @_ZNK3JPH13CompoundShape8SubShape14TransformScaleENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(37) %65, double %67, double %69)
  %71 = getelementptr inbounds %"class.JPH::Vec3", ptr %27, i32 0, i32 0
  %72 = getelementptr inbounds %union.anon.7, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds { double, double }, ptr %72, i32 0, i32 0
  %74 = extractvalue { double, double } %70, 0
  store double %74, ptr %73, align 16
  %75 = getelementptr inbounds { double, double }, ptr %72, i32 0, i32 1
  %76 = extractvalue { double, double } %70, 1
  store double %76, ptr %75, align 8
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %79 = load double, ptr %78, align 16
  %80 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %81 = load double, ptr %80, align 8
  %82 = load ptr, ptr %64, align 8, !tbaa !13
  %83 = getelementptr inbounds ptr, ptr %82, i64 15
  %84 = load ptr, ptr %83, align 8
  call void %84(ptr noundef nonnull align 8 dereferenceable(26) %64, ptr noundef nonnull align 16 dereferenceable(64) %21, double %79, double %81, ptr noundef nonnull align 16 dereferenceable(16) %77, ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 16 dereferenceable(16) %26)
  %85 = load float, ptr %24, align 4, !tbaa !9
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = load float, ptr %86, align 4, !tbaa !9
  %88 = fadd float %87, %85
  store float %88, ptr %86, align 4, !tbaa !9
  %89 = load float, ptr %25, align 4, !tbaa !9
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = load float, ptr %90, align 4, !tbaa !9
  %92 = fadd float %91, %89
  store float %92, ptr %90, align 4, !tbaa !9
  %93 = load float, ptr %25, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %30, ptr align 16 %26, i64 16, i1 false), !tbaa.struct !11
  %94 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %95 = load double, ptr %94, align 16
  %96 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %97 = load double, ptr %96, align 8
  %98 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %93, double %95, double %97)
  %99 = getelementptr inbounds %"class.JPH::Vec3", ptr %29, i32 0, i32 0
  %100 = getelementptr inbounds %union.anon.7, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds { double, double }, ptr %100, i32 0, i32 0
  %102 = extractvalue { double, double } %98, 0
  store double %102, ptr %101, align 16
  %103 = getelementptr inbounds { double, double }, ptr %100, i32 0, i32 1
  %104 = extractvalue { double, double } %98, 1
  store double %104, ptr %103, align 8
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %107 = load double, ptr %106, align 16
  %108 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %109 = load double, ptr %108, align 8
  %110 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %105, double %107, double %109)
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %111

111:                                              ; preds = %54
  %112 = load ptr, ptr %18, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.JPH::CompoundShape::SubShape", ptr %112, i32 1
  store ptr %113, ptr %18, align 8, !tbaa !5
  br label %49

114:                                              ; preds = %53
  %115 = load ptr, ptr %14, align 8, !tbaa !5
  %116 = load float, ptr %115, align 4, !tbaa !9
  %117 = fcmp ogt float %116, 0.000000e+00
  br i1 %117, label %118, label %123

118:                                              ; preds = %114
  %119 = load ptr, ptr %14, align 8, !tbaa !5
  %120 = load float, ptr %119, align 4, !tbaa !9
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  %122 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3dVEf(ptr noundef nonnull align 16 dereferenceable(16) %121, float noundef %120)
  br label %123

123:                                              ; preds = %118, %114
  ret void
}

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #7 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3dVEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) #3 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = { alwaysinline mustprogress nounwind 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 #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 = !{i64 0, i64 16, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}


; 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::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.8 }
%union.anon.8 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon.7 }
%union.anon.7 = 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 16 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(64)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH13CompoundShape8SubShape24GetLocalTransformNoScaleENS_4Vec3E(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, ptr noundef nonnull align 8 dereferenceable(37), double, double) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH13CompoundShape8SubShape14TransformScaleENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(37), double, double) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH13CompoundShape18GetSubmergedVolumeERKNS_5Mat44ENS_4Vec3ERKNS_5PlaneERfS8_RS4_(ptr noundef nonnull align 16 dereferenceable(108) %0, ptr noundef nonnull align 16 dereferenceable(64) %1, double %2, double %3, ptr noundef nonnull align 16 dereferenceable(16) %4, ptr nocapture noundef nonnull align 4 dereferenceable(4) %5, ptr nocapture noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 16 dereferenceable(16) %7) unnamed_addr #5 align 2 {
  %9 = alloca %"class.JPH::Mat44", align 16
  %10 = alloca %"class.JPH::Mat44", align 16
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca %"class.JPH::Vec3", align 16
  store float 0.000000e+00, ptr %5, align 4, !tbaa !5
  store float 0.000000e+00, ptr %6, align 4, !tbaa !5
  %14 = tail call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %15 = extractvalue { double, double } %14, 0
  %16 = extractvalue { double, double } %14, 1
  store double %15, ptr %7, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store double %16, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %0, i64 80
  %18 = tail call noundef ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  %19 = tail call noundef ptr @_ZNK3JPH5ArrayINS_13CompoundShape8SubShapeENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  %.not32 = icmp eq ptr %18, %19
  br i1 %.not32, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  br label %22

._crit_edge:                                      ; preds = %22, %8
  %20 = load float, ptr %6, align 4, !tbaa !5
  %21 = fcmp ogt float %20, 0.000000e+00
  br i1 %21, label %41, label %43

22:                                               ; preds = %.lr.ph, %22
  %.033 = phi ptr [ %18, %.lr.ph ], [ %40, %22 ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #7
  call void @_ZNK3JPH13CompoundShape8SubShape24GetLocalTransformNoScaleENS_4Vec3E(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %10, ptr noundef nonnull align 8 dereferenceable(37) %.033, double %2, double %3)
  call void @_ZNK3JPH5Mat44mlERKS0_(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %9, ptr noundef nonnull align 16 dereferenceable(64) %1, ptr noundef nonnull align 16 dereferenceable(64) %10)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  %23 = call noundef ptr @_ZNK3JPH8RefConstINS_5ShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.033)
  %24 = call { double, double } @_ZNK3JPH13CompoundShape8SubShape14TransformScaleENS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(37) %.033, double %2, double %3)
  %25 = extractvalue { double, double } %24, 0
  %26 = extractvalue { double, double } %24, 1
  %27 = load ptr, ptr %23, align 8, !tbaa !10
  %28 = getelementptr inbounds i8, ptr %27, i64 120
  %29 = load ptr, ptr %28, align 8
  call void %29(ptr noundef nonnull align 8 dereferenceable(26) %23, ptr noundef nonnull align 16 dereferenceable(64) %9, double %25, double %26, ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 16 dereferenceable(16) %13)
  %30 = load float, ptr %11, align 4, !tbaa !5
  %31 = load float, ptr %5, align 4, !tbaa !5
  %32 = fadd float %30, %31
  store float %32, ptr %5, align 4, !tbaa !5
  %33 = load float, ptr %12, align 4, !tbaa !5
  %34 = load float, ptr %6, align 4, !tbaa !5
  %35 = fadd float %33, %34
  store float %35, ptr %6, align 4, !tbaa !5
  %.sroa.0.0.copyload = load double, ptr %13, align 16
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !9
  %36 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %33, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %37 = extractvalue { double, double } %36, 0
  %38 = extractvalue { double, double } %36, 1
  %39 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %37, double %38)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #7
  %40 = getelementptr inbounds i8, ptr %.033, i64 40
  %.not = icmp eq ptr %40, %19
  br i1 %.not, label %._crit_edge, label %22

41:                                               ; preds = %._crit_edge
  %42 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3dVEf(ptr noundef nonnull align 16 dereferenceable(16) %7, float noundef %20)
  br label %43

43:                                               ; preds = %41, %._crit_edge
  ret void
}

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #6 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { 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 #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 = { alwaysinline mustprogress nounwind 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 #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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"vtable pointer", !8, i64 0}


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