; LLVM IR from atlantis13579/Riemann :: Src/Collision/DynamicAABBTree.ll (ZN7Riemann15DynamicAABBTree9AllocNodeEv)

; 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.Riemann::DynamicAABBTree" = type <{ i32, [4 x i8], %"class.std::vector", i32, i32, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Riemann::DynamicAABBTree::Node" = type <{ %union.anon, %"class.Maths::TAABB3", i32, i32, i32, ptr, i8, [7 x i8] }>
%union.anon = type { i32 }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree9AllocNodeEv = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7Riemann15DynamicAABBTree9AllocNodeEv(ptr noundef nonnull align 8 dereferenceable(44) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 5
  %7 = load i32, ptr %6, align 8, !tbaa !9
  %8 = icmp eq i32 %7, -1
  br i1 %8, label %9, label %69

9:                                                ; preds = %1
  %10 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 3
  %11 = load i32, ptr %10, align 8, !tbaa !16
  %12 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 4
  %13 = load i32, ptr %12, align 4, !tbaa !17
  %14 = icmp eq i32 %11, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %9
  br label %18

16:                                               ; preds = %9
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 623, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree9AllocNodeEv) #4
  unreachable

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  %19 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 4
  %20 = load i32, ptr %19, align 4, !tbaa !17
  %21 = mul nsw i32 %20, 2
  store i32 %21, ptr %19, align 4, !tbaa !17
  %22 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %23 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 4
  %24 = load i32, ptr %23, align 4, !tbaa !17
  %25 = sext i32 %24 to i64
  call void @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %26 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 3
  %27 = load i32, ptr %26, align 8, !tbaa !16
  store i32 %27, ptr %3, align 4, !tbaa !18
  br label %28

28:                                               ; preds = %48, %18
  %29 = load i32, ptr %3, align 4, !tbaa !18
  %30 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 4
  %31 = load i32, ptr %30, align 4, !tbaa !17
  %32 = sub nsw i32 %31, 1
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %51

35:                                               ; preds = %28
  %36 = load i32, ptr %3, align 4, !tbaa !18
  %37 = add nsw i32 %36, 1
  %38 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %39 = load i32, ptr %3, align 4, !tbaa !18
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %40) #5
  %42 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %41, i32 0, i32 0
  store i32 %37, ptr %42, align 8, !tbaa !19
  %43 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %44 = load i32, ptr %3, align 4, !tbaa !18
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %45) #5
  %47 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %46, i32 0, i32 4
  store i32 -1, ptr %47, align 4, !tbaa !20
  br label %48

48:                                               ; preds = %35
  %49 = load i32, ptr %3, align 4, !tbaa !18
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %3, align 4, !tbaa !18
  br label %28, !llvm.loop !26

51:                                               ; preds = %34
  %52 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %53 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 4
  %54 = load i32, ptr %53, align 4, !tbaa !17
  %55 = sub nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %56) #5
  %58 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %57, i32 0, i32 0
  store i32 -1, ptr %58, align 8, !tbaa !19
  %59 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %60 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 4
  %61 = load i32, ptr %60, align 4, !tbaa !17
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %63) #5
  %65 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %64, i32 0, i32 4
  store i32 -1, ptr %65, align 4, !tbaa !20
  %66 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 3
  %67 = load i32, ptr %66, align 8, !tbaa !16
  %68 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 5
  store i32 %67, ptr %68, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %51, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %70 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 5
  %71 = load i32, ptr %70, align 8, !tbaa !9
  store i32 %71, ptr %4, align 4, !tbaa !18
  %72 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %73 = load i32, ptr %4, align 4, !tbaa !18
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %72, i64 noundef %74) #5
  %76 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 8, !tbaa !19
  %78 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 5
  store i32 %77, ptr %78, align 8, !tbaa !9
  %79 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %80 = load i32, ptr %4, align 4, !tbaa !18
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %79, i64 noundef %81) #5
  %83 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %82, i32 0, i32 0
  store i32 -1, ptr %83, align 8, !tbaa !19
  %84 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %85 = load i32, ptr %4, align 4, !tbaa !18
  %86 = sext i32 %85 to i64
  %87 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %86) #5
  %88 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %87, i32 0, i32 2
  store i32 -1, ptr %88, align 4, !tbaa !28
  %89 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %90 = load i32, ptr %4, align 4, !tbaa !18
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %91) #5
  %93 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %92, i32 0, i32 3
  store i32 -1, ptr %93, align 8, !tbaa !29
  %94 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %95 = load i32, ptr %4, align 4, !tbaa !18
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %94, i64 noundef %96) #5
  %98 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %97, i32 0, i32 4
  store i32 0, ptr %98, align 4, !tbaa !20
  %99 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %100 = load i32, ptr %4, align 4, !tbaa !18
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %99, i64 noundef %101) #5
  %103 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %102, i32 0, i32 5
  store ptr null, ptr %103, align 8, !tbaa !30
  %104 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 2
  %105 = load i32, ptr %4, align 4, !tbaa !18
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106) #5
  %108 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %107, i32 0, i32 6
  store i8 0, ptr %108, align 8, !tbaa !31
  %109 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %5, i32 0, i32 3
  %110 = load i32, ptr %109, align 8, !tbaa !16
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %109, align 8, !tbaa !16
  %112 = load i32, ptr %4, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  ret i32 %112
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { noreturn 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 #4 = { noreturn nounwind }
attributes #5 = { 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, !11, i64 40}
!10 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !11, i64 0, !12, i64 8, !11, i64 32, !11, i64 36, !11, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!10, !11, i64 32}
!17 = !{!10, !11, i64 36}
!18 = !{!11, !11, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !11, i64 36}
!21 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !7, i64 0, !22, i64 4, !11, i64 28, !11, i64 32, !11, i64 36, !6, i64 40, !25, i64 48}
!22 = !{!"_ZTSN5Maths6TAABB3IfEE", !23, i64 0, !23, i64 12}
!23 = !{!"_ZTSN5Maths8TVector3IfEE", !24, i64 0, !24, i64 4, !24, i64 8}
!24 = !{!"float", !7, i64 0}
!25 = !{!"bool", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!21, !11, i64 28}
!29 = !{!21, !11, i64 32}
!30 = !{!21, !6, i64 40}
!31 = !{!21, !25, i64 48}


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

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree9AllocNodeEv = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7Riemann15DynamicAABBTree9AllocNodeEv(ptr noundef nonnull align 8 dereferenceable(44) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp eq i32 %3, -1
  br i1 %4, label %5, label %36

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load i32, ptr %6, align 8, !tbaa !15
  %8 = getelementptr inbounds i8, ptr %0, i64 36
  %9 = load i32, ptr %8, align 4, !tbaa !16
  %10 = icmp eq i32 %7, %9
  br i1 %10, label %12, label %11

11:                                               ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 623, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree9AllocNodeEv) #3
  unreachable

12:                                               ; preds = %5
  %13 = shl nsw i32 %7, 1
  store i32 %13, ptr %8, align 4, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = sext i32 %13 to i64
  tail call void @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %15)
  %16 = load i32, ptr %6, align 8, !tbaa !15
  %17 = load i32, ptr %8, align 4, !tbaa !16
  %18 = add nsw i32 %17, -1
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %.lr.ph.preheader, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %12
  %.pre = sext i32 %18 to i64
  br label %._crit_edge

.lr.ph.preheader:                                 ; preds = %12
  %20 = sext i32 %16 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %34, %.lr.ph ]
  %21 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %.pre-phi) #4
  store i32 -1, ptr %21, align 8, !tbaa !17
  %22 = load i32, ptr %8, align 4, !tbaa !16
  %23 = add nsw i32 %22, -1
  %24 = sext i32 %23 to i64
  %25 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %24) #4
  %26 = getelementptr inbounds i8, ptr %25, i64 36
  store i32 -1, ptr %26, align 4, !tbaa !18
  %27 = load i32, ptr %6, align 8, !tbaa !15
  store i32 %27, ptr %2, align 8, !tbaa !5
  br label %36

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %20, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %28 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %indvars.iv) #4
  %29 = trunc nsw i64 %indvars.iv.next to i32
  store i32 %29, ptr %28, align 8, !tbaa !17
  %30 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %indvars.iv) #4
  %31 = getelementptr inbounds i8, ptr %30, i64 36
  store i32 -1, ptr %31, align 4, !tbaa !18
  %32 = load i32, ptr %8, align 4, !tbaa !16
  %33 = add nsw i32 %32, -1
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !24

36:                                               ; preds = %._crit_edge, %1
  %37 = phi i32 [ %27, %._crit_edge ], [ %3, %1 ]
  %38 = getelementptr inbounds i8, ptr %0, i64 8
  %39 = sext i32 %37 to i64
  %40 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #4
  %41 = load i32, ptr %40, align 8, !tbaa !17
  store i32 %41, ptr %2, align 8, !tbaa !5
  %42 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #4
  store i32 -1, ptr %42, align 8, !tbaa !17
  %43 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #4
  %44 = getelementptr inbounds i8, ptr %43, i64 28
  store i32 -1, ptr %44, align 4, !tbaa !26
  %45 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #4
  %46 = getelementptr inbounds i8, ptr %45, i64 32
  store i32 -1, ptr %46, align 8, !tbaa !27
  %47 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #4
  %48 = getelementptr inbounds i8, ptr %47, i64 36
  store i32 0, ptr %48, align 4, !tbaa !18
  %49 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #4
  %50 = getelementptr inbounds i8, ptr %49, i64 40
  store ptr null, ptr %50, align 8, !tbaa !28
  %51 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #4
  %52 = getelementptr inbounds i8, ptr %51, i64 48
  store i8 0, ptr %52, align 8, !tbaa !29
  %53 = getelementptr inbounds i8, ptr %0, i64 32
  %54 = load i32, ptr %53, align 8, !tbaa !15
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %53, align 8, !tbaa !15
  ret i32 %37
}

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 = { noreturn 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 #3 = { noreturn nounwind }
attributes #4 = { 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, !7, i64 40}
!6 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !7, i64 0, !10, i64 8, !7, i64 32, !7, i64 36, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!6, !7, i64 32}
!16 = !{!6, !7, i64 36}
!17 = !{!8, !8, i64 0}
!18 = !{!19, !7, i64 36}
!19 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !8, i64 0, !20, i64 4, !7, i64 28, !7, i64 32, !7, i64 36, !14, i64 40, !23, i64 48}
!20 = !{!"_ZTSN5Maths6TAABB3IfEE", !21, i64 0, !21, i64 12}
!21 = !{!"_ZTSN5Maths8TVector3IfEE", !22, i64 0, !22, i64 4, !22, i64 8}
!22 = !{!"float", !8, i64 0}
!23 = !{!"bool", !8, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!19, !7, i64 28}
!27 = !{!19, !7, i64 32}
!28 = !{!19, !14, i64 40}
!29 = !{!19, !23, i64 48}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass