; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/SoftBody (SoftBodySharedSettings)

; 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::Array.71" = type { i64, i64, ptr }
%"class.JPH::Array.74" = type { i64, i64, ptr }
%struct.Open = type { i32, float }
%"struct.std::less" = type { i8 }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SoftBodySharedSettings" = type { %"class.JPH::RefTarget", %"class.JPH::Array", %"class.JPH::Array.38", %"class.JPH::Array.41", %"class.JPH::Array.44", %"class.JPH::Array.47", %"class.JPH::Array.50", %"class.JPH::Array.53", %"class.JPH::Array.56", %"class.JPH::Array.59", float, %"class.JPH::Array.62", %"class.JPH::Array.65", %"class.JPH::Array.68" }
%"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.38" = type { i64, i64, ptr }
%"class.JPH::Array.41" = type { i64, i64, ptr }
%"class.JPH::Array.44" = type { i64, i64, ptr }
%"class.JPH::Array.47" = type { i64, i64, ptr }
%"class.JPH::Array.50" = type { i64, i64, ptr }
%"class.JPH::Array.53" = type { i64, i64, ptr }
%"class.JPH::Array.56" = type { i64, i64, ptr }
%"class.JPH::Array.59" = type { i64, i64, ptr }
%"class.JPH::Array.62" = type { i64, i64, ptr }
%"class.JPH::Array.65" = type { i64, i64, ptr }
%"class.JPH::Array.68" = type { i64, i64, ptr }
%"struct.JPH::SoftBodySharedSettings::Edge" = type { [2 x i32], float, float }
%"struct.JPH::SoftBodySharedSettings::Vertex" = type { %"class.JPH::Float3", %"class.JPH::Float3", float }
%"class.JPH::Float3" = type { float, float, float }
%"struct.JPH::SoftBodySharedSettings::ClosestKinematic" = type { i32, float }

@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [101 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: mustprogress uwtable
define dso_local void @_ZN3JPH22SoftBodySharedSettings25CalculateClosestKinematicEv(ptr noundef nonnull align 8 dereferenceable(304) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.JPH::Array.71", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.JPH::Array.74", align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.Open, align 4
  %13 = alloca %"struct.std::less", align 1
  %14 = alloca float, align 4
  %15 = alloca %"struct.std::less", align 1
  %16 = alloca %struct.Open, align 4
  %17 = alloca %"struct.JPH::AssertLastParam", align 1
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %struct.Open, align 4
  %27 = alloca %"struct.std::less", align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8
  %29 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 11
  %30 = call noundef zeroext i1 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %29)
  br i1 %30, label %32, label %31

31:                                               ; preds = %1
  br label %314

32:                                               ; preds = %1
  %33 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 11
  %34 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 1
  %35 = call noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34)
  call void @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %35)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #8
  call void @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %36 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 1
  %37 = invoke noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %36)
          to label %38 unwind label %52

38:                                               ; preds = %32
  invoke void @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %37)
          to label %39 unwind label %52

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %40 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 3
  store ptr %40, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = invoke noundef ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings4EdgeENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %41)
          to label %43 unwind label %56

43:                                               ; preds = %39
  store ptr %42, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = invoke noundef ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings4EdgeENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %44)
          to label %46 unwind label %60

46:                                               ; preds = %43
  store ptr %45, ptr %8, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %88, %46
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = icmp ne ptr %48, %49
  br i1 %50, label %64, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %97

52:                                               ; preds = %38, %32
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %4, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %5, align 4
  br label %317

56:                                               ; preds = %39
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %4, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %5, align 4
  br label %96

60:                                               ; preds = %43
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %4, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %5, align 4
  br label %95

64:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %65, ptr %9, align 8, !tbaa !5
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Edge", ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds [2 x i32], ptr %67, i64 0, i64 0
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %70)
          to label %72 unwind label %91

72:                                               ; preds = %64
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Edge", ptr %73, i32 0, i32 0
  %75 = getelementptr inbounds [2 x i32], ptr %74, i64 0, i64 1
  invoke void @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef nonnull align 4 dereferenceable(4) %75)
          to label %76 unwind label %91

76:                                               ; preds = %72
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Edge", ptr %77, i32 0, i32 0
  %79 = getelementptr inbounds [2 x i32], ptr %78, i64 0, i64 1
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %81)
          to label %83 unwind label %91

83:                                               ; preds = %76
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Edge", ptr %84, i32 0, i32 0
  %86 = getelementptr inbounds [2 x i32], ptr %85, i64 0, i64 0
  invoke void @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %82, ptr noundef nonnull align 4 dereferenceable(4) %86)
          to label %87 unwind label %91

87:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Edge", ptr %89, i32 1
  store ptr %90, ptr %7, align 8, !tbaa !5
  br label %47

91:                                               ; preds = %83, %76, %72, %64
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %4, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %95

95:                                               ; preds = %91, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %96

96:                                               ; preds = %95, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %317

97:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #8
  call void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %147, %97
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 1
  %102 = invoke noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %101)
          to label %103 unwind label %106

103:                                              ; preds = %98
  %104 = icmp ult i64 %100, %102
  br i1 %104, label %110, label %105

105:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %151

106:                                              ; preds = %140, %138, %136, %125, %119, %110, %98
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %4, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %5, align 4
  br label %150

110:                                              ; preds = %103
  %111 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 1
  %112 = load i32, ptr %11, align 4, !tbaa !9
  %113 = zext i32 %112 to i64
  %114 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %111, i64 noundef %113)
          to label %115 unwind label %106

115:                                              ; preds = %110
  %116 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Vertex", ptr %114, i32 0, i32 2
  %117 = load float, ptr %116, align 4, !tbaa !11
  %118 = fcmp oeq float %117, 0.000000e+00
  br i1 %118, label %119, label %146

119:                                              ; preds = %115
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 11
  %122 = load i32, ptr %11, align 4, !tbaa !9
  %123 = zext i32 %122 to i64
  %124 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %123)
          to label %125 unwind label %106

125:                                              ; preds = %119
  %126 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::ClosestKinematic", ptr %124, i32 0, i32 0
  store i32 %120, ptr %126, align 4, !tbaa !15
  %127 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 11
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = zext i32 %128 to i64
  %130 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %127, i64 noundef %129)
          to label %131 unwind label %106

131:                                              ; preds = %125
  %132 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::ClosestKinematic", ptr %130, i32 0, i32 1
  store float 0.000000e+00, ptr %132, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %133 = getelementptr inbounds %struct.Open, ptr %12, i32 0, i32 0
  %134 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %134, ptr %133, align 4, !tbaa !18
  %135 = getelementptr inbounds %struct.Open, ptr %12, i32 0, i32 1
  store float 0.000000e+00, ptr %135, align 4, !tbaa !20
  invoke void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %136 unwind label %142

136:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %137 = invoke noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %138 unwind label %106

138:                                              ; preds = %136
  %139 = invoke noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %140 unwind label %106

140:                                              ; preds = %138
  invoke void @_ZN3JPH14BinaryHeapPushIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef %137, ptr noundef %139)
          to label %141 unwind label %106

141:                                              ; preds = %140
  br label %146

142:                                              ; preds = %131
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %4, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %150

146:                                              ; preds = %141, %115
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %11, align 4, !tbaa !9
  %149 = add i32 %148, 1
  store i32 %149, ptr %11, align 4, !tbaa !9
  br label %98, !llvm.loop !21

150:                                              ; preds = %142, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %316

151:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store float 0.000000e+00, ptr %14, align 4, !tbaa !23
  br label %152

152:                                              ; preds = %311, %151
  %153 = invoke noundef zeroext i1 @_ZNK3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %154 unwind label %174

154:                                              ; preds = %152
  %155 = xor i1 %153, true
  br i1 %155, label %156, label %313

156:                                              ; preds = %154
  %157 = invoke noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %158 unwind label %174

158:                                              ; preds = %156
  %159 = invoke noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %160 unwind label %174

160:                                              ; preds = %158
  invoke void @_ZN3JPH13BinaryHeapPopIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef %157, ptr noundef %159)
          to label %161 unwind label %174

161:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %162 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %163 unwind label %178

163:                                              ; preds = %161
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %162, i64 8, i1 false), !tbaa.struct !24
  invoke void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %164 unwind label %178

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  %166 = getelementptr inbounds %struct.Open, ptr %16, i32 0, i32 1
  %167 = load float, ptr %166, align 4, !tbaa !20
  %168 = load float, ptr %14, align 4, !tbaa !23
  %169 = fcmp oge float %167, %168
  br i1 %169, label %182, label %170

170:                                              ; preds = %165
  %171 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.10, ptr noundef @.str.11, i32 noundef 147)
          to label %172 unwind label %178

172:                                              ; preds = %170
  br i1 %171, label %173, label %182

173:                                              ; preds = %172
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !25
  br label %182

174:                                              ; preds = %160, %158, %156, %152
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %4, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %5, align 4
  br label %315

178:                                              ; preds = %170, %163, %161
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %4, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %5, align 4
  br label %312

182:                                              ; preds = %173, %172, %165
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  %185 = getelementptr inbounds %struct.Open, ptr %16, i32 0, i32 1
  %186 = load float, ptr %185, align 4, !tbaa !20
  store float %186, ptr %14, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %187 = getelementptr inbounds %struct.Open, ptr %16, i32 0, i32 0
  %188 = load i32, ptr %187, align 4, !tbaa !18
  %189 = zext i32 %188 to i64
  %190 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %189)
          to label %191 unwind label %203

191:                                              ; preds = %184
  store ptr %190, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %192 = load ptr, ptr %18, align 8, !tbaa !5
  %193 = invoke noundef ptr @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %192)
          to label %194 unwind label %207

194:                                              ; preds = %191
  store ptr %193, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %195 = load ptr, ptr %18, align 8, !tbaa !5
  %196 = invoke noundef ptr @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %195)
          to label %197 unwind label %211

197:                                              ; preds = %194
  store ptr %196, ptr %20, align 8, !tbaa !5
  br label %198

198:                                              ; preds = %304, %197
  %199 = load ptr, ptr %19, align 8, !tbaa !5
  %200 = load ptr, ptr %20, align 8, !tbaa !5
  %201 = icmp ne ptr %199, %200
  br i1 %201, label %215, label %202

202:                                              ; preds = %198
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %311

203:                                              ; preds = %184
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %4, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %5, align 4
  br label %310

207:                                              ; preds = %191
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %4, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %5, align 4
  br label %309

211:                                              ; preds = %194
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %4, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %5, align 4
  br label %308

215:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %216 = load ptr, ptr %19, align 8, !tbaa !5
  %217 = load i32, ptr %216, align 4, !tbaa !9
  store i32 %217, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %218 = getelementptr inbounds %struct.Open, ptr %16, i32 0, i32 1
  %219 = load float, ptr %218, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #8
  %220 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 1
  %221 = load i32, ptr %21, align 4, !tbaa !9
  %222 = zext i32 %221 to i64
  %223 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %220, i64 noundef %222)
          to label %224 unwind label %291

224:                                              ; preds = %215
  %225 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Vertex", ptr %223, i32 0, i32 0
  invoke void @_ZN3JPH4Vec3C2ERKNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(12) %225)
          to label %226 unwind label %291

226:                                              ; preds = %224
  %227 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 1
  %228 = getelementptr inbounds %struct.Open, ptr %16, i32 0, i32 0
  %229 = load i32, ptr %228, align 4, !tbaa !18
  %230 = zext i32 %229 to i64
  %231 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %227, i64 noundef %230)
          to label %232 unwind label %291

232:                                              ; preds = %226
  %233 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::Vertex", ptr %231, i32 0, i32 0
  invoke void @_ZN3JPH4Vec3C2ERKNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(12) %233)
          to label %234 unwind label %291

234:                                              ; preds = %232
  %235 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %236 = load double, ptr %235, align 16
  %237 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %238 = load double, ptr %237, align 8
  %239 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %24, double %236, double %238)
          to label %240 unwind label %291

240:                                              ; preds = %234
  %241 = getelementptr inbounds %"class.JPH::Vec3", ptr %23, i32 0, i32 0
  %242 = getelementptr inbounds %union.anon, ptr %241, i32 0, i32 0
  %243 = getelementptr inbounds { double, double }, ptr %242, i32 0, i32 0
  %244 = extractvalue { double, double } %239, 0
  store double %244, ptr %243, align 16
  %245 = getelementptr inbounds { double, double }, ptr %242, i32 0, i32 1
  %246 = extractvalue { double, double } %239, 1
  store double %246, ptr %245, align 8
  %247 = invoke noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %23)
          to label %248 unwind label %291

248:                                              ; preds = %240
  %249 = fadd float %219, %247
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  store float %249, ptr %22, align 4, !tbaa !23
  %250 = load float, ptr %22, align 4, !tbaa !23
  %251 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 11
  %252 = load i32, ptr %21, align 4, !tbaa !9
  %253 = zext i32 %252 to i64
  %254 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %251, i64 noundef %253)
          to label %255 unwind label %295

255:                                              ; preds = %248
  %256 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::ClosestKinematic", ptr %254, i32 0, i32 1
  %257 = load float, ptr %256, align 4, !tbaa !17
  %258 = fcmp olt float %250, %257
  br i1 %258, label %259, label %303

259:                                              ; preds = %255
  %260 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 11
  %261 = getelementptr inbounds %struct.Open, ptr %16, i32 0, i32 0
  %262 = load i32, ptr %261, align 4, !tbaa !18
  %263 = zext i32 %262 to i64
  %264 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %260, i64 noundef %263)
          to label %265 unwind label %295

265:                                              ; preds = %259
  %266 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::ClosestKinematic", ptr %264, i32 0, i32 0
  %267 = load i32, ptr %266, align 4, !tbaa !15
  %268 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 11
  %269 = load i32, ptr %21, align 4, !tbaa !9
  %270 = zext i32 %269 to i64
  %271 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %268, i64 noundef %270)
          to label %272 unwind label %295

272:                                              ; preds = %265
  %273 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::ClosestKinematic", ptr %271, i32 0, i32 0
  store i32 %267, ptr %273, align 4, !tbaa !15
  %274 = load float, ptr %22, align 4, !tbaa !23
  %275 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %28, i32 0, i32 11
  %276 = load i32, ptr %21, align 4, !tbaa !9
  %277 = zext i32 %276 to i64
  %278 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %275, i64 noundef %277)
          to label %279 unwind label %295

279:                                              ; preds = %272
  %280 = getelementptr inbounds %"struct.JPH::SoftBodySharedSettings::ClosestKinematic", ptr %278, i32 0, i32 1
  store float %274, ptr %280, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %281 = getelementptr inbounds %struct.Open, ptr %26, i32 0, i32 0
  %282 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %282, ptr %281, align 4, !tbaa !18
  %283 = getelementptr inbounds %struct.Open, ptr %26, i32 0, i32 1
  %284 = load float, ptr %22, align 4, !tbaa !23
  store float %284, ptr %283, align 4, !tbaa !20
  invoke void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(8) %26)
          to label %285 unwind label %299

285:                                              ; preds = %279
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  %286 = invoke noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %287 unwind label %295

287:                                              ; preds = %285
  %288 = invoke noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %289 unwind label %295

289:                                              ; preds = %287
  invoke void @_ZN3JPH14BinaryHeapPushIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef %286, ptr noundef %288)
          to label %290 unwind label %295

290:                                              ; preds = %289
  br label %303

291:                                              ; preds = %240, %234, %232, %226, %224, %215
  %292 = landingpad { ptr, i32 }
          cleanup
  %293 = extractvalue { ptr, i32 } %292, 0
  store ptr %293, ptr %4, align 8
  %294 = extractvalue { ptr, i32 } %292, 1
  store i32 %294, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  br label %307

295:                                              ; preds = %289, %287, %285, %272, %265, %259, %248
  %296 = landingpad { ptr, i32 }
          cleanup
  %297 = extractvalue { ptr, i32 } %296, 0
  store ptr %297, ptr %4, align 8
  %298 = extractvalue { ptr, i32 } %296, 1
  store i32 %298, ptr %5, align 4
  br label %307

299:                                              ; preds = %279
  %300 = landingpad { ptr, i32 }
          cleanup
  %301 = extractvalue { ptr, i32 } %300, 0
  store ptr %301, ptr %4, align 8
  %302 = extractvalue { ptr, i32 } %300, 1
  store i32 %302, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %307

303:                                              ; preds = %290, %255
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %304

304:                                              ; preds = %303
  %305 = load ptr, ptr %19, align 8, !tbaa !5
  %306 = getelementptr inbounds i32, ptr %305, i32 1
  store ptr %306, ptr %19, align 8, !tbaa !5
  br label %198

307:                                              ; preds = %299, %295, %291
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %308

308:                                              ; preds = %307, %211
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %309

309:                                              ; preds = %308, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %310

310:                                              ; preds = %309, %203
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %312

311:                                              ; preds = %202
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %152, !llvm.loop !26

312:                                              ; preds = %310, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %315

313:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #8
  call void @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  br label %314

314:                                              ; preds = %313, %31
  ret void

315:                                              ; preds = %312, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %316

316:                                              ; preds = %315, %150
  call void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #8
  br label %317

317:                                              ; preds = %316, %96, %52
  call void @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  br label %318

318:                                              ; preds = %317
  %319 = load ptr, ptr %4, align 8
  %320 = load i32, ptr %5, align 4
  %321 = insertvalue { ptr, i32 } poison, ptr %319, 0
  %322 = insertvalue { ptr, i32 } %321, i32 %320, 1
  resume { ptr, i32 } %322
}

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3JPH14BinaryHeapPushIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef, ptr noundef) #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZNK3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3JPH13BinaryHeapPopIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #3

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH4Vec3C2ERKNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #6 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16)) #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { alwaysinline 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 #7 = { 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 #8 = { 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, !14, i64 24}
!12 = !{!"_ZTSN3JPH22SoftBodySharedSettings6VertexE", !13, i64 0, !13, i64 12, !14, i64 24}
!13 = !{!"_ZTSN3JPH6Float3E", !14, i64 0, !14, i64 4, !14, i64 8}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTSN3JPH22SoftBodySharedSettings16ClosestKinematicE", !10, i64 0, !14, i64 4}
!17 = !{!16, !14, i64 4}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTSZN3JPH22SoftBodySharedSettings25CalculateClosestKinematicEvE4Open", !10, i64 0, !14, i64 4}
!20 = !{!19, !14, i64 4}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!14, !14, i64 0}
!24 = !{i64 0, i64 4, !9, i64 4, i64 4, !23}
!25 = !{i64 2157800533}
!26 = distinct !{!26, !22}


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

%"class.JPH::Array.71" = type { i64, i64, ptr }
%"class.JPH::Array.74" = type { i64, i64, ptr }
%struct.Open = type { i32, float }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }

@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [101 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: mustprogress uwtable
define dso_local void @_ZN3JPH22SoftBodySharedSettings25CalculateClosestKinematicEv(ptr noundef nonnull align 8 dereferenceable(304) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.JPH::Array.71", align 8
  %3 = alloca %"class.JPH::Array.74", align 8
  %4 = alloca %struct.Open, align 4
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %struct.Open, align 4
  %9 = getelementptr inbounds i8, ptr %0, i64 232
  %10 = tail call noundef zeroext i1 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  br i1 %10, label %11, label %133

11:                                               ; preds = %1
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = tail call noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  tail call void @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %13)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  call void @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %14 = call noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  invoke void @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %14)
          to label %15 unwind label %21

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 56
  %17 = call noundef ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings4EdgeENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = call noundef ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings4EdgeENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %.not61 = icmp eq ptr %17, %18
  br i1 %.not61, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %33, %15
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %19 = call noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %.not73 = icmp eq i64 %19, 0
  br i1 %.not73, label %.preheader, label %.lr.ph65

.lr.ph65:                                         ; preds = %._crit_edge
  %20 = getelementptr inbounds i8, ptr %4, i64 4
  br label %43

21:                                               ; preds = %11
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %135

.lr.ph:                                           ; preds = %15, %33
  %.04562 = phi ptr [ %34, %33 ], [ %17, %15 ]
  %23 = load i32, ptr %.04562, align 4, !tbaa !5
  %24 = zext i32 %23 to i64
  %25 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %24)
          to label %26 unwind label %35

26:                                               ; preds = %.lr.ph
  %27 = getelementptr inbounds i8, ptr %.04562, i64 4
  invoke void @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %28 unwind label %35

28:                                               ; preds = %26
  %29 = load i32, ptr %27, align 4, !tbaa !5
  %30 = zext i32 %29 to i64
  %31 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %30)
          to label %32 unwind label %35

32:                                               ; preds = %28
  invoke void @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(4) %.04562)
          to label %33 unwind label %35

33:                                               ; preds = %32
  %34 = getelementptr inbounds i8, ptr %.04562, i64 16
  %.not = icmp eq ptr %34, %18
  br i1 %.not, label %._crit_edge, label %.lr.ph

35:                                               ; preds = %32, %28, %26, %.lr.ph
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %135

.preheader:                                       ; preds = %61, %._crit_edge
  %37 = call noundef zeroext i1 @_ZNK3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  br i1 %37, label %._crit_edge72, label %.lr.ph71

.lr.ph71:                                         ; preds = %.preheader
  %38 = getelementptr inbounds i8, ptr %7, i64 8
  %39 = getelementptr inbounds i8, ptr %5, i64 8
  %40 = getelementptr inbounds i8, ptr %8, i64 4
  br label %67

41:                                               ; preds = %56, %52, %50, %43
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %134

43:                                               ; preds = %.lr.ph65, %61
  %44 = phi i64 [ 0, %.lr.ph65 ], [ %63, %61 ]
  %.04763 = phi i32 [ 0, %.lr.ph65 ], [ %62, %61 ]
  %45 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %44)
          to label %46 unwind label %41

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %45, i64 24
  %48 = load float, ptr %47, align 4, !tbaa !9
  %49 = fcmp oeq float %48, 0.000000e+00
  br i1 %49, label %50, label %61

50:                                               ; preds = %46
  %51 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %44)
          to label %52 unwind label %41

52:                                               ; preds = %50
  store i32 %.04763, ptr %51, align 4, !tbaa !13
  %53 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %44)
          to label %54 unwind label %41

54:                                               ; preds = %52
  %55 = getelementptr inbounds i8, ptr %53, i64 4
  store float 0.000000e+00, ptr %55, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i32 %.04763, ptr %4, align 4, !tbaa !16
  store float 0.000000e+00, ptr %20, align 4, !tbaa !18
  invoke void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %56 unwind label %59

56:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %57 = call noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %58 = call noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  invoke void @_ZN3JPH14BinaryHeapPushIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef %57, ptr noundef %58)
          to label %61 unwind label %41

59:                                               ; preds = %54
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %134

61:                                               ; preds = %46, %56
  %62 = add i32 %.04763, 1
  %63 = zext i32 %62 to i64
  %64 = call noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %65 = icmp ugt i64 %64, %63
  br i1 %65, label %43, label %.preheader, !llvm.loop !19

.loopexit:                                        ; preds = %131, %86
  %66 = call noundef zeroext i1 @_ZNK3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  br i1 %66, label %._crit_edge72, label %67, !llvm.loop !21

67:                                               ; preds = %.lr.ph71, %.loopexit
  %.04870 = phi float [ 0.000000e+00, %.lr.ph71 ], [ %.sroa.7.0.copyload, %.loopexit ]
  %68 = call noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %69 = call noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  invoke void @_ZN3JPH13BinaryHeapPopIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef %68, ptr noundef %69)
          to label %70 unwind label %79

70:                                               ; preds = %67
  %71 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %72 unwind label %81

72:                                               ; preds = %70
  %.sroa.0.0.copyload = load i32, ptr %71, align 4, !tbaa !5
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %71, i64 4
  %.sroa.7.0.copyload = load float, ptr %.sroa.7.0..sroa_idx, align 4, !tbaa !22
  invoke void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %73 unwind label %81

73:                                               ; preds = %72
  %74 = fcmp ult float %.sroa.7.0.copyload, %.04870
  br i1 %74, label %75, label %83

75:                                               ; preds = %73
  %76 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.11, i32 noundef 147)
          to label %77 unwind label %81

77:                                               ; preds = %75
  br i1 %76, label %78, label %83

78:                                               ; preds = %77
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !23
  br label %83

79:                                               ; preds = %67
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %134

81:                                               ; preds = %75, %72, %70
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %134

83:                                               ; preds = %78, %77, %73
  %84 = zext i32 %.sroa.0.0.copyload to i64
  %85 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %84)
          to label %86 unwind label %89

86:                                               ; preds = %83
  %87 = call noundef ptr @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %85)
  %88 = call noundef ptr @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %85)
  %.not5166 = icmp eq ptr %87, %88
  br i1 %.not5166, label %.loopexit, label %.lr.ph69

89:                                               ; preds = %83
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %134

.lr.ph69:                                         ; preds = %86, %131
  %.04667 = phi ptr [ %132, %131 ], [ %87, %86 ]
  %91 = load i32, ptr %.04667, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %92 = zext i32 %91 to i64
  %93 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %92)
          to label %94 unwind label %125

94:                                               ; preds = %.lr.ph69
  invoke void @_ZN3JPH4Vec3C2ERKNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(12) %93)
          to label %95 unwind label %125

95:                                               ; preds = %94
  %96 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings6VertexENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %84)
          to label %97 unwind label %125

97:                                               ; preds = %95
  invoke void @_ZN3JPH4Vec3C2ERKNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(12) %96)
          to label %98 unwind label %125

98:                                               ; preds = %97
  %99 = load double, ptr %7, align 16
  %100 = load double, ptr %38, align 8
  %101 = invoke { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %99, double %100)
          to label %102 unwind label %125

102:                                              ; preds = %98
  %103 = extractvalue { double, double } %101, 0
  store double %103, ptr %5, align 16
  %104 = extractvalue { double, double } %101, 1
  store double %104, ptr %39, align 8
  %105 = invoke noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %5)
          to label %106 unwind label %125

106:                                              ; preds = %102
  %107 = fadd float %.sroa.7.0.copyload, %105
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  %108 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %92)
          to label %109 unwind label %127

109:                                              ; preds = %106
  %110 = getelementptr inbounds i8, ptr %108, i64 4
  %111 = load float, ptr %110, align 4, !tbaa !15
  %112 = fcmp olt float %107, %111
  br i1 %112, label %113, label %131

113:                                              ; preds = %109
  %114 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %84)
          to label %115 unwind label %127

115:                                              ; preds = %113
  %116 = load i32, ptr %114, align 4, !tbaa !13
  %117 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %92)
          to label %118 unwind label %127

118:                                              ; preds = %115
  store i32 %116, ptr %117, align 4, !tbaa !13
  %119 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_22SoftBodySharedSettings16ClosestKinematicENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %92)
          to label %120 unwind label %127

120:                                              ; preds = %118
  %121 = getelementptr inbounds i8, ptr %119, i64 4
  store float %107, ptr %121, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store i32 %91, ptr %8, align 4, !tbaa !16
  store float %107, ptr %40, align 4, !tbaa !18
  invoke void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %122 unwind label %129

122:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %123 = call noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %124 = call noundef ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  invoke void @_ZN3JPH14BinaryHeapPushIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef %123, ptr noundef %124)
          to label %131 unwind label %127

125:                                              ; preds = %102, %98, %97, %95, %94, %.lr.ph69
  %126 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %134

127:                                              ; preds = %122, %118, %115, %113, %106
  %128 = landingpad { ptr, i32 }
          cleanup
  br label %134

129:                                              ; preds = %120
  %130 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %134

131:                                              ; preds = %122, %109
  %132 = getelementptr inbounds i8, ptr %.04667, i64 4
  %.not51 = icmp eq ptr %132, %88
  br i1 %.not51, label %.loopexit, label %.lr.ph69

._crit_edge72:                                    ; preds = %.loopexit, %.preheader
  call void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  call void @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  br label %133

133:                                              ; preds = %1, %._crit_edge72
  ret void

134:                                              ; preds = %79, %89, %129, %127, %125, %81, %41, %59
  %.pn56.pn = phi { ptr, i32 } [ %42, %41 ], [ %60, %59 ], [ %80, %79 ], [ %82, %81 ], [ %90, %89 ], [ %128, %127 ], [ %130, %129 ], [ %126, %125 ]
  call void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %135

135:                                              ; preds = %134, %35, %21
  %.pn59 = phi { ptr, i32 } [ %36, %35 ], [ %.pn56.pn, %134 ], [ %22, %21 ]
  call void @_ZN3JPH5ArrayINS0_IjNS_12STLAllocatorIjEEEENS1_IS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn59
}

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3JPH14BinaryHeapPushIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZNK3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN3JPH13BinaryHeapPopIPZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenSt4lessIS2_EEEvT_S6_T0_(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH4Vec3C2ERKNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN3JPH5ArrayIZNS_22SoftBodySharedSettings25CalculateClosestKinematicEvE4OpenNS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #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 = { alwaysinline 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 #6 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 24}
!10 = !{!"_ZTSN3JPH22SoftBodySharedSettings6VertexE", !11, i64 0, !11, i64 12, !12, i64 24}
!11 = !{!"_ZTSN3JPH6Float3E", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN3JPH22SoftBodySharedSettings16ClosestKinematicE", !6, i64 0, !12, i64 4}
!15 = !{!14, !12, i64 4}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSZN3JPH22SoftBodySharedSettings25CalculateClosestKinematicEvE4Open", !6, i64 0, !12, i64 4}
!18 = !{!17, !12, i64 4}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!12, !12, i64 0}
!23 = !{i64 2157800533}


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