; 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] }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3vox9animation7offline12RawAnimation10JointTrack8ValidateEf(ptr noundef nonnull align 8 dereferenceable(72), float noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3vox9animation7offline12RawAnimation8ValidateEv(ptr noundef nonnull align 8 dereferenceable(64) %0) #0 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 1
  %8 = load float, ptr %7, align 8, !tbaa !9
  %9 = fcmp ole float %8, 0.000000e+00
  br i1 %9, label %10, label %11

10:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %42

11:                                               ; preds = %1
  %12 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 0
  %13 = call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  %14 = icmp ugt i64 %13, 1024
  br i1 %14, label %15, label %16

15:                                               ; preds = %11
  store i1 false, ptr %2, align 1
  br label %42

16:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #3
  store i8 1, ptr %4, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  store i64 0, ptr %5, align 8, !tbaa !21
  br label %17

17:                                               ; preds = %36, %16
  %18 = load i8, ptr %4, align 1, !tbaa !19, !range !22, !noundef !23
  %19 = trunc i8 %18 to i1
  br i1 %19, label %20, label %25

20:                                               ; preds = %17
  %21 = load i64, ptr %5, align 8, !tbaa !21
  %22 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 0
  %23 = call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #3
  %24 = icmp ult i64 %21, %23
  br label %25

25:                                               ; preds = %20, %17
  %26 = phi i1 [ false, %17 ], [ %24, %20 ]
  br i1 %26, label %28, label %27

27:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br label %39

28:                                               ; preds = %25
  %29 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 0
  %30 = load i64, ptr %5, align 8, !tbaa !21
  %31 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %30) #3
  %32 = getelementptr inbounds %"struct.vox::animation::offline::RawAnimation", ptr %6, i32 0, i32 1
  %33 = load float, ptr %32, align 8, !tbaa !9
  %34 = call noundef zeroext i1 @_ZNK3vox9animation7offline12RawAnimation10JointTrack8ValidateEf(ptr noundef nonnull align 8 dereferenceable(72) %31, float noundef %33)
  %35 = zext i1 %34 to i8
  store i8 %35, ptr %4, align 1, !tbaa !19
  br label %36

36:                                               ; preds = %28
  %37 = load i64, ptr %5, align 8, !tbaa !21
  %38 = add i64 %37, 1
  store i64 %38, ptr %5, align 8, !tbaa !21
  br label %17, !llvm.loop !24

39:                                               ; preds = %27
  %40 = load i8, ptr %4, align 1, !tbaa !19, !range !22, !noundef !23
  %41 = trunc i8 %40 to i1
  store i1 %41, ptr %2, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  br label %42

42:                                               ; preds = %39, %15, %10
  %43 = load i1, ptr %2, align 1
  ret i1 %43
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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) #1 align 2

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

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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, !15, i64 24}
!10 = !{!"_ZTSN3vox9animation7offline12RawAnimationE", !11, i64 0, !15, i64 24, !16, i64 32}
!11 = !{!"_ZTSSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3vox12StdAllocatorIcEEEE", !17, i64 0, !18, i64 8, !7, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3vox12StdAllocatorIcEEE12_Alloc_hiderE", !6, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!18, !18, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !25}
!25 = !{!"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 uwtable
declare dso_local noundef zeroext i1 @_ZNK3vox9animation7offline12RawAnimation10JointTrack8ValidateEf(ptr noundef nonnull align 8 dereferenceable(72), float noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3vox9animation7offline12RawAnimation8ValidateEv(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = load float, ptr %2, align 8, !tbaa !5
  %4 = fcmp ugt float %3, 0.000000e+00
  br i1 %4, label %5, label %.critedge

5:                                                ; preds = %1
  %6 = tail call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #2
  %7 = icmp ugt i64 %6, 1024
  br i1 %7, label %.critedge, label %.preheader

.preheader:                                       ; preds = %5, %9
  %.08 = phi i64 [ %13, %9 ], [ 0, %5 ]
  %8 = tail call noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #2
  %.not = icmp uge i64 %.08, %8
  br i1 %.not, label %.critedge, label %9

9:                                                ; preds = %.preheader
  %10 = tail call noundef nonnull align 8 dereferenceable(72) ptr @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.08) #2
  %11 = load float, ptr %2, align 8, !tbaa !5
  %12 = tail call noundef zeroext i1 @_ZNK3vox9animation7offline12RawAnimation10JointTrack8ValidateEf(ptr noundef nonnull align 8 dereferenceable(72) %10, float noundef %11)
  %13 = add nuw i64 %.08, 1
  br i1 %12, label %.preheader, label %.critedge, !llvm.loop !18

.critedge:                                        ; preds = %.preheader, %9, %5, %1
  %.07 = phi i1 [ false, %1 ], [ false, %5 ], [ %.not, %9 ], [ %.not, %.preheader ]
  ret i1 %.07
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 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 #1 align 2

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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, !14, i64 24}
!6 = !{!"_ZTSN3vox9animation7offline12RawAnimationE", !7, i64 0, !14, i64 24, !15, i64 32}
!7 = !{!"_ZTSSt6vectorIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIN3vox9animation7offline12RawAnimation10JointTrackENS0_12StdAllocatorIS4_EEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"float", !12, i64 0}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3vox12StdAllocatorIcEEEE", !16, i64 0, !17, i64 8, !12, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3vox12StdAllocatorIcEEE12_Alloc_hiderE", !11, i64 0}
!17 = !{!"long", !12, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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