; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Graphics/R3SceneNode.ll (ZNK11R3SceneNode9LocalBBoxEv)

; 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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

@R3null_box = external global %class.R3Box, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK11R3SceneNode7ElementEi(ptr noundef nonnull align 8 dereferenceable(432), i32 noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK11R3SceneNode9ReferenceEi(ptr noundef nonnull align 8 dereferenceable(432), i32 noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK11R3SceneNode5ChildEi(ptr noundef nonnull align 8 dereferenceable(432), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNK11R3SceneNode4BBoxEv(ptr noundef nonnull align 8 dereferenceable(432)) #4 align 2

declare void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3SceneNode9LocalBBoxEv(ptr dead_on_unwind noalias writable sret(%class.R3Box) align 8 %0, ptr noundef nonnull align 8 dereferenceable(432) %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) @R3null_box)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %33, %2
  %16 = load i32, ptr %6, align 4, !tbaa !9
  %17 = invoke noundef i32 @_ZNK11R3SceneNode9NElementsEv(ptr noundef nonnull align 8 dereferenceable(432) %14)
          to label %18 unwind label %21

18:                                               ; preds = %15
  %19 = icmp slt i32 %16, %17
  br i1 %19, label %25, label %20

20:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %41

21:                                               ; preds = %15
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %7, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %8, align 4
  br label %40

25:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = invoke noundef ptr @_ZNK11R3SceneNode7ElementEi(ptr noundef nonnull align 8 dereferenceable(432) %14, i32 noundef %26)
          to label %28 unwind label %36

28:                                               ; preds = %25
  store ptr %27, ptr %9, align 8, !tbaa !5
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK14R3SceneElement4BBoxEv(ptr noundef nonnull align 8 dereferenceable(96) %29)
          to label %31 unwind label %36

31:                                               ; preds = %28
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %30)
          to label %32 unwind label %36

32:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %33

33:                                               ; preds = %32
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %6, align 4, !tbaa !9
  br label %15, !llvm.loop !11

36:                                               ; preds = %31, %28, %25
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %7, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %40

40:                                               ; preds = %36, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %99

41:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %60, %41
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = invoke noundef i32 @_ZNK11R3SceneNode11NReferencesEv(ptr noundef nonnull align 8 dereferenceable(432) %14)
          to label %45 unwind label %48

45:                                               ; preds = %42
  %46 = icmp slt i32 %43, %44
  br i1 %46, label %52, label %47

47:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %68

48:                                               ; preds = %42
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %7, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %8, align 4
  br label %67

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = invoke noundef ptr @_ZNK11R3SceneNode9ReferenceEi(ptr noundef nonnull align 8 dereferenceable(432) %14, i32 noundef %53)
          to label %55 unwind label %63

55:                                               ; preds = %52
  store ptr %54, ptr %11, align 8, !tbaa !5
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK16R3SceneReference4BBoxEv(ptr noundef nonnull align 8 dereferenceable(48) %56)
          to label %58 unwind label %63

58:                                               ; preds = %55
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %57)
          to label %59 unwind label %63

59:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %10, align 4, !tbaa !9
  br label %42, !llvm.loop !13

63:                                               ; preds = %58, %55, %52
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %7, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %67

67:                                               ; preds = %63, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %99

68:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %87, %68
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = invoke noundef i32 @_ZNK11R3SceneNode9NChildrenEv(ptr noundef nonnull align 8 dereferenceable(432) %14)
          to label %72 unwind label %75

72:                                               ; preds = %69
  %73 = icmp slt i32 %70, %71
  br i1 %73, label %79, label %74

74:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %95

75:                                               ; preds = %69
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %7, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %8, align 4
  br label %94

79:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = invoke noundef ptr @_ZNK11R3SceneNode5ChildEi(ptr noundef nonnull align 8 dereferenceable(432) %14, i32 noundef %80)
          to label %82 unwind label %90

82:                                               ; preds = %79
  store ptr %81, ptr %13, align 8, !tbaa !5
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK11R3SceneNode4BBoxEv(ptr noundef nonnull align 8 dereferenceable(432) %83)
          to label %85 unwind label %90

85:                                               ; preds = %82
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %84)
          to label %86 unwind label %90

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

87:                                               ; preds = %86
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %12, align 4, !tbaa !9
  br label %69, !llvm.loop !14

90:                                               ; preds = %85, %82, %79
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %7, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %94

94:                                               ; preds = %90, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %99

95:                                               ; preds = %74
  store i1 true, ptr %5, align 1
  %96 = load i1, ptr %5, align 1
  br i1 %96, label %98, label %97

97:                                               ; preds = %95
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #6
  br label %98

98:                                               ; preds = %97, %95
  ret void

99:                                               ; preds = %94, %67, %40
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #6
  br label %100

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

declare void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNK14R3SceneElement4BBoxEv(ptr noundef nonnull align 8 dereferenceable(96)) #3 align 2

declare noundef nonnull align 8 dereferenceable(56) ptr @_ZNK16R3SceneReference4BBoxEv(ptr noundef nonnull align 8 dereferenceable(48)) #5

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { "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 }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; 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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

@R3null_box = external global %class.R3Box, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK11R3SceneNode7ElementEi(ptr noundef nonnull align 8 dereferenceable(432), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK11R3SceneNode9ReferenceEi(ptr noundef nonnull align 8 dereferenceable(432), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK11R3SceneNode5ChildEi(ptr noundef nonnull align 8 dereferenceable(432), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNK11R3SceneNode4BBoxEv(ptr noundef nonnull align 8 dereferenceable(432)) local_unnamed_addr #3 align 2

declare void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3SceneNode9LocalBBoxEv(ptr dead_on_unwind noalias nonnull writable sret(%class.R3Box) align 8 %0, ptr noundef nonnull align 8 dereferenceable(432) %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) @R3null_box)
  %3 = tail call noundef i32 @_ZNK11R3SceneNode9NElementsEv(ptr noundef nonnull align 8 dereferenceable(432) %1)
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.preheader20

.preheader20:                                     ; preds = %11, %2
  %5 = tail call noundef i32 @_ZNK11R3SceneNode11NReferencesEv(ptr noundef nonnull align 8 dereferenceable(432) %1)
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph23, label %.preheader

.lr.ph:                                           ; preds = %2, %11
  %.01521 = phi i32 [ %12, %11 ], [ 0, %2 ]
  %7 = invoke noundef ptr @_ZNK11R3SceneNode7ElementEi(ptr noundef nonnull align 8 dereferenceable(432) %1, i32 noundef %.01521)
          to label %8 unwind label %15

8:                                                ; preds = %.lr.ph
  %9 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK14R3SceneElement4BBoxEv(ptr noundef nonnull align 8 dereferenceable(96) %7)
          to label %10 unwind label %15

10:                                               ; preds = %8
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %9)
          to label %11 unwind label %15

11:                                               ; preds = %10
  %12 = add nuw nsw i32 %.01521, 1
  %13 = tail call noundef i32 @_ZNK11R3SceneNode9NElementsEv(ptr noundef nonnull align 8 dereferenceable(432) %1)
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %.lr.ph, label %.preheader20, !llvm.loop !5

15:                                               ; preds = %10, %8, %.lr.ph
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %39

.preheader:                                       ; preds = %23, %.preheader20
  %17 = tail call noundef i32 @_ZNK11R3SceneNode9NChildrenEv(ptr noundef nonnull align 8 dereferenceable(432) %1)
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph25, label %._crit_edge

.lr.ph23:                                         ; preds = %.preheader20, %23
  %.01622 = phi i32 [ %24, %23 ], [ 0, %.preheader20 ]
  %19 = invoke noundef ptr @_ZNK11R3SceneNode9ReferenceEi(ptr noundef nonnull align 8 dereferenceable(432) %1, i32 noundef %.01622)
          to label %20 unwind label %27

20:                                               ; preds = %.lr.ph23
  %21 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK16R3SceneReference4BBoxEv(ptr noundef nonnull align 8 dereferenceable(48) %19)
          to label %22 unwind label %27

22:                                               ; preds = %20
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %21)
          to label %23 unwind label %27

23:                                               ; preds = %22
  %24 = add nuw nsw i32 %.01622, 1
  %25 = tail call noundef i32 @_ZNK11R3SceneNode11NReferencesEv(ptr noundef nonnull align 8 dereferenceable(432) %1)
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %.lr.ph23, label %.preheader, !llvm.loop !7

27:                                               ; preds = %22, %20, %.lr.ph23
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %39

.lr.ph25:                                         ; preds = %.preheader, %33
  %.024 = phi i32 [ %34, %33 ], [ 0, %.preheader ]
  %29 = invoke noundef ptr @_ZNK11R3SceneNode5ChildEi(ptr noundef nonnull align 8 dereferenceable(432) %1, i32 noundef %.024)
          to label %30 unwind label %37

30:                                               ; preds = %.lr.ph25
  %31 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK11R3SceneNode4BBoxEv(ptr noundef nonnull align 8 dereferenceable(432) %29)
          to label %32 unwind label %37

32:                                               ; preds = %30
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %31)
          to label %33 unwind label %37

33:                                               ; preds = %32
  %34 = add nuw nsw i32 %.024, 1
  %35 = tail call noundef i32 @_ZNK11R3SceneNode9NChildrenEv(ptr noundef nonnull align 8 dereferenceable(432) %1)
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph25, label %._crit_edge, !llvm.loop !8

37:                                               ; preds = %32, %30, %.lr.ph25
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %39

._crit_edge:                                      ; preds = %33, %.preheader
  ret void

39:                                               ; preds = %37, %27, %15
  %.pn = phi { ptr, i32 } [ %16, %15 ], [ %28, %27 ], [ %38, %37 ]
  tail call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #5
  resume { ptr, i32 } %.pn
}

declare void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNK14R3SceneElement4BBoxEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(56) ptr @_ZNK16R3SceneReference4BBoxEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4

attributes #0 = { 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 = { 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 #2 = { 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 #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 = { "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 }

!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"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


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