; LLVM IR from jrouwe/JoltPhysics :: Jolt/Skeleton/SkeletalAnimation.ll (ZNK3JPH17SkeletalAnimation6SampleEfRNS_12SkeletonPoseE)

; 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"

%"struct.JPH::AssertLastParam" = type { i8 }
%"class.std::basic_string_view" = type { i64, ptr }
%"class.JPH::Vec3" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SkeletalAnimation" = type <{ %"class.JPH::RefTarget", [4 x i8], %"class.JPH::Array", i8, [7 x i8] }>
%"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::SkeletalAnimation::AnimatedJoint" = type { %"class.std::__cxx11::basic_string", %"class.JPH::Array.18" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.17 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.17 = type { i64, [8 x i8] }
%"class.JPH::Array.18" = type { i64, i64, ptr }
%"class.JPH::SkeletalAnimation::Keyframe" = type <{ %"class.JPH::SkeletalAnimation::JointState", float, [12 x i8] }>
%"class.JPH::SkeletalAnimation::JointState" = type { %"class.JPH::Quat", %"class.JPH::Vec3" }

@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 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: 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: mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH17SkeletalAnimation11GetDurationEv(ptr noundef nonnull align 8 dereferenceable(33)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH17SkeletalAnimation6SampleEfRNS_12SkeletonPoseE(ptr noundef nonnull align 8 dereferenceable(33) %0, float noundef %1, ptr noundef nonnull align 16 dereferenceable(80) %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.JPH::AssertLastParam", align 1
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %"class.std::basic_string_view", align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca float, align 4
  %22 = alloca %"struct.JPH::AssertLastParam", align 1
  %23 = alloca %"class.JPH::Vec3", align 16
  %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 %"struct.JPH::AssertLastParam", align 1
  %29 = alloca %"struct.JPH::AssertLastParam", align 1
  %30 = alloca %"class.JPH::Quat", align 16
  %31 = alloca %"class.JPH::Quat", align 16
  %32 = alloca %"struct.JPH::AssertLastParam", align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store float %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %4, align 8
  br label %34

34:                                               ; preds = %3
  %35 = load float, ptr %5, align 4, !tbaa !9
  %36 = fcmp oge float %35, 0.000000e+00
  br i1 %36, label %40, label %37

37:                                               ; preds = %34
  %38 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.4, ptr noundef @.str.5, i32 noundef 65)
  br i1 %38, label %39, label %40

39:                                               ; preds = %37
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !11
  br label %40

40:                                               ; preds = %39, %37, %34
  br label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %42 = call noundef float @_ZNK3JPH17SkeletalAnimation11GetDurationEv(ptr noundef nonnull align 8 dereferenceable(33) %33)
  store float %42, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %43 = load float, ptr %8, align 4, !tbaa !9
  %44 = fcmp ogt float %43, 0.000000e+00
  br i1 %44, label %45, label %53

45:                                               ; preds = %41
  %46 = getelementptr inbounds %"class.JPH::SkeletalAnimation", ptr %33, i32 0, i32 3
  %47 = load i8, ptr %46, align 8, !tbaa !12, !range !21, !noundef !22
  %48 = trunc i8 %47 to i1
  br i1 %48, label %49, label %53

49:                                               ; preds = %45
  %50 = load float, ptr %5, align 4, !tbaa !9
  %51 = load float, ptr %8, align 4, !tbaa !9
  %52 = call noundef float @_ZSt4fmodff(float noundef %50, float noundef %51)
  br label %55

53:                                               ; preds = %45, %41
  %54 = load float, ptr %5, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %53, %49
  %56 = phi float [ %52, %49 ], [ %54, %53 ]
  store float %56, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %57 = getelementptr inbounds %"class.JPH::SkeletalAnimation", ptr %33, i32 0, i32 2
  store ptr %57, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = call noundef ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation13AnimatedJointENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %58)
  store ptr %59, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = call noundef ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation13AnimatedJointENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %60)
  store ptr %61, ptr %12, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %259, %55
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = icmp ne ptr %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %262

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %68, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %69, i32 0, i32 1
  %71 = call noundef i64 @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %70)
  %72 = trunc i64 %71 to i32
  store i32 %72, ptr %14, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 -1, ptr %15, align 4, !tbaa !23
  br label %73

73:                                               ; preds = %96, %67
  %74 = load i32, ptr %14, align 4, !tbaa !23
  %75 = load i32, ptr %15, align 4, !tbaa !23
  %76 = sub nsw i32 %74, %75
  %77 = icmp sgt i32 %76, 1
  br i1 %77, label %78, label %97

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  %79 = load i32, ptr %14, align 4, !tbaa !23
  %80 = load i32, ptr %15, align 4, !tbaa !23
  %81 = add nsw i32 %79, %80
  %82 = sdiv i32 %81, 2
  store i32 %82, ptr %16, align 4, !tbaa !23
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %83, i32 0, i32 1
  %85 = load i32, ptr %16, align 4, !tbaa !23
  %86 = sext i32 %85 to i64
  %87 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %86)
  %88 = getelementptr inbounds %"class.JPH::SkeletalAnimation::Keyframe", ptr %87, i32 0, i32 1
  %89 = load float, ptr %88, align 16, !tbaa !24
  %90 = load float, ptr %9, align 4, !tbaa !9
  %91 = fcmp olt float %89, %90
  br i1 %91, label %92, label %94

92:                                               ; preds = %78
  %93 = load i32, ptr %16, align 4, !tbaa !23
  store i32 %93, ptr %15, align 4, !tbaa !23
  br label %96

94:                                               ; preds = %78
  %95 = load i32, ptr %16, align 4, !tbaa !23
  store i32 %95, ptr %14, align 4, !tbaa !23
  br label %96

96:                                               ; preds = %94, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %73, !llvm.loop !30

97:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = call noundef ptr @_ZNK3JPH12SkeletonPose11GetSkeletonEv(ptr noundef nonnull align 16 dereferenceable(80) %99)
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #9
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %101, i32 0, i32 0
  %103 = call { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32) %102) #9
  %104 = getelementptr inbounds { i64, ptr }, ptr %18, i32 0, i32 0
  %105 = extractvalue { i64, ptr } %103, 0
  store i64 %105, ptr %104, align 8
  %106 = getelementptr inbounds { i64, ptr }, ptr %18, i32 0, i32 1
  %107 = extractvalue { i64, ptr } %103, 1
  store ptr %107, ptr %106, align 8
  %108 = call noundef i32 @_ZNK3JPH8Skeleton13GetJointIndexERKSt17basic_string_viewIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(32) %100, ptr noundef nonnull align 8 dereferenceable(16) %18)
  %109 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZN3JPH12SkeletonPose8GetJointEi(ptr noundef nonnull align 16 dereferenceable(80) %98, i32 noundef %108)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #9
  store ptr %109, ptr %17, align 8, !tbaa !5
  %110 = load i32, ptr %15, align 4, !tbaa !23
  %111 = icmp eq i32 %110, -1
  br i1 %111, label %112, label %117

112:                                              ; preds = %97
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %113, i32 0, i32 1
  %115 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %114)
  %116 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %116, ptr align 16 %115, i64 32, i1 false), !tbaa.struct !32
  br label %258

117:                                              ; preds = %97
  %118 = load i32, ptr %14, align 4, !tbaa !23
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %119, i32 0, i32 1
  %121 = call noundef i64 @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %120)
  %122 = trunc i64 %121 to i32
  %123 = icmp eq i32 %118, %122
  br i1 %123, label %124, label %129

124:                                              ; preds = %117
  %125 = load ptr, ptr %13, align 8, !tbaa !5
  %126 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %125, i32 0, i32 1
  %127 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %126)
  %128 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %128, ptr align 16 %127, i64 32, i1 false), !tbaa.struct !32
  br label %257

129:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  %131 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %130, i32 0, i32 1
  %132 = load i32, ptr %15, align 4, !tbaa !23
  %133 = sext i32 %132 to i64
  %134 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %131, i64 noundef %133)
  store ptr %134, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %135, i32 0, i32 1
  %137 = load i32, ptr %15, align 4, !tbaa !23
  %138 = add nsw i32 %137, 1
  %139 = sext i32 %138 to i64
  %140 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %136, i64 noundef %139)
  store ptr %140, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  %141 = load float, ptr %9, align 4, !tbaa !9
  %142 = load ptr, ptr %19, align 8, !tbaa !5
  %143 = getelementptr inbounds %"class.JPH::SkeletalAnimation::Keyframe", ptr %142, i32 0, i32 1
  %144 = load float, ptr %143, align 16, !tbaa !24
  %145 = fsub float %141, %144
  %146 = load ptr, ptr %20, align 8, !tbaa !5
  %147 = getelementptr inbounds %"class.JPH::SkeletalAnimation::Keyframe", ptr %146, i32 0, i32 1
  %148 = load float, ptr %147, align 16, !tbaa !24
  %149 = load ptr, ptr %19, align 8, !tbaa !5
  %150 = getelementptr inbounds %"class.JPH::SkeletalAnimation::Keyframe", ptr %149, i32 0, i32 1
  %151 = load float, ptr %150, align 16, !tbaa !24
  %152 = fsub float %148, %151
  %153 = fdiv float %145, %152
  store float %153, ptr %21, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %129
  %155 = load float, ptr %21, align 4, !tbaa !9
  %156 = fcmp oge float %155, 0.000000e+00
  br i1 %156, label %157, label %160

157:                                              ; preds = %154
  %158 = load float, ptr %21, align 4, !tbaa !9
  %159 = fcmp ole float %158, 1.000000e+00
  br i1 %159, label %163, label %160

160:                                              ; preds = %157, %154
  %161 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.6, ptr noundef @.str.5, i32 noundef 101)
  br i1 %161, label %162, label %163

162:                                              ; preds = %160
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !34
  br label %163

163:                                              ; preds = %162, %160, %157
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #9
  %166 = load float, ptr %21, align 4, !tbaa !9
  %167 = fsub float 1.000000e+00, %166
  %168 = load ptr, ptr %19, align 8, !tbaa !5
  %169 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %168, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %169, i64 16, i1 false), !tbaa.struct !35
  %170 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %171 = load double, ptr %170, align 16
  %172 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %173 = load double, ptr %172, align 8
  %174 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %167, double %171, double %173)
  %175 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %176 = getelementptr inbounds %union.anon.6, ptr %175, i32 0, i32 0
  %177 = getelementptr inbounds { double, double }, ptr %176, i32 0, i32 0
  %178 = extractvalue { double, double } %174, 0
  store double %178, ptr %177, align 16
  %179 = getelementptr inbounds { double, double }, ptr %176, i32 0, i32 1
  %180 = extractvalue { double, double } %174, 1
  store double %180, ptr %179, align 8
  %181 = load float, ptr %21, align 4, !tbaa !9
  %182 = load ptr, ptr %20, align 8, !tbaa !5
  %183 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %182, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 16 %183, i64 16, i1 false), !tbaa.struct !35
  %184 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %185 = load double, ptr %184, align 16
  %186 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %187 = load double, ptr %186, align 8
  %188 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %181, double %185, double %187)
  %189 = getelementptr inbounds %"class.JPH::Vec3", ptr %26, i32 0, i32 0
  %190 = getelementptr inbounds %union.anon.6, ptr %189, i32 0, i32 0
  %191 = getelementptr inbounds { double, double }, ptr %190, i32 0, i32 0
  %192 = extractvalue { double, double } %188, 0
  store double %192, ptr %191, align 16
  %193 = getelementptr inbounds { double, double }, ptr %190, i32 0, i32 1
  %194 = extractvalue { double, double } %188, 1
  store double %194, ptr %193, align 8
  %195 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %196 = load double, ptr %195, align 16
  %197 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %198 = load double, ptr %197, align 8
  %199 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %24, double %196, double %198)
  %200 = getelementptr inbounds %"class.JPH::Vec3", ptr %23, i32 0, i32 0
  %201 = getelementptr inbounds %union.anon.6, ptr %200, i32 0, i32 0
  %202 = getelementptr inbounds { double, double }, ptr %201, i32 0, i32 0
  %203 = extractvalue { double, double } %199, 0
  store double %203, ptr %202, align 16
  %204 = getelementptr inbounds { double, double }, ptr %201, i32 0, i32 1
  %205 = extractvalue { double, double } %199, 1
  store double %205, ptr %204, align 8
  %206 = load ptr, ptr %17, align 8, !tbaa !5
  %207 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %206, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %207, ptr align 16 %23, i64 16, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #9
  br label %208

208:                                              ; preds = %165
  %209 = load ptr, ptr %19, align 8, !tbaa !5
  %210 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %209, i32 0, i32 0
  %211 = call noundef zeroext i1 @_ZNK3JPH4Quat12IsNormalizedEf(ptr noundef nonnull align 16 dereferenceable(16) %210, float noundef 0x3EE4F8B580000000)
  br i1 %211, label %215, label %212

212:                                              ; preds = %208
  %213 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.7, ptr noundef @.str.5, i32 noundef 104)
  br i1 %213, label %214, label %215

214:                                              ; preds = %212
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !36
  br label %215

215:                                              ; preds = %214, %212, %208
  br label %216

216:                                              ; preds = %215
  br label %217

217:                                              ; preds = %216
  br label %218

218:                                              ; preds = %217
  %219 = load ptr, ptr %20, align 8, !tbaa !5
  %220 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %219, i32 0, i32 0
  %221 = call noundef zeroext i1 @_ZNK3JPH4Quat12IsNormalizedEf(ptr noundef nonnull align 16 dereferenceable(16) %220, float noundef 0x3EE4F8B580000000)
  br i1 %221, label %225, label %222

222:                                              ; preds = %218
  %223 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.8, ptr noundef @.str.5, i32 noundef 105)
  br i1 %223, label %224, label %225

224:                                              ; preds = %222
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !37
  br label %225

225:                                              ; preds = %224, %222, %218
  br label %226

226:                                              ; preds = %225
  br label %227

227:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #9
  %228 = load ptr, ptr %19, align 8, !tbaa !5
  %229 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %228, i32 0, i32 0
  %230 = load ptr, ptr %20, align 8, !tbaa !5
  %231 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %230, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %31, ptr align 16 %231, i64 16, i1 false), !tbaa.struct !35
  %232 = load float, ptr %21, align 4, !tbaa !9
  %233 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %234 = load double, ptr %233, align 16
  %235 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %236 = load double, ptr %235, align 8
  %237 = call { double, double } @_ZNK3JPH4Quat5SLERPES0_f(ptr noundef nonnull align 16 dereferenceable(16) %229, double %234, double %236, float noundef %232)
  %238 = getelementptr inbounds %"class.JPH::Quat", ptr %30, i32 0, i32 0
  %239 = getelementptr inbounds %"class.JPH::Vec4", ptr %238, i32 0, i32 0
  %240 = getelementptr inbounds %union.anon, ptr %239, i32 0, i32 0
  %241 = getelementptr inbounds { double, double }, ptr %240, i32 0, i32 0
  %242 = extractvalue { double, double } %237, 0
  store double %242, ptr %241, align 16
  %243 = getelementptr inbounds { double, double }, ptr %240, i32 0, i32 1
  %244 = extractvalue { double, double } %237, 1
  store double %244, ptr %243, align 8
  %245 = load ptr, ptr %17, align 8, !tbaa !5
  %246 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %245, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %246, ptr align 16 %30, i64 16, i1 false), !tbaa.struct !35
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #9
  br label %247

247:                                              ; preds = %227
  %248 = load ptr, ptr %17, align 8, !tbaa !5
  %249 = getelementptr inbounds %"class.JPH::SkeletalAnimation::JointState", ptr %248, i32 0, i32 0
  %250 = call noundef zeroext i1 @_ZNK3JPH4Quat12IsNormalizedEf(ptr noundef nonnull align 16 dereferenceable(16) %249, float noundef 0x3EE4F8B580000000)
  br i1 %250, label %254, label %251

251:                                              ; preds = %247
  %252 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.9, ptr noundef @.str.5, i32 noundef 107)
  br i1 %252, label %253, label %254

253:                                              ; preds = %251
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !38
  br label %254

254:                                              ; preds = %253, %251, %247
  br label %255

255:                                              ; preds = %254
  br label %256

256:                                              ; preds = %255
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br label %257

257:                                              ; preds = %256, %124
  br label %258

258:                                              ; preds = %257, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %259

259:                                              ; preds = %258
  %260 = load ptr, ptr %11, align 8, !tbaa !5
  %261 = getelementptr inbounds %"class.JPH::SkeletalAnimation::AnimatedJoint", ptr %260, i32 1
  store ptr %261, ptr %11, align 8, !tbaa !5
  br label %62

262:                                              ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fmodff(float noundef, float noundef) #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZN3JPH12SkeletonPose8GetJointEi(ptr noundef nonnull align 16 dereferenceable(80), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3JPH12SkeletonPose11GetSkeletonEv(ptr noundef nonnull align 16 dereferenceable(80)) #2 align 2

declare noundef i32 @_ZNK3JPH8Skeleton13GetJointIndexERKSt17basic_string_viewIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH4Quat12IsNormalizedEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { "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 = { 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 #9 = { 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 2157458785}
!12 = !{!13, !20, i64 32}
!13 = !{!"_ZTSN3JPH17SkeletalAnimationE", !14, i64 0, !18, i64 8, !20, i64 32}
!14 = !{!"_ZTSN3JPH9RefTargetINS_17SkeletalAnimationEEE", !15, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN3JPH5ArrayINS_17SkeletalAnimation13AnimatedJointENS_12STLAllocatorIS2_EEEE", !19, i64 0, !19, i64 8, !6, i64 16}
!19 = !{!"long", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!17, !17, i64 0}
!24 = !{!25, !10, i64 32}
!25 = !{!"_ZTSN3JPH17SkeletalAnimation8KeyframeE", !26, i64 0, !10, i64 32}
!26 = !{!"_ZTSN3JPH17SkeletalAnimation10JointStateE", !27, i64 0, !29, i64 16}
!27 = !{!"_ZTSN3JPH4QuatE", !28, i64 0}
!28 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!29 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{i64 0, i64 16, !33, i64 16, i64 16, !33}
!33 = !{!7, !7, i64 0}
!34 = !{i64 2157459153}
!35 = !{i64 0, i64 16, !33}
!36 = !{i64 2157459503}
!37 = !{i64 2157459853}
!38 = !{i64 2157460209}


; 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.std::basic_string_view" = type { i64, ptr }
%"class.JPH::Vec3" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }

@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 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: 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: mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH17SkeletalAnimation11GetDurationEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH17SkeletalAnimation6SampleEfRNS_12SkeletonPoseE(ptr noundef nonnull align 8 dereferenceable(33) %0, float noundef %1, ptr noundef nonnull align 16 dereferenceable(80) %2) local_unnamed_addr #2 align 2 {
  %4 = alloca %"class.std::basic_string_view", align 8
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = fcmp ult float %1, 0.000000e+00
  br i1 %6, label %7, label %10

7:                                                ; preds = %3
  %8 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, i32 noundef 65)
  br i1 %8, label %9, label %10

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

10:                                               ; preds = %3, %7, %9
  %11 = tail call noundef float @_ZNK3JPH17SkeletalAnimation11GetDurationEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %12 = fcmp ogt float %11, 0.000000e+00
  br i1 %12, label %13, label %19

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = load i8, ptr %14, align 8, !tbaa !6, !range !18, !noundef !19
  %16 = trunc nuw i8 %15 to i1
  br i1 %16, label %17, label %19

17:                                               ; preds = %13
  %18 = tail call noundef float @_ZSt4fmodff(float noundef %1, float noundef %11)
  br label %19

19:                                               ; preds = %10, %13, %17
  %20 = phi float [ %18, %17 ], [ %1, %13 ], [ %1, %10 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = tail call noundef ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation13AnimatedJointENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %23 = tail call noundef ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation13AnimatedJointENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %.not70 = icmp eq ptr %22, %23
  br i1 %.not70, label %._crit_edge74, label %.lr.ph73

.lr.ph73:                                         ; preds = %19
  %24 = getelementptr inbounds i8, ptr %4, i64 8
  %25 = getelementptr inbounds i8, ptr %5, i64 8
  br label %26

._crit_edge74:                                    ; preds = %104, %19
  ret void

26:                                               ; preds = %.lr.ph73, %104
  %.071 = phi ptr [ %22, %.lr.ph73 ], [ %105, %104 ]
  %27 = getelementptr inbounds i8, ptr %.071, i64 32
  %28 = call noundef i64 @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %29 = trunc i64 %28 to i32
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %26, %.lr.ph
  %.06368 = phi i32 [ %.063., %.lr.ph ], [ %29, %26 ]
  %.06467 = phi i32 [ %..064, %.lr.ph ], [ -1, %26 ]
  %31 = add nsw i32 %.06368, %.06467
  %32 = sdiv i32 %31, 2
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %33)
  %35 = getelementptr inbounds i8, ptr %34, i64 32
  %36 = load float, ptr %35, align 16, !tbaa !20
  %37 = fcmp olt float %36, %20
  %..064 = select i1 %37, i32 %32, i32 %.06467
  %.063. = select i1 %37, i32 %.06368, i32 %32
  %38 = sub nsw i32 %.063., %..064
  %39 = icmp sgt i32 %38, 1
  br i1 %39, label %.lr.ph, label %._crit_edge, !llvm.loop !27

._crit_edge:                                      ; preds = %.lr.ph, %26
  %.064.lcssa = phi i32 [ -1, %26 ], [ %..064, %.lr.ph ]
  %.063.lcssa = phi i32 [ %29, %26 ], [ %.063., %.lr.ph ]
  %40 = call noundef ptr @_ZNK3JPH12SkeletonPose11GetSkeletonEv(ptr noundef nonnull align 16 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  %41 = call { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32) %.071) #9
  %42 = extractvalue { i64, ptr } %41, 0
  store i64 %42, ptr %4, align 8
  %43 = extractvalue { i64, ptr } %41, 1
  store ptr %43, ptr %24, align 8
  %44 = call noundef i32 @_ZNK3JPH8Skeleton13GetJointIndexERKSt17basic_string_viewIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(32) %40, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %45 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZN3JPH12SkeletonPose8GetJointEi(ptr noundef nonnull align 16 dereferenceable(80) %2, i32 noundef %44)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  %46 = icmp eq i32 %.064.lcssa, -1
  br i1 %46, label %47, label %49

47:                                               ; preds = %._crit_edge
  %48 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %45, ptr noundef nonnull align 16 dereferenceable(32) %48, i64 32, i1 false), !tbaa.struct !29
  br label %104

49:                                               ; preds = %._crit_edge
  %50 = call noundef i64 @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  %51 = trunc i64 %50 to i32
  %52 = icmp eq i32 %.063.lcssa, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %49
  %54 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %45, ptr noundef nonnull align 16 dereferenceable(32) %54, i64 32, i1 false), !tbaa.struct !29
  br label %104

55:                                               ; preds = %49
  %56 = sext i32 %.064.lcssa to i64
  %57 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %56)
  %58 = add nuw nsw i32 %.064.lcssa, 1
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %59)
  %61 = getelementptr inbounds i8, ptr %57, i64 32
  %62 = load float, ptr %61, align 16, !tbaa !20
  %63 = fsub float %20, %62
  %64 = getelementptr inbounds i8, ptr %60, i64 32
  %65 = load float, ptr %64, align 16, !tbaa !20
  %66 = fsub float %65, %62
  %67 = fdiv float %63, %66
  %68 = fcmp oge float %67, 0.000000e+00
  %69 = fcmp ole float %67, 1.000000e+00
  %or.cond = and i1 %68, %69
  br i1 %or.cond, label %73, label %70

70:                                               ; preds = %55
  %71 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.5, i32 noundef 101)
  br i1 %71, label %72, label %73

72:                                               ; preds = %70
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !31
  br label %73

73:                                               ; preds = %55, %72, %70
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #9
  %74 = fsub float 1.000000e+00, %67
  %75 = getelementptr inbounds i8, ptr %57, i64 16
  %.sroa.07.0.copyload = load double, ptr %75, align 16
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %57, i64 24
  %.sroa.28.0.copyload = load double, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !30
  %76 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %74, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload)
  %77 = extractvalue { double, double } %76, 0
  store double %77, ptr %5, align 16
  %78 = extractvalue { double, double } %76, 1
  store double %78, ptr %25, align 8
  %79 = getelementptr inbounds i8, ptr %60, i64 16
  %.sroa.03.0.copyload = load double, ptr %79, align 16
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %60, i64 24
  %.sroa.24.0.copyload = load double, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !30
  %80 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %67, double %.sroa.03.0.copyload, double %.sroa.24.0.copyload)
  %81 = extractvalue { double, double } %80, 0
  %82 = extractvalue { double, double } %80, 1
  %83 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %5, double %81, double %82)
  %84 = extractvalue { double, double } %83, 0
  %85 = extractvalue { double, double } %83, 1
  %86 = getelementptr inbounds i8, ptr %45, i64 16
  store double %84, ptr %86, align 16
  %.sroa.410.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 24
  store double %85, ptr %.sroa.410.0..sroa_idx, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  %87 = call noundef zeroext i1 @_ZNK3JPH4Quat12IsNormalizedEf(ptr noundef nonnull align 16 dereferenceable(16) %57, float noundef 0x3EE4F8B580000000)
  br i1 %87, label %91, label %88

88:                                               ; preds = %73
  %89 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.5, i32 noundef 104)
  br i1 %89, label %90, label %91

90:                                               ; preds = %88
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !32
  br label %91

91:                                               ; preds = %73, %88, %90
  %92 = call noundef zeroext i1 @_ZNK3JPH4Quat12IsNormalizedEf(ptr noundef nonnull align 16 dereferenceable(16) %60, float noundef 0x3EE4F8B580000000)
  br i1 %92, label %96, label %93

93:                                               ; preds = %91
  %94 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.5, i32 noundef 105)
  br i1 %94, label %95, label %96

95:                                               ; preds = %93
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !33
  br label %96

96:                                               ; preds = %95, %93, %91
  %.sroa.0.0.copyload = load double, ptr %60, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %60, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !30
  %97 = call { double, double } @_ZNK3JPH4Quat5SLERPES0_f(ptr noundef nonnull align 16 dereferenceable(16) %57, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, float noundef %67)
  %98 = extractvalue { double, double } %97, 0
  %99 = extractvalue { double, double } %97, 1
  store double %98, ptr %45, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 8
  store double %99, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !30
  %100 = call noundef zeroext i1 @_ZNK3JPH4Quat12IsNormalizedEf(ptr noundef nonnull align 16 dereferenceable(16) %45, float noundef 0x3EE4F8B580000000)
  br i1 %100, label %104, label %101

101:                                              ; preds = %96
  %102 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.5, i32 noundef 107)
  br i1 %102, label %103, label %104

103:                                              ; preds = %101
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !34
  br label %104

104:                                              ; preds = %96, %101, %103, %53, %47
  %105 = getelementptr inbounds i8, ptr %.071, i64 56
  %.not = icmp eq ptr %105, %23
  br i1 %.not, label %._crit_edge74, label %26
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4fmodff(float noundef, float noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZN3JPH12SkeletonPose8GetJointEi(ptr noundef nonnull align 16 dereferenceable(80), i32 noundef) local_unnamed_addr #2 align 2

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

declare noundef i32 @_ZNK3JPH8Skeleton13GetJointIndexERKSt17basic_string_viewIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(36) ptr @_ZNK3JPH5ArrayINS_17SkeletalAnimation8KeyframeENS_12STLAllocatorIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH4Quat12IsNormalizedEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Quat5SLERPES0_f(ptr noundef nonnull align 16 dereferenceable(16), double, double, float noundef) local_unnamed_addr #8 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 = { 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 = { 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 #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 = { "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 = { 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 #9 = { 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 2157458785}
!6 = !{!7, !17, i64 32}
!7 = !{!"_ZTSN3JPH17SkeletalAnimationE", !8, i64 0, !14, i64 8, !17, i64 32}
!8 = !{!"_ZTSN3JPH9RefTargetINS_17SkeletalAnimationEEE", !9, i64 0}
!9 = !{!"_ZTSSt6atomicIjE", !10, i64 0}
!10 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSN3JPH5ArrayINS_17SkeletalAnimation13AnimatedJointENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !16, i64 16}
!15 = !{!"long", !12, i64 0}
!16 = !{!"any pointer", !12, i64 0}
!17 = !{!"bool", !12, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !26, i64 32}
!21 = !{!"_ZTSN3JPH17SkeletalAnimation8KeyframeE", !22, i64 0, !26, i64 32}
!22 = !{!"_ZTSN3JPH17SkeletalAnimation10JointStateE", !23, i64 0, !25, i64 16}
!23 = !{!"_ZTSN3JPH4QuatE", !24, i64 0}
!24 = !{!"_ZTSN3JPH4Vec4E", !12, i64 0}
!25 = !{!"_ZTSN3JPH4Vec3E", !12, i64 0}
!26 = !{!"float", !12, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{i64 0, i64 16, !30, i64 16, i64 16, !30}
!30 = !{!12, !12, i64 0}
!31 = !{i64 2157459153}
!32 = !{i64 2157459503}
!33 = !{i64 2157459853}
!34 = !{i64 2157460209}


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