; LLVM IR from jrouwe/JoltPhysics :: Jolt/Skeleton (SkeletonMapper)

; 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 }
%union.anon = type { <4 x float> }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::SkeletonMapper::Locked" = type { i32, i32, %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.22 }
%union.anon.22 = type { <4 x float> }
%"class.JPH::Skeleton::Joint" = type <{ %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.21 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.21 = type { i64, [8 x i8] }
%"class.JPH::SkeletonMapper" = type { %"class.JPH::RefTarget", %"class.JPH::Array", %"class.JPH::Array.0", %"class.JPH::Array.3", %"class.JPH::Array.6" }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.0" = type { i64, i64, ptr }
%"class.JPH::Array.3" = type { i64, i64, ptr }
%"class.JPH::Array.6" = type { i64, i64, ptr }

@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1

; 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH8Skeleton13GetJointCountEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(68) ptr @_ZNK3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH14SkeletonMapper16LockTranslationsEPKNS_8SkeletonEPKbPKNS_5Mat44E(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.JPH::AssertLastParam", align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.JPH::SkeletonMapper::Locked", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Mat44", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  br label %18

18:                                               ; preds = %4
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call noundef zeroext i1 @_ZNK3JPH8Skeleton25AreJointsCorrectlyOrderedEv(ptr noundef nonnull align 8 dereferenceable(32) %19)
  br i1 %20, label %24, label %21

21:                                               ; preds = %18
  %22 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 114)
  br i1 %22, label %23, label %24

23:                                               ; preds = %21
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !9
  br label %24

24:                                               ; preds = %23, %21, %18
  br label %25

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call noundef i32 @_ZNK3JPH8Skeleton13GetJointCountEv(ptr noundef nonnull align 8 dereferenceable(32) %26)
  store i32 %27, ptr %10, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !10
  br label %28

28:                                               ; preds = %97, %25
  %29 = load i32, ptr %11, align 4, !tbaa !10
  %30 = load i32, ptr %10, align 4, !tbaa !10
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %100

33:                                               ; preds = %28
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load i32, ptr %11, align 4, !tbaa !10
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i8, ptr %34, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !12, !range !14, !noundef !15
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %96

40:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  %41 = load i32, ptr %11, align 4, !tbaa !10
  %42 = getelementptr inbounds %"class.JPH::SkeletonMapper::Locked", ptr %12, i32 0, i32 0
  store i32 %41, ptr %42, align 16, !tbaa !16
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load i32, ptr %11, align 4, !tbaa !10
  %45 = call noundef nonnull align 8 dereferenceable(68) ptr @_ZNK3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32) %43, i32 noundef %44)
  %46 = getelementptr inbounds %"class.JPH::Skeleton::Joint", ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !19
  %48 = getelementptr inbounds %"class.JPH::SkeletonMapper::Locked", ptr %12, i32 0, i32 1
  store i32 %47, ptr %48, align 4, !tbaa !24
  %49 = getelementptr inbounds %"class.JPH::SkeletonMapper::Locked", ptr %12, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !24
  %51 = icmp sge i32 %50, 0
  br i1 %51, label %52, label %81

52:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %14) #7
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.JPH::SkeletonMapper::Locked", ptr %12, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !24
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %"class.JPH::Mat44", ptr %53, i64 %56
  call void @_ZNK3JPH5Mat448InversedEv(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %14, ptr noundef nonnull align 16 dereferenceable(64) %57)
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = load i32, ptr %11, align 4, !tbaa !10
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %"class.JPH::Mat44", ptr %58, i64 %60
  %62 = call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %61)
  %63 = getelementptr inbounds %"class.JPH::Vec3", ptr %15, i32 0, i32 0
  %64 = getelementptr inbounds %union.anon.22, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds { double, double }, ptr %64, i32 0, i32 0
  %66 = extractvalue { double, double } %62, 0
  store double %66, ptr %65, align 16
  %67 = getelementptr inbounds { double, double }, ptr %64, i32 0, i32 1
  %68 = extractvalue { double, double } %62, 1
  store double %68, ptr %67, align 8
  %69 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %70 = load double, ptr %69, align 16
  %71 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %72 = load double, ptr %71, align 8
  %73 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %14, double %70, double %72)
  %74 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %75 = getelementptr inbounds %union.anon.22, ptr %74, i32 0, i32 0
  %76 = getelementptr inbounds { double, double }, ptr %75, i32 0, i32 0
  %77 = extractvalue { double, double } %73, 0
  store double %77, ptr %76, align 16
  %78 = getelementptr inbounds { double, double }, ptr %75, i32 0, i32 1
  %79 = extractvalue { double, double } %73, 1
  store double %79, ptr %78, align 8
  %80 = getelementptr inbounds %"class.JPH::SkeletonMapper::Locked", ptr %12, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %80, ptr align 16 %13, i64 16, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  br label %94

81:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !10
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds %"class.JPH::Mat44", ptr %82, i64 %84
  %86 = call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %85)
  %87 = getelementptr inbounds %"class.JPH::Vec3", ptr %16, i32 0, i32 0
  %88 = getelementptr inbounds %union.anon.22, 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
  %93 = getelementptr inbounds %"class.JPH::SkeletonMapper::Locked", ptr %12, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %93, ptr align 16 %16, i64 16, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  br label %94

94:                                               ; preds = %81, %52
  %95 = getelementptr inbounds %"class.JPH::SkeletonMapper", ptr %17, i32 0, i32 4
  call void @_ZN3JPH5ArrayINS_14SkeletonMapper6LockedENS_12STLAllocatorIS2_EEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %95, ptr noundef nonnull align 16 dereferenceable(32) %12)
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %96

96:                                               ; preds = %94, %33
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %11, align 4, !tbaa !10
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %11, align 4, !tbaa !10
  br label %28, !llvm.loop !27

100:                                              ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  ret void
}

declare noundef zeroext i1 @_ZNK3JPH8Skeleton25AreJointsCorrectlyOrderedEv(ptr noundef nonnull align 8 dereferenceable(32)) #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayINS_14SkeletonMapper6LockedENS_12STLAllocatorIS2_EEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(32)) #1 align 2

attributes #0 = { 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 = { 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 = { "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 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 2157111960}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !11, i64 0}
!17 = !{!"_ZTSN3JPH14SkeletonMapper6LockedE", !11, i64 0, !11, i64 4, !18, i64 16}
!18 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!19 = !{!20, !11, i64 64}
!20 = !{!"_ZTSN3JPH8Skeleton5JointE", !21, i64 0, !21, i64 32, !11, i64 64}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !22, i64 0, !23, i64 8, !7, i64 16}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !6, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!17, !11, i64 4}
!25 = !{i64 0, i64 16, !26}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"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::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SkeletonMapper::Locked" = type { i32, i32, %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.22 }
%union.anon.22 = type { <4 x float> }

@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1

; 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 zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH8Skeleton13GetJointCountEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(68) ptr @_ZNK3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH14SkeletonMapper16LockTranslationsEPKNS_8SkeletonEPKbPKNS_5Mat44E(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %1, ptr nocapture noundef readonly %2, ptr noundef %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %"class.JPH::SkeletonMapper::Locked", align 16
  %6 = alloca %"class.JPH::Mat44", align 16
  %7 = tail call noundef zeroext i1 @_ZNK3JPH8Skeleton25AreJointsCorrectlyOrderedEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  br i1 %7, label %11, label %8

8:                                                ; preds = %4
  %9 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 114)
  br i1 %9, label %10, label %11

10:                                               ; preds = %8
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !5
  br label %11

11:                                               ; preds = %4, %8, %10
  %12 = tail call noundef i32 @_ZNK3JPH8Skeleton13GetJointCountEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %11
  %14 = getelementptr inbounds i8, ptr %5, i64 4
  %15 = getelementptr inbounds i8, ptr %5, i64 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 24
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %wide.trip.count = zext nneg i32 %12 to i64
  br label %17

._crit_edge:                                      ; preds = %43, %11
  ret void

17:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %18 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv
  %19 = load i8, ptr %18, align 1, !tbaa !6, !range !10, !noundef !11
  %20 = trunc nuw i8 %19 to i1
  br i1 %20, label %21, label %43

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  %22 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %22, ptr %5, align 16, !tbaa !12
  %23 = call noundef nonnull align 8 dereferenceable(68) ptr @_ZNK3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %22)
  %24 = getelementptr inbounds i8, ptr %23, i64 64
  %25 = load i32, ptr %24, align 8, !tbaa !16
  store i32 %25, ptr %14, align 4, !tbaa !22
  %26 = icmp sgt i32 %25, -1
  br i1 %26, label %27, label %37

27:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #6
  %28 = zext nneg i32 %25 to i64
  %29 = getelementptr inbounds %"class.JPH::Mat44", ptr %3, i64 %28
  call void @_ZNK3JPH5Mat448InversedEv(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %6, ptr noundef nonnull align 16 dereferenceable(64) %29)
  %30 = getelementptr inbounds %"class.JPH::Mat44", ptr %3, i64 %indvars.iv
  %31 = call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %30)
  %32 = extractvalue { double, double } %31, 0
  %33 = extractvalue { double, double } %31, 1
  %34 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %6, double %32, double %33)
  %35 = extractvalue { double, double } %34, 0
  %36 = extractvalue { double, double } %34, 1
  store double %35, ptr %15, align 16
  store double %36, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #6
  br label %42

37:                                               ; preds = %21
  %38 = getelementptr inbounds %"class.JPH::Mat44", ptr %3, i64 %indvars.iv
  %39 = call { double, double } @_ZNK3JPH5Mat4414GetTranslationEv(ptr noundef nonnull align 16 dereferenceable(64) %38)
  %40 = extractvalue { double, double } %39, 0
  %41 = extractvalue { double, double } %39, 1
  store double %40, ptr %15, align 16
  store double %41, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !23
  br label %42

42:                                               ; preds = %37, %27
  call void @_ZN3JPH5ArrayINS_14SkeletonMapper6LockedENS_12STLAllocatorIS2_EEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 16 dereferenceable(32) %5)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %43

43:                                               ; preds = %17, %42
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %17, !llvm.loop !24
}

declare noundef zeroext i1 @_ZNK3JPH8Skeleton25AreJointsCorrectlyOrderedEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayINS_14SkeletonMapper6LockedENS_12STLAllocatorIS2_EEE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #1 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 = { 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 = { "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 = { 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 #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 2157111960}
!6 = !{!7, !7, i64 0}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{i8 0, i8 2}
!11 = !{}
!12 = !{!13, !14, i64 0}
!13 = !{!"_ZTSN3JPH14SkeletonMapper6LockedE", !14, i64 0, !14, i64 4, !15, i64 16}
!14 = !{!"int", !8, i64 0}
!15 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!16 = !{!17, !14, i64 64}
!17 = !{!"_ZTSN3JPH8Skeleton5JointE", !18, i64 0, !18, i64 32, !14, i64 64}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !19, i64 0, !21, i64 8, !8, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !20, i64 0}
!20 = !{!"any pointer", !8, i64 0}
!21 = !{!"long", !8, i64 0}
!22 = !{!13, !14, i64 4}
!23 = !{!8, !8, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass