; LLVM IR from yangfengzzz/DigitalVox3 :: vox.render/offline/animation (raw_animation)

; 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.vox::animation::offline::RawAnimation" = type { %"class.std::vector", float, %"class.std::__cxx11::basic_string" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vox::animation::offline::RawAnimation::JointTrack, vox::StdAllocator<vox::animation::offline::RawAnimation::JointTrack>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::animation::offline::RawAnimation::JointTrack, vox::StdAllocator<vox::animation::offline::RawAnimation::JointTrack>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::animation::offline::RawAnimation::JointTrack, vox::StdAllocator<vox::animation::offline::RawAnimation::JointTrack>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::animation::offline::RawAnimation::JointTrack, vox::StdAllocator<vox::animation::offline::RawAnimation::JointTrack>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, vox::StdAllocator<char>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, vox::StdAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.vox::animation::offline::RawAnimation::JointTrack" = type { %"class.std::vector.2", %"class.std::vector.6", %"class.std::vector.10" }
%"class.std::vector.2" = type { %"struct.std::_Vector_base.3" }
%"struct.std::_Vector_base.3" = type { %"struct.std::_Vector_base<vox::animation::offline::RawAnimation::TranslationKey, vox::StdAllocator<vox::animation::offline::RawAnimation::TranslationKey>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::animation::offline::RawAnimation::TranslationKey, vox::StdAllocator<vox::animation::offline::RawAnimation::TranslationKey>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::animation::offline::RawAnimation::TranslationKey, vox::StdAllocator<vox::animation::offline::RawAnimation::TranslationKey>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::animation::offline::RawAnimation::TranslationKey, vox::StdAllocator<vox::animation::offline::RawAnimation::TranslationKey>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<vox::animation::offline::RawAnimation::RotationKey, vox::StdAllocator<vox::animation::offline::RawAnimation::RotationKey>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::animation::offline::RawAnimation::RotationKey, vox::StdAllocator<vox::animation::offline::RawAnimation::RotationKey>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::animation::offline::RawAnimation::RotationKey, vox::StdAllocator<vox::animation::offline::RawAnimation::RotationKey>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::animation::offline::RawAnimation::RotationKey, vox::StdAllocator<vox::animation::offline::RawAnimation::RotationKey>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<vox::animation::offline::RawAnimation::ScaleKey, vox::StdAllocator<vox::animation::offline::RawAnimation::ScaleKey>>::_Vector_impl" }
%"struct.std::_Vector_base<vox::animation::offline::RawAnimation::ScaleKey, vox::StdAllocator<vox::animation::offline::RawAnimation::ScaleKey>>::_Vector_impl" = type { %"struct.std::_Vector_base<vox::animation::offline::RawAnimation::ScaleKey, vox::StdAllocator<vox::animation::offline::RawAnimation::ScaleKey>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vox::animation::offline::RawAnimation::ScaleKey, vox::StdAllocator<vox::animation::offline::RawAnimation::ScaleKey>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_ZNK3vox9animation7offline12RawAnimation4sizeEv(ptr noundef nonnull align 8 dereferenceable(64) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  store i64 64, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  %7 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 0
  %8 = call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #2
  store i64 %8, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  store i64 0, ptr %5, align 8, !tbaa !9
  br label %9

9:                                                ; preds = %39, %1
  %10 = load i64, ptr %5, align 8, !tbaa !9
  %11 = load i64, ptr %4, align 8, !tbaa !9
  %12 = icmp ult i64 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  br label %42

14:                                               ; preds = %9
  %15 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 0
  %16 = load i64, ptr %5, align 8, !tbaa !9
  %17 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %16) #2
  %18 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation::JointTrack", ptr %17, i32 0, i32 0
  %19 = call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation14TranslationKeyENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #2
  %20 = mul i64 %19, 16
  %21 = load i64, ptr %3, align 8, !tbaa !9
  %22 = add i64 %21, %20
  store i64 %22, ptr %3, align 8, !tbaa !9
  %23 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 0
  %24 = load i64, ptr %5, align 8, !tbaa !9
  %25 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %24) #2
  %26 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation::JointTrack", ptr %25, i32 0, i32 1
  %27 = call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation11RotationKeyENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #2
  %28 = mul i64 %27, 20
  %29 = load i64, ptr %3, align 8, !tbaa !9
  %30 = add i64 %29, %28
  store i64 %30, ptr %3, align 8, !tbaa !9
  %31 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 0
  %32 = load i64, ptr %5, align 8, !tbaa !9
  %33 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %32) #2
  %34 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation::JointTrack", ptr %33, i32 0, i32 2
  %35 = call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation8ScaleKeyENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #2
  %36 = mul i64 %35, 16
  %37 = load i64, ptr %3, align 8, !tbaa !9
  %38 = add i64 %37, %36
  store i64 %38, ptr %3, align 8, !tbaa !9
  br label %39

39:                                               ; preds = %14
  %40 = load i64, ptr %5, align 8, !tbaa !9
  %41 = add i64 %40, 1
  store i64 %41, ptr %5, align 8, !tbaa !9
  br label %9, !llvm.loop !11

42:                                               ; preds = %13
  %43 = load i64, ptr %4, align 8, !tbaa !9
  %44 = mul i64 %43, 72
  %45 = load i64, ptr %3, align 8, !tbaa !9
  %46 = add i64 %45, %44
  store i64 %46, ptr %3, align 8, !tbaa !9
  %47 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 2
  %48 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3vox12StdAllocatorIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %47) #2
  %49 = load i64, ptr %3, align 8, !tbaa !9
  %50 = add i64 %49, %48
  store i64 %50, ptr %3, align 8, !tbaa !9
  %51 = load i64, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret i64 %51
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3vox12StdAllocatorIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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"

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_ZNK3vox9animation7offline12RawAnimation4sizeEv(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #0 align 2 {
  %2 = tail call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #1
  %.not = icmp eq i64 %2, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %1
  %.013.lcssa = phi i64 [ 64, %1 ], [ %18, %.lr.ph ]
  %3 = mul i64 %2, 72
  %4 = add i64 %.013.lcssa, %3
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3vox12StdAllocatorIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #1
  %7 = add i64 %4, %6
  ret i64 %7

.lr.ph:                                           ; preds = %1, %.lr.ph
  %.016 = phi i64 [ %19, %.lr.ph ], [ 0, %1 ]
  %.01315 = phi i64 [ %18, %.lr.ph ], [ 64, %1 ]
  %8 = tail call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.016) #1
  %9 = tail call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation14TranslationKeyENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #1
  %10 = tail call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.016) #1
  %11 = getelementptr inbounds i8, ptr %10, i64 24
  %12 = tail call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation11RotationKeyENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #1
  %13 = mul i64 %12, 20
  %14 = tail call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.016) #1
  %15 = getelementptr inbounds i8, ptr %14, i64 48
  %16 = tail call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation8ScaleKeyENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #1
  %reass.add = add i64 %16, %9
  %reass.mul = shl i64 %reass.add, 4
  %17 = add i64 %13, %.01315
  %18 = add i64 %17, %reass.mul
  %19 = add nuw i64 %.016, 1
  %exitcond.not = icmp eq i64 %19, %2
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3vox12StdAllocatorIcEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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