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

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

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

; Function Attrs: 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 nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 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) #3 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)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH16CharacterVirtual25RemoveConflictingContactsERNS_5ArrayINS0_7ContactENS_16STLTempAllocatorIS2_EEEERNS1_INS0_10ContactKeyENS3_IS7_EEEE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #5 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.JPH::Vec3", align 16
  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
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %15 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %14, i32 0, i32 12
  %16 = load float, ptr %15, align 16, !tbaa !9
  %17 = fmul float 1.250000e+00, %16
  store float %17, ptr %7, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !34
  br label %18

18:                                               ; preds = %111, %3
  %19 = load i64, ptr %8, align 8, !tbaa !34
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %20)
  %22 = icmp ult i64 %19, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %18
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %114

24:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = load i64, ptr %8, align 8, !tbaa !34
  %27 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %25, i64 noundef %26)
  store ptr %27, ptr %10, align 8, !tbaa !5
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %28, i32 0, i32 6
  %30 = load float, ptr %29, align 16, !tbaa !35
  %31 = load float, ptr %7, align 4, !tbaa !33
  %32 = fneg float %31
  %33 = fcmp ole float %30, %32
  br i1 %33, label %34, label %110

34:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %35 = load i64, ptr %8, align 8, !tbaa !34
  %36 = add i64 %35, 1
  store i64 %36, ptr %11, align 8, !tbaa !34
  br label %37

37:                                               ; preds = %105, %34
  %38 = load i64, ptr %11, align 8, !tbaa !34
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %39)
  %41 = icmp ult i64 %38, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %37
  store i32 5, ptr %9, align 4
  br label %108

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load i64, ptr %11, align 8, !tbaa !34
  %46 = call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %44, i64 noundef %45)
  store ptr %46, ptr %12, align 8, !tbaa !5
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = call noundef zeroext i1 @_ZNK3JPH16CharacterVirtual10ContactKey10IsSameBodyERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %47, ptr noundef nonnull align 4 dereferenceable(12) %48)
  br i1 %49, label %50, label %101

50:                                               ; preds = %43
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %51, i32 0, i32 6
  %53 = load float, ptr %52, align 16, !tbaa !35
  %54 = load float, ptr %7, align 4, !tbaa !33
  %55 = fneg float %54
  %56 = fcmp ole float %53, %55
  br i1 %56, label %57, label %101

57:                                               ; preds = %50
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %58, i32 0, i32 4
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %60, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %61, i64 16, i1 false), !tbaa.struct !39
  %62 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %63 = load double, ptr %62, align 16
  %64 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %65 = load double, ptr %64, align 8
  %66 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %59, double %63, double %65)
  %67 = fcmp olt float %66, 0.000000e+00
  br i1 %67, label %68, label %101

68:                                               ; preds = %57
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %69, i32 0, i32 6
  %71 = load float, ptr %70, align 16, !tbaa !35
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %72, i32 0, i32 6
  %74 = load float, ptr %73, align 16, !tbaa !35
  %75 = fcmp olt float %71, %74
  br i1 %75, label %76, label %88

76:                                               ; preds = %68
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual10ContactKeyENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS1_7ContactEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %77, ptr noundef nonnull align 16 dereferenceable(123) %78)
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %81)
  %83 = load i64, ptr %11, align 8, !tbaa !34
  %84 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %82, i64 %83
  %85 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %80, ptr noundef %84)
  %86 = load i64, ptr %11, align 8, !tbaa !34
  %87 = add i64 %86, -1
  store i64 %87, ptr %11, align 8, !tbaa !34
  br label %100

88:                                               ; preds = %68
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual10ContactKeyENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS1_7ContactEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %89, ptr noundef nonnull align 16 dereferenceable(123) %90)
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %93)
  %95 = load i64, ptr %8, align 8, !tbaa !34
  %96 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %94, i64 %95
  %97 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %92, ptr noundef %96)
  %98 = load i64, ptr %8, align 8, !tbaa !34
  %99 = add i64 %98, -1
  store i64 %99, ptr %8, align 8, !tbaa !34
  store i32 5, ptr %9, align 4
  br label %102

100:                                              ; preds = %76
  br label %101

101:                                              ; preds = %100, %57, %50, %43
  store i32 0, ptr %9, align 4
  br label %102

102:                                              ; preds = %101, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %103 = load i32, ptr %9, align 4
  switch i32 %103, label %108 [
    i32 0, label %104
  ]

104:                                              ; preds = %102
  br label %105

105:                                              ; preds = %104
  %106 = load i64, ptr %11, align 8, !tbaa !34
  %107 = add i64 %106, 1
  store i64 %107, ptr %11, align 8, !tbaa !34
  br label %37, !llvm.loop !41

108:                                              ; preds = %102, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %111

111:                                              ; preds = %110
  %112 = load i64, ptr %8, align 8, !tbaa !34
  %113 = add i64 %112, 1
  store i64 %113, ptr %8, align 8, !tbaa !34
  br label %18, !llvm.loop !43

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #5 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 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 = { 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 #5 = { 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, !20, i64 192}
!10 = !{!"_ZTSN3JPH16CharacterVirtualE", !11, i64 0, !26, i64 144, !6, i64 152, !6, i64 160, !27, i64 168, !20, i64 172, !15, i64 176, !15, i64 180, !20, i64 184, !20, i64 188, !20, i64 192, !15, i64 196, !20, i64 200, !20, i64 204, !28, i64 208, !20, i64 212, !20, i64 216, !17, i64 224, !17, i64 240, !29, i64 256, !17, i64 272, !30, i64 288, !15, i64 312, !31, i64 320, !20, i64 352, !28, i64 356, !25, i64 360, !22, i64 368}
!11 = !{!"_ZTSN3JPH13CharacterBaseE", !12, i64 8, !6, i64 16, !16, i64 24, !17, i64 32, !18, i64 48, !20, i64 64, !21, i64 68, !22, i64 72, !23, i64 76, !17, i64 80, !17, i64 96, !17, i64 112, !24, i64 128, !25, i64 136}
!12 = !{!"_ZTSN3JPH9RefTargetINS_13CharacterBaseEEE", !13, i64 0}
!13 = !{!"_ZTSSt6atomicIjE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIjE", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !6, i64 0}
!17 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!18 = !{!"_ZTSN3JPH5PlaneE", !19, i64 0}
!19 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!"_ZTSN3JPH13CharacterBase12EGroundStateE", !7, i64 0}
!22 = !{!"_ZTSN3JPH6BodyIDE", !15, i64 0}
!23 = !{!"_ZTSN3JPH10SubShapeIDE", !15, i64 0}
!24 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !6, i64 0}
!25 = !{!"long", !7, i64 0}
!26 = !{!"_ZTSN3JPH11CharacterIDE", !15, i64 0}
!27 = !{!"_ZTSN3JPH13EBackFaceModeE", !7, i64 0}
!28 = !{!"bool", !7, i64 0}
!29 = !{!"_ZTSN3JPH4QuatE", !19, i64 0}
!30 = !{!"_ZTSN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !6, i64 16}
!31 = !{!"_ZTSN3JPH12UnorderedMapINS_16CharacterVirtual10ContactKeyENS1_20ListenerContactValueENS_4HashIS2_EESt8equal_toIS2_EEE", !32, i64 0}
!32 = !{!"_ZTSN3JPH9HashTableINS_16CharacterVirtual10ContactKeyESt4pairIS2_NS1_20ListenerContactValueEENS_18UnorderedMapDetailIS2_S4_EENS_4HashIS2_EESt8equal_toIS2_EEE", !6, i64 0, !6, i64 8, !15, i64 16, !15, i64 20, !15, i64 24}
!33 = !{!20, !20, i64 0}
!34 = !{!25, !25, i64 0}
!35 = !{!36, !20, i64 80}
!36 = !{!"_ZTSN3JPH16CharacterVirtual7ContactE", !37, i64 0, !17, i64 16, !17, i64 32, !17, i64 48, !17, i64 64, !20, i64 80, !20, i64 84, !38, i64 88, !28, i64 89, !6, i64 96, !25, i64 104, !6, i64 112, !28, i64 120, !28, i64 121, !28, i64 122}
!37 = !{!"_ZTSN3JPH16CharacterVirtual10ContactKeyE", !22, i64 0, !26, i64 4, !23, i64 8}
!38 = !{!"_ZTSN3JPH11EMotionTypeE", !7, i64 0}
!39 = !{i64 0, i64 16, !40}
!40 = !{!7, !7, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = distinct !{!43, !42}


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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH16CharacterVirtual25RemoveConflictingContactsERNS_5ArrayINS0_7ContactENS_16STLTempAllocatorIS2_EEEERNS1_INS0_10ContactKeyENS3_IS7_EEEE(ptr nocapture noundef nonnull readonly align 16 dereferenceable(372) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #3 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 192
  %5 = load float, ptr %4, align 16, !tbaa !5
  %6 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph46

.lr.ph46:                                         ; preds = %3
  %7 = fmul float %5, -1.250000e+00
  br label %8

._crit_edge:                                      ; preds = %.loopexit, %3
  ret void

8:                                                ; preds = %.lr.ph46, %.loopexit
  %.045 = phi i64 [ 0, %.lr.ph46 ], [ %44, %.loopexit ]
  %9 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.045)
  %10 = getelementptr inbounds i8, ptr %9, i64 80
  %11 = load float, ptr %10, align 16, !tbaa !32
  %12 = fcmp ugt float %11, %7
  br i1 %12, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %8
  %.03542 = add nuw i64 %.045, 1
  %13 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %14 = icmp ult i64 %.03542, %13
  br i1 %14, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader
  %15 = getelementptr inbounds i8, ptr %9, i64 48
  br label %16

16:                                               ; preds = %.lr.ph, %41
  %.03544 = phi i64 [ %.03542, %.lr.ph ], [ %.035, %41 ]
  %.035.in43 = phi i64 [ %.045, %.lr.ph ], [ %.237, %41 ]
  %17 = tail call noundef nonnull align 16 dereferenceable(123) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.03544)
  %18 = tail call noundef zeroext i1 @_ZNK3JPH16CharacterVirtual10ContactKey10IsSameBodyERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %17)
  br i1 %18, label %19, label %41

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %17, i64 80
  %21 = load float, ptr %20, align 16, !tbaa !32
  %22 = fcmp ugt float %21, %7
  br i1 %22, label %41, label %23

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %17, i64 48
  %.sroa.0.0.copyload = load double, ptr %24, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %17, i64 56
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !36
  %25 = tail call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %15, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %26 = fcmp olt float %25, 0.000000e+00
  br i1 %26, label %27, label %41

27:                                               ; preds = %23
  %28 = load float, ptr %10, align 16, !tbaa !32
  %29 = load float, ptr %20, align 16, !tbaa !32
  %30 = fcmp olt float %28, %29
  br i1 %30, label %31, label %.thread

31:                                               ; preds = %27
  %32 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual10ContactKeyENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS1_7ContactEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 16 dereferenceable(123) %17)
  %33 = tail call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %34 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %33, i64 %.03544
  %35 = tail call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %34)
  br label %41

.thread:                                          ; preds = %27
  %36 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual10ContactKeyENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS1_7ContactEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 16 dereferenceable(123) %9)
  %37 = tail call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %38 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %37, i64 %.045
  %39 = tail call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %38)
  %40 = add i64 %.045, -1
  br label %.loopexit

41:                                               ; preds = %16, %19, %23, %31
  %.237 = phi i64 [ %.035.in43, %31 ], [ %.03544, %23 ], [ %.03544, %19 ], [ %.03544, %16 ]
  %.035 = add i64 %.237, 1
  %42 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %43 = icmp ult i64 %.035, %42
  br i1 %43, label %16, label %.loopexit, !llvm.loop !37

.loopexit:                                        ; preds = %41, %.preheader, %.thread, %8
  %.4 = phi i64 [ %.045, %8 ], [ %40, %.thread ], [ %.045, %.preheader ], [ %.045, %41 ]
  %44 = add i64 %.4, 1
  %45 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %46 = icmp ult i64 %44, %45
  br i1 %46, label %8, label %._crit_edge, !llvm.loop !39
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3 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 = { 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 #2 = { 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 #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" }

!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, !19, i64 192}
!6 = !{!"_ZTSN3JPH16CharacterVirtualE", !7, i64 0, !25, i64 144, !14, i64 152, !14, i64 160, !26, i64 168, !19, i64 172, !11, i64 176, !11, i64 180, !19, i64 184, !19, i64 188, !19, i64 192, !11, i64 196, !19, i64 200, !19, i64 204, !27, i64 208, !19, i64 212, !19, i64 216, !16, i64 224, !16, i64 240, !28, i64 256, !16, i64 272, !29, i64 288, !11, i64 312, !30, i64 320, !19, i64 352, !27, i64 356, !24, i64 360, !21, i64 368}
!7 = !{!"_ZTSN3JPH13CharacterBaseE", !8, i64 8, !14, i64 16, !15, i64 24, !16, i64 32, !17, i64 48, !19, i64 64, !20, i64 68, !21, i64 72, !22, i64 76, !16, i64 80, !16, i64 96, !16, i64 112, !23, i64 128, !24, i64 136}
!8 = !{!"_ZTSN3JPH9RefTargetINS_13CharacterBaseEEE", !9, i64 0}
!9 = !{!"_ZTSSt6atomicIjE", !10, i64 0}
!10 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !14, i64 0}
!16 = !{!"_ZTSN3JPH4Vec3E", !12, i64 0}
!17 = !{!"_ZTSN3JPH5PlaneE", !18, i64 0}
!18 = !{!"_ZTSN3JPH4Vec4E", !12, i64 0}
!19 = !{!"float", !12, i64 0}
!20 = !{!"_ZTSN3JPH13CharacterBase12EGroundStateE", !12, i64 0}
!21 = !{!"_ZTSN3JPH6BodyIDE", !11, i64 0}
!22 = !{!"_ZTSN3JPH10SubShapeIDE", !11, i64 0}
!23 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !14, i64 0}
!24 = !{!"long", !12, i64 0}
!25 = !{!"_ZTSN3JPH11CharacterIDE", !11, i64 0}
!26 = !{!"_ZTSN3JPH13EBackFaceModeE", !12, i64 0}
!27 = !{!"bool", !12, i64 0}
!28 = !{!"_ZTSN3JPH4QuatE", !18, i64 0}
!29 = !{!"_ZTSN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !14, i64 16}
!30 = !{!"_ZTSN3JPH12UnorderedMapINS_16CharacterVirtual10ContactKeyENS1_20ListenerContactValueENS_4HashIS2_EESt8equal_toIS2_EEE", !31, i64 0}
!31 = !{!"_ZTSN3JPH9HashTableINS_16CharacterVirtual10ContactKeyESt4pairIS2_NS1_20ListenerContactValueEENS_18UnorderedMapDetailIS2_S4_EENS_4HashIS2_EESt8equal_toIS2_EEE", !14, i64 0, !14, i64 8, !11, i64 16, !11, i64 20, !11, i64 24}
!32 = !{!33, !19, i64 80}
!33 = !{!"_ZTSN3JPH16CharacterVirtual7ContactE", !34, i64 0, !16, i64 16, !16, i64 32, !16, i64 48, !16, i64 64, !19, i64 80, !19, i64 84, !35, i64 88, !27, i64 89, !14, i64 96, !24, i64 104, !14, i64 112, !27, i64 120, !27, i64 121, !27, i64 122}
!34 = !{!"_ZTSN3JPH16CharacterVirtual10ContactKeyE", !21, i64 0, !25, i64 4, !22, i64 8}
!35 = !{!"_ZTSN3JPH11EMotionTypeE", !12, i64 0}
!36 = !{!12, !12, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}


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