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

; 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.14 }
%union.anon.14 = type { <4 x float> }
%"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::DecodingContext" = type { %"class.JPH::Vec4", %"class.JPH::Vec4", %"class.JPH::Vec4", %"class.JPH::Vec4", %"class.JPH::Vec4", %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.33 }
%union.anon.33 = type { <4 x float> }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::MeshShape" = type { %"class.JPH::Shape.base", %"class.JPH::Array.8", %"class.JPH::ByteBuffer" }
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.15", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.15" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Array.8" = type { i64, i64, ptr }
%"class.JPH::ByteBuffer" = type { %"class.JPH::Array.16" }
%"class.JPH::Array.16" = type { i64, i64, ptr }

; 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 void @_ZNK3JPH9MeshShape16DecodeSubShapeIDERKNS_10SubShapeIDERPKvRj(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden noundef ptr @_ZN3JPHL18sGetTriangleHeaderERKNS_10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags15DecodingContextC2EPKNS0_14TriangleHeaderE(ptr noundef nonnull align 16 dereferenceable(96), ptr noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags15DecodingContext11GetTriangleEPKvjRNS_4Vec3ES5_S5_(ptr noundef nonnull align 16 dereferenceable(96), ptr noundef, i32 noundef, ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH9MeshShape17GetSupportingFaceERKNS_10SubShapeIDENS_4Vec3ES4_RKNS_5Mat44ERNS_11StaticArrayIS4_Lj32EEE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, double %2, double %3, double %4, double %5, ptr noundef nonnull align 16 dereferenceable(64) %6, ptr noundef nonnull align 16 dereferenceable(528) %7) unnamed_addr #4 align 2 {
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %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 i32, align 4
  %17 = alloca %"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::DecodingContext", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Mat44", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  store double %2, ptr %27, align 16
  %28 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  store double %3, ptr %28, align 8
  %29 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  store double %4, ptr %29, align 16
  %30 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  store double %5, ptr %30, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %6, ptr %13, align 8, !tbaa !5
  store ptr %7, ptr %14, align 8, !tbaa !5
  %31 = load ptr, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZNK3JPH9MeshShape16DecodeSubShapeIDERKNS_10SubShapeIDERPKvRj(ptr noundef nonnull align 8 dereferenceable(80) %31, ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.start.p0(i64 96, ptr %17) #8
  %33 = getelementptr inbounds %"class.JPH::MeshShape", ptr %31, i32 0, i32 2
  %34 = call noundef ptr @_ZN3JPHL18sGetTriangleHeaderERKNS_10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(24) %33)
  call void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags15DecodingContextC2EPKNS0_14TriangleHeaderE(ptr noundef nonnull align 16 dereferenceable(96) %17, ptr noundef %34)
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE6resizeEj(ptr noundef nonnull align 16 dereferenceable(528) %35, i32 noundef 3)
  %36 = load ptr, ptr %15, align 8, !tbaa !5
  %37 = load i32, ptr %16, align 4, !tbaa !9
  %38 = load ptr, ptr %14, align 8, !tbaa !5
  %39 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %38, i32 noundef 0)
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %40, i32 noundef 1)
  %42 = load ptr, ptr %14, align 8, !tbaa !5
  %43 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %42, i32 noundef 2)
  call void @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags15DecodingContext11GetTriangleEPKvjRNS_4Vec3ES5_S5_(ptr noundef nonnull align 16 dereferenceable(96) %17, ptr noundef %36, i32 noundef %37, ptr noundef nonnull align 16 dereferenceable(16) %39, ptr noundef nonnull align 16 dereferenceable(16) %41, ptr noundef nonnull align 16 dereferenceable(16) %43)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %10, i64 16, i1 false), !tbaa.struct !11
  %44 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %45 = load double, ptr %44, align 16
  %46 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %47 = load double, ptr %46, align 8
  %48 = call noundef zeroext i1 @_ZN3JPH12ScaleHelpers11IsInsideOutENS_4Vec3E(double %45, double %47)
  br i1 %48, label %49, label %54

49:                                               ; preds = %8
  %50 = load ptr, ptr %14, align 8, !tbaa !5
  %51 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %50, i32 noundef 1)
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %52, i32 noundef 2)
  call void @_ZSt4swapIN3JPH4Vec3EENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 16 dereferenceable(16) %51, ptr noundef nonnull align 16 dereferenceable(16) %53) #8
  br label %54

54:                                               ; preds = %49, %8
  call void @llvm.lifetime.start.p0(i64 64, ptr %19) #8
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %10, i64 16, i1 false), !tbaa.struct !11
  %56 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %57 = load double, ptr %56, align 16
  %58 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %59 = load double, ptr %58, align 8
  call void @_ZNK3JPH5Mat449PreScaledENS_4Vec3E(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %19, ptr noundef nonnull align 16 dereferenceable(64) %55, double %57, double %59)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %60, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %61 = load ptr, ptr %21, align 8, !tbaa !5
  %62 = call noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE5beginEv(ptr noundef nonnull align 16 dereferenceable(528) %61)
  store ptr %62, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %63 = load ptr, ptr %21, align 8, !tbaa !5
  %64 = call noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE3endEv(ptr noundef nonnull align 16 dereferenceable(528) %63)
  store ptr %64, ptr %23, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %85, %54
  %66 = load ptr, ptr %22, align 8, !tbaa !5
  %67 = load ptr, ptr %23, align 8, !tbaa !5
  %68 = icmp ne ptr %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  br label %88

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %71 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %71, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #8
  %72 = load ptr, ptr %24, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %72, i64 16, i1 false), !tbaa.struct !11
  %73 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %74 = load double, ptr %73, align 16
  %75 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %76 = load double, ptr %75, align 8
  %77 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %19, double %74, double %76)
  %78 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %79 = getelementptr inbounds %union.anon.14, ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds { double, double }, ptr %79, i32 0, i32 0
  %81 = extractvalue { double, double } %77, 0
  store double %81, ptr %80, align 16
  %82 = getelementptr inbounds { double, double }, ptr %79, i32 0, i32 1
  %83 = extractvalue { double, double } %77, 1
  store double %83, ptr %82, align 8
  %84 = load ptr, ptr %24, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %84, ptr align 16 %25, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %85

85:                                               ; preds = %70
  %86 = load ptr, ptr %22, align 8, !tbaa !5
  %87 = getelementptr inbounds %"class.JPH::Vec3", ptr %86, i32 1
  store ptr %87, ptr %22, align 8, !tbaa !5
  br label %65

88:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 64, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 96, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE6resizeEj(ptr noundef nonnull align 16 dereferenceable(528), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528), i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH12ScaleHelpers11IsInsideOutENS_4Vec3E(double, double) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIN3JPH4Vec3EENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE5beginEv(ptr noundef nonnull align 16 dereferenceable(528)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE3endEv(ptr noundef nonnull align 16 dereferenceable(528)) #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64), double, double) #7 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 = { 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 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 #6 = { 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 #7 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 16, !12}
!12 = !{!7, !7, 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::TriangleCodecIndexed8BitPackSOA4Flags::DecodingContext" = type { %"class.JPH::Vec4", %"class.JPH::Vec4", %"class.JPH::Vec4", %"class.JPH::Vec4", %"class.JPH::Vec4", %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.33 }
%union.anon.33 = type { <4 x float> }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }

; 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 void @_ZNK3JPH9MeshShape16DecodeSubShapeIDERKNS_10SubShapeIDERPKvRj(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden noundef ptr @_ZN3JPHL18sGetTriangleHeaderERKNS_10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags15DecodingContextC2EPKNS0_14TriangleHeaderE(ptr noundef nonnull align 16 dereferenceable(96), ptr noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags15DecodingContext11GetTriangleEPKvjRNS_4Vec3ES5_S5_(ptr noundef nonnull align 16 dereferenceable(96), ptr noundef, i32 noundef, ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH9MeshShape17GetSupportingFaceERKNS_10SubShapeIDENS_4Vec3ES4_RKNS_5Mat44ERNS_11StaticArrayIS4_Lj32EEE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, double %2, double %3, double %4, double %5, ptr noundef nonnull align 16 dereferenceable(64) %6, ptr noundef nonnull align 16 dereferenceable(528) %7) unnamed_addr #3 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::DecodingContext", align 16
  %12 = alloca %"class.JPH::Mat44", align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  call void @_ZNK3JPH9MeshShape16DecodeSubShapeIDERKNS_10SubShapeIDERPKvRj(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %11) #7
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  %14 = call noundef ptr @_ZN3JPHL18sGetTriangleHeaderERKNS_10ByteBufferE(ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags15DecodingContextC2EPKNS0_14TriangleHeaderE(ptr noundef nonnull align 16 dereferenceable(96) %11, ptr noundef %14)
  call void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE6resizeEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 3)
  %15 = load ptr, ptr %9, align 8, !tbaa !5
  %16 = load i32, ptr %10, align 4, !tbaa !9
  %17 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 0)
  %18 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 1)
  %19 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 2)
  call void @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags15DecodingContext11GetTriangleEPKvjRNS_4Vec3ES5_S5_(ptr noundef nonnull align 16 dereferenceable(96) %11, ptr noundef %15, i32 noundef %16, ptr noundef nonnull align 16 dereferenceable(16) %17, ptr noundef nonnull align 16 dereferenceable(16) %18, ptr noundef nonnull align 16 dereferenceable(16) %19)
  %20 = call noundef zeroext i1 @_ZN3JPH12ScaleHelpers11IsInsideOutENS_4Vec3E(double %4, double %5)
  br i1 %20, label %21, label %24

21:                                               ; preds = %8
  %22 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 1)
  %23 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528) %7, i32 noundef 2)
  call void @_ZSt4swapIN3JPH4Vec3EENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 16 dereferenceable(16) %22, ptr noundef nonnull align 16 dereferenceable(16) %23) #7
  br label %24

24:                                               ; preds = %21, %8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #7
  call void @_ZNK3JPH5Mat449PreScaledENS_4Vec3E(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %12, ptr noundef nonnull align 16 dereferenceable(64) %6, double %4, double %5)
  %25 = call noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE5beginEv(ptr noundef nonnull align 16 dereferenceable(528) %7)
  %26 = call noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE3endEv(ptr noundef nonnull align 16 dereferenceable(528) %7)
  %.not25 = icmp eq ptr %25, %26
  br i1 %.not25, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %24
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  ret void

.lr.ph:                                           ; preds = %24, %.lr.ph
  %.026 = phi ptr [ %30, %.lr.ph ], [ %25, %24 ]
  %.sroa.0.0.copyload = load double, ptr %.026, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %.026, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !11
  %27 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %12, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %28 = extractvalue { double, double } %27, 0
  %29 = extractvalue { double, double } %27, 1
  store double %28, ptr %.026, align 16
  store double %29, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !11
  %30 = getelementptr inbounds i8, ptr %.026, i64 16
  %.not = icmp eq ptr %30, %26
  br i1 %.not, label %._crit_edge, label %.lr.ph
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE6resizeEj(ptr noundef nonnull align 16 dereferenceable(528), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EEixEj(ptr noundef nonnull align 16 dereferenceable(528), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH12ScaleHelpers11IsInsideOutENS_4Vec3E(double, double) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIN3JPH4Vec3EENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE5beginEv(ptr noundef nonnull align 16 dereferenceable(528)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH11StaticArrayINS_4Vec3ELj32EE3endEv(ptr noundef nonnull align 16 dereferenceable(528)) local_unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64), double, double) local_unnamed_addr #6 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 = { 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 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 #5 = { 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 #6 = { 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 #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 = !{!"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 = !{!7, !7, i64 0}


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