; LLVM IR from jrouwe/JoltPhysics :: Samples/Utils (ContactListenerImpl)

; 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::Color" = type { %union.anon.18 }
%union.anon.18 = type { i32 }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%class.ContactListenerImpl = type { %"class.JPH::ContactListener", %"class.JPH::Mutex", %"class.JPH::UnorderedMap", ptr }
%"class.JPH::ContactListener" = type { ptr }
%"class.JPH::Mutex" = type { %"class.std::mutex", %"class.std::thread::id" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::thread::id" = type { i64 }
%"class.JPH::UnorderedMap" = type { %"class.JPH::HashTable.base", [4 x i8] }
%"class.JPH::HashTable.base" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::CollideShapeResult" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, %"class.JPH::SubShapeID", %"class.JPH::SubShapeID", %"class.JPH::BodyID", %"class.JPH::StaticArray", %"class.JPH::StaticArray" }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::StaticArray" = type { i32, [12 x i8], [32 x %"struct.JPH::StaticArray<JPH::Vec3, 32>::Storage"] }
%"struct.JPH::StaticArray<JPH::Vec3, 32>::Storage" = type { [16 x i8] }

@_ZN3JPH13DebugRenderer9sInstanceE = external global ptr, align 8
@_ZN3JPH5Color5sBlueE = external global %"class.JPH::Color", align 4
@_ZN3JPH5TraceE = external global ptr, align 8
@.str = external hidden unnamed_addr constant [29 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: mustprogress uwtable
define dso_local noundef i32 @_ZN19ContactListenerImpl17OnContactValidateERKN3JPH4BodyES3_NS0_4Vec3ERKNS0_18CollideShapeResultE(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 16 dereferenceable(122) %1, ptr noundef nonnull align 16 dereferenceable(122) %2, double %3, double %4, ptr noundef nonnull align 16 dereferenceable(1120) %5) unnamed_addr #1 align 2 {
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Color", align 4
  %23 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  store double %3, ptr %23, align 16
  %24 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  store double %4, ptr %24, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %5, ptr %11, align 8, !tbaa !5
  %25 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #8
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %26)
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %28)
  %30 = icmp uge i8 %27, %29
  br i1 %30, label %45, label %31

31:                                               ; preds = %6
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %32)
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %34)
  %36 = icmp eq i8 %33, %35
  br i1 %36, label %37, label %43

37:                                               ; preds = %31
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %38)
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %40)
  %42 = call noundef zeroext i1 @_ZNK3JPH6BodyIDltERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %41)
  br label %43

43:                                               ; preds = %37, %31
  %44 = phi i1 [ false, %31 ], [ %42, %37 ]
  br label %45

45:                                               ; preds = %43, %6
  %46 = phi i1 [ true, %6 ], [ %44, %43 ]
  %47 = zext i1 %46 to i8
  store i8 %47, ptr %12, align 1, !tbaa !9
  %48 = load i8, ptr %12, align 1, !tbaa !9, !range !11, !noundef !12
  %49 = trunc i8 %48 to i1
  br i1 %49, label %51, label %50

50:                                               ; preds = %45
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !13
  br label %51

51:                                               ; preds = %50, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %52 = getelementptr inbounds %class.ContactListenerImpl, ptr %25, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %69

55:                                               ; preds = %51
  %56 = getelementptr inbounds %class.ContactListenerImpl, ptr %25, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !14
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %7, i64 16, i1 false), !tbaa.struct !25
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %62 = load double, ptr %61, align 16
  %63 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %64 = load double, ptr %63, align 8
  %65 = load ptr, ptr %57, align 8, !tbaa !27
  %66 = getelementptr inbounds ptr, ptr %65, i64 2
  %67 = load ptr, ptr %66, align 8
  %68 = call noundef i32 %67(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull align 16 dereferenceable(122) %58, ptr noundef nonnull align 16 dereferenceable(122) %59, double %62, double %64, ptr noundef nonnull align 16 dereferenceable(1120) %60)
  store i32 %68, ptr %13, align 4, !tbaa !29
  br label %78

69:                                               ; preds = %51
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 %7, i64 16, i1 false), !tbaa.struct !25
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %74 = load double, ptr %73, align 16
  %75 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %76 = load double, ptr %75, align 8
  %77 = call noundef i32 @_ZN3JPH15ContactListener17OnContactValidateERKNS_4BodyES3_NS_4Vec3ERKNS_18CollideShapeResultE(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 16 dereferenceable(122) %70, ptr noundef nonnull align 16 dereferenceable(122) %71, double %74, double %76, ptr noundef nonnull align 16 dereferenceable(1120) %72)
  store i32 %77, ptr %13, align 4, !tbaa !29
  br label %78

78:                                               ; preds = %69, %55
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  %80 = getelementptr inbounds %"class.JPH::CollideShapeResult", ptr %79, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 %80, i64 16, i1 false), !tbaa.struct !25
  %81 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %82 = load double, ptr %81, align 16
  %83 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %84 = load double, ptr %83, align 8
  %85 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %82, double %84)
  %86 = getelementptr inbounds %"class.JPH::Vec3", ptr %16, i32 0, i32 0
  %87 = getelementptr inbounds %union.anon, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds { double, double }, ptr %87, i32 0, i32 0
  %89 = extractvalue { double, double } %85, 0
  store double %89, ptr %88, align 16
  %90 = getelementptr inbounds { double, double }, ptr %87, i32 0, i32 1
  %91 = extractvalue { double, double } %85, 1
  store double %91, ptr %90, align 8
  %92 = load ptr, ptr @_ZN3JPH13DebugRenderer9sInstanceE, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %16, i64 16, i1 false), !tbaa.struct !25
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.JPH::CollideShapeResult", ptr %93, i32 0, i32 2
  %95 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %96 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %97 = getelementptr inbounds %union.anon, ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds { double, double }, ptr %97, i32 0, i32 0
  %99 = extractvalue { double, double } %95, 0
  store double %99, ptr %98, align 16
  %100 = getelementptr inbounds { double, double }, ptr %97, i32 0, i32 1
  %101 = extractvalue { double, double } %95, 1
  store double %101, ptr %100, align 8
  %102 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %103 = load double, ptr %102, align 16
  %104 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %105 = load double, ptr %104, align 8
  %106 = call { double, double } @_ZNK3JPH4Vec312NormalizedOrES0_(ptr noundef nonnull align 16 dereferenceable(16) %94, double %103, double %105)
  %107 = getelementptr inbounds %"class.JPH::Vec3", ptr %20, i32 0, i32 0
  %108 = getelementptr inbounds %union.anon, ptr %107, i32 0, i32 0
  %109 = getelementptr inbounds { double, double }, ptr %108, i32 0, i32 0
  %110 = extractvalue { double, double } %106, 0
  store double %110, ptr %109, align 16
  %111 = getelementptr inbounds { double, double }, ptr %108, i32 0, i32 1
  %112 = extractvalue { double, double } %106, 1
  store double %112, ptr %111, align 8
  %113 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %114 = load double, ptr %113, align 16
  %115 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %116 = load double, ptr %115, align 8
  %117 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %16, double %114, double %116)
  %118 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %119 = getelementptr inbounds %union.anon, ptr %118, i32 0, i32 0
  %120 = getelementptr inbounds { double, double }, ptr %119, i32 0, i32 0
  %121 = extractvalue { double, double } %117, 0
  store double %121, ptr %120, align 16
  %122 = getelementptr inbounds { double, double }, ptr %119, i32 0, i32 1
  %123 = extractvalue { double, double } %117, 1
  store double %123, ptr %122, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 @_ZN3JPH5Color5sBlueE, i64 4, i1 false), !tbaa.struct !31
  %124 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %125 = load double, ptr %124, align 16
  %126 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %127 = load double, ptr %126, align 8
  %128 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %129 = load double, ptr %128, align 16
  %130 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %131 = load double, ptr %130, align 8
  %132 = getelementptr inbounds %"class.JPH::Color", ptr %22, i32 0, i32 0
  %133 = getelementptr inbounds %union.anon.18, ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 4
  call void @_ZN3JPH13DebugRenderer9DrawArrowENS_4Vec3ES1_NS_5ColorEf(ptr noundef nonnull align 8 dereferenceable(320) %92, double %125, double %127, double %129, double %131, i32 %134, float noundef 0x3FA99999A0000000)
  %135 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !5
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %136)
  %138 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %137)
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %139)
  %141 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %140)
  %142 = load i32, ptr %13, align 4, !tbaa !29
  call void (ptr, ...) %135(ptr noundef @.str, i32 noundef %138, i32 noundef %141, i32 noundef %142)
  %143 = load i32, ptr %13, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #8
  ret i32 %143
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122)) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH15ContactListener17OnContactValidateERKNS_4BodyES3_NS_4Vec3ERKNS_18CollideShapeResultE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, ptr noundef nonnull align 16 dereferenceable(1120)) unnamed_addr #4 align 2

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

declare void @_ZN3JPH13DebugRenderer9DrawArrowENS_4Vec3ES1_NS_5ColorEf(ptr noundef nonnull align 8 dereferenceable(320), double, double, double, double, i32, float noundef) #6

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{i64 2159160023}
!14 = !{!15, !6, i64 88}
!15 = !{!"_ZTS19ContactListenerImpl", !16, i64 0, !17, i64 8, !22, i64 56, !6, i64 88}
!16 = !{!"_ZTSN3JPH15ContactListenerE"}
!17 = !{!"_ZTSN3JPH5MutexE", !18, i64 0, !20, i64 40}
!18 = !{!"_ZTSSt5mutex", !19, i64 0}
!19 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!20 = !{!"_ZTSNSt6thread2idE", !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN3JPH12UnorderedMapINS_14SubShapeIDPairESt4pairINS_4Vec3ENS_11StaticArrayIS3_Lj64EEEENS_4HashIS1_EESt8equal_toIS1_EEE", !23, i64 0}
!23 = !{!"_ZTSN3JPH9HashTableINS_14SubShapeIDPairESt4pairIS1_S2_INS_4Vec3ENS_11StaticArrayIS3_Lj64EEEEENS_18UnorderedMapDetailIS1_S6_EENS_4HashIS1_EESt8equal_toIS1_EEE", !6, i64 0, !6, i64 8, !24, i64 16, !24, i64 20, !24, i64 24}
!24 = !{!"int", !7, i64 0}
!25 = !{i64 0, i64 16, !26}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !8, i64 0}
!29 = !{!30, !30, i64 0}
!30 = !{!"_ZTSN3JPH14ValidateResultE", !7, i64 0}
!31 = !{i64 0, i64 4, !26}


; 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::Color" = type { %union.anon.18 }
%union.anon.18 = type { i32 }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }

@_ZN3JPH13DebugRenderer9sInstanceE = external local_unnamed_addr global ptr, align 8
@_ZN3JPH5Color5sBlueE = external local_unnamed_addr global %"class.JPH::Color", align 4
@_ZN3JPH5TraceE = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [29 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN19ContactListenerImpl17OnContactValidateERKN3JPH4BodyES3_NS0_4Vec3ERKNS0_18CollideShapeResultE(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 16 dereferenceable(122) %1, ptr noundef nonnull align 16 dereferenceable(122) %2, double %3, double %4, ptr noundef nonnull align 16 dereferenceable(1120) %5) unnamed_addr #1 align 2 {
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  store double %3, ptr %7, align 16
  %9 = getelementptr inbounds i8, ptr %7, i64 8
  store double %4, ptr %9, align 8
  %10 = tail call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %1)
  %11 = tail call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %2)
  %.not = icmp ult i8 %10, %11
  br i1 %.not, label %12, label %.critedge

12:                                               ; preds = %6
  %13 = tail call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %1)
  %14 = tail call noundef zeroext i8 @_ZNK3JPH4Body13GetMotionTypeEv(ptr noundef nonnull align 16 dereferenceable(122) %2)
  %15 = icmp eq i8 %13, %14
  br i1 %15, label %16, label %.critedge35

16:                                               ; preds = %12
  %17 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %1)
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %2)
  %19 = tail call noundef zeroext i1 @_ZNK3JPH6BodyIDltERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  br i1 %19, label %.critedge, label %.critedge35

.critedge35:                                      ; preds = %12, %16
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !5
  br label %.critedge

.critedge:                                        ; preds = %6, %.critedge35, %16
  %20 = getelementptr inbounds i8, ptr %0, i64 88
  %21 = load ptr, ptr %20, align 8, !tbaa !6
  %.not33 = icmp eq ptr %21, null
  br i1 %.not33, label %27, label %22

22:                                               ; preds = %.critedge
  %23 = load ptr, ptr %21, align 8, !tbaa !20
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %25 = load ptr, ptr %24, align 8
  %26 = tail call noundef i32 %25(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 16 dereferenceable(122) %1, ptr noundef nonnull align 16 dereferenceable(122) %2, double %3, double %4, ptr noundef nonnull align 16 dereferenceable(1120) %5)
  br label %29

27:                                               ; preds = %.critedge
  %28 = tail call noundef i32 @_ZN3JPH15ContactListener17OnContactValidateERKNS_4BodyES3_NS_4Vec3ERKNS_18CollideShapeResultE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 16 dereferenceable(122) %1, ptr noundef nonnull align 16 dereferenceable(122) %2, double %3, double %4, ptr noundef nonnull align 16 dereferenceable(1120) %5)
  br label %29

29:                                               ; preds = %27, %22
  %.0 = phi i32 [ %26, %22 ], [ %28, %27 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  %.sroa.08.0.copyload = load double, ptr %5, align 16
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %.sroa.29.0.copyload = load double, ptr %.sroa.29.0..sroa_idx, align 8, !tbaa !22
  %30 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %.sroa.08.0.copyload, double %.sroa.29.0.copyload)
  %31 = extractvalue { double, double } %30, 0
  store double %31, ptr %8, align 16
  %32 = getelementptr inbounds i8, ptr %8, i64 8
  %33 = extractvalue { double, double } %30, 1
  store double %33, ptr %32, align 8
  %34 = load ptr, ptr @_ZN3JPH13DebugRenderer9sInstanceE, align 8, !tbaa !23
  %35 = getelementptr inbounds i8, ptr %5, i64 32
  %36 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %37 = extractvalue { double, double } %36, 0
  %38 = extractvalue { double, double } %36, 1
  %39 = call { double, double } @_ZNK3JPH4Vec312NormalizedOrES0_(ptr noundef nonnull align 16 dereferenceable(16) %35, double %37, double %38)
  %40 = extractvalue { double, double } %39, 0
  %41 = extractvalue { double, double } %39, 1
  %42 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %40, double %41)
  %43 = extractvalue { double, double } %42, 0
  %44 = extractvalue { double, double } %42, 1
  %.sroa.0.0.copyload = load i32, ptr @_ZN3JPH5Color5sBlueE, align 4, !tbaa !22
  call void @_ZN3JPH13DebugRenderer9DrawArrowENS_4Vec3ES1_NS_5ColorEf(ptr noundef nonnull align 8 dereferenceable(320) %34, double %31, double %33, double %43, double %44, i32 %.sroa.0.0.copyload, float noundef 0x3FA99999A0000000)
  %45 = load ptr, ptr @_ZN3JPH5TraceE, align 8, !tbaa !23
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %1)
  %47 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %46)
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %2)
  %49 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %48)
  call void (ptr, ...) %45(ptr noundef nonnull @.str, i32 noundef %47, i32 noundef %49, i32 noundef %.0)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  ret i32 %.0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH15ContactListener17OnContactValidateERKNS_4BodyES3_NS_4Vec3ERKNS_18CollideShapeResultE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, ptr noundef nonnull align 16 dereferenceable(1120)) unnamed_addr #3 align 2

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

declare void @_ZN3JPH13DebugRenderer9DrawArrowENS_4Vec3ES1_NS_5ColorEf(ptr noundef nonnull align 8 dereferenceable(320), double, double, double, double, i32, float noundef) local_unnamed_addr #5

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 2159160023}
!6 = !{!7, !18, i64 88}
!7 = !{!"_ZTS19ContactListenerImpl", !8, i64 0, !9, i64 8, !16, i64 56, !18, i64 88}
!8 = !{!"_ZTSN3JPH15ContactListenerE"}
!9 = !{!"_ZTSN3JPH5MutexE", !10, i64 0, !14, i64 40}
!10 = !{!"_ZTSSt5mutex", !11, i64 0}
!11 = !{!"_ZTSSt12__mutex_base", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSNSt6thread2idE", !15, i64 0}
!15 = !{!"long", !12, i64 0}
!16 = !{!"_ZTSN3JPH12UnorderedMapINS_14SubShapeIDPairESt4pairINS_4Vec3ENS_11StaticArrayIS3_Lj64EEEENS_4HashIS1_EESt8equal_toIS1_EEE", !17, i64 0}
!17 = !{!"_ZTSN3JPH9HashTableINS_14SubShapeIDPairESt4pairIS1_S2_INS_4Vec3ENS_11StaticArrayIS3_Lj64EEEEENS_18UnorderedMapDetailIS1_S6_EENS_4HashIS1_EESt8equal_toIS1_EEE", !18, i64 0, !18, i64 8, !19, i64 16, !19, i64 20, !19, i64 24}
!18 = !{!"any pointer", !12, i64 0}
!19 = !{!"int", !12, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !13, i64 0}
!22 = !{!12, !12, i64 0}
!23 = !{!18, !18, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass