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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::Result" = type <{ %union.anon.8, i8, [7 x i8] }>
%union.anon.8 = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::Skeleton" = type { %"class.JPH::RefTarget", %"class.JPH::Array" }
%"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::Skeleton::Joint" = type <{ %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, [4 x i8] }>

@.str.2 = external hidden unnamed_addr constant [36 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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH8Skeleton23sRestoreFromBinaryStateERNS_8StreamInE(ptr dead_on_unwind noalias writable sret(%"class.JPH::Result") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.JPH::Ref", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i1, align 1
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %14 = call noundef ptr @_ZN3JPH8SkeletonnwEm(i64 noundef 32)
  call void @_ZN3JPH8SkeletonC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @_ZN3JPH3RefINS_8SkeletonEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %16 unwind label %37

16:                                               ; preds = %2
  %17 = invoke noundef ptr @_ZNK3JPH3RefINS_8SkeletonEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %18 unwind label %37

18:                                               ; preds = %16
  %19 = getelementptr inbounds %"class.JPH::Skeleton", ptr %17, i32 0, i32 1
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = zext i32 %20 to i64
  invoke void @_ZN3JPH5ArrayINS_8Skeleton5JointENS_12STLAllocatorIS2_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %21)
          to label %22 unwind label %37

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %23 = invoke noundef ptr @_ZNK3JPH3RefINS_8SkeletonEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %24 unwind label %41

24:                                               ; preds = %22
  %25 = getelementptr inbounds %"class.JPH::Skeleton", ptr %23, i32 0, i32 1
  store ptr %25, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = invoke noundef ptr @_ZN3JPH5ArrayINS_8Skeleton5JointENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
          to label %28 unwind label %45

28:                                               ; preds = %24
  store ptr %27, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = invoke noundef ptr @_ZN3JPH5ArrayINS_8Skeleton5JointENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %29)
          to label %31 unwind label %49

31:                                               ; preds = %28
  store ptr %30, ptr %11, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %67, %31
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = icmp ne ptr %33, %34
  br i1 %35, label %53, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %77

37:                                               ; preds = %77, %18, %16, %2
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %7, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %8, align 4
  br label %104

41:                                               ; preds = %22
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %7, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %8, align 4
  br label %76

45:                                               ; preds = %24
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  br label %75

49:                                               ; preds = %28
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %7, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %8, align 4
  br label %74

53:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %54, ptr %12, align 8, !tbaa !5
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.JPH::Skeleton::Joint", ptr %56, i32 0, i32 0
  invoke void @_ZN3JPH8StreamIn4ReadIcSt11char_traitsIcENS_12STLAllocatorIcEEEEvRNSt7__cxx1112basic_stringIT_T0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull align 8 dereferenceable(32) %57)
          to label %58 unwind label %70

58:                                               ; preds = %53
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %"class.JPH::Skeleton::Joint", ptr %60, i32 0, i32 2
  invoke void @_ZN3JPH8StreamIn4ReadIiTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(4) %61)
          to label %62 unwind label %70

62:                                               ; preds = %58
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.JPH::Skeleton::Joint", ptr %64, i32 0, i32 1
  invoke void @_ZN3JPH8StreamIn4ReadIcSt11char_traitsIcENS_12STLAllocatorIcEEEEvRNSt7__cxx1112basic_stringIT_T0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull align 8 dereferenceable(32) %65)
          to label %66 unwind label %70

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

67:                                               ; preds = %66
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.JPH::Skeleton::Joint", ptr %68, i32 1
  store ptr %69, ptr %10, align 8, !tbaa !5
  br label %32

70:                                               ; preds = %62, %58, %53
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %7, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %74

74:                                               ; preds = %70, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %75

75:                                               ; preds = %74, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %76

76:                                               ; preds = %75, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %104

77:                                               ; preds = %36
  store i1 false, ptr %13, align 1
  invoke void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %0)
          to label %78 unwind label %37

78:                                               ; preds = %77
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = getelementptr inbounds ptr, ptr %80, i64 3
  %82 = load ptr, ptr %81, align 8
  %83 = invoke noundef zeroext i1 %82(ptr noundef nonnull align 8 dereferenceable(8) %79)
          to label %84 unwind label %94

84:                                               ; preds = %78
  br i1 %83, label %92, label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load ptr, ptr %86, align 8, !tbaa !11
  %88 = getelementptr inbounds ptr, ptr %87, i64 4
  %89 = load ptr, ptr %88, align 8
  %90 = invoke noundef zeroext i1 %89(ptr noundef nonnull align 8 dereferenceable(8) %86)
          to label %91 unwind label %94

91:                                               ; preds = %85
  br i1 %90, label %92, label %98

92:                                               ; preds = %91, %84
  invoke void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef @.str.2)
          to label %93 unwind label %94

93:                                               ; preds = %92
  br label %100

94:                                               ; preds = %98, %92, %85, %78
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %7, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %8, align 4
  call void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %0) #6
  br label %104

98:                                               ; preds = %91
  invoke void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEE3SetERKS3_(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %99 unwind label %94

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99, %93
  store i1 true, ptr %13, align 1
  %101 = load i1, ptr %13, align 1
  br i1 %101, label %103, label %102

102:                                              ; preds = %100
  call void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %0) #6
  br label %103

103:                                              ; preds = %102, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN3JPH3RefINS_8SkeletonEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

104:                                              ; preds = %94, %76, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN3JPH3RefINS_8SkeletonEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %105

105:                                              ; preds = %104
  %106 = load ptr, ptr %7, align 8
  %107 = load i32, ptr %8, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH8SkeletonnwEm(i64 noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefINS_8SkeletonEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #4 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #5 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!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, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::Result" = type <{ %union.anon.8, i8, [7 x i8] }>
%union.anon.8 = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.JPH::Ref" = type { ptr }

@.str.2 = external hidden unnamed_addr constant [36 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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH8Skeleton23sRestoreFromBinaryStateERNS_8StreamInE(ptr dead_on_unwind noalias writable sret(%"class.JPH::Result") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.JPH::Ref", align 8
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %5 = tail call noundef ptr @_ZN3JPH8SkeletonnwEm(i64 noundef 32)
  tail call void @_ZN3JPH8SkeletonC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @_ZN3JPH3RefINS_8SkeletonEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %6 unwind label %20

6:                                                ; preds = %2
  %7 = call noundef ptr @_ZNK3JPH3RefINS_8SkeletonEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %10 = zext i32 %9 to i64
  invoke void @_ZN3JPH5ArrayINS_8Skeleton5JointENS_12STLAllocatorIS2_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10)
          to label %11 unwind label %20

11:                                               ; preds = %6
  %12 = call noundef ptr @_ZNK3JPH3RefINS_8SkeletonEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = call noundef ptr @_ZN3JPH5ArrayINS_8Skeleton5JointENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %15 = call noundef ptr @_ZN3JPH5ArrayINS_8Skeleton5JointENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %.not20 = icmp eq ptr %14, %15
  br i1 %.not20, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %26, %11
  call void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %16 = load ptr, ptr %1, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %16, i64 24
  %18 = load ptr, ptr %17, align 8
  %19 = invoke noundef zeroext i1 %18(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %30 unwind label %38

20:                                               ; preds = %6, %2
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %42

.lr.ph:                                           ; preds = %11, %26
  %.01821 = phi ptr [ %27, %26 ], [ %14, %11 ]
  invoke void @_ZN3JPH8StreamIn4ReadIcSt11char_traitsIcENS_12STLAllocatorIcEEEEvRNSt7__cxx1112basic_stringIT_T0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(32) %.01821)
          to label %22 unwind label %28

22:                                               ; preds = %.lr.ph
  %23 = getelementptr inbounds i8, ptr %.01821, i64 64
  invoke void @_ZN3JPH8StreamIn4ReadIiTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %24 unwind label %28

24:                                               ; preds = %22
  %25 = getelementptr inbounds i8, ptr %.01821, i64 32
  invoke void @_ZN3JPH8StreamIn4ReadIcSt11char_traitsIcENS_12STLAllocatorIcEEEEvRNSt7__cxx1112basic_stringIT_T0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(32) %25)
          to label %26 unwind label %28

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %.01821, i64 72
  %.not = icmp eq ptr %27, %15
  br i1 %.not, label %._crit_edge, label %.lr.ph

28:                                               ; preds = %24, %22, %.lr.ph
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %42

30:                                               ; preds = %._crit_edge
  br i1 %19, label %37, label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr %1, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %32, i64 32
  %34 = load ptr, ptr %33, align 8
  %35 = invoke noundef zeroext i1 %34(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %36 unwind label %38

36:                                               ; preds = %31
  br i1 %35, label %37, label %40

37:                                               ; preds = %36, %30
  invoke void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEE8SetErrorEPKc(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull @.str.2)
          to label %41 unwind label %38

38:                                               ; preds = %40, %37, %31, %._crit_edge
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %0) #6
  br label %42

40:                                               ; preds = %36
  invoke void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEE3SetERKS3_(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %41 unwind label %38

41:                                               ; preds = %37, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @_ZN3JPH3RefINS_8SkeletonEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret void

42:                                               ; preds = %38, %28, %20
  %.pn = phi { ptr, i32 } [ %29, %28 ], [ %39, %38 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @_ZN3JPH3RefINS_8SkeletonEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH8SkeletonnwEm(i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefINS_8SkeletonEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #4 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH6ResultINS_3RefINS_8SkeletonEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #5 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}


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