; LLVM IR from SOHNE/Dura2D :: src/collision/d2AABBTree.ll (ZN10d2AABBTree6UpdateEv)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%class.d2AABBTree = type { %class.d2Broadphase, ptr, %"class.std::__cxx11::list", float, %"class.std::vector" }
%class.d2Broadphase = type { ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<std::pair<d2Body *, d2Body *>, std::allocator<std::pair<d2Body *, d2Body *>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::pair<d2Body *, d2Body *>, std::allocator<std::pair<d2Body *, d2Body *>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<d2Node *, std::allocator<d2Node *>>::_Vector_impl" }
%"struct.std::_Vector_base<d2Node *, std::allocator<d2Node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<d2Node *, std::allocator<d2Node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<d2Node *, std::allocator<d2Node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.d2Node = type { ptr, [2 x ptr], i8, %struct.d2AABB, ptr }
%struct.d2AABB = type { %struct.d2Vec2, %struct.d2Vec2, ptr, ptr }
%struct.d2Vec2 = type { float, float }

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6d2Node10UpdateAABBEf(ptr noundef nonnull align 8 dereferenceable(72), float noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10d2AABBTree10InsertNodeEP6d2NodePS1_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, ptr noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10d2AABBTree6UpdateEv(ptr noundef nonnull align 8 dereferenceable(72) %0) unnamed_addr #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  %11 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = icmp ne ptr %12, null
  br i1 %13, label %15, label %14

14:                                               ; preds = %1
  br label %96

15:                                               ; preds = %1
  %16 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = call noundef zeroext i1 @_ZNK6d2Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(72) %17)
  br i1 %18, label %19, label %24

19:                                               ; preds = %15
  %20 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 3
  %23 = load float, ptr %22, align 8, !tbaa !23
  call void @_ZN6d2Node10UpdateAABBEf(ptr noundef nonnull align 8 dereferenceable(72) %21, float noundef %23)
  br label %96

24:                                               ; preds = %15
  %25 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 4
  call void @_ZNSt6vectorIP6d2NodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #6
  %26 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 4
  call void @_ZN10d2AABBTree16UpdateNodeHelperEP6d2NodeRSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(72) %10, ptr noundef %27, ptr noundef nonnull align 8 dereferenceable(24) %28)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %29 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 4
  store ptr %29, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = call ptr @_ZNSt6vectorIP6d2NodeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  %32 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %31, ptr %32, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = call ptr @_ZNSt6vectorIP6d2NodeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  br label %36

36:                                               ; preds = %92, %24
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP6d2NodeSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %37, label %39, label %38

38:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %94

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP6d2NodeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  store ptr %41, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.d2Node, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !24
  store ptr %44, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = call noundef ptr @_ZNK6d2Node10GetSiblingEv(ptr noundef nonnull align 8 dereferenceable(72) %45)
  store ptr %46, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.d2Node, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !24
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %73

51:                                               ; preds = %39
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.d2Node, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !24
  %56 = getelementptr inbounds %struct.d2Node, ptr %55, i32 0, i32 1
  %57 = getelementptr inbounds [2 x ptr], ptr %56, i64 0, i64 0
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = icmp eq ptr %52, %58
  br i1 %59, label %60, label %66

60:                                               ; preds = %51
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.d2Node, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !24
  %64 = getelementptr inbounds %struct.d2Node, ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds [2 x ptr], ptr %64, i64 0, i64 0
  store ptr %65, ptr %9, align 8, !tbaa !5
  br label %72

66:                                               ; preds = %51
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.d2Node, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !24
  %70 = getelementptr inbounds %struct.d2Node, ptr %69, i32 0, i32 1
  %71 = getelementptr inbounds [2 x ptr], ptr %70, i64 0, i64 1
  store ptr %71, ptr %9, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %66, %60
  br label %75

73:                                               ; preds = %39
  %74 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 1
  store ptr %74, ptr %9, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %73, %72
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.d2Node, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !24
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.d2Node, ptr %79, i32 0, i32 0
  store ptr %78, ptr %80, align 8, !tbaa !24
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %81, ptr %82, align 8, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = icmp eq ptr %83, null
  br i1 %84, label %86, label %85

85:                                               ; preds = %75
  call void @_ZdlPvm(ptr noundef %83, i64 noundef 72) #7
  br label %86

86:                                               ; preds = %85, %75
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 3
  %89 = load float, ptr %88, align 8, !tbaa !23
  call void @_ZN6d2Node10UpdateAABBEf(ptr noundef nonnull align 8 dereferenceable(72) %87, float noundef %89)
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 1
  call void @_ZN10d2AABBTree10InsertNodeEP6d2NodePS1_(ptr noundef nonnull align 8 dereferenceable(72) %10, ptr noundef %90, ptr noundef %91)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %92

92:                                               ; preds = %86
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP6d2NodeSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %36

94:                                               ; preds = %38
  %95 = getelementptr inbounds %class.d2AABBTree, ptr %10, i32 0, i32 4
  call void @_ZNSt6vectorIP6d2NodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %95) #6
  br label %96

96:                                               ; preds = %94, %19, %14
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP6d2NodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10d2AABBTree16UpdateNodeHelperEP6d2NodeRSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIP6d2NodeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIP6d2NodeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

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

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

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

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

attributes #0 = { nobuiltin nounwind "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 uwtable "min-legal-vector-width"="64" "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { builtin 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, !6, i64 8}
!10 = !{!"_ZTS10d2AABBTree", !11, i64 0, !6, i64 8, !12, i64 16, !18, i64 40, !19, i64 48}
!11 = !{!"_ZTS12d2Broadphase"}
!12 = !{!"_ZTSNSt7__cxx114listISt4pairIP6d2BodyS3_ESaIS4_EEE", !13, i64 0}
!13 = !{!"_ZTSNSt7__cxx1110_List_baseISt4pairIP6d2BodyS3_ESaIS4_EEE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1110_List_baseISt4pairIP6d2BodyS3_ESaIS4_EE10_List_implE", !15, i64 0}
!15 = !{!"_ZTSNSt8__detail17_List_node_headerE", !16, i64 0, !17, i64 16}
!16 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!17 = !{!"long", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSSt6vectorIP6d2NodeSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIP6d2NodeSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP6d2NodeSaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP6d2NodeSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!10, !18, i64 40}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTS6d2Node", !6, i64 0, !7, i64 8, !26, i64 24, !27, i64 32, !6, i64 64}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"_ZTS6d2AABB", !28, i64 0, !28, i64 8, !6, i64 16, !6, i64 24}
!28 = !{!"_ZTS6d2Vec2", !18, i64 0, !18, i64 4}


; 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.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6d2Node10UpdateAABBEf(ptr noundef nonnull align 8 dereferenceable(72), float noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10d2AABBTree10InsertNodeEP6d2NodePS1_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, ptr noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10d2AABBTree6UpdateEv(ptr noundef nonnull align 8 dereferenceable(72) %0) unnamed_addr #3 align 2 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %34, label %6

6:                                                ; preds = %1
  %7 = tail call noundef zeroext i1 @_ZNK6d2Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(72) %5)
  br i1 %7, label %8, label %12

8:                                                ; preds = %6
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = load float, ptr %10, align 8, !tbaa !22
  tail call void @_ZN6d2Node10UpdateAABBEf(ptr noundef nonnull align 8 dereferenceable(72) %9, float noundef %11)
  br label %34

12:                                               ; preds = %6
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZNSt6vectorIP6d2NodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  tail call void @_ZN10d2AABBTree16UpdateNodeHelperEP6d2NodeRSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef %14, ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %15 = tail call ptr @_ZNSt6vectorIP6d2NodeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  store ptr %15, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %16 = tail call ptr @_ZNSt6vectorIP6d2NodeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  store ptr %16, ptr %3, align 8
  %17 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP6d2NodeSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12
  %18 = getelementptr inbounds i8, ptr %0, i64 40
  br label %19

._crit_edge:                                      ; preds = %30, %12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @_ZNSt6vectorIP6d2NodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  br label %34

19:                                               ; preds = %.lr.ph, %30
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP6d2NodeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %21 = load ptr, ptr %20, align 8, !tbaa !23
  %22 = load ptr, ptr %21, align 8, !tbaa !24
  %23 = call noundef ptr @_ZNK6d2Node10GetSiblingEv(ptr noundef nonnull align 8 dereferenceable(72) %21)
  %24 = load ptr, ptr %22, align 8, !tbaa !24
  %.not19 = icmp eq ptr %24, null
  br i1 %.not19, label %30, label %25

25:                                               ; preds = %19
  %26 = getelementptr inbounds i8, ptr %24, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !23
  %28 = icmp eq ptr %22, %27
  %29 = getelementptr inbounds i8, ptr %24, i64 16
  %spec.select = select i1 %28, ptr %26, ptr %29
  br label %30

30:                                               ; preds = %25, %19
  %.0 = phi ptr [ %4, %19 ], [ %spec.select, %25 ]
  store ptr %24, ptr %23, align 8, !tbaa !24
  store ptr %23, ptr %.0, align 8, !tbaa !23
  call void @_ZdlPvm(ptr noundef nonnull %22, i64 noundef 72) #7
  %31 = load float, ptr %18, align 8, !tbaa !22
  call void @_ZN6d2Node10UpdateAABBEf(ptr noundef nonnull align 8 dereferenceable(72) %21, float noundef %31)
  call void @_ZN10d2AABBTree10InsertNodeEP6d2NodePS1_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull %21, ptr noundef nonnull %4)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP6d2NodeSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %33 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP6d2NodeSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %33, label %19, label %._crit_edge

34:                                               ; preds = %1, %._crit_edge, %8
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP6d2NodeSaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10d2AABBTree16UpdateNodeHelperEP6d2NodeRSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIP6d2NodeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIP6d2NodeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP6d2NodeSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP6d2NodeSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

attributes #0 = { nobuiltin nounwind "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 uwtable "min-legal-vector-width"="64" "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { builtin 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, !8, i64 8}
!6 = !{!"_ZTS10d2AABBTree", !7, i64 0, !8, i64 8, !11, i64 16, !17, i64 40, !18, i64 48}
!7 = !{!"_ZTS12d2Broadphase"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSNSt7__cxx114listISt4pairIP6d2BodyS3_ESaIS4_EEE", !12, i64 0}
!12 = !{!"_ZTSNSt7__cxx1110_List_baseISt4pairIP6d2BodyS3_ESaIS4_EEE", !13, i64 0}
!13 = !{!"_ZTSNSt7__cxx1110_List_baseISt4pairIP6d2BodyS3_ESaIS4_EE10_List_implE", !14, i64 0}
!14 = !{!"_ZTSNSt8__detail17_List_node_headerE", !15, i64 0, !16, i64 16}
!15 = !{!"_ZTSNSt8__detail15_List_node_baseE", !8, i64 0, !8, i64 8}
!16 = !{!"long", !9, i64 0}
!17 = !{!"float", !9, i64 0}
!18 = !{!"_ZTSSt6vectorIP6d2NodeSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIP6d2NodeSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIP6d2NodeSaIS1_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP6d2NodeSaIS1_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!22 = !{!6, !17, i64 40}
!23 = !{!8, !8, i64 0}
!24 = !{!25, !8, i64 0}
!25 = !{!"_ZTS6d2Node", !8, i64 0, !9, i64 8, !26, i64 24, !27, i64 32, !8, i64 64}
!26 = !{!"bool", !9, i64 0}
!27 = !{!"_ZTS6d2AABB", !28, i64 0, !28, i64 8, !8, i64 16, !8, i64 24}
!28 = !{!"_ZTS6d2Vec2", !17, i64 0, !17, i64 4}


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