; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/PhysicsScene.ll (ZNK3JPH12PhysicsScene15SaveBinaryStateERNS_9StreamOutEbb)

; 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::UnorderedMap" = type { %"class.JPH::HashTable.base", [4 x i8] }
%"class.JPH::HashTable.base" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.41" = type { %"class.JPH::HashTable.base.43", [4 x i8] }
%"class.JPH::HashTable.base.43" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.45" = type { %"class.JPH::HashTable.base.47", [4 x i8] }
%"class.JPH::HashTable.base.47" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.49" = type { %"class.JPH::HashTable.base.51", [4 x i8] }
%"class.JPH::HashTable.base.51" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::PhysicsScene" = type { %"class.JPH::RefTarget", %"class.JPH::Array", %"class.JPH::Array.6", %"class.JPH::Array.9" }
%"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::Array.6" = type { i64, i64, ptr }
%"class.JPH::Array.9" = type { i64, i64, ptr }
%"class.JPH::BodyCreationSettings" = type { %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Vec3", i64, i16, %"class.JPH::CollisionGroup", i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, float, i32, i32, i8, float, %"class.JPH::MassProperties", %"class.JPH::RefConst.13", %"class.JPH::RefConst.14" }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.12 }
%union.anon.12 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst", i32, i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::MassProperties" = type { float, %"class.JPH::Mat44" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::RefConst.13" = type { ptr }
%"class.JPH::RefConst.14" = type { ptr }
%"class.JPH::PhysicsScene::ConnectedConstraint" = type { %"class.JPH::RefConst.15", i32, i32 }
%"class.JPH::RefConst.15" = type { ptr }
%"class.JPH::SoftBodyCreationSettings" = type <{ %"class.JPH::RefConst.16", [8 x i8], %"class.JPH::Vec3", %"class.JPH::Quat", i64, i16, [6 x i8], %"class.JPH::CollisionGroup", i32, float, float, float, float, float, float, i8, i8, i8, i8 }>
%"class.JPH::RefConst.16" = type { ptr }

; 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 i64 @_ZNK3JPH5ArrayINS_20BodyCreationSettingsENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH12PhysicsScene15SaveBinaryStateERNS_9StreamOutEbb(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext %2, i1 noundef zeroext %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca %"class.JPH::UnorderedMap", align 8
  %10 = alloca %"class.JPH::UnorderedMap.41", align 8
  %11 = alloca %"class.JPH::UnorderedMap.45", align 8
  %12 = alloca %"class.JPH::UnorderedMap.49", align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %30 = zext i1 %2 to i8
  store i8 %30, ptr %7, align 1, !tbaa !9
  %31 = zext i1 %3 to i8
  store i8 %31, ptr %8, align 1, !tbaa !9
  %32 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  call void @_ZN3JPH12UnorderedMapIPKNS_5ShapeEjNS_4HashIS3_EESt8equal_toIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %9) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  call void @_ZN3JPH12UnorderedMapIPKNS_15PhysicsMaterialEjNS_4HashIS3_EESt8equal_toIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %10) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @_ZN3JPH12UnorderedMapIPKNS_11GroupFilterEjNS_4HashIS3_EESt8equal_toIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %11) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  call void @_ZN3JPH12UnorderedMapIPKNS_22SoftBodySharedSettingsEjNS_4HashIS3_EESt8equal_toIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %12) #5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %34 = getelementptr inbounds %"class.JPH::PhysicsScene", ptr %32, i32 0, i32 1
  %35 = invoke noundef i64 @_ZNK3JPH5ArrayINS_20BodyCreationSettingsENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34)
          to label %36 unwind label %51

36:                                               ; preds = %4
  %37 = trunc i64 %35 to i32
  store i32 %37, ptr %13, align 4, !tbaa !11
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %38 unwind label %51

38:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %39 = getelementptr inbounds %"class.JPH::PhysicsScene", ptr %32, i32 0, i32 1
  store ptr %39, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %40 = load ptr, ptr %16, align 8, !tbaa !5
  %41 = invoke noundef ptr @_ZNK3JPH5ArrayINS_20BodyCreationSettingsENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %40)
          to label %42 unwind label %55

42:                                               ; preds = %38
  store ptr %41, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %43 = load ptr, ptr %16, align 8, !tbaa !5
  %44 = invoke noundef ptr @_ZNK3JPH5ArrayINS_20BodyCreationSettingsENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %43)
          to label %45 unwind label %59

45:                                               ; preds = %42
  store ptr %44, ptr %18, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %86, %45
  %47 = load ptr, ptr %17, align 8, !tbaa !5
  %48 = load ptr, ptr %18, align 8, !tbaa !5
  %49 = icmp ne ptr %47, %48
  br i1 %49, label %63, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %95

51:                                               ; preds = %36, %4
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %14, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %206

55:                                               ; preds = %38
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %14, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %15, align 4
  br label %94

59:                                               ; preds = %42
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %14, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %15, align 4
  br label %93

63:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %64 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %64, ptr %19, align 8, !tbaa !5
  %65 = load ptr, ptr %19, align 8, !tbaa !5
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = load i8, ptr %7, align 1, !tbaa !9, !range !13, !noundef !14
  %68 = trunc i8 %67 to i1
  br i1 %68, label %69, label %70

69:                                               ; preds = %63
  br label %71

70:                                               ; preds = %63
  br label %71

71:                                               ; preds = %70, %69
  %72 = phi ptr [ %9, %69 ], [ null, %70 ]
  %73 = load i8, ptr %7, align 1, !tbaa !9, !range !13, !noundef !14
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %76

75:                                               ; preds = %71
  br label %77

76:                                               ; preds = %71
  br label %77

77:                                               ; preds = %76, %75
  %78 = phi ptr [ %10, %75 ], [ null, %76 ]
  %79 = load i8, ptr %8, align 1, !tbaa !9, !range !13, !noundef !14
  %80 = trunc i8 %79 to i1
  br i1 %80, label %81, label %82

81:                                               ; preds = %77
  br label %83

82:                                               ; preds = %77
  br label %83

83:                                               ; preds = %82, %81
  %84 = phi ptr [ %11, %81 ], [ null, %82 ]
  invoke void @_ZNK3JPH20BodyCreationSettings16SaveWithChildrenERNS_9StreamOutEPNS_12UnorderedMapIPKNS_5ShapeEjNS_4HashIS6_EESt8equal_toIS6_EEEPNS3_IPKNS_15PhysicsMaterialEjNS7_ISF_EES9_ISF_EEEPNS3_IPKNS_11GroupFilterEjNS7_ISM_EES9_ISM_EEE(ptr noundef nonnull align 16 dereferenceable(256) %65, ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef %72, ptr noundef %78, ptr noundef %84)
          to label %85 unwind label %89

85:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.JPH::BodyCreationSettings", ptr %87, i32 1
  store ptr %88, ptr %17, align 8, !tbaa !5
  br label %46

89:                                               ; preds = %83
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %14, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %93

93:                                               ; preds = %89, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %94

94:                                               ; preds = %93, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %206

95:                                               ; preds = %50
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %97 = getelementptr inbounds %"class.JPH::PhysicsScene", ptr %32, i32 0, i32 2
  %98 = invoke noundef i64 @_ZNK3JPH5ArrayINS_12PhysicsScene19ConnectedConstraintENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %97)
          to label %99 unwind label %114

99:                                               ; preds = %95
  %100 = trunc i64 %98 to i32
  store i32 %100, ptr %20, align 4, !tbaa !11
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %101 unwind label %114

101:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %102 = getelementptr inbounds %"class.JPH::PhysicsScene", ptr %32, i32 0, i32 2
  store ptr %102, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %103 = load ptr, ptr %21, align 8, !tbaa !5
  %104 = invoke noundef ptr @_ZNK3JPH5ArrayINS_12PhysicsScene19ConnectedConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %103)
          to label %105 unwind label %118

105:                                              ; preds = %101
  store ptr %104, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %106 = load ptr, ptr %21, align 8, !tbaa !5
  %107 = invoke noundef ptr @_ZNK3JPH5ArrayINS_12PhysicsScene19ConnectedConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %106)
          to label %108 unwind label %122

108:                                              ; preds = %105
  store ptr %107, ptr %23, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %145, %108
  %110 = load ptr, ptr %22, align 8, !tbaa !5
  %111 = load ptr, ptr %23, align 8, !tbaa !5
  %112 = icmp ne ptr %110, %111
  br i1 %112, label %126, label %113

113:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %154

114:                                              ; preds = %99, %95
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %14, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %206

118:                                              ; preds = %101
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %14, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %15, align 4
  br label %153

122:                                              ; preds = %105
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %14, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %15, align 4
  br label %152

126:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %127 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %127, ptr %24, align 8, !tbaa !5
  %128 = load ptr, ptr %24, align 8, !tbaa !5
  %129 = getelementptr inbounds %"class.JPH::PhysicsScene::ConnectedConstraint", ptr %128, i32 0, i32 0
  %130 = invoke noundef ptr @_ZNK3JPH8RefConstINS_25TwoBodyConstraintSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %129)
          to label %131 unwind label %148

131:                                              ; preds = %126
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = load ptr, ptr %130, align 8, !tbaa !15
  %134 = getelementptr inbounds ptr, ptr %133, i64 4
  %135 = load ptr, ptr %134, align 8
  invoke void %135(ptr noundef nonnull align 8 dereferenceable(40) %130, ptr noundef nonnull align 8 dereferenceable(8) %132)
          to label %136 unwind label %148

136:                                              ; preds = %131
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = load ptr, ptr %24, align 8, !tbaa !5
  %139 = getelementptr inbounds %"class.JPH::PhysicsScene::ConnectedConstraint", ptr %138, i32 0, i32 1
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull align 4 dereferenceable(4) %139)
          to label %140 unwind label %148

140:                                              ; preds = %136
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = load ptr, ptr %24, align 8, !tbaa !5
  %143 = getelementptr inbounds %"class.JPH::PhysicsScene::ConnectedConstraint", ptr %142, i32 0, i32 2
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef nonnull align 4 dereferenceable(4) %143)
          to label %144 unwind label %148

144:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %145

145:                                              ; preds = %144
  %146 = load ptr, ptr %22, align 8, !tbaa !5
  %147 = getelementptr inbounds %"class.JPH::PhysicsScene::ConnectedConstraint", ptr %146, i32 1
  store ptr %147, ptr %22, align 8, !tbaa !5
  br label %109

148:                                              ; preds = %140, %136, %131, %126
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %14, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %152

152:                                              ; preds = %148, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %153

153:                                              ; preds = %152, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %206

154:                                              ; preds = %113
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %156 = getelementptr inbounds %"class.JPH::PhysicsScene", ptr %32, i32 0, i32 3
  %157 = invoke noundef i64 @_ZNK3JPH5ArrayINS_24SoftBodyCreationSettingsENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %156)
          to label %158 unwind label %173

158:                                              ; preds = %154
  %159 = trunc i64 %157 to i32
  store i32 %159, ptr %25, align 4, !tbaa !11
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %160 unwind label %173

160:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %161 = getelementptr inbounds %"class.JPH::PhysicsScene", ptr %32, i32 0, i32 3
  store ptr %161, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %162 = load ptr, ptr %26, align 8, !tbaa !5
  %163 = invoke noundef ptr @_ZNK3JPH5ArrayINS_24SoftBodyCreationSettingsENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %162)
          to label %164 unwind label %177

164:                                              ; preds = %160
  store ptr %163, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %165 = load ptr, ptr %26, align 8, !tbaa !5
  %166 = invoke noundef ptr @_ZNK3JPH5ArrayINS_24SoftBodyCreationSettingsENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %165)
          to label %167 unwind label %181

167:                                              ; preds = %164
  store ptr %166, ptr %28, align 8, !tbaa !5
  br label %168

168:                                              ; preds = %196, %167
  %169 = load ptr, ptr %27, align 8, !tbaa !5
  %170 = load ptr, ptr %28, align 8, !tbaa !5
  %171 = icmp ne ptr %169, %170
  br i1 %171, label %185, label %172

172:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %205

173:                                              ; preds = %158, %154
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %14, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %206

177:                                              ; preds = %160
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %14, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %15, align 4
  br label %204

181:                                              ; preds = %164
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %14, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %15, align 4
  br label %203

185:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %186 = load ptr, ptr %27, align 8, !tbaa !5
  store ptr %186, ptr %29, align 8, !tbaa !5
  %187 = load ptr, ptr %29, align 8, !tbaa !5
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = load i8, ptr %8, align 1, !tbaa !9, !range !13, !noundef !14
  %190 = trunc i8 %189 to i1
  br i1 %190, label %191, label %192

191:                                              ; preds = %185
  br label %193

192:                                              ; preds = %185
  br label %193

193:                                              ; preds = %192, %191
  %194 = phi ptr [ %11, %191 ], [ null, %192 ]
  invoke void @_ZNK3JPH24SoftBodyCreationSettings16SaveWithChildrenERNS_9StreamOutEPNS_12UnorderedMapIPKNS_22SoftBodySharedSettingsEjNS_4HashIS6_EESt8equal_toIS6_EEEPNS3_IPKNS_15PhysicsMaterialEjNS7_ISF_EES9_ISF_EEEPNS3_IPKNS_11GroupFilterEjNS7_ISM_EES9_ISM_EEE(ptr noundef nonnull align 16 dereferenceable(111) %187, ptr noundef nonnull align 8 dereferenceable(8) %188, ptr noundef %12, ptr noundef %10, ptr noundef %194)
          to label %195 unwind label %199

195:                                              ; preds = %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %196

196:                                              ; preds = %195
  %197 = load ptr, ptr %27, align 8, !tbaa !5
  %198 = getelementptr inbounds %"class.JPH::SoftBodyCreationSettings", ptr %197, i32 1
  store ptr %198, ptr %27, align 8, !tbaa !5
  br label %168

199:                                              ; preds = %193
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %14, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %203

203:                                              ; preds = %199, %181
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %204

204:                                              ; preds = %203, %177
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %206

205:                                              ; preds = %172
  call void @_ZN3JPH9HashTableIPKNS_22SoftBodySharedSettingsESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @_ZN3JPH9HashTableIPKNS_11GroupFilterESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @_ZN3JPH9HashTableIPKNS_15PhysicsMaterialESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @_ZN3JPH9HashTableIPKNS_5ShapeESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  ret void

206:                                              ; preds = %204, %173, %153, %114, %94, %51
  call void @_ZN3JPH9HashTableIPKNS_22SoftBodySharedSettingsESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @_ZN3JPH9HashTableIPKNS_11GroupFilterESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @_ZN3JPH9HashTableIPKNS_15PhysicsMaterialESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @_ZN3JPH9HashTableIPKNS_5ShapeESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  br label %207

207:                                              ; preds = %206
  %208 = load ptr, ptr %14, align 8
  %209 = load i32, ptr %15, align 4
  %210 = insertvalue { ptr, i32 } poison, ptr %208, 0
  %211 = insertvalue { ptr, i32 } %210, i32 %209, 1
  resume { ptr, i32 } %211
}

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

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

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

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

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

declare void @_ZNK3JPH20BodyCreationSettings16SaveWithChildrenERNS_9StreamOutEPNS_12UnorderedMapIPKNS_5ShapeEjNS_4HashIS6_EESt8equal_toIS6_EEEPNS3_IPKNS_15PhysicsMaterialEjNS7_ISF_EES9_ISF_EEEPNS3_IPKNS_11GroupFilterEjNS7_ISM_EES9_ISM_EEE(ptr noundef nonnull align 16 dereferenceable(256), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef, ptr noundef) #3

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

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

declare void @_ZNK3JPH24SoftBodyCreationSettings16SaveWithChildrenERNS_9StreamOutEPNS_12UnorderedMapIPKNS_22SoftBodySharedSettingsEjNS_4HashIS6_EESt8equal_toIS6_EEEPNS3_IPKNS_15PhysicsMaterialEjNS7_ISF_EES9_ISF_EEEPNS3_IPKNS_11GroupFilterEjNS7_ISM_EES9_ISM_EEE(ptr noundef nonnull align 16 dereferenceable(111), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH9HashTableIPKNS_22SoftBodySharedSettingsESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH9HashTableIPKNS_11GroupFilterESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH9HashTableIPKNS_15PhysicsMaterialESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH9HashTableIPKNS_5ShapeESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 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 = { "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 = { 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 #5 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"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::UnorderedMap" = type { %"class.JPH::HashTable.base", [4 x i8] }
%"class.JPH::HashTable.base" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.41" = type { %"class.JPH::HashTable.base.43", [4 x i8] }
%"class.JPH::HashTable.base.43" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.45" = type { %"class.JPH::HashTable.base.47", [4 x i8] }
%"class.JPH::HashTable.base.47" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.49" = type { %"class.JPH::HashTable.base.51", [4 x i8] }
%"class.JPH::HashTable.base.51" = type <{ ptr, ptr, i32, i32, i32 }>

; 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 i64 @_ZNK3JPH5ArrayINS_20BodyCreationSettingsENS_12STLAllocatorIS1_EEE4sizeEv(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_24SoftBodyCreationSettingsENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH12PhysicsScene15SaveBinaryStateERNS_9StreamOutEbb(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext %2, i1 noundef zeroext %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.JPH::UnorderedMap", align 8
  %6 = alloca %"class.JPH::UnorderedMap.41", align 8
  %7 = alloca %"class.JPH::UnorderedMap.45", align 8
  %8 = alloca %"class.JPH::UnorderedMap.49", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN3JPH12UnorderedMapIPKNS_5ShapeEjNS_4HashIS3_EESt8equal_toIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @_ZN3JPH12UnorderedMapIPKNS_15PhysicsMaterialEjNS_4HashIS3_EESt8equal_toIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN3JPH12UnorderedMapIPKNS_11GroupFilterEjNS_4HashIS3_EESt8equal_toIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  call void @_ZN3JPH12UnorderedMapIPKNS_22SoftBodySharedSettingsEjNS_4HashIS3_EESt8equal_toIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = call noundef i64 @_ZNK3JPH5ArrayINS_20BodyCreationSettingsENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %14 = trunc i64 %13 to i32
  store i32 %14, ptr %9, align 4, !tbaa !5
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %15 unwind label %23

15:                                               ; preds = %4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  %16 = call noundef ptr @_ZNK3JPH5ArrayINS_20BodyCreationSettingsENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %17 = call noundef ptr @_ZNK3JPH5ArrayINS_20BodyCreationSettingsENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %.not45 = icmp eq ptr %16, %17
  br i1 %.not45, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %. = select i1 %2, ptr %5, ptr null
  %18 = select i1 %2, ptr %6, ptr null
  %19 = select i1 %3, ptr %7, ptr null
  br label %25

._crit_edge:                                      ; preds = %26, %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  %20 = getelementptr inbounds i8, ptr %0, i64 32
  %21 = call noundef i64 @_ZNK3JPH5ArrayINS_12PhysicsScene19ConnectedConstraintENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %22 = trunc i64 %21 to i32
  store i32 %22, ptr %10, align 4, !tbaa !5
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %30 unwind label %36

23:                                               ; preds = %4
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br label %60

25:                                               ; preds = %.lr.ph, %26
  %.04046 = phi ptr [ %16, %.lr.ph ], [ %27, %26 ]
  invoke void @_ZNK3JPH20BodyCreationSettings16SaveWithChildrenERNS_9StreamOutEPNS_12UnorderedMapIPKNS_5ShapeEjNS_4HashIS6_EESt8equal_toIS6_EEEPNS3_IPKNS_15PhysicsMaterialEjNS7_ISF_EES9_ISF_EEEPNS3_IPKNS_11GroupFilterEjNS7_ISM_EES9_ISM_EEE(ptr noundef nonnull align 16 dereferenceable(256) %.04046, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %., ptr noundef %18, ptr noundef %19)
          to label %26 unwind label %28

26:                                               ; preds = %25
  %27 = getelementptr inbounds i8, ptr %.04046, i64 256
  %.not = icmp eq ptr %27, %17
  br i1 %.not, label %._crit_edge, label %25

28:                                               ; preds = %25
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %60

30:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %31 = call noundef ptr @_ZNK3JPH5ArrayINS_12PhysicsScene19ConnectedConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %32 = call noundef ptr @_ZNK3JPH5ArrayINS_12PhysicsScene19ConnectedConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %.not4247 = icmp eq ptr %31, %32
  br i1 %.not4247, label %._crit_edge51, label %.lr.ph50

._crit_edge51:                                    ; preds = %46, %30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  %33 = getelementptr inbounds i8, ptr %0, i64 56
  %34 = call noundef i64 @_ZNK3JPH5ArrayINS_24SoftBodyCreationSettingsENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %35 = trunc i64 %34 to i32
  store i32 %35, ptr %11, align 4, !tbaa !5
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %50 unwind label %53

36:                                               ; preds = %._crit_edge
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  br label %60

.lr.ph50:                                         ; preds = %30, %46
  %.04148 = phi ptr [ %47, %46 ], [ %31, %30 ]
  %38 = call noundef ptr @_ZNK3JPH8RefConstINS_25TwoBodyConstraintSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.04148)
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %39, i64 32
  %41 = load ptr, ptr %40, align 8
  invoke void %41(ptr noundef nonnull align 8 dereferenceable(40) %38, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %42 unwind label %48

42:                                               ; preds = %.lr.ph50
  %43 = getelementptr inbounds i8, ptr %.04148, i64 8
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %43)
          to label %44 unwind label %48

44:                                               ; preds = %42
  %45 = getelementptr inbounds i8, ptr %.04148, i64 12
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %45)
          to label %46 unwind label %48

46:                                               ; preds = %44
  %47 = getelementptr inbounds i8, ptr %.04148, i64 16
  %.not42 = icmp eq ptr %47, %32
  br i1 %.not42, label %._crit_edge51, label %.lr.ph50

48:                                               ; preds = %44, %42, %.lr.ph50
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %60

50:                                               ; preds = %._crit_edge51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  %51 = call noundef ptr @_ZNK3JPH5ArrayINS_24SoftBodyCreationSettingsENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %52 = call noundef ptr @_ZNK3JPH5ArrayINS_24SoftBodyCreationSettingsENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %.not4352 = icmp eq ptr %51, %52
  br i1 %.not4352, label %._crit_edge56, label %.lr.ph55

.lr.ph55:                                         ; preds = %50
  %.1 = select i1 %3, ptr %7, ptr null
  br label %55

._crit_edge56:                                    ; preds = %56, %50
  call void @_ZN3JPH9HashTableIPKNS_22SoftBodySharedSettingsESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @_ZN3JPH9HashTableIPKNS_11GroupFilterESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN3JPH9HashTableIPKNS_15PhysicsMaterialESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @_ZN3JPH9HashTableIPKNS_5ShapeESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  ret void

53:                                               ; preds = %._crit_edge51
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br label %60

55:                                               ; preds = %.lr.ph55, %56
  %.03953 = phi ptr [ %51, %.lr.ph55 ], [ %57, %56 ]
  invoke void @_ZNK3JPH24SoftBodyCreationSettings16SaveWithChildrenERNS_9StreamOutEPNS_12UnorderedMapIPKNS_22SoftBodySharedSettingsEjNS_4HashIS6_EESt8equal_toIS6_EEEPNS3_IPKNS_15PhysicsMaterialEjNS7_ISF_EES9_ISF_EEEPNS3_IPKNS_11GroupFilterEjNS7_ISM_EES9_ISM_EEE(ptr noundef nonnull align 16 dereferenceable(111) %.03953, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %8, ptr noundef nonnull %6, ptr noundef %.1)
          to label %56 unwind label %58

56:                                               ; preds = %55
  %57 = getelementptr inbounds i8, ptr %.03953, i64 112
  %.not43 = icmp eq ptr %57, %52
  br i1 %.not43, label %._crit_edge56, label %55

58:                                               ; preds = %55
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %60

60:                                               ; preds = %58, %53, %48, %36, %28, %23
  %.pn = phi { ptr, i32 } [ %29, %28 ], [ %49, %48 ], [ %59, %58 ], [ %54, %53 ], [ %37, %36 ], [ %24, %23 ]
  call void @_ZN3JPH9HashTableIPKNS_22SoftBodySharedSettingsESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @_ZN3JPH9HashTableIPKNS_11GroupFilterESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN3JPH9HashTableIPKNS_15PhysicsMaterialESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @_ZN3JPH9HashTableIPKNS_5ShapeESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn
}

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

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

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

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

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

declare void @_ZNK3JPH20BodyCreationSettings16SaveWithChildrenERNS_9StreamOutEPNS_12UnorderedMapIPKNS_5ShapeEjNS_4HashIS6_EESt8equal_toIS6_EEEPNS3_IPKNS_15PhysicsMaterialEjNS7_ISF_EES9_ISF_EEEPNS3_IPKNS_11GroupFilterEjNS7_ISM_EES9_ISM_EEE(ptr noundef nonnull align 16 dereferenceable(256), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

declare void @_ZNK3JPH24SoftBodyCreationSettings16SaveWithChildrenERNS_9StreamOutEPNS_12UnorderedMapIPKNS_22SoftBodySharedSettingsEjNS_4HashIS6_EESt8equal_toIS6_EEEPNS3_IPKNS_15PhysicsMaterialEjNS7_ISF_EES9_ISF_EEEPNS3_IPKNS_11GroupFilterEjNS7_ISM_EES9_ISM_EEE(ptr noundef nonnull align 16 dereferenceable(111), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH9HashTableIPKNS_22SoftBodySharedSettingsESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH9HashTableIPKNS_11GroupFilterESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH9HashTableIPKNS_15PhysicsMaterialESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH9HashTableIPKNS_5ShapeESt4pairIS3_jENS_18UnorderedMapDetailIS3_jEENS_4HashIS3_EESt8equal_toIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 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 = { "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 = { 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 #5 = { 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,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass