; LLVM IR from atlantis13579/Riemann :: Src/RigidBodyDynamics (KinematicsTree)

; 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.std::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<Riemann::Keyframe<Maths::TVector3<float>>, std::allocator<Riemann::Keyframe<Maths::TVector3<float>>>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::Keyframe<Maths::TVector3<float>>, std::allocator<Riemann::Keyframe<Maths::TVector3<float>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::Keyframe<Maths::TVector3<float>>, std::allocator<Riemann::Keyframe<Maths::TVector3<float>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::Keyframe<Maths::TVector3<float>>, std::allocator<Riemann::Keyframe<Maths::TVector3<float>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<Riemann::Keyframe<Maths::Quaternion>, std::allocator<Riemann::Keyframe<Maths::Quaternion>>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::Keyframe<Maths::Quaternion>, std::allocator<Riemann::Keyframe<Maths::Quaternion>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::Keyframe<Maths::Quaternion>, std::allocator<Riemann::Keyframe<Maths::Quaternion>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::Keyframe<Maths::Quaternion>, std::allocator<Riemann::Keyframe<Maths::Quaternion>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Riemann::_Node" = type { i32, %"class.std::vector.19" }
%"class.std::vector.19" = type { %"struct.std::_Vector_base.20" }
%"struct.std::_Vector_base.20" = type { %"struct.std::_Vector_base<Riemann::_Node *, std::allocator<Riemann::_Node *>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::_Node *, std::allocator<Riemann::_Node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::_Node *, std::allocator<Riemann::_Node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::_Node *, std::allocator<Riemann::_Node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Riemann::AnimTreeData" = type { %"class.std::vector.24" }
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<Riemann::AnimTreeData::Channel, std::allocator<Riemann::AnimTreeData::Channel>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::AnimTreeData::Channel, std::allocator<Riemann::AnimTreeData::Channel>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::AnimTreeData::Channel, std::allocator<Riemann::AnimTreeData::Channel>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::AnimTreeData::Channel, std::allocator<Riemann::AnimTreeData::Channel>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Riemann::AnimTreeData::Channel" = type <{ %"class.std::__cxx11::basic_string", %"class.std::vector.29", %"class.std::vector.29", %"class.std::vector.34", i32, [4 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.29" = type { %"struct.std::_Vector_base.30" }
%"struct.std::_Vector_base.30" = type { %"struct.std::_Vector_base<std::pair<int, Maths::TVector3<float>>, std::allocator<std::pair<int, Maths::TVector3<float>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, Maths::TVector3<float>>, std::allocator<std::pair<int, Maths::TVector3<float>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, Maths::TVector3<float>>, std::allocator<std::pair<int, Maths::TVector3<float>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, Maths::TVector3<float>>, std::allocator<std::pair<int, Maths::TVector3<float>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<std::pair<int, Maths::Quaternion>, std::allocator<std::pair<int, Maths::Quaternion>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, Maths::Quaternion>, std::allocator<std::pair<int, Maths::Quaternion>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, Maths::Quaternion>, std::allocator<std::pair<int, Maths::Quaternion>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, Maths::Quaternion>, std::allocator<std::pair<int, Maths::Quaternion>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }
%"struct.std::pair.39" = type { i32, %"class.Maths::Quaternion" }
%"class.Maths::Quaternion" = type { float, float, float, float }
%"class.Riemann::KeyframeKinematics" = type <{ %"class.Riemann::RigidBodyKinematics.base", [6 x i8], %"class.Riemann::KeyFrameAnimation", %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"class.Riemann::RigidBodyKinematics.base" = type { %"class.Riemann::RigidBody.base" }
%"class.Riemann::RigidBody.base" = type <{ ptr, %"class.std::vector.3", i8, [7 x i8], i64, %"class.Maths::TVector3", %"class.Maths::Quaternion", %"class.Maths::TVector3", %"class.Maths::TVector3", %"class.Maths::TVector3", float, %"class.Maths::Matrix3", i16 }>
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Maths::Matrix3" = type { [3 x [3 x float]] }
%"class.Riemann::KeyFrameAnimation" = type <{ %"struct.Riemann::Timeline", %"struct.Riemann::Timeline.8", %"class.std::vector.9", %"class.std::vector.14", i8, [7 x i8] }>
%"struct.Riemann::Timeline" = type { float, i32, i8 }
%"struct.Riemann::Timeline.8" = type { float, i32, i8 }

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann8_FlattenERSt6vectorIPNS_18KeyframeKinematicsESaIS2_EEiPKNS_5_NodeEPKNS_12AnimTreeDataE(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #3 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::vector.9", align 8
  %10 = alloca %"class.std::vector.14", align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %20 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 280) #7
          to label %21 unwind label %44

21:                                               ; preds = %4
  invoke void @_ZN7Riemann18KeyframeKinematicsC2Ev(ptr noundef nonnull align 8 dereferenceable(276) %20)
          to label %22 unwind label %48

22:                                               ; preds = %21
  store ptr %20, ptr %11, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN7Riemann18KeyframeKinematicsESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %24 unwind label %44

24:                                               ; preds = %22
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.Riemann::_Node", ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !11
  %28 = icmp sge i32 %27, 0
  br i1 %28, label %29, label %117

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.Riemann::AnimTreeData", ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.Riemann::_Node", ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 8 dereferenceable(108) ptr @_ZNKSt6vectorIN7Riemann12AnimTreeData7ChannelESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %35) #6
  store ptr %36, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #6
  store i8 1, ptr %15, align 1, !tbaa !17
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !19
  br label %37

37:                                               ; preds = %65, %29
  %38 = load i64, ptr %16, align 8, !tbaa !19
  %39 = load ptr, ptr %14, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.Riemann::AnimTreeData::Channel", ptr %39, i32 0, i32 2
  %41 = call noundef i64 @_ZNKSt6vectorISt4pairIiN5Maths8TVector3IfEEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #6
  %42 = icmp ult i64 %38, %41
  br i1 %42, label %52, label %43

43:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %72

44:                                               ; preds = %22, %4
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %12, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %13, align 4
  br label %150

48:                                               ; preds = %21
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %12, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %20, i64 noundef 280) #8
  br label %150

52:                                               ; preds = %37
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.Riemann::AnimTreeData::Channel", ptr %53, i32 0, i32 2
  %55 = load i64, ptr %16, align 8, !tbaa !19
  %56 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNKSt6vectorISt4pairIiN5Maths8TVector3IfEEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %55) #6
  %57 = getelementptr inbounds %"struct.std::pair", ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.Riemann::AnimTreeData::Channel", ptr %58, i32 0, i32 2
  %60 = load i64, ptr %16, align 8, !tbaa !19
  %61 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNKSt6vectorISt4pairIiN5Maths8TVector3IfEEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %60) #6
  %62 = getelementptr inbounds %"struct.std::pair", ptr %61, i32 0, i32 1
  %63 = invoke noundef nonnull align 1 ptr @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE12emplace_backIJRKiRKS4_EEERS5_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %57, ptr noundef nonnull align 4 dereferenceable(12) %62)
          to label %64 unwind label %68

64:                                               ; preds = %52
  br label %65

65:                                               ; preds = %64
  %66 = load i64, ptr %16, align 8, !tbaa !19
  %67 = add i64 %66, 1
  store i64 %67, ptr %16, align 8, !tbaa !19
  br label %37, !llvm.loop !21

68:                                               ; preds = %52
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %12, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %116

72:                                               ; preds = %43
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !19
  br label %73

73:                                               ; preds = %93, %72
  %74 = load i64, ptr %17, align 8, !tbaa !19
  %75 = load ptr, ptr %14, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.Riemann::AnimTreeData::Channel", ptr %75, i32 0, i32 3
  %77 = call noundef i64 @_ZNKSt6vectorISt4pairIiN5Maths10QuaternionEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #6
  %78 = icmp ult i64 %74, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %100

80:                                               ; preds = %73
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.Riemann::AnimTreeData::Channel", ptr %81, i32 0, i32 3
  %83 = load i64, ptr %17, align 8, !tbaa !19
  %84 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNKSt6vectorISt4pairIiN5Maths10QuaternionEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %83) #6
  %85 = getelementptr inbounds %"struct.std::pair.39", ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.Riemann::AnimTreeData::Channel", ptr %86, i32 0, i32 3
  %88 = load i64, ptr %17, align 8, !tbaa !19
  %89 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNKSt6vectorISt4pairIiN5Maths10QuaternionEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %87, i64 noundef %88) #6
  %90 = getelementptr inbounds %"struct.std::pair.39", ptr %89, i32 0, i32 1
  %91 = invoke noundef nonnull align 1 ptr @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE12emplace_backIJRKiRKS3_EEERS4_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %85, ptr noundef nonnull align 4 dereferenceable(16) %90)
          to label %92 unwind label %96

92:                                               ; preds = %80
  br label %93

93:                                               ; preds = %92
  %94 = load i64, ptr %17, align 8, !tbaa !19
  %95 = add i64 %94, 1
  store i64 %95, ptr %17, align 8, !tbaa !19
  br label %73, !llvm.loop !23

96:                                               ; preds = %80
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %12, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %116

100:                                              ; preds = %79
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.Riemann::AnimTreeData::Channel", ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %"class.Riemann::KeyframeKinematics", ptr %103, i32 0, i32 3
  %105 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %104, ptr noundef nonnull align 8 dereferenceable(32) %102)
          to label %106 unwind label %112

106:                                              ; preds = %100
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.Riemann::KeyframeKinematics", ptr %107, i32 0, i32 2
  %109 = load i8, ptr %15, align 1, !tbaa !17, !range !24, !noundef !25
  %110 = trunc i8 %109 to i1
  invoke void @_ZN7Riemann17KeyFrameAnimation13LoadKeyframesERKSt6vectorINS_8KeyframeIN5Maths8TVector3IfEEEESaIS6_EERKS1_INS2_INS3_10QuaternionEEESaISC_EEb(ptr noundef nonnull align 8 dereferenceable(73) %108, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %10, i1 noundef zeroext %110)
          to label %111 unwind label %112

111:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %117

112:                                              ; preds = %106, %100
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %12, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %13, align 4
  br label %116

116:                                              ; preds = %112, %96, %68
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %150

117:                                              ; preds = %111, %24
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = getelementptr inbounds %"class.Riemann::KeyframeKinematics", ptr %119, i32 0, i32 4
  store i32 %118, ptr %120, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = call noundef i64 @_ZNKSt6vectorIPN7Riemann18KeyframeKinematicsESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %121) #6
  %123 = trunc i64 %122 to i32
  %124 = sub nsw i32 %123, 1
  store i32 %124, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !19
  br label %125

125:                                              ; preds = %142, %117
  %126 = load i64, ptr %19, align 8, !tbaa !19
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.Riemann::_Node", ptr %127, i32 0, i32 1
  %129 = call noundef i64 @_ZNKSt6vectorIPN7Riemann5_NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %128) #6
  %130 = icmp ult i64 %126, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %149

132:                                              ; preds = %125
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = load i32, ptr %18, align 4, !tbaa !9
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.Riemann::_Node", ptr %135, i32 0, i32 1
  %137 = load i64, ptr %19, align 8, !tbaa !19
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7Riemann5_NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %136, i64 noundef %137) #6
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN7Riemann8_FlattenERSt6vectorIPNS_18KeyframeKinematicsESaIS2_EEiPKNS_5_NodeEPKNS_12AnimTreeDataE(ptr noundef nonnull align 8 dereferenceable(24) %133, i32 noundef %134, ptr noundef %139, ptr noundef %140)
          to label %141 unwind label %145

141:                                              ; preds = %132
  br label %142

142:                                              ; preds = %141
  %143 = load i64, ptr %19, align 8, !tbaa !19
  %144 = add i64 %143, 1
  store i64 %144, ptr %19, align 8, !tbaa !19
  br label %125, !llvm.loop !53

145:                                              ; preds = %132
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %12, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %150

149:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  ret void

150:                                              ; preds = %145, %116, %48, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %151

151:                                              ; preds = %150
  %152 = load ptr, ptr %12, align 8
  %153 = load i32, ptr %13, align 4
  %154 = insertvalue { ptr, i32 } poison, ptr %152, 0
  %155 = insertvalue { ptr, i32 } %154, i32 %153, 1
  resume { ptr, i32 } %155
}

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann18KeyframeKinematicsC2Ev(ptr noundef nonnull align 8 dereferenceable(276)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN7Riemann18KeyframeKinematicsESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 ptr @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE12emplace_backIJRKiRKS4_EEERS5_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 ptr @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE12emplace_backIJRKiRKS3_EEERS4_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

declare void @_ZN7Riemann17KeyFrameAnimation13LoadKeyframesERKSt6vectorINS_8KeyframeIN5Maths8TVector3IfEEEESaIS6_EERKS1_INS2_INS3_10QuaternionEEESaISC_EEb(ptr noundef nonnull align 8 dereferenceable(73), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext) #5

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nobuiltin allocsize(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 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN7Riemann5_NodeE", !10, i64 0, !13, i64 8}
!13 = !{!"_ZTSSt6vectorIPN7Riemann5_NodeESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIPN7Riemann5_NodeESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann5_NodeESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann5_NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!27, !10, i64 272}
!27 = !{!"_ZTSN7Riemann18KeyframeKinematicsE", !28, i64 0, !40, i64 160, !51, i64 240, !10, i64 272}
!28 = !{!"_ZTSN7Riemann19RigidBodyKinematicsE", !29, i64 0}
!29 = !{!"_ZTSN7Riemann9RigidBodyE", !30, i64 8, !34, i64 32, !20, i64 40, !35, i64 48, !37, i64 60, !35, i64 76, !35, i64 88, !35, i64 100, !36, i64 112, !38, i64 116, !39, i64 152}
!30 = !{!"_ZTSSt6vectorIPN7Riemann8GeometryESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"_ZTSN7Riemann9RigidTypeE", !7, i64 0}
!35 = !{!"_ZTSN5Maths8TVector3IfEE", !36, i64 0, !36, i64 4, !36, i64 8}
!36 = !{!"float", !7, i64 0}
!37 = !{!"_ZTSN5Maths10QuaternionE", !36, i64 0, !36, i64 4, !36, i64 8, !36, i64 12}
!38 = !{!"_ZTSN5Maths7Matrix3E", !7, i64 0}
!39 = !{!"short", !7, i64 0}
!40 = !{!"_ZTSN7Riemann17KeyFrameAnimationE", !41, i64 0, !42, i64 12, !43, i64 24, !47, i64 48, !18, i64 72}
!41 = !{!"_ZTSN7Riemann8TimelineIN5Maths8TVector3IfEEEE", !36, i64 0, !10, i64 4, !18, i64 8}
!42 = !{!"_ZTSN7Riemann8TimelineIN5Maths10QuaternionEEE", !36, i64 0, !10, i64 4, !18, i64 8}
!43 = !{!"_ZTSSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE", !44, i64 0}
!44 = !{!"_ZTSSt12_Vector_baseIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE12_Vector_implE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!47 = !{!"_ZTSSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE", !48, i64 0}
!48 = !{!"_ZTSSt12_Vector_baseIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE12_Vector_implE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!51 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !52, i64 0, !20, i64 8, !7, i64 16}
!52 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!53 = distinct !{!53, !22}


; 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::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<Riemann::Keyframe<Maths::TVector3<float>>, std::allocator<Riemann::Keyframe<Maths::TVector3<float>>>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::Keyframe<Maths::TVector3<float>>, std::allocator<Riemann::Keyframe<Maths::TVector3<float>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::Keyframe<Maths::TVector3<float>>, std::allocator<Riemann::Keyframe<Maths::TVector3<float>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::Keyframe<Maths::TVector3<float>>, std::allocator<Riemann::Keyframe<Maths::TVector3<float>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = type { %"struct.std::_Vector_base<Riemann::Keyframe<Maths::Quaternion>, std::allocator<Riemann::Keyframe<Maths::Quaternion>>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::Keyframe<Maths::Quaternion>, std::allocator<Riemann::Keyframe<Maths::Quaternion>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::Keyframe<Maths::Quaternion>, std::allocator<Riemann::Keyframe<Maths::Quaternion>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::Keyframe<Maths::Quaternion>, std::allocator<Riemann::Keyframe<Maths::Quaternion>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann8_FlattenERSt6vectorIPNS_18KeyframeKinematicsESaIS2_EEiPKNS_5_NodeEPKNS_12AnimTreeDataE(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector.9", align 8
  %6 = alloca %"class.std::vector.14", align 8
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %8 = invoke noalias noundef nonnull dereferenceable(280) ptr @_Znwm(i64 noundef 280) #7
          to label %9 unwind label %21

9:                                                ; preds = %4
  invoke void @_ZN7Riemann18KeyframeKinematicsC2Ev(ptr noundef nonnull align 8 dereferenceable(276) %8)
          to label %10 unwind label %23

10:                                               ; preds = %9
  store ptr %8, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN7Riemann18KeyframeKinematicsESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %11 unwind label %21

11:                                               ; preds = %10
  %12 = load i32, ptr %2, align 8, !tbaa !9
  %13 = icmp sgt i32 %12, -1
  br i1 %13, label %14, label %53

14:                                               ; preds = %11
  %15 = zext nneg i32 %12 to i64
  %16 = call noundef nonnull align 8 dereferenceable(108) ptr @_ZNKSt6vectorIN7Riemann12AnimTreeData7ChannelESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %15) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %17 = getelementptr inbounds i8, ptr %16, i64 56
  %18 = call noundef i64 @_ZNKSt6vectorISt4pairIiN5Maths8TVector3IfEEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  %.not = icmp eq i64 %18, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %29, %14
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %19 = getelementptr inbounds i8, ptr %16, i64 80
  %20 = call noundef i64 @_ZNKSt6vectorISt4pairIiN5Maths10QuaternionEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  %.not48 = icmp eq i64 %20, 0
  br i1 %.not48, label %._crit_edge43, label %.lr.ph42

21:                                               ; preds = %10, %4
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %69

23:                                               ; preds = %9
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 280) #8
  br label %69

.lr.ph:                                           ; preds = %14, %29
  %.03339 = phi i64 [ %30, %29 ], [ 0, %14 ]
  %25 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNKSt6vectorISt4pairIiN5Maths8TVector3IfEEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %.03339) #6
  %26 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNKSt6vectorISt4pairIiN5Maths8TVector3IfEEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %.03339) #6
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %28 = invoke noundef nonnull align 1 ptr @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE12emplace_backIJRKiRKS4_EEERS5_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(12) %27)
          to label %29 unwind label %33

29:                                               ; preds = %.lr.ph
  %30 = add nuw i64 %.03339, 1
  %31 = call noundef i64 @_ZNKSt6vectorISt4pairIiN5Maths8TVector3IfEEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  %32 = icmp ult i64 %30, %31
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !16

33:                                               ; preds = %.lr.ph
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %69

._crit_edge43:                                    ; preds = %42, %._crit_edge
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 240
  %37 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %36, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %48 unwind label %51

.lr.ph42:                                         ; preds = %._crit_edge, %42
  %.03240 = phi i64 [ %43, %42 ], [ 0, %._crit_edge ]
  %38 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNKSt6vectorISt4pairIiN5Maths10QuaternionEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %.03240) #6
  %39 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNKSt6vectorISt4pairIiN5Maths10QuaternionEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %.03240) #6
  %40 = getelementptr inbounds i8, ptr %39, i64 4
  %41 = invoke noundef nonnull align 1 ptr @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE12emplace_backIJRKiRKS3_EEERS4_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %38, ptr noundef nonnull align 4 dereferenceable(16) %40)
          to label %42 unwind label %46

42:                                               ; preds = %.lr.ph42
  %43 = add nuw i64 %.03240, 1
  %44 = call noundef i64 @_ZNKSt6vectorISt4pairIiN5Maths10QuaternionEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  %45 = icmp ult i64 %43, %44
  br i1 %45, label %.lr.ph42, label %._crit_edge43, !llvm.loop !18

46:                                               ; preds = %.lr.ph42
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %69

48:                                               ; preds = %._crit_edge43
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 160
  invoke void @_ZN7Riemann17KeyFrameAnimation13LoadKeyframesERKSt6vectorINS_8KeyframeIN5Maths8TVector3IfEEEESaIS6_EERKS1_INS2_INS3_10QuaternionEEESaISC_EEb(ptr noundef nonnull align 8 dereferenceable(73) %50, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %6, i1 noundef zeroext true)
          to label %53 unwind label %51

51:                                               ; preds = %48, %._crit_edge43
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %69

53:                                               ; preds = %48, %11
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 272
  store i32 %1, ptr %55, align 8, !tbaa !19
  %56 = call noundef i64 @_ZNKSt6vectorIPN7Riemann18KeyframeKinematicsESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %57 = trunc i64 %56 to i32
  %58 = add nsw i32 %57, -1
  %59 = getelementptr inbounds i8, ptr %2, i64 8
  %60 = call noundef i64 @_ZNKSt6vectorIPN7Riemann5_NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #6
  %.not49 = icmp eq i64 %60, 0
  br i1 %.not49, label %._crit_edge47, label %.lr.ph46

._crit_edge47:                                    ; preds = %63, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  ret void

.lr.ph46:                                         ; preds = %53, %63
  %.044 = phi i64 [ %64, %63 ], [ 0, %53 ]
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7Riemann5_NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %.044) #6
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  invoke void @_ZN7Riemann8_FlattenERSt6vectorIPNS_18KeyframeKinematicsESaIS2_EEiPKNS_5_NodeEPKNS_12AnimTreeDataE(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %58, ptr noundef %62, ptr noundef %3)
          to label %63 unwind label %67

63:                                               ; preds = %.lr.ph46
  %64 = add nuw i64 %.044, 1
  %65 = call noundef i64 @_ZNKSt6vectorIPN7Riemann5_NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #6
  %66 = icmp ult i64 %64, %65
  br i1 %66, label %.lr.ph46, label %._crit_edge47, !llvm.loop !48

67:                                               ; preds = %.lr.ph46
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %69

69:                                               ; preds = %33, %46, %51, %67, %23, %21
  %.pn.pn = phi { ptr, i32 } [ %68, %67 ], [ %22, %21 ], [ %24, %23 ], [ %34, %33 ], [ %47, %46 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann18KeyframeKinematicsC2Ev(ptr noundef nonnull align 8 dereferenceable(276)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN7Riemann18KeyframeKinematicsESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 ptr @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE12emplace_backIJRKiRKS4_EEERS5_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 ptr @_ZNSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE12emplace_backIJRKiRKS3_EEERS4_DpOT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

declare void @_ZN7Riemann17KeyFrameAnimation13LoadKeyframesERKSt6vectorINS_8KeyframeIN5Maths8TVector3IfEEEESaIS6_EERKS1_INS2_INS3_10QuaternionEEESaISC_EEb(ptr noundef nonnull align 8 dereferenceable(73), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext) local_unnamed_addr #5

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nobuiltin allocsize(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 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !11, i64 0}
!10 = !{!"_ZTSN7Riemann5_NodeE", !11, i64 0, !12, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIPN7Riemann5_NodeESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIPN7Riemann5_NodeESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann5_NodeESaIS2_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann5_NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !11, i64 272}
!20 = !{!"_ZTSN7Riemann18KeyframeKinematicsE", !21, i64 0, !34, i64 160, !46, i64 240, !11, i64 272}
!21 = !{!"_ZTSN7Riemann19RigidBodyKinematicsE", !22, i64 0}
!22 = !{!"_ZTSN7Riemann9RigidBodyE", !23, i64 8, !27, i64 32, !28, i64 40, !29, i64 48, !31, i64 60, !29, i64 76, !29, i64 88, !29, i64 100, !30, i64 112, !32, i64 116, !33, i64 152}
!23 = !{!"_ZTSSt6vectorIPN7Riemann8GeometryESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSN7Riemann9RigidTypeE", !7, i64 0}
!28 = !{!"long", !7, i64 0}
!29 = !{!"_ZTSN5Maths8TVector3IfEE", !30, i64 0, !30, i64 4, !30, i64 8}
!30 = !{!"float", !7, i64 0}
!31 = !{!"_ZTSN5Maths10QuaternionE", !30, i64 0, !30, i64 4, !30, i64 8, !30, i64 12}
!32 = !{!"_ZTSN5Maths7Matrix3E", !7, i64 0}
!33 = !{!"short", !7, i64 0}
!34 = !{!"_ZTSN7Riemann17KeyFrameAnimationE", !35, i64 0, !37, i64 12, !38, i64 24, !42, i64 48, !36, i64 72}
!35 = !{!"_ZTSN7Riemann8TimelineIN5Maths8TVector3IfEEEE", !30, i64 0, !11, i64 4, !36, i64 8}
!36 = !{!"bool", !7, i64 0}
!37 = !{!"_ZTSN7Riemann8TimelineIN5Maths10QuaternionEEE", !30, i64 0, !11, i64 4, !36, i64 8}
!38 = !{!"_ZTSSt6vectorIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE", !39, i64 0}
!39 = !{!"_ZTSSt12_Vector_baseIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE12_Vector_implE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseIN7Riemann8KeyframeIN5Maths8TVector3IfEEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!42 = !{!"_ZTSSt6vectorIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE", !43, i64 0}
!43 = !{!"_ZTSSt12_Vector_baseIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE", !44, i64 0}
!44 = !{!"_ZTSNSt12_Vector_baseIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE12_Vector_implE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIN7Riemann8KeyframeIN5Maths10QuaternionEEESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!46 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !47, i64 0, !28, i64 8, !7, i64 16}
!47 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!48 = distinct !{!48, !17}


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