; LLVM IR from zig-gamedev/zphysics :: libs/Jolt/Physics/Collision/Shape/MeshShape.ll (ZN3JPH17MeshShapeSettings8SanitizeEv)

; 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.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::ValidationContext" = type { ptr, %"class.JPH::AABox" }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.18 }
%union.anon.18 = type { <4 x float> }
%"struct.std::pair" = type <{ %"struct.std::__detail::_Node_iterator", i8, [7 x i8] }>
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"class.JPH::IndexedTriangle" = type { %"class.JPH::IndexedTriangleNoMaterial", i32 }
%"class.JPH::IndexedTriangleNoMaterial" = type { [3 x i32] }
%"class.JPH::MeshShapeSettings" = type { %"class.JPH::ShapeSettings", %"class.JPH::Array", %"class.JPH::Array.5", %"class.JPH::Array.8", i32, float }
%"class.JPH::ShapeSettings" = type { %"class.JPH::SerializableObject", %"class.JPH::RefTarget", i64, %"class.JPH::Result" }
%"class.JPH::SerializableObject" = type { ptr }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Result" = type <{ %union.anon, i8, [7 x i8] }>
%union.anon = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.2 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.2 = type { i64, [8 x i8] }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.5" = type { i64, i64, ptr }
%"class.JPH::Array.8" = type { i64, i64, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17MeshShapeSettings8SanitizeEv(ptr noundef nonnull align 8 dereferenceable(144) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::unordered_set", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::ValidationContext", align 16
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"class.JPH::IndexedTriangle", align 4
  %11 = alloca { ptr, i8 }, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr %3) #6
  call void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  %13 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  %14 = invoke noundef i64 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %15 unwind label %29

15:                                               ; preds = %1
  invoke void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(56) %3, i64 noundef %14)
          to label %16 unwind label %29

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #6
  %17 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  %18 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 1
  invoke void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContextC2ERKNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS3_EEEERKNS2_INS_6Float3ENS4_IS9_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %19 unwind label %33

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %20 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  %21 = invoke noundef i64 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %22 unwind label %37

22:                                               ; preds = %19
  %23 = trunc i64 %21 to i32
  %24 = sub nsw i32 %23, 1
  store i32 %24, ptr %7, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %91, %22
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = icmp sge i32 %26, 0
  br i1 %27, label %41, label %28

28:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %96

29:                                               ; preds = %15, %1
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %4, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %5, align 4
  br label %98

33:                                               ; preds = %16
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %4, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %5, align 4
  br label %97

37:                                               ; preds = %19
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  br label %95

41:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %42 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %44)
          to label %46 unwind label %82

46:                                               ; preds = %41
  store ptr %45, ptr %8, align 8, !tbaa !5
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %49 = invoke noundef zeroext i1 @_ZNK3JPH25IndexedTriangleNoMaterial12IsDegenerateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(12) %47, ptr noundef nonnull align 8 dereferenceable(24) %48)
          to label %50 unwind label %82

50:                                               ; preds = %46
  br i1 %49, label %69, label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = invoke noundef zeroext i1 @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContext12IsDegenerateERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(16) %52)
          to label %54 unwind label %82

54:                                               ; preds = %51
  br i1 %53, label %69, label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = invoke { i64, i64 } @_ZNK3JPH15IndexedTriangle19GetLowestIndexFirstEv(ptr noundef nonnull align 4 dereferenceable(16) %56)
          to label %58 unwind label %86

58:                                               ; preds = %55
  %59 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %60 = extractvalue { i64, i64 } %57, 0
  store i64 %60, ptr %59, align 4
  %61 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %62 = extractvalue { i64, i64 } %57, 1
  store i64 %62, ptr %61, align 4
  %63 = invoke { ptr, i8 } @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 4 dereferenceable(16) %10)
          to label %64 unwind label %86

64:                                               ; preds = %58
  store { ptr, i8 } %63, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %11, i64 9, i1 false)
  %65 = getelementptr inbounds %"struct.std::pair", ptr %9, i32 0, i32 1
  %66 = load i8, ptr %65, align 8, !tbaa !11, !range !16, !noundef !17
  %67 = trunc i8 %66 to i1
  %68 = xor i1 %67, true
  br label %69

69:                                               ; preds = %64, %54, %50
  %70 = phi i1 [ true, %54 ], [ true, %50 ], [ %68, %64 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br i1 %70, label %71, label %90

71:                                               ; preds = %69
  %72 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  %73 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %72)
          to label %74 unwind label %82

74:                                               ; preds = %71
  %75 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %77)
          to label %79 unwind label %82

79:                                               ; preds = %74
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 4 %73, i64 16, i1 false)
  %80 = getelementptr inbounds %"class.JPH::MeshShapeSettings", ptr %12, i32 0, i32 2
  invoke void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %80)
          to label %81 unwind label %82

81:                                               ; preds = %79
  br label %90

82:                                               ; preds = %79, %74, %71, %51, %46, %41
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %4, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %5, align 4
  br label %94

86:                                               ; preds = %58, %55
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %4, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br label %94

90:                                               ; preds = %81, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %7, align 4, !tbaa !9
  %93 = add nsw i32 %92, -1
  store i32 %93, ptr %7, align 4, !tbaa !9
  br label %25, !llvm.loop !18

94:                                               ; preds = %86, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %95

95:                                               ; preds = %94, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %97

96:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #6
  call void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #6
  ret void

97:                                               ; preds = %95, %33
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #6
  br label %98

98:                                               ; preds = %97, %29
  call void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #6
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %4, align 8
  %101 = load i32, ptr %5, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH25IndexedTriangleNoMaterial12IsDegenerateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContext12IsDegenerateERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZNK3JPH15IndexedTriangle19GetLowestIndexFirstEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 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) #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #3 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 = { 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 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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !15, i64 8}
!12 = !{!"_ZTSSt4pairINSt8__detail14_Node_iteratorIN3JPH15IndexedTriangleELb1ELb1EEEbE", !13, i64 0, !15, i64 8}
!13 = !{!"_ZTSNSt8__detail14_Node_iteratorIN3JPH15IndexedTriangleELb1ELb1EEE", !14, i64 0}
!14 = !{!"_ZTSNSt8__detail19_Node_iterator_baseIN3JPH15IndexedTriangleELb1EEE", !6, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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

%"class.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::ValidationContext" = type { ptr, %"class.JPH::AABox" }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.18 }
%union.anon.18 = type { <4 x float> }
%"class.JPH::IndexedTriangle" = type { %"class.JPH::IndexedTriangleNoMaterial", i32 }
%"class.JPH::IndexedTriangleNoMaterial" = type { [3 x i32] }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17MeshShapeSettings8SanitizeEv(ptr noundef nonnull align 8 dereferenceable(144) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::unordered_set", align 8
  %3 = alloca %"class.JPH::TriangleCodecIndexed8BitPackSOA4Flags::ValidationContext", align 16
  %4 = alloca %"class.JPH::IndexedTriangle", align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #6
  call void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #6
  %5 = getelementptr inbounds i8, ptr %0, i64 88
  %6 = call noundef i64 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  invoke void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(56) %2, i64 noundef %6)
          to label %7 unwind label %15

7:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #6
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  invoke void @_ZN3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContextC2ERKNS_5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS3_EEEERKNS2_INS_6Float3ENS4_IS9_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %9 unwind label %17

9:                                                ; preds = %7
  %10 = call noundef i64 @_ZNK3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %11 = trunc i64 %10 to i32
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9
  %13 = getelementptr inbounds i8, ptr %4, i64 8
  %14 = and i64 %10, 2147483647
  br label %19

._crit_edge:                                      ; preds = %44, %9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #6
  call void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #6
  ret void

15:                                               ; preds = %1
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %47

17:                                               ; preds = %7
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %46

19:                                               ; preds = %.lr.ph, %44
  %indvars.iv = phi i64 [ %14, %.lr.ph ], [ %indvars.iv.next, %44 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %20 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv.next)
          to label %21 unwind label %40

21:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  %22 = invoke noundef zeroext i1 @_ZNK3JPH25IndexedTriangleNoMaterial12IsDegenerateERKNS_5ArrayINS_6Float3ENS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(12) %20, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %23 unwind label %40

23:                                               ; preds = %21
  br i1 %22, label %.critedge, label %24

24:                                               ; preds = %23
  %25 = invoke noundef zeroext i1 @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContext12IsDegenerateERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(16) %20)
          to label %26 unwind label %40

26:                                               ; preds = %24
  br i1 %25, label %.critedge, label %27

27:                                               ; preds = %26
  %28 = invoke { i64, i64 } @_ZNK3JPH15IndexedTriangle19GetLowestIndexFirstEv(ptr noundef nonnull align 4 dereferenceable(16) %20)
          to label %29 unwind label %42

29:                                               ; preds = %27
  %30 = extractvalue { i64, i64 } %28, 0
  store i64 %30, ptr %4, align 8
  %31 = extractvalue { i64, i64 } %28, 1
  store i64 %31, ptr %13, align 8
  %32 = invoke { ptr, i8 } @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(16) %4)
          to label %33 unwind label %42

33:                                               ; preds = %29
  %.fca.1.extract = extractvalue { ptr, i8 } %32, 1
  %34 = trunc i8 %.fca.1.extract to i1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br i1 %34, label %44, label %35

.critedge:                                        ; preds = %23, %26
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br label %35

35:                                               ; preds = %.critedge, %33
  %36 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %37 unwind label %40

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv.next)
          to label %39 unwind label %40

39:                                               ; preds = %37
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(16) %36, i64 16, i1 false)
  invoke void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %44 unwind label %40

40:                                               ; preds = %39, %37, %35, %24, %21, %19
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %46

42:                                               ; preds = %29, %27
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br label %46

44:                                               ; preds = %39, %33
  %45 = icmp ugt i64 %indvars.iv, 1
  br i1 %45, label %19, label %._crit_edge, !llvm.loop !5

46:                                               ; preds = %40, %42, %17
  %.pn.pn = phi { ptr, i32 } [ %18, %17 ], [ %41, %40 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #6
  br label %47

47:                                               ; preds = %46, %15
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %46 ], [ %16, %15 ]
  call void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH37TriangleCodecIndexed8BitPackSOA4Flags17ValidationContext12IsDegenerateERKNS_15IndexedTriangleE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIN3JPH15IndexedTriangleESt4hashIS1_ESt8equal_toIS1_ENS0_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #3 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 = { 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 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 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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