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

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

%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::BodyLockRead" = type { %"class.JPH::BodyLockBase" }
%"class.JPH::BodyLockBase" = type { ptr, ptr, ptr }
%"class.JPH::CharacterVirtual::ContactCollector" = type <{ %"class.JPH::CollisionCollector", [8 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", ptr, ptr, ptr, ptr, i32, float, i8, [7 x i8] }>
%"class.JPH::CollisionCollector" = type { ptr, float, ptr }
%"struct.JPH::CharacterVirtual::Contact" = type <{ %"class.JPH::CharacterVirtual::ContactKey", [4 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, float, i8, i8, [6 x i8], ptr, i64, ptr, i8, i8, i8, [5 x i8] }>
%"class.JPH::CharacterVirtual::ContactKey" = type { %"class.JPH::BodyID", %"class.JPH::CharacterID", %"class.JPH::SubShapeID" }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::CharacterID" = type { i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::CollideShapeResult" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, %"class.JPH::SubShapeID", %"class.JPH::SubShapeID", %"class.JPH::BodyID", %"class.JPH::StaticArray", %"class.JPH::StaticArray" }
%"class.JPH::StaticArray" = type { i32, [12 x i8], [32 x %"struct.JPH::StaticArray<JPH::Vec3, 32>::Storage"] }
%"struct.JPH::StaticArray<JPH::Vec3, 32>::Storage" = type { [16 x i8] }

@.str.1 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 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: 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) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH16CharacterVirtual16ContactCollector6AddHitERKNS_18CollideShapeResultE(ptr noundef nonnull align 16 dereferenceable(105) %0, ptr noundef nonnull align 16 dereferenceable(1120) %1) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca i8, align 1
  %12 = alloca %"struct.JPH::AssertLastParam", align 1
  %13 = alloca ptr, align 8
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::BodyLockRead", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8
  %22 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  %25 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 8
  %26 = load i32, ptr %25, align 16, !tbaa !16
  %27 = zext i32 %26 to i64
  %28 = icmp eq i64 %24, %27
  br i1 %28, label %29, label %143

29:                                               ; preds = %2
  %30 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 10
  store i8 1, ptr %30, align 8, !tbaa !17
  %31 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 9
  %32 = load float, ptr %31, align 4, !tbaa !18
  %33 = fcmp ogt float %32, -1.000000e+00
  br i1 %33, label %34, label %133

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %35 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %36)
  %38 = trunc i64 %37 to i32
  %39 = sub nsw i32 %38, 1
  store i32 %39, ptr %5, align 4, !tbaa !19
  br label %40

40:                                               ; preds = %129, %34
  %41 = load i32, ptr %5, align 4, !tbaa !19
  %42 = icmp sge i32 %41, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %132

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %45 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = load i32, ptr %5, align 4, !tbaa !19
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %46, i64 noundef %48)
  store ptr %49, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %50 = load i32, ptr %5, align 4, !tbaa !19
  %51 = sub nsw i32 %50, 1
  store i32 %51, ptr %8, align 4, !tbaa !19
  br label %52

52:                                               ; preds = %124, %44
  %53 = load i32, ptr %8, align 4, !tbaa !19
  %54 = icmp sge i32 %53, 0
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 5, ptr %6, align 4
  br label %127

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %57 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = load i32, ptr %8, align 4, !tbaa !19
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %58, i64 noundef %60)
  store ptr %61, ptr %9, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = call noundef zeroext i1 @_ZNK3JPH16CharacterVirtual10ContactKey10IsSameBodyERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %62, ptr noundef nonnull align 4 dereferenceable(12) %63)
  br i1 %64, label %65, label %120

65:                                               ; preds = %56
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %66, i32 0, i32 4
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %68, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %69, i64 16, i1 false), !tbaa.struct !20
  %70 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %71 = load double, ptr %70, align 16
  %72 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %73 = load double, ptr %72, align 8
  %74 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %67, double %71, double %73)
  %75 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 9
  %76 = load float, ptr %75, align 4, !tbaa !18
  %77 = fcmp ogt float %74, %76
  br i1 %77, label %78, label %120

78:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  %79 = load i32, ptr %5, align 4, !tbaa !19
  %80 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  %82 = call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %81)
  %83 = trunc i64 %82 to i32
  %84 = sub nsw i32 %83, 1
  %85 = icmp eq i32 %79, %84
  %86 = zext i1 %85 to i8
  store i8 %86, ptr %11, align 1, !tbaa !22
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %87, i32 0, i32 6
  %89 = load float, ptr %88, align 16, !tbaa !23
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %90, i32 0, i32 6
  %92 = load float, ptr %91, align 16, !tbaa !23
  %93 = fcmp ogt float %89, %92
  br i1 %93, label %94, label %105

94:                                               ; preds = %78
  %95 = load i8, ptr %11, align 1, !tbaa !22, !range !31, !noundef !32
  %96 = trunc i8 %95 to i1
  br i1 %96, label %102, label %97

97:                                               ; preds = %94
  %98 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %99)
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %101, ptr align 16 %100, i64 123, i1 false)
  br label %102

102:                                              ; preds = %97, %94
  %103 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(32) %104)
  store i32 5, ptr %6, align 4
  br label %117

105:                                              ; preds = %78
  %106 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %107)
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %109, ptr align 16 %108, i64 123, i1 false)
  %110 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(32) %111)
  %112 = load i8, ptr %11, align 1, !tbaa !22, !range !31, !noundef !32
  %113 = trunc i8 %112 to i1
  br i1 %113, label %114, label %115

114:                                              ; preds = %105
  store i32 5, ptr %6, align 4
  br label %117

115:                                              ; preds = %105
  br label %116

116:                                              ; preds = %115
  store i32 0, ptr %6, align 4
  br label %117

117:                                              ; preds = %116, %114, %102
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  %118 = load i32, ptr %6, align 4
  switch i32 %118, label %121 [
    i32 0, label %119
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119, %65, %56
  store i32 0, ptr %6, align 4
  br label %121

121:                                              ; preds = %120, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %122 = load i32, ptr %6, align 4
  switch i32 %122, label %127 [
    i32 0, label %123
  ]

123:                                              ; preds = %121
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %8, align 4, !tbaa !19
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %8, align 4, !tbaa !19
  br label %52, !llvm.loop !33

127:                                              ; preds = %121, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %128

128:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %5, align 4, !tbaa !19
  %131 = add nsw i32 %130, -1
  store i32 %131, ptr %5, align 4, !tbaa !19
  br label %40, !llvm.loop !35

132:                                              ; preds = %43
  br label %133

133:                                              ; preds = %132, %29
  %134 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %135 = load ptr, ptr %134, align 8, !tbaa !9
  %136 = call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %135)
  %137 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 8
  %138 = load i32, ptr %137, align 16, !tbaa !16
  %139 = zext i32 %138 to i64
  %140 = icmp eq i64 %136, %139
  br i1 %140, label %141, label %142

141:                                              ; preds = %133
  call void @_ZN3JPH18CollisionCollectorINS_18CollideShapeResultENS_36CollisionCollectorTraitsCollideShapeEE13ForceEarlyOutEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  br label %220

142:                                              ; preds = %133
  br label %143

143:                                              ; preds = %142, %2
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %"class.JPH::CollideShapeResult", ptr %144, i32 0, i32 6
  %146 = call noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4) %145)
  br i1 %146, label %147, label %174

147:                                              ; preds = %143
  br label %148

148:                                              ; preds = %147
  %149 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 6
  %150 = load ptr, ptr %149, align 16, !tbaa !36
  %151 = icmp ne ptr %150, null
  br i1 %151, label %155, label %152

152:                                              ; preds = %148
  %153 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 306)
  br i1 %153, label %154, label %155

154:                                              ; preds = %152
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !37
  br label %155

155:                                              ; preds = %154, %152, %148
  br label %156

156:                                              ; preds = %155
  %157 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  %159 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %158)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %160 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %161 = load ptr, ptr %160, align 8, !tbaa !9
  %162 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %161)
  store ptr %162, ptr %13, align 8, !tbaa !5
  %163 = load ptr, ptr %13, align 8, !tbaa !5
  %164 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 6
  %165 = load ptr, ptr %164, align 16, !tbaa !36
  %166 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %166, i64 16, i1 false), !tbaa.struct !20
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %169 = load double, ptr %168, align 16
  %170 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %171 = load double, ptr %170, align 8
  call void @_ZN3JPH16CharacterVirtual31sFillCharacterContactPropertiesERNS0_7ContactEPKS0_NS_4Vec3ERKNS_18CollideShapeResultE(ptr noundef nonnull align 16 dereferenceable(123) %163, ptr noundef %165, double %169, double %171, ptr noundef nonnull align 16 dereferenceable(1120) %167)
  %172 = load ptr, ptr %13, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %172, i32 0, i32 7
  store float 0.000000e+00, ptr %173, align 4, !tbaa !38
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %220

174:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #7
  %175 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 4
  %176 = load ptr, ptr %175, align 16, !tbaa !39
  %177 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3JPH13PhysicsSystem20GetBodyLockInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %176)
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %"class.JPH::CollideShapeResult", ptr %178, i32 0, i32 6
  call void @_ZN3JPH12BodyLockReadCI2NS_12BodyLockBaseILb0EKNS_4BodyEEEERKNS_17BodyLockInterfaceERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(16) %177, ptr noundef nonnull align 4 dereferenceable(4) %179)
  %180 = invoke noundef zeroext i1 @_ZNK3JPH12BodyLockBaseILb0EKNS_4BodyEE26SucceededAndIsInBroadPhaseEv(ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %181 unwind label %210

181:                                              ; preds = %174
  br i1 %180, label %182, label %218

182:                                              ; preds = %181
  %183 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %184 = load ptr, ptr %183, align 8, !tbaa !9
  %185 = invoke noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %184)
          to label %186 unwind label %210

186:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %187 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 7
  %188 = load ptr, ptr %187, align 8, !tbaa !9
  %189 = invoke noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %188)
          to label %190 unwind label %214

190:                                              ; preds = %186
  store ptr %189, ptr %18, align 8, !tbaa !5
  %191 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 5
  %192 = load ptr, ptr %191, align 8, !tbaa !40
  %193 = load ptr, ptr %18, align 8, !tbaa !5
  %194 = invoke noundef nonnull align 16 dereferenceable(122) ptr @_ZNK3JPH12BodyLockBaseILb0EKNS_4BodyEE7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %195 unwind label %214

195:                                              ; preds = %190
  %196 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %196, i64 16, i1 false), !tbaa.struct !20
  %197 = getelementptr inbounds %"class.JPH::CharacterVirtual::ContactCollector", ptr %21, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %197, i64 16, i1 false), !tbaa.struct !20
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %200 = load double, ptr %199, align 16
  %201 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %202 = load double, ptr %201, align 8
  %203 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %204 = load double, ptr %203, align 16
  %205 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %206 = load double, ptr %205, align 8
  invoke void @_ZN3JPH16CharacterVirtual22sFillContactPropertiesINS0_16ContactCollectorEEEvPKS0_RNS0_7ContactERKNS_4BodyENS_4Vec3ESA_RKT_RKNS_18CollideShapeResultE(ptr noundef %192, ptr noundef nonnull align 16 dereferenceable(123) %193, ptr noundef nonnull align 16 dereferenceable(122) %194, double %200, double %202, double %204, double %206, ptr noundef nonnull align 16 dereferenceable(105) %21, ptr noundef nonnull align 16 dereferenceable(1120) %198)
          to label %207 unwind label %214

207:                                              ; preds = %195
  %208 = load ptr, ptr %18, align 8, !tbaa !5
  %209 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %208, i32 0, i32 7
  store float 0.000000e+00, ptr %209, align 4, !tbaa !38
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %218

210:                                              ; preds = %182, %174
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %16, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %17, align 4
  br label %219

214:                                              ; preds = %195, %190, %186
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %16, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %219

218:                                              ; preds = %207, %181
  call void @_ZN3JPH12BodyLockBaseILb0EKNS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #7
  br label %220

219:                                              ; preds = %214, %210
  call void @_ZN3JPH12BodyLockBaseILb0EKNS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #7
  br label %221

220:                                              ; preds = %218, %156, %141
  ret void

221:                                              ; preds = %219
  %222 = load ptr, ptr %16, align 8
  %223 = load i32, ptr %17, align 4
  %224 = insertvalue { ptr, i32 } poison, ptr %222, 0
  %225 = insertvalue { ptr, i32 } %224, i32 %223, 1
  resume { ptr, i32 } %225
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH16CharacterVirtual10ContactKey10IsSameBodyERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual31sFillCharacterContactPropertiesERNS0_7ContactEPKS0_NS_4Vec3ERKNS_18CollideShapeResultE(ptr noundef nonnull align 16 dereferenceable(123), ptr noundef, double, double, ptr noundef nonnull align 16 dereferenceable(1120)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3JPH13PhysicsSystem20GetBodyLockInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual22sFillContactPropertiesINS0_16ContactCollectorEEEvPKS0_RNS0_7ContactERKNS_4BodyENS_4Vec3ESA_RKT_RKNS_18CollideShapeResultE(ptr noundef, ptr noundef nonnull align 16 dereferenceable(123), ptr noundef nonnull align 16 dereferenceable(122), double, double, double, double, ptr noundef nonnull align 16 dereferenceable(105), ptr noundef nonnull align 16 dereferenceable(1120)) #2 align 2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 88}
!10 = !{!"_ZTSN3JPH16CharacterVirtual16ContactCollectorE", !11, i64 0, !13, i64 32, !13, i64 48, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !14, i64 96, !12, i64 100, !15, i64 104}
!11 = !{!"_ZTSN3JPH18CollisionCollectorINS_18CollideShapeResultENS_36CollisionCollectorTraitsCollideShapeEEE", !12, i64 8, !6, i64 16}
!12 = !{!"float", !7, i64 0}
!13 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!10, !14, i64 96}
!17 = !{!10, !15, i64 104}
!18 = !{!10, !12, i64 100}
!19 = !{!14, !14, i64 0}
!20 = !{i64 0, i64 16, !21}
!21 = !{!7, !7, i64 0}
!22 = !{!15, !15, i64 0}
!23 = !{!24, !12, i64 80}
!24 = !{!"_ZTSN3JPH16CharacterVirtual7ContactE", !25, i64 0, !13, i64 16, !13, i64 32, !13, i64 48, !13, i64 64, !12, i64 80, !12, i64 84, !29, i64 88, !15, i64 89, !6, i64 96, !30, i64 104, !6, i64 112, !15, i64 120, !15, i64 121, !15, i64 122}
!25 = !{!"_ZTSN3JPH16CharacterVirtual10ContactKeyE", !26, i64 0, !27, i64 4, !28, i64 8}
!26 = !{!"_ZTSN3JPH6BodyIDE", !14, i64 0}
!27 = !{!"_ZTSN3JPH11CharacterIDE", !14, i64 0}
!28 = !{!"_ZTSN3JPH10SubShapeIDE", !14, i64 0}
!29 = !{!"_ZTSN3JPH11EMotionTypeE", !7, i64 0}
!30 = !{!"long", !7, i64 0}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}
!36 = !{!10, !6, i64 80}
!37 = !{i64 2159828460}
!38 = !{!24, !12, i64 84}
!39 = !{!10, !6, i64 64}
!40 = !{!10, !6, i64 72}


; 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::BodyLockRead" = type { %"class.JPH::BodyLockBase" }
%"class.JPH::BodyLockBase" = type { ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 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 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) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH16CharacterVirtual16ContactCollector6AddHitERKNS_18CollideShapeResultE(ptr noundef nonnull align 16 dereferenceable(105) %0, ptr noundef nonnull align 16 dereferenceable(1120) %1) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.JPH::BodyLockRead", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  %8 = load i32, ptr %7, align 16, !tbaa !15
  %9 = zext i32 %8 to i64
  %10 = icmp eq i64 %6, %9
  br i1 %10, label %11, label %63

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 104
  store i8 1, ptr %12, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 100
  %14 = load float, ptr %13, align 4, !tbaa !17
  %15 = fcmp ogt float %14, -1.000000e+00
  br i1 %15, label %16, label %.loopexit52

16:                                               ; preds = %11
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %17)
  %19 = trunc i64 %18 to i32
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph58.preheader, label %.loopexit52

.lr.ph58.preheader:                               ; preds = %16
  %21 = and i64 %18, 2147483647
  br label %.lr.ph58

.lr.ph58:                                         ; preds = %.lr.ph58.preheader, %.loopexit
  %indvars.iv = phi i64 [ %21, %.lr.ph58.preheader ], [ %indvars.iv.next, %.loopexit ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %22, i64 noundef %indvars.iv.next)
  %24 = icmp ugt i64 %indvars.iv, 1
  br i1 %24, label %.lr.ph, label %.loopexit52

.lr.ph:                                           ; preds = %.lr.ph58
  %25 = getelementptr inbounds i8, ptr %23, i64 48
  %26 = getelementptr inbounds i8, ptr %23, i64 80
  %27 = trunc i64 %indvars.iv to i32
  %28 = add i32 %27, -2
  br label %29

29:                                               ; preds = %.backedge, %.lr.ph
  %.03853 = phi i32 [ %28, %.lr.ph ], [ %.03853.be, %.backedge ]
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = zext nneg i32 %.03853 to i64
  %32 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %30, i64 noundef %31)
  %33 = tail call noundef zeroext i1 @_ZNK3JPH16CharacterVirtual10ContactKey10IsSameBodyERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %32)
  br i1 %33, label %34, label %.thread45

34:                                               ; preds = %29
  %35 = getelementptr inbounds i8, ptr %32, i64 48
  %.sroa.012.0.copyload = load double, ptr %35, align 16
  %.sroa.213.0..sroa_idx = getelementptr inbounds i8, ptr %32, i64 56
  %.sroa.213.0.copyload = load double, ptr %.sroa.213.0..sroa_idx, align 8, !tbaa !18
  %36 = tail call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %25, double %.sroa.012.0.copyload, double %.sroa.213.0.copyload)
  %37 = load float, ptr %13, align 4, !tbaa !17
  %38 = fcmp ogt float %36, %37
  br i1 %38, label %39, label %.thread45

39:                                               ; preds = %34
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %40)
  %42 = and i64 %41, 4294967295
  %.not51 = icmp ne i64 %indvars.iv, %42
  %43 = load float, ptr %26, align 16, !tbaa !19
  %44 = getelementptr inbounds i8, ptr %32, i64 80
  %45 = load float, ptr %44, align 16, !tbaa !19
  %46 = fcmp ogt float %43, %45
  br i1 %46, label %47, label %52

47:                                               ; preds = %39
  br i1 %.not51, label %48, label %.thread48

48:                                               ; preds = %47
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %49)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(123) %23, ptr noundef nonnull align 16 dereferenceable(123) %50, i64 123, i1 false)
  br label %.thread48

.thread48:                                        ; preds = %48, %47
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  tail call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(32) %51)
  br label %.loopexit

52:                                               ; preds = %39
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %53)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(123) %32, ptr noundef nonnull align 16 dereferenceable(123) %54, i64 123, i1 false)
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  tail call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(32) %55)
  %56 = icmp sgt i32 %.03853, 0
  %or.cond = and i1 %.not51, %56
  br i1 %or.cond, label %.backedge, label %.loopexit

.thread45:                                        ; preds = %34, %29
  %.old59 = icmp sgt i32 %.03853, 0
  br i1 %.old59, label %.backedge, label %.loopexit

.backedge:                                        ; preds = %.thread45, %52
  %.03853.be = add nsw i32 %.03853, -1
  br label %29, !llvm.loop !27

.loopexit:                                        ; preds = %.thread45, %52, %.thread48
  br i1 %24, label %.lr.ph58, label %.loopexit52, !llvm.loop !29

.loopexit52:                                      ; preds = %.lr.ph58, %.loopexit, %16, %11
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %57)
  %59 = load i32, ptr %7, align 16, !tbaa !15
  %60 = zext i32 %59 to i64
  %61 = icmp eq i64 %58, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %.loopexit52
  tail call void @_ZN3JPH18CollisionCollectorINS_18CollideShapeResultENS_36CollisionCollectorTraitsCollideShapeEE13ForceEarlyOutEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  br label %107

63:                                               ; preds = %.loopexit52, %2
  %64 = getelementptr inbounds i8, ptr %1, i64 60
  %65 = tail call noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4) %64)
  br i1 %65, label %66, label %80

66:                                               ; preds = %63
  %67 = getelementptr inbounds i8, ptr %0, i64 80
  %68 = load ptr, ptr %67, align 16, !tbaa !30
  %.not = icmp eq ptr %68, null
  br i1 %.not, label %69, label %72

69:                                               ; preds = %66
  %70 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 306)
  br i1 %70, label %71, label %72

71:                                               ; preds = %69
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !31
  br label %72

72:                                               ; preds = %66, %69, %71
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %73)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %75)
  %77 = load ptr, ptr %67, align 16, !tbaa !30
  %78 = getelementptr inbounds i8, ptr %0, i64 32
  %.sroa.06.0.copyload = load double, ptr %78, align 16
  %.sroa.27.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 40
  %.sroa.27.0.copyload = load double, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !18
  tail call void @_ZN3JPH16CharacterVirtual31sFillCharacterContactPropertiesERNS0_7ContactEPKS0_NS_4Vec3ERKNS_18CollideShapeResultE(ptr noundef nonnull align 16 dereferenceable(123) %76, ptr noundef %77, double %.sroa.06.0.copyload, double %.sroa.27.0.copyload, ptr noundef nonnull align 16 dereferenceable(1120) %1)
  %79 = getelementptr inbounds i8, ptr %76, i64 84
  store float 0.000000e+00, ptr %79, align 4, !tbaa !32
  br label %107

80:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %81 = getelementptr inbounds i8, ptr %0, i64 64
  %82 = load ptr, ptr %81, align 16, !tbaa !33
  %83 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3JPH13PhysicsSystem20GetBodyLockInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %82)
  call void @_ZN3JPH12BodyLockReadCI2NS_12BodyLockBaseILb0EKNS_4BodyEEEERKNS_17BodyLockInterfaceERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(16) %83, ptr noundef nonnull align 4 dereferenceable(4) %64)
  %84 = invoke noundef zeroext i1 @_ZNK3JPH12BodyLockBaseILb0EKNS_4BodyEE26SucceededAndIsInBroadPhaseEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %85 unwind label %101

85:                                               ; preds = %80
  br i1 %84, label %86, label %105

86:                                               ; preds = %85
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = invoke noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %87)
          to label %89 unwind label %101

89:                                               ; preds = %86
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = invoke noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %90)
          to label %92 unwind label %103

92:                                               ; preds = %89
  %93 = getelementptr inbounds i8, ptr %0, i64 72
  %94 = load ptr, ptr %93, align 8, !tbaa !34
  %95 = invoke noundef nonnull align 16 dereferenceable(122) ptr @_ZNK3JPH12BodyLockBaseILb0EKNS_4BodyEE7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %96 unwind label %103

96:                                               ; preds = %92
  %97 = getelementptr inbounds i8, ptr %0, i64 48
  %.sroa.02.0.copyload = load double, ptr %97, align 16
  %.sroa.23.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 56
  %.sroa.23.0.copyload = load double, ptr %.sroa.23.0..sroa_idx, align 8, !tbaa !18
  %98 = getelementptr inbounds i8, ptr %0, i64 32
  %.sroa.0.0.copyload = load double, ptr %98, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 40
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !18
  invoke void @_ZN3JPH16CharacterVirtual22sFillContactPropertiesINS0_16ContactCollectorEEEvPKS0_RNS0_7ContactERKNS_4BodyENS_4Vec3ESA_RKT_RKNS_18CollideShapeResultE(ptr noundef %94, ptr noundef nonnull align 16 dereferenceable(123) %91, ptr noundef nonnull align 16 dereferenceable(122) %95, double %.sroa.02.0.copyload, double %.sroa.23.0.copyload, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, ptr noundef nonnull align 16 dereferenceable(105) %0, ptr noundef nonnull align 16 dereferenceable(1120) %1)
          to label %99 unwind label %103

99:                                               ; preds = %96
  %100 = getelementptr inbounds i8, ptr %91, i64 84
  store float 0.000000e+00, ptr %100, align 4, !tbaa !32
  br label %105

101:                                              ; preds = %86, %80
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %106

103:                                              ; preds = %96, %92, %89
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %106

105:                                              ; preds = %99, %85
  call void @_ZN3JPH12BodyLockBaseILb0EKNS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %107

106:                                              ; preds = %103, %101
  %.pn = phi { ptr, i32 } [ %104, %103 ], [ %102, %101 ]
  call void @_ZN3JPH12BodyLockBaseILb0EKNS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn

107:                                              ; preds = %105, %72, %62
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH16CharacterVirtual10ContactKey10IsSameBodyERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual31sFillCharacterContactPropertiesERNS0_7ContactEPKS0_NS_4Vec3ERKNS_18CollideShapeResultE(ptr noundef nonnull align 16 dereferenceable(123), ptr noundef, double, double, ptr noundef nonnull align 16 dereferenceable(1120)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3JPH13PhysicsSystem20GetBodyLockInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual22sFillContactPropertiesINS0_16ContactCollectorEEEvPKS0_RNS0_7ContactERKNS_4BodyENS_4Vec3ESA_RKT_RKNS_18CollideShapeResultE(ptr noundef, ptr noundef nonnull align 16 dereferenceable(123), ptr noundef nonnull align 16 dereferenceable(122), double, double, double, double, ptr noundef nonnull align 16 dereferenceable(105), ptr noundef nonnull align 16 dereferenceable(1120)) local_unnamed_addr #2 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #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, !11, i64 88}
!6 = !{!"_ZTSN3JPH16CharacterVirtual16ContactCollectorE", !7, i64 0, !12, i64 32, !12, i64 48, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !13, i64 96, !8, i64 100, !14, i64 104}
!7 = !{!"_ZTSN3JPH18CollisionCollectorINS_18CollideShapeResultENS_36CollisionCollectorTraitsCollideShapeEEE", !8, i64 8, !11, i64 16}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_ZTSN3JPH4Vec3E", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"bool", !9, i64 0}
!15 = !{!6, !13, i64 96}
!16 = !{!6, !14, i64 104}
!17 = !{!6, !8, i64 100}
!18 = !{!9, !9, i64 0}
!19 = !{!20, !8, i64 80}
!20 = !{!"_ZTSN3JPH16CharacterVirtual7ContactE", !21, i64 0, !12, i64 16, !12, i64 32, !12, i64 48, !12, i64 64, !8, i64 80, !8, i64 84, !25, i64 88, !14, i64 89, !11, i64 96, !26, i64 104, !11, i64 112, !14, i64 120, !14, i64 121, !14, i64 122}
!21 = !{!"_ZTSN3JPH16CharacterVirtual10ContactKeyE", !22, i64 0, !23, i64 4, !24, i64 8}
!22 = !{!"_ZTSN3JPH6BodyIDE", !13, i64 0}
!23 = !{!"_ZTSN3JPH11CharacterIDE", !13, i64 0}
!24 = !{!"_ZTSN3JPH10SubShapeIDE", !13, i64 0}
!25 = !{!"_ZTSN3JPH11EMotionTypeE", !9, i64 0}
!26 = !{!"long", !9, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = !{!6, !11, i64 80}
!31 = !{i64 2159828460}
!32 = !{!20, !8, i64 84}
!33 = !{!6, !11, i64 64}
!34 = !{!6, !11, i64 72}


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