; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Constraints (ContactConstraintManager)

; 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"

%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::ContactConstraintManager" = type { [8 x i8], [2 x %"class.JPH::ContactConstraintManager::ManifoldCache"], i32, ptr, ptr, ptr, ptr, ptr, i32, %"struct.std::atomic", ptr }
%"class.JPH::ContactConstraintManager::ManifoldCache" = type <{ %"class.JPH::LFHMAllocator", %"class.JPH::LockFreeHashMap", %"class.JPH::LockFreeHashMap.0", i8, [7 x i8] }>
%"class.JPH::LFHMAllocator" = type { ptr, i32, %"struct.std::atomic" }
%"class.JPH::LockFreeHashMap" = type { ptr, %"struct.std::atomic", ptr, i32, i32 }
%"class.JPH::LockFreeHashMap.0" = type { ptr, %"struct.std::atomic", ptr, i32, i32 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::ContactConstraintManager::ContactConstraint" = type { ptr, ptr, i64, %"class.JPH::Float3", float, float, float, float, float, %"class.JPH::StaticArray" }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::StaticArray" = type { i32, [4 x i8], [4 x %"struct.JPH::StaticArray<JPH::ContactConstraintManager::WorldContactPoint, 4>::Storage"] }
%"struct.JPH::StaticArray<JPH::ContactConstraintManager::WorldContactPoint, 4>::Storage" = type { [200 x i8] }

@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [6 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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH4Body28GetMotionPropertiesUncheckedEv(ptr noundef nonnull align 16 dereferenceable(122)) #2 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolveVelocityConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef %1, ptr noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca %"struct.JPH::AssertLastParam", align 1
  %17 = alloca %"struct.JPH::AssertLastParam", align 1
  %18 = alloca %"struct.JPH::AssertLastParam", align 1
  %19 = alloca %"struct.JPH::AssertLastParam", align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  store i8 0, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %21, ptr %8, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %145, %3
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = icmp ult ptr %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %148

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %28 = getelementptr inbounds %"class.JPH::ContactConstraintManager", ptr %20, i32 0, i32 7
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = load i32, ptr %30, align 4, !tbaa !16
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds %"class.JPH::ContactConstraintManager::ContactConstraint", ptr %29, i64 %32
  store ptr %33, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.JPH::ContactConstraintManager::ContactConstraint", ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !17
  store ptr %36, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %37)
  store i8 %38, ptr %11, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = call noundef ptr @_ZN3JPH4Body28GetMotionPropertiesUncheckedEv(ptr noundef nonnull align 16 dereferenceable(122) %39)
  store ptr %40, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.JPH::ContactConstraintManager::ContactConstraint", ptr %41, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !25
  store ptr %43, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #6
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  %45 = call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %44)
  store i8 %45, ptr %14, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %46 = load ptr, ptr %13, align 8, !tbaa !5
  %47 = call noundef ptr @_ZN3JPH4Body28GetMotionPropertiesUncheckedEv(ptr noundef nonnull align 16 dereferenceable(122) %46)
  store ptr %47, ptr %15, align 8, !tbaa !5
  %48 = load i8, ptr %11, align 1, !tbaa !23
  switch i8 %48, label %137 [
    i8 2, label %49
    i8 1, label %95
    i8 0, label %116
  ]

49:                                               ; preds = %27
  %50 = load i8, ptr %14, align 1, !tbaa !23
  switch i8 %50, label %87 [
    i8 2, label %51
    i8 1, label %63
    i8 0, label %75
  ]

51:                                               ; preds = %49
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  %55 = call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %52, ptr noundef %53, ptr noundef %54)
  %56 = zext i1 %55 to i32
  %57 = load i8, ptr %7, align 1, !tbaa !9, !range !26, !noundef !27
  %58 = trunc i8 %57 to i1
  %59 = zext i1 %58 to i32
  %60 = or i32 %59, %56
  %61 = icmp ne i32 %60, 0
  %62 = zext i1 %61 to i8
  store i8 %62, ptr %7, align 1, !tbaa !9
  br label %94

63:                                               ; preds = %49
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = load ptr, ptr %15, align 8, !tbaa !5
  %67 = call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_1EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %64, ptr noundef %65, ptr noundef %66)
  %68 = zext i1 %67 to i32
  %69 = load i8, ptr %7, align 1, !tbaa !9, !range !26, !noundef !27
  %70 = trunc i8 %69 to i1
  %71 = zext i1 %70 to i32
  %72 = or i32 %71, %68
  %73 = icmp ne i32 %72, 0
  %74 = zext i1 %73 to i8
  store i8 %74, ptr %7, align 1, !tbaa !9
  br label %94

75:                                               ; preds = %49
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_0EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %76, ptr noundef %77, ptr noundef %78)
  %80 = zext i1 %79 to i32
  %81 = load i8, ptr %7, align 1, !tbaa !9, !range !26, !noundef !27
  %82 = trunc i8 %81 to i1
  %83 = zext i1 %82 to i32
  %84 = or i32 %83, %80
  %85 = icmp ne i32 %84, 0
  %86 = zext i1 %85 to i8
  store i8 %86, ptr %7, align 1, !tbaa !9
  br label %94

87:                                               ; preds = %49
  br label %88

88:                                               ; preds = %87
  %89 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 1669)
  br i1 %89, label %90, label %91

90:                                               ; preds = %88
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !28
  br label %91

91:                                               ; preds = %90, %88
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93, %75, %63, %51
  br label %144

95:                                               ; preds = %27
  br label %96

96:                                               ; preds = %95
  %97 = load i8, ptr %14, align 1, !tbaa !23
  %98 = icmp eq i8 %97, 2
  br i1 %98, label %102, label %99

99:                                               ; preds = %96
  %100 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1675)
  br i1 %100, label %101, label %102

101:                                              ; preds = %99
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !29
  br label %102

102:                                              ; preds = %101, %99, %96
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = load ptr, ptr %15, align 8, !tbaa !5
  %108 = call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE1ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %105, ptr noundef %106, ptr noundef %107)
  %109 = zext i1 %108 to i32
  %110 = load i8, ptr %7, align 1, !tbaa !9, !range !26, !noundef !27
  %111 = trunc i8 %110 to i1
  %112 = zext i1 %111 to i32
  %113 = or i32 %112, %109
  %114 = icmp ne i32 %113, 0
  %115 = zext i1 %114 to i8
  store i8 %115, ptr %7, align 1, !tbaa !9
  br label %144

116:                                              ; preds = %27
  br label %117

117:                                              ; preds = %116
  %118 = load i8, ptr %14, align 1, !tbaa !23
  %119 = icmp eq i8 %118, 2
  br i1 %119, label %123, label %120

120:                                              ; preds = %117
  %121 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1680)
  br i1 %121, label %122, label %123

122:                                              ; preds = %120
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !30
  br label %123

123:                                              ; preds = %122, %120, %117
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE0ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %126, ptr noundef %127, ptr noundef %128)
  %130 = zext i1 %129 to i32
  %131 = load i8, ptr %7, align 1, !tbaa !9, !range !26, !noundef !27
  %132 = trunc i8 %131 to i1
  %133 = zext i1 %132 to i32
  %134 = or i32 %133, %130
  %135 = icmp ne i32 %134, 0
  %136 = zext i1 %135 to i8
  store i8 %136, ptr %7, align 1, !tbaa !9
  br label %144

137:                                              ; preds = %27
  br label %138

138:                                              ; preds = %137
  %139 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 1685)
  br i1 %139, label %140, label %141

140:                                              ; preds = %138
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !31
  br label %141

141:                                              ; preds = %140, %138
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  br label %144

144:                                              ; preds = %143, %125, %104, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %145

145:                                              ; preds = %144
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = getelementptr inbounds i32, ptr %146, i32 1
  store ptr %147, ptr %8, align 8, !tbaa !5
  br label %22, !llvm.loop !32

148:                                              ; preds = %26
  %149 = load i8, ptr %7, align 1, !tbaa !9, !range !26, !noundef !27
  %150 = trunc i8 %149 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  ret i1 %150
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_1EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_0EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE1ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE0ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) #5 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 224}
!12 = !{!"_ZTSN3JPH24ContactConstraintManagerE", !7, i64 8, !13, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !13, i64 232, !14, i64 236, !6, i64 240}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt6atomicIjE", !15, i64 0}
!15 = !{!"_ZTSSt13__atomic_baseIjE", !13, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSN3JPH24ContactConstraintManager17ContactConstraintE", !6, i64 0, !6, i64 8, !19, i64 16, !20, i64 24, !21, i64 36, !21, i64 40, !21, i64 44, !21, i64 48, !21, i64 52, !22, i64 56}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSN3JPH6Float3E", !21, i64 0, !21, i64 4, !21, i64 8}
!21 = !{!"float", !7, i64 0}
!22 = !{!"_ZTSN3JPH11StaticArrayINS_24ContactConstraintManager17WorldContactPointELj4EEE", !13, i64 0, !7, i64 8}
!23 = !{!24, !24, i64 0}
!24 = !{!"_ZTSN3JPH11EMotionTypeE", !7, i64 0}
!25 = !{!18, !6, i64 8}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{i64 2159376913}
!29 = !{i64 2159377300}
!30 = !{i64 2159377687}
!31 = !{i64 2159378012}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


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

%"class.JPH::ContactConstraintManager::ContactConstraint" = type { ptr, ptr, i64, %"class.JPH::Float3", float, float, float, float, float, %"class.JPH::StaticArray" }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::StaticArray" = type { i32, [4 x i8], [4 x %"struct.JPH::StaticArray<JPH::ContactConstraintManager::WorldContactPoint, 4>::Storage"] }
%"struct.JPH::StaticArray<JPH::ContactConstraintManager::WorldContactPoint, 4>::Storage" = type { [200 x i8] }

@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH4Body28GetMotionPropertiesUncheckedEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #1 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 #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolveVelocityConstraintsEPKjS2_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(248) %0, ptr noundef readonly %1, ptr noundef readnone %2) local_unnamed_addr #3 align 2 {
  %4 = icmp ult ptr %1, %2
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %5 = getelementptr inbounds i8, ptr %0, i64 224
  br label %6

._crit_edge:                                      ; preds = %50, %3
  %.0.lcssa = phi i1 [ false, %3 ], [ %.1, %50 ]
  ret i1 %.0.lcssa

6:                                                ; preds = %.lr.ph, %50
  %.038 = phi i1 [ false, %.lr.ph ], [ %.1, %50 ]
  %.03637 = phi ptr [ %1, %.lr.ph ], [ %51, %50 ]
  %7 = load ptr, ptr %5, align 8, !tbaa !5
  %8 = load i32, ptr %.03637, align 4, !tbaa !13
  %9 = zext i32 %8 to i64
  %10 = getelementptr inbounds %"class.JPH::ContactConstraintManager::ContactConstraint", ptr %7, i64 %9
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %12 = tail call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %11)
  %13 = tail call noundef ptr @_ZN3JPH4Body28GetMotionPropertiesUncheckedEv(ptr noundef nonnull align 16 dereferenceable(122) %11)
  %14 = getelementptr inbounds i8, ptr %10, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !20
  %16 = tail call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %15)
  %17 = tail call noundef ptr @_ZN3JPH4Body28GetMotionPropertiesUncheckedEv(ptr noundef nonnull align 16 dereferenceable(122) %15)
  switch i8 %12, label %47 [
    i8 2, label %18
    i8 1, label %31
    i8 0, label %39
  ]

18:                                               ; preds = %6
  switch i8 %16, label %28 [
    i8 2, label %19
    i8 1, label %22
    i8 0, label %25
  ]

19:                                               ; preds = %18
  %20 = tail call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %10, ptr noundef %13, ptr noundef %17)
  %21 = or i1 %.038, %20
  br label %50

22:                                               ; preds = %18
  %23 = tail call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_1EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %10, ptr noundef %13, ptr noundef %17)
  %24 = or i1 %.038, %23
  br label %50

25:                                               ; preds = %18
  %26 = tail call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_0EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %10, ptr noundef %13, ptr noundef %17)
  %27 = or i1 %.038, %26
  br label %50

28:                                               ; preds = %18
  %29 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 1669)
  br i1 %29, label %30, label %50

30:                                               ; preds = %28
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !21
  br label %50

31:                                               ; preds = %6
  %32 = icmp eq i8 %16, 2
  br i1 %32, label %36, label %33

33:                                               ; preds = %31
  %34 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1675)
  br i1 %34, label %35, label %36

35:                                               ; preds = %33
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !22
  br label %36

36:                                               ; preds = %35, %33, %31
  %37 = tail call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE1ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %10, ptr noundef %13, ptr noundef %17)
  %38 = or i1 %.038, %37
  br label %50

39:                                               ; preds = %6
  %40 = icmp eq i8 %16, 2
  br i1 %40, label %44, label %41

41:                                               ; preds = %39
  %42 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1680)
  br i1 %42, label %43, label %44

43:                                               ; preds = %41
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !23
  br label %44

44:                                               ; preds = %43, %41, %39
  %45 = tail call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE0ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864) %10, ptr noundef %13, ptr noundef %17)
  %46 = or i1 %.038, %45
  br label %50

47:                                               ; preds = %6
  %48 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 1685)
  br i1 %48, label %49, label %50

49:                                               ; preds = %47
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !24
  br label %50

50:                                               ; preds = %47, %49, %19, %22, %25, %30, %28, %44, %36
  %.1 = phi i1 [ %.038, %49 ], [ %.038, %47 ], [ %46, %44 ], [ %38, %36 ], [ %.038, %30 ], [ %.038, %28 ], [ %27, %25 ], [ %24, %22 ], [ %21, %19 ]
  %51 = getelementptr inbounds i8, ptr %.03637, i64 4
  %52 = icmp ult ptr %51, %2
  br i1 %52, label %6, label %._crit_edge, !llvm.loop !25
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_1EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE2ELS2_0EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE1ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24sSolveVelocityConstraintILNS_11EMotionTypeE0ELS2_2EEEbRNS0_17ContactConstraintEPNS_16MotionPropertiesES6_(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 224}
!6 = !{!"_ZTSN3JPH24ContactConstraintManagerE", !7, i64 8, !9, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !9, i64 232, !11, i64 236, !10, i64 240}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"_ZTSSt6atomicIjE", !12, i64 0}
!12 = !{!"_ZTSSt13__atomic_baseIjE", !9, i64 0}
!13 = !{!9, !9, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"_ZTSN3JPH24ContactConstraintManager17ContactConstraintE", !10, i64 0, !10, i64 8, !16, i64 16, !17, i64 24, !18, i64 36, !18, i64 40, !18, i64 44, !18, i64 48, !18, i64 52, !19, i64 56}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN3JPH6Float3E", !18, i64 0, !18, i64 4, !18, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSN3JPH11StaticArrayINS_24ContactConstraintManager17WorldContactPointELj4EEE", !9, i64 0, !7, i64 8}
!20 = !{!15, !10, i64 8}
!21 = !{i64 2159376913}
!22 = !{i64 2159377300}
!23 = !{i64 2159377687}
!24 = !{i64 2159378012}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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