; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Character (CharacterVirtual)

; 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::CharacterVirtual" = type <{ %"class.JPH::CharacterBase", %"class.JPH::CharacterID", [4 x i8], ptr, ptr, i8, [3 x i8], float, i32, i32, float, float, float, i32, float, float, i8, [3 x i8], float, float, [4 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Array.2", i32, [4 x i8], %"class.JPH::UnorderedMap", float, i8, [3 x i8], i64, %"class.JPH::BodyID", [12 x i8] }>
%"class.JPH::CharacterBase" = type { ptr, %"class.JPH::RefTarget", ptr, %"class.JPH::RefConst", %"class.JPH::Vec3", %"class.JPH::Plane", float, i32, %"class.JPH::BodyID", %"class.JPH::SubShapeID", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::RefConst.1", i64 }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::RefConst.1" = type { ptr }
%"class.JPH::CharacterID" = type { i32 }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::Array.2" = type { i64, i64, ptr }
%"class.JPH::UnorderedMap" = type { %"class.JPH::HashTable.base", [4 x i8] }
%"class.JPH::HashTable.base" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::BodyID" = type { i32 }
%"struct.JPH::CharacterVirtual::Contact" = type <{ %"class.JPH::CharacterVirtual::ContactKey", [4 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, float, i8, i8, [6 x i8], ptr, i64, ptr, i8, i8, i8, [5 x i8] }>
%"class.JPH::CharacterVirtual::ContactKey" = type { %"class.JPH::BodyID", %"class.JPH::CharacterID", %"class.JPH::SubShapeID" }

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual7Contact12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(123), ptr noundef nonnull align 8 dereferenceable(18)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH8StreamIn4ReadIfTnNSt9enable_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 uwtable
declare dso_local void @_ZN3JPH8StreamIn4ReadIbTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH16CharacterVirtual12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 8 dereferenceable(18) %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3JPH13CharacterBase12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(144) %11, ptr noundef nonnull align 8 dereferenceable(18) %12)
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 22
  call void @_ZN3JPH8StreamIn4ReadERNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 16 dereferenceable(16) %14)
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 23
  call void @_ZN3JPH8StreamIn4ReadINS_4QuatETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 16 dereferenceable(16) %16)
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 24
  call void @_ZN3JPH8StreamIn4ReadERNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 16 dereferenceable(16) %18)
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 29
  call void @_ZN3JPH8StreamIn4ReadIfTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 30
  call void @_ZN3JPH8StreamIn4ReadIbTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 1 dereferenceable(1) %22)
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(18) %23)
  br i1 %24, label %25, label %55

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %26 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 25
  %27 = call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  %28 = trunc i64 %27 to i32
  %29 = sub nsw i32 %28, 1
  store i32 %29, ptr %5, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %51, %25
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = icmp sge i32 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %54

34:                                               ; preds = %30
  %35 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 25
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %37)
  %39 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %38, i32 0, i32 14
  %40 = load i8, ptr %39, align 8, !tbaa !11, !range !22, !noundef !23
  %41 = trunc i8 %40 to i1
  br i1 %41, label %50, label %42

42:                                               ; preds = %34
  %43 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 25
  %44 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 25
  %45 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %44)
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %45, i64 %47
  %49 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef %48)
  br label %50

50:                                               ; preds = %42, %34
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %5, align 4, !tbaa !9
  br label %30, !llvm.loop !24

54:                                               ; preds = %33
  br label %55

55:                                               ; preds = %54, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %56 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 25
  %57 = call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %56)
  %58 = trunc i64 %57 to i32
  store i32 %58, ptr %6, align 4, !tbaa !9
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %60 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 25
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %63 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %11, i32 0, i32 25
  store ptr %63, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %64)
  store ptr %65, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %66)
  store ptr %67, ptr %9, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %77, %55
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = icmp ne ptr %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %80

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %74, ptr %10, align 8, !tbaa !5
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3JPH16CharacterVirtual7Contact12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(123) %75, ptr noundef nonnull align 8 dereferenceable(18) %76)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %77

77:                                               ; preds = %73
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %78, i32 1
  store ptr %79, ptr %8, align 8, !tbaa !5
  br label %68

80:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  ret void
}

declare void @_ZN3JPH13CharacterBase12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(18)) unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(18)) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #2 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 uwtable
declare dso_local void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #6 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 = { mustprogress uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 #7 = { 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, !20, i64 120}
!12 = !{!"_ZTSN3JPH16CharacterVirtual7ContactE", !13, i64 0, !17, i64 16, !17, i64 32, !17, i64 48, !17, i64 64, !18, i64 80, !18, i64 84, !19, i64 88, !20, i64 89, !6, i64 96, !21, i64 104, !6, i64 112, !20, i64 120, !20, i64 121, !20, i64 122}
!13 = !{!"_ZTSN3JPH16CharacterVirtual10ContactKeyE", !14, i64 0, !15, i64 4, !16, i64 8}
!14 = !{!"_ZTSN3JPH6BodyIDE", !10, i64 0}
!15 = !{!"_ZTSN3JPH11CharacterIDE", !10, i64 0}
!16 = !{!"_ZTSN3JPH10SubShapeIDE", !10, i64 0}
!17 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSN3JPH11EMotionTypeE", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"long", !7, 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"

%"struct.JPH::CharacterVirtual::Contact" = type <{ %"class.JPH::CharacterVirtual::ContactKey", [4 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, float, i8, i8, [6 x i8], ptr, i64, ptr, i8, i8, i8, [5 x i8] }>
%"class.JPH::CharacterVirtual::ContactKey" = type { %"class.JPH::BodyID", %"class.JPH::CharacterID", %"class.JPH::SubShapeID" }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::CharacterID" = type { i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual7Contact12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(123), ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH8StreamIn4ReadIfTnNSt9enable_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 uwtable
declare dso_local void @_ZN3JPH8StreamIn4ReadIbTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH16CharacterVirtual12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 8 dereferenceable(18) %1) unnamed_addr #2 align 2 {
  %3 = alloca i32, align 4
  tail call void @_ZN3JPH13CharacterBase12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(144) %0, ptr noundef nonnull align 8 dereferenceable(18) %1)
  %4 = getelementptr inbounds i8, ptr %0, i64 240
  tail call void @_ZN3JPH8StreamIn4ReadERNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 16 dereferenceable(16) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 256
  tail call void @_ZN3JPH8StreamIn4ReadINS_4QuatETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 16 dereferenceable(16) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 272
  tail call void @_ZN3JPH8StreamIn4ReadERNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 16 dereferenceable(16) %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 352
  tail call void @_ZN3JPH8StreamIn4ReadIfTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 356
  tail call void @_ZN3JPH8StreamIn4ReadIbTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 1 dereferenceable(1) %8)
  %9 = tail call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(18) %1)
  br i1 %9, label %10, label %.loopexit

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %0, i64 288
  %12 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %13 = trunc i64 %12 to i32
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %10
  %15 = and i64 %12, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %24
  %indvars.iv = phi i64 [ %15, %.lr.ph.preheader ], [ %indvars.iv.next, %24 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %16 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %indvars.iv.next)
  %17 = getelementptr inbounds i8, ptr %16, i64 120
  %18 = load i8, ptr %17, align 8, !tbaa !5, !range !20, !noundef !21
  %19 = trunc nuw i8 %18 to i1
  br i1 %19, label %24, label %20

20:                                               ; preds = %.lr.ph
  %21 = tail call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %22 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %21, i64 %indvars.iv.next
  %23 = tail call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef %22)
  br label %24

24:                                               ; preds = %.lr.ph, %20
  %25 = icmp ugt i64 %indvars.iv, 1
  br i1 %25, label %.lr.ph, label %.loopexit, !llvm.loop !22

.loopexit:                                        ; preds = %24, %10, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %26 = getelementptr inbounds i8, ptr %0, i64 288
  %27 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  %28 = trunc i64 %27 to i32
  store i32 %28, ptr %3, align 4, !tbaa !24
  call void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = load i32, ptr %3, align 4, !tbaa !24
  %30 = zext i32 %29 to i64
  call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %30)
  %31 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  %32 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  %.not23 = icmp eq ptr %31, %32
  br i1 %.not23, label %._crit_edge, label %.lr.ph25

._crit_edge:                                      ; preds = %.lr.ph25, %.loopexit
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret void

.lr.ph25:                                         ; preds = %.loopexit, %.lr.ph25
  %.02024 = phi ptr [ %33, %.lr.ph25 ], [ %31, %.loopexit ]
  call void @_ZN3JPH16CharacterVirtual7Contact12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(123) %.02024, ptr noundef nonnull align 8 dereferenceable(18) %1)
  %33 = getelementptr inbounds i8, ptr %.02024, i64 128
  %.not = icmp eq ptr %33, %32
  br i1 %.not, label %._crit_edge, label %.lr.ph25
}

declare void @_ZN3JPH13CharacterBase12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 16 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(18)) unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #2 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 uwtable
declare dso_local void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #6 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 = { mustprogress uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 #7 = { 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, !17, i64 120}
!6 = !{!"_ZTSN3JPH16CharacterVirtual7ContactE", !7, i64 0, !14, i64 16, !14, i64 32, !14, i64 48, !14, i64 64, !15, i64 80, !15, i64 84, !16, i64 88, !17, i64 89, !18, i64 96, !19, i64 104, !18, i64 112, !17, i64 120, !17, i64 121, !17, i64 122}
!7 = !{!"_ZTSN3JPH16CharacterVirtual10ContactKeyE", !8, i64 0, !12, i64 4, !13, i64 8}
!8 = !{!"_ZTSN3JPH6BodyIDE", !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN3JPH11CharacterIDE", !9, i64 0}
!13 = !{!"_ZTSN3JPH10SubShapeIDE", !9, i64 0}
!14 = !{!"_ZTSN3JPH4Vec3E", !10, i64 0}
!15 = !{!"float", !10, i64 0}
!16 = !{!"_ZTSN3JPH11EMotionTypeE", !10, i64 0}
!17 = !{!"bool", !10, i64 0}
!18 = !{!"any pointer", !10, i64 0}
!19 = !{!"long", !10, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!9, !9, i64 0}


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