; LLVM IR from erayzesen/QuarkPhysics :: QuarkPhysics/extensions (qspatialhashing)

; 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.QSpatialHashing = type { %class.QBroadPhase, float, float, %"class.std::unordered_map", %"class.std::unordered_map.17" }
%class.QBroadPhase = type { ptr, %"class.std::unordered_set", ptr }
%"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.std::unordered_map" = type { %"class.std::_Hashtable.2" }
%"class.std::_Hashtable.2" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::unordered_map.17" = type { %"class.std::_Hashtable.18" }
%"class.std::_Hashtable.18" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }

@_ZTV15QSpatialHashing = external dso_local unnamed_addr constant { [6 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN15QSpatialHashingC2ERSt6vectorIP5QBodySaIS2_EEf(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, float noundef %2) unnamed_addr #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store float %2, ptr %6, align 4, !tbaa !9
  %7 = load ptr, ptr %4, align 8
  %8 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN11QBroadPhaseC2ERSt6vectorIP5QBodySaIS2_EE(ptr noundef nonnull align 8 dereferenceable(72) %7, ptr noundef nonnull align 8 dereferenceable(24) %8)
  store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTV15QSpatialHashing, i32 0, i32 0, i32 2), ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds %class.QSpatialHashing, ptr %7, i32 0, i32 1
  store float 1.280000e+02, ptr %9, align 8, !tbaa !13
  %10 = getelementptr inbounds %class.QSpatialHashing, ptr %7, i32 0, i32 2
  %11 = getelementptr inbounds %class.QSpatialHashing, ptr %7, i32 0, i32 1
  %12 = load float, ptr %11, align 8, !tbaa !13
  %13 = fdiv float 1.000000e+00, %12
  store float %13, ptr %10, align 4, !tbaa !25
  %14 = getelementptr inbounds %class.QSpatialHashing, ptr %7, i32 0, i32 3
  call void @_ZNSt13unordered_mapISt4pairIiiESt6vectorIP5QBodySaIS4_EEN15QSpatialHashing8PairHashESt8equal_toIS1_ESaIS0_IKS1_S6_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %14) #2
  %15 = getelementptr inbounds %class.QSpatialHashing, ptr %7, i32 0, i32 4
  call void @_ZNSt13unordered_mapIP5QBodyN15QSpatialHashing8CellAABBESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %15) #2
  ret void
}

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

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

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

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !10, i64 72}
!14 = !{!"_ZTS15QSpatialHashing", !15, i64 0, !10, i64 72, !10, i64 76, !21, i64 80, !23, i64 136}
!15 = !{!"_ZTS11QBroadPhase", !16, i64 8, !6, i64 64}
!16 = !{!"_ZTSSt13unordered_setISt4pairIP5QBodyS2_ENS1_12BodyPairHashENS1_13BodyPairEqualESaIS3_EE", !17, i64 0}
!17 = !{!"_ZTSSt10_HashtableISt4pairIP5QBodyS2_ES3_SaIS3_ENSt8__detail9_IdentityENS1_13BodyPairEqualENS1_12BodyPairHashENS5_18_Mod_range_hashingENS5_20_Default_ranged_hashENS5_20_Prime_rehash_policyENS5_17_Hashtable_traitsILb1ELb1ELb1EEEE", !6, i64 0, !18, i64 8, !19, i64 16, !18, i64 24, !20, i64 32, !6, i64 48}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!20 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !10, i64 0, !18, i64 8}
!21 = !{!"_ZTSSt13unordered_mapISt4pairIiiESt6vectorIP5QBodySaIS4_EEN15QSpatialHashing8PairHashESt8equal_toIS1_ESaIS0_IKS1_S6_EEE", !22, i64 0}
!22 = !{!"_ZTSSt10_HashtableISt4pairIiiES0_IKS1_St6vectorIP5QBodySaIS5_EEESaIS8_ENSt8__detail10_Select1stESt8equal_toIS1_EN15QSpatialHashing8PairHashENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb1ELb0ELb1EEEE", !6, i64 0, !18, i64 8, !19, i64 16, !18, i64 24, !20, i64 32, !6, i64 48}
!23 = !{!"_ZTSSt13unordered_mapIP5QBodyN15QSpatialHashing8CellAABBESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S3_EEE", !24, i64 0}
!24 = !{!"_ZTSSt10_HashtableIP5QBodySt4pairIKS1_N15QSpatialHashing8CellAABBEESaIS6_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENS8_18_Mod_range_hashingENS8_20_Default_ranged_hashENS8_20_Prime_rehash_policyENS8_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !18, i64 8, !19, i64 16, !18, i64 24, !20, i64 32, !6, i64 48}
!25 = !{!14, !10, i64 76}


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

@_ZTV15QSpatialHashing = external dso_local unnamed_addr constant { [6 x ptr] }, align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN15QSpatialHashingC2ERSt6vectorIP5QBodySaIS2_EEf(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, float noundef %2) unnamed_addr #0 align 2 {
  tail call void @_ZN11QBroadPhaseC2ERSt6vectorIP5QBodySaIS2_EE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(24) %1)
  store ptr getelementptr inbounds inrange(-16, 32) (i8, ptr @_ZTV15QSpatialHashing, i64 16), ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 72
  store <2 x float> <float 1.280000e+02, float 7.812500e-03>, ptr %4, align 8, !tbaa !8
  %5 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZNSt13unordered_mapISt4pairIiiESt6vectorIP5QBodySaIS4_EEN15QSpatialHashing8PairHashESt8equal_toIS1_ESaIS0_IKS1_S6_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #1
  %6 = getelementptr inbounds i8, ptr %0, i64 136
  tail call void @_ZNSt13unordered_mapIP5QBodyN15QSpatialHashing8CellAABBESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #1
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11QBroadPhaseC2ERSt6vectorIP5QBodySaIS2_EE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

attributes #0 = { 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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass