; LLVM IR from zig-gamedev/zphysics :: libs/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", ptr, ptr, i8, [3 x i8], float, i32, i32, float, float, float, i32, float, float, i8, [3 x i8], float, float, [12 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Array.2", float, i8, [3 x i8], i64, %"class.JPH::BodyID", [4 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::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Array.2" = type { i64, i64, ptr }
%"class.JPH::BodyID" = type { i32 }
%"struct.JPH::CharacterVirtual::Contact" = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, float, %"class.JPH::BodyID", [4 x i8], ptr, %"class.JPH::SubShapeID", i8, i8, [2 x i8], i64, ptr, i8, i8, i8, [13 x i8] }>

; 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(115) 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 @_ZNK3JPH16CharacterVirtual7Contact10IsSameBodyERKS1_(ptr noundef nonnull align 16 dereferenceable(115), ptr noundef nonnull align 16 dereferenceable(115)) #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_14IgnoredContactENS3_IS7_EEEE(ptr noundef nonnull align 16 dereferenceable(332) %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 10
  %16 = load float, ptr %15, align 8, !tbaa !9
  %17 = fmul float 1.250000e+00, %16
  store float %17, ptr %7, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !31
  br label %18

18:                                               ; preds = %115, %3
  %19 = load i64, ptr %8, align 8, !tbaa !31
  %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 %118

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 !31
  %27 = call noundef nonnull align 16 dereferenceable(115) 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 4
  %30 = load float, ptr %29, align 16, !tbaa !32
  %31 = load float, ptr %7, align 4, !tbaa !30
  %32 = fneg float %31
  %33 = fcmp ole float %30, %32
  br i1 %33, label %34, label %114

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

37:                                               ; preds = %109, %34
  %38 = load i64, ptr %11, align 8, !tbaa !31
  %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 %112

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 !31
  %46 = call noundef nonnull align 16 dereferenceable(115) 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 @_ZNK3JPH16CharacterVirtual7Contact10IsSameBodyERKS1_(ptr noundef nonnull align 16 dereferenceable(115) %47, ptr noundef nonnull align 16 dereferenceable(115) %48)
  br i1 %49, label %50, label %105

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

57:                                               ; preds = %50
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %60, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %61, i64 16, i1 false), !tbaa.struct !35
  %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 %105

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

76:                                               ; preds = %68
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %78, i32 0, i32 6
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %80, i32 0, i32 9
  %82 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual14IgnoredContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS_6BodyIDERNS_10SubShapeIDEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %77, ptr noundef nonnull align 4 dereferenceable(4) %79, ptr noundef nonnull align 4 dereferenceable(4) %81)
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %84)
  %86 = load i64, ptr %11, align 8, !tbaa !31
  %87 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %85, i64 %86
  call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %83, ptr noundef %87)
  %88 = load i64, ptr %11, align 8, !tbaa !31
  %89 = add i64 %88, -1
  store i64 %89, ptr %11, align 8, !tbaa !31
  br label %104

90:                                               ; preds = %68
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %92, i32 0, i32 6
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %94, i32 0, i32 9
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual14IgnoredContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS_6BodyIDERNS_10SubShapeIDEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %91, ptr noundef nonnull align 4 dereferenceable(4) %93, ptr noundef nonnull align 4 dereferenceable(4) %95)
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %98)
  %100 = load i64, ptr %8, align 8, !tbaa !31
  %101 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %99, i64 %100
  call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %97, ptr noundef %101)
  %102 = load i64, ptr %8, align 8, !tbaa !31
  %103 = add i64 %102, -1
  store i64 %103, ptr %8, align 8, !tbaa !31
  store i32 5, ptr %9, align 4
  br label %106

104:                                              ; preds = %76
  br label %105

105:                                              ; preds = %104, %57, %50, %43
  store i32 0, ptr %9, align 4
  br label %106

106:                                              ; preds = %105, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %107 = load i32, ptr %9, align 4
  switch i32 %107, label %112 [
    i32 0, label %108
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108
  %110 = load i64, ptr %11, align 8, !tbaa !31
  %111 = add i64 %110, 1
  store i64 %111, ptr %11, align 8, !tbaa !31
  br label %37, !llvm.loop !37

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

113:                                              ; preds = %112
  br label %114

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

115:                                              ; preds = %114
  %116 = load i64, ptr %8, align 8, !tbaa !31
  %117 = add i64 %116, 1
  store i64 %117, ptr %8, align 8, !tbaa !31
  br label %18, !llvm.loop !39

118:                                              ; 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(8) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual14IgnoredContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS_6BodyIDERNS_10SubShapeIDEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_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 184}
!10 = !{!"_ZTSN3JPH16CharacterVirtualE", !11, i64 0, !6, i64 144, !6, i64 152, !26, i64 160, !20, i64 164, !15, i64 168, !15, i64 172, !20, i64 176, !20, i64 180, !20, i64 184, !15, i64 188, !20, i64 192, !20, i64 196, !27, i64 200, !20, i64 204, !20, i64 208, !17, i64 224, !17, i64 240, !28, i64 256, !17, i64 272, !29, i64 288, !20, i64 312, !27, i64 316, !25, i64 320, !22, i64 328}
!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 = !{!"_ZTSN3JPH13EBackFaceModeE", !7, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSN3JPH4QuatE", !19, i64 0}
!29 = !{!"_ZTSN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !6, i64 16}
!30 = !{!20, !20, i64 0}
!31 = !{!25, !25, i64 0}
!32 = !{!33, !20, i64 64}
!33 = !{!"_ZTSN3JPH16CharacterVirtual7ContactE", !17, i64 0, !17, i64 16, !17, i64 32, !17, i64 48, !20, i64 64, !20, i64 68, !22, i64 72, !6, i64 80, !23, i64 88, !34, i64 92, !27, i64 93, !25, i64 96, !6, i64 104, !27, i64 112, !27, i64 113, !27, i64 114}
!34 = !{!"_ZTSN3JPH11EMotionTypeE", !7, i64 0}
!35 = !{i64 0, i64 16, !36}
!36 = !{!7, !7, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}


; 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::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, float, %"class.JPH::BodyID", [4 x i8], ptr, %"class.JPH::SubShapeID", i8, i8, [2 x i8], i64, ptr, i8, i8, i8, [13 x i8] }>
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::SubShapeID" = type { i32 }

; 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(115) 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 @_ZNK3JPH16CharacterVirtual7Contact10IsSameBodyERKS1_(ptr noundef nonnull align 16 dereferenceable(115), ptr noundef nonnull align 16 dereferenceable(115)) 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_14IgnoredContactENS3_IS7_EEEE(ptr nocapture noundef nonnull readonly align 16 dereferenceable(332) %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 184
  %5 = load float, ptr %4, align 8, !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.ph48

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

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

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

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

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

16:                                               ; preds = %.lr.ph, %43
  %.03746 = phi i64 [ %.03744, %.lr.ph ], [ %.037, %43 ]
  %.037.in45 = phi i64 [ %.047, %.lr.ph ], [ %.239, %43 ]
  %17 = tail call noundef nonnull align 16 dereferenceable(115) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.03746)
  %18 = tail call noundef zeroext i1 @_ZNK3JPH16CharacterVirtual7Contact10IsSameBodyERKS1_(ptr noundef nonnull align 16 dereferenceable(115) %9, ptr noundef nonnull align 16 dereferenceable(115) %17)
  br i1 %18, label %19, label %43

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

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %17, i64 32
  %.sroa.0.0.copyload = load double, ptr %24, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %17, i64 40
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !32
  %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 %43

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

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %17, i64 72
  %33 = getelementptr inbounds i8, ptr %17, i64 88
  %34 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual14IgnoredContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS_6BodyIDERNS_10SubShapeIDEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %35 = tail call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %36 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %35, i64 %.03746
  tail call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %36)
  br label %43

.thread:                                          ; preds = %27
  %37 = getelementptr inbounds i8, ptr %9, i64 72
  %38 = getelementptr inbounds i8, ptr %9, i64 88
  %39 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_16CharacterVirtual14IgnoredContactENS_16STLTempAllocatorIS2_EEE12emplace_backIJRNS_6BodyIDERNS_10SubShapeIDEEEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 4 dereferenceable(4) %37, ptr noundef nonnull align 4 dereferenceable(4) %38)
  %40 = tail call noundef ptr @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %41 = getelementptr inbounds %"struct.JPH::CharacterVirtual::Contact", ptr %40, i64 %.047
  tail call void @_ZN3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE5eraseEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %41)
  %42 = add i64 %.047, -1
  br label %.loopexit

43:                                               ; preds = %16, %19, %23, %31
  %.239 = phi i64 [ %.037.in45, %31 ], [ %.03746, %23 ], [ %.03746, %19 ], [ %.03746, %16 ]
  %.037 = add i64 %.239, 1
  %44 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %45 = icmp ult i64 %.037, %44
  br i1 %45, label %16, label %.loopexit, !llvm.loop !33

.loopexit:                                        ; preds = %43, %.preheader, %.thread, %8
  %.4 = phi i64 [ %.047, %8 ], [ %42, %.thread ], [ %.047, %.preheader ], [ %.047, %43 ]
  %46 = add i64 %.4, 1
  %47 = tail call noundef i64 @_ZNK3JPH5ArrayINS_16CharacterVirtual7ContactENS_16STLTempAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %48 = icmp ult i64 %46, %47
  br i1 %48, label %8, label %._crit_edge, !llvm.loop !35
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_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 184}
!6 = !{!"_ZTSN3JPH16CharacterVirtualE", !7, i64 0, !14, i64 144, !14, i64 152, !25, i64 160, !19, i64 164, !11, i64 168, !11, i64 172, !19, i64 176, !19, i64 180, !19, i64 184, !11, i64 188, !19, i64 192, !19, i64 196, !26, i64 200, !19, i64 204, !19, i64 208, !16, i64 224, !16, i64 240, !27, i64 256, !16, i64 272, !28, i64 288, !19, i64 312, !26, i64 316, !24, i64 320, !21, i64 328}
!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 = !{!"_ZTSN3JPH13EBackFaceModeE", !12, i64 0}
!26 = !{!"bool", !12, i64 0}
!27 = !{!"_ZTSN3JPH4QuatE", !18, i64 0}
!28 = !{!"_ZTSN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !14, i64 16}
!29 = !{!30, !19, i64 64}
!30 = !{!"_ZTSN3JPH16CharacterVirtual7ContactE", !16, i64 0, !16, i64 16, !16, i64 32, !16, i64 48, !19, i64 64, !19, i64 68, !21, i64 72, !14, i64 80, !22, i64 88, !31, i64 92, !26, i64 93, !24, i64 96, !14, i64 104, !26, i64 112, !26, i64 113, !26, i64 114}
!31 = !{!"_ZTSN3JPH11EMotionTypeE", !12, i64 0}
!32 = !{!12, !12, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


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