; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes (R3MeshSearchTree)

; 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.R3MeshSearchTreeNode = type { ptr, [2 x ptr], double, i32, %class.RNArray, %class.RNArray }
%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3MeshSearchTreeFace = type { ptr, double, i32, i32 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1

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

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #1

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #4 align 2

declare void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16R3MeshSearchTree5EmptyEP20R3MeshSearchTreeNode(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %10, i32 0, i32 1
  %12 = getelementptr inbounds [2 x ptr], ptr %11, i64 0, i64 0
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %30

15:                                               ; preds = %2
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %16, i32 0, i32 1
  %18 = getelementptr inbounds [2 x ptr], ptr %17, i64 0, i64 0
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN16R3MeshSearchTree5EmptyEP20R3MeshSearchTreeNode(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef %19)
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %20, i32 0, i32 1
  %22 = getelementptr inbounds [2 x ptr], ptr %21, i64 0, i64 0
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %15
  call void @_ZN20R3MeshSearchTreeNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %23) #5
  call void @_ZdlPvm(ptr noundef %23, i64 noundef 72) #6
  br label %26

26:                                               ; preds = %25, %15
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds [2 x ptr], ptr %28, i64 0, i64 0
  store ptr null, ptr %29, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %26, %2
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %31, i32 0, i32 1
  %33 = getelementptr inbounds [2 x ptr], ptr %32, i64 0, i64 1
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %51

36:                                               ; preds = %30
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %37, i32 0, i32 1
  %39 = getelementptr inbounds [2 x ptr], ptr %38, i64 0, i64 1
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  call void @_ZN16R3MeshSearchTree5EmptyEP20R3MeshSearchTreeNode(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef %40)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %41, i32 0, i32 1
  %43 = getelementptr inbounds [2 x ptr], ptr %42, i64 0, i64 1
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %47, label %46

46:                                               ; preds = %36
  call void @_ZN20R3MeshSearchTreeNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %44) #5
  call void @_ZdlPvm(ptr noundef %44, i64 noundef 72) #6
  br label %47

47:                                               ; preds = %46, %36
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds [2 x ptr], ptr %49, i64 0, i64 1
  store ptr null, ptr %50, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %47, %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %82, %51
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %54, i32 0, i32 5
  %56 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %55)
  %57 = icmp slt i32 %53, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %85

59:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %60, i32 0, i32 5
  %62 = load i32, ptr %5, align 4, !tbaa !9
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16) %61, i32 noundef %62)
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  store ptr %64, ptr %6, align 8, !tbaa !5
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %66, align 8, !tbaa !11
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %70, label %69

69:                                               ; preds = %59
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.7, i32 noundef 272, ptr noundef @.str.2)
  br label %70

70:                                               ; preds = %69, %59
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %71, i32 0, i32 2
  %73 = load i32, ptr %72, align 8, !tbaa !11
  %74 = add nsw i32 %73, -1
  store i32 %74, ptr %72, align 8, !tbaa !11
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %81

76:                                               ; preds = %70
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = icmp eq ptr %77, null
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  call void @_ZdlPvm(ptr noundef %77, i64 noundef 24) #6
  br label %80

80:                                               ; preds = %79, %76
  br label %81

81:                                               ; preds = %80, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %5, align 4, !tbaa !9
  br label %52, !llvm.loop !14

85:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %116, %85
  %87 = load i32, ptr %7, align 4, !tbaa !9
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %88, i32 0, i32 4
  %90 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %89)
  %91 = icmp slt i32 %87, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %119

93:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %94, i32 0, i32 4
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16) %95, i32 noundef %96)
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  store ptr %98, ptr %8, align 8, !tbaa !5
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %99, i32 0, i32 2
  %101 = load i32, ptr %100, align 8, !tbaa !11
  %102 = icmp sgt i32 %101, 0
  br i1 %102, label %104, label %103

103:                                              ; preds = %93
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.7, i32 noundef 279, ptr noundef @.str.2)
  br label %104

104:                                              ; preds = %103, %93
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %class.R3MeshSearchTreeFace, ptr %105, i32 0, i32 2
  %107 = load i32, ptr %106, align 8, !tbaa !11
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr %106, align 8, !tbaa !11
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %115

110:                                              ; preds = %104
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = icmp eq ptr %111, null
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  call void @_ZdlPvm(ptr noundef %111, i64 noundef 24) #6
  br label %114

114:                                              ; preds = %113, %110
  br label %115

115:                                              ; preds = %114, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %7, align 4, !tbaa !9
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %7, align 4, !tbaa !9
  br label %86, !llvm.loop !16

119:                                              ; preds = %92
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %120, i32 0, i32 5
  call void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %121, i32 noundef 0)
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %class.R3MeshSearchTreeNode, ptr %122, i32 0, i32 4
  call void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %123, i32 noundef 0)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN20R3MeshSearchTreeNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3 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 = { "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 = { 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 = { 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 = { nounwind }
attributes #6 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS20R3MeshSearchTreeFace", !6, i64 0, !13, i64 8, !10, i64 16, !10, i64 20}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; 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 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [98 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1

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

declare void @_Z7RNAbortPKcz(ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

declare void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16R3MeshSearchTree5EmptyEP20R3MeshSearchTreeNode(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) local_unnamed_addr #3 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %10, label %5

5:                                                ; preds = %2
  tail call void @_ZN16R3MeshSearchTree5EmptyEP20R3MeshSearchTreeNode(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %4)
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %9, label %8

8:                                                ; preds = %5
  tail call void @_ZN20R3MeshSearchTreeNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %6) #4
  tail call void @_ZdlPvm(ptr noundef nonnull %6, i64 noundef 72) #5
  br label %9

9:                                                ; preds = %8, %5
  store ptr null, ptr %3, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %9, %2
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %.not33 = icmp eq ptr %12, null
  br i1 %.not33, label %18, label %13

13:                                               ; preds = %10
  tail call void @_ZN16R3MeshSearchTree5EmptyEP20R3MeshSearchTreeNode(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %12)
  %14 = load ptr, ptr %11, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  tail call void @_ZN20R3MeshSearchTreeNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %14) #4
  tail call void @_ZdlPvm(ptr noundef nonnull %14, i64 noundef 72) #5
  br label %17

17:                                               ; preds = %16, %13
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %17, %10
  %19 = getelementptr inbounds i8, ptr %1, i64 56
  %20 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %19)
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %35, %18
  %22 = getelementptr inbounds i8, ptr %1, i64 40
  %23 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph40, label %._crit_edge

.lr.ph:                                           ; preds = %18, %35
  %.038 = phi i32 [ %36, %35 ], [ 0, %18 ]
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16) %19, i32 noundef %.038)
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %28 = load i32, ptr %27, align 8, !tbaa !9
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %.lr.ph
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.7, i32 noundef 272, ptr noundef nonnull @.str.2)
  %.pre = load i32, ptr %27, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %30, %.lr.ph
  %32 = phi i32 [ %.pre, %30 ], [ %28, %.lr.ph ]
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %27, align 8, !tbaa !9
  %.not36 = icmp eq i32 %33, 0
  br i1 %.not36, label %34, label %35

34:                                               ; preds = %31
  tail call void @_ZdlPvm(ptr noundef nonnull %26, i64 noundef 24) #5
  br label %35

35:                                               ; preds = %34, %31
  %36 = add nuw nsw i32 %.038, 1
  %37 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %19)
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph, label %.preheader, !llvm.loop !13

._crit_edge:                                      ; preds = %49, %.preheader
  tail call void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %19, i32 noundef 0)
  tail call void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %22, i32 noundef 0)
  ret void

.lr.ph40:                                         ; preds = %.preheader, %49
  %.02639 = phi i32 [ %50, %49 ], [ 0, %.preheader ]
  %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP20R3MeshSearchTreeFaceEixEi(ptr noundef nonnull align 8 dereferenceable(16) %22, i32 noundef %.02639)
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %42 = load i32, ptr %41, align 8, !tbaa !9
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %45, label %44

44:                                               ; preds = %.lr.ph40
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.7, i32 noundef 279, ptr noundef nonnull @.str.2)
  %.pre42 = load i32, ptr %41, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %44, %.lr.ph40
  %46 = phi i32 [ %.pre42, %44 ], [ %42, %.lr.ph40 ]
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr %41, align 8, !tbaa !9
  %.not35 = icmp eq i32 %47, 0
  br i1 %.not35, label %48, label %49

48:                                               ; preds = %45
  tail call void @_ZdlPvm(ptr noundef nonnull %40, i64 noundef 24) #5
  br label %49

49:                                               ; preds = %48, %45
  %50 = add nuw nsw i32 %.02639, 1
  %51 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.lr.ph40, label %._crit_edge, !llvm.loop !15
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN20R3MeshSearchTreeNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #2 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { nounwind }
attributes #5 = { 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, !12, i64 16}
!10 = !{!"_ZTS20R3MeshSearchTreeFace", !6, i64 0, !11, i64 8, !12, i64 16, !12, i64 20}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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