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

; 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.R3SceneNode = type { ptr, i32, ptr, i32, %class.RNArray, %class.RNArray.0, %class.RNArray.1, %class.RNSymbolTable, %class.R3Affine, %class.R3Box, ptr, ptr }
%class.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNArray.1 = type { %class.RNVArray }
%class.RNSymbolTable = type { %class.RNMap }
%class.RNMap = type { ptr }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.R4Matrix = type { [4 x [4 x double]] }
%class.RNFlags = type { i64 }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN11R3SceneNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(432) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %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 %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %24, %1
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 5
  %13 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %14 unwind label %93

14:                                               ; preds = %10
  %15 = icmp slt i32 %11, %13
  br i1 %15, label %17, label %16

16:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %27

17:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %18 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 5
  %19 = load i32, ptr %3, align 4, !tbaa !9
  %20 = invoke noundef ptr @_ZNK7RNArrayIP14R3SceneElementE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %18, i32 noundef %19)
          to label %21 unwind label %93

21:                                               ; preds = %17
  store ptr %20, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN11R3SceneNode13RemoveElementEP14R3SceneElement(ptr noundef nonnull align 8 dereferenceable(432) %9, ptr noundef %22)
          to label %23 unwind label %93

23:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %24

24:                                               ; preds = %23
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %3, align 4, !tbaa !9
  br label %10, !llvm.loop !11

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

28:                                               ; preds = %42, %27
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 6
  %31 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
          to label %32 unwind label %93

32:                                               ; preds = %28
  %33 = icmp slt i32 %29, %31
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %36 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 6
  %37 = load i32, ptr %5, align 4, !tbaa !9
  %38 = invoke noundef ptr @_ZNK7RNArrayIP16R3SceneReferenceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %36, i32 noundef %37)
          to label %39 unwind label %93

39:                                               ; preds = %35
  store ptr %38, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN11R3SceneNode15RemoveReferenceEP16R3SceneReference(ptr noundef nonnull align 8 dereferenceable(432) %9, ptr noundef %40)
          to label %41 unwind label %93

41:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %5, align 4, !tbaa !9
  br label %28, !llvm.loop !13

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

46:                                               ; preds = %60, %45
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 4
  %49 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %48)
          to label %50 unwind label %93

50:                                               ; preds = %46
  %51 = icmp slt i32 %47, %49
  br i1 %51, label %53, label %52

52:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %63

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %54 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 4
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = invoke noundef ptr @_ZNK7RNArrayIP11R3SceneNodeE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %54, i32 noundef %55)
          to label %57 unwind label %93

57:                                               ; preds = %53
  store ptr %56, ptr %8, align 8, !tbaa !5
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN11R3SceneNode11RemoveChildEPS_(ptr noundef nonnull align 8 dereferenceable(432) %9, ptr noundef %58)
          to label %59 unwind label %93

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

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

63:                                               ; preds = %52
  %64 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !15
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %71

67:                                               ; preds = %63
  %68 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 2
  %69 = load ptr, ptr %68, align 8, !tbaa !15
  invoke void @_ZN11R3SceneNode11RemoveChildEPS_(ptr noundef nonnull align 8 dereferenceable(432) %69, ptr noundef %9)
          to label %70 unwind label %93

70:                                               ; preds = %67
  br label %71

71:                                               ; preds = %70, %63
  %72 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !32
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %79

75:                                               ; preds = %71
  %76 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !32
  invoke void @_ZN7R3Scene10RemoveNodeEP11R3SceneNode(ptr noundef nonnull align 8 dereferenceable(352) %77, ptr noundef %9)
          to label %78 unwind label %93

78:                                               ; preds = %75
  br label %79

79:                                               ; preds = %78, %71
  %80 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 10
  %81 = load ptr, ptr %80, align 8, !tbaa !33
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %86

83:                                               ; preds = %79
  %84 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 10
  %85 = load ptr, ptr %84, align 8, !tbaa !33
  call void @free(ptr noundef %85) #7
  br label %86

86:                                               ; preds = %83, %79
  %87 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 9
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %87) #7
  %88 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 8
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %88) #7
  %89 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 7
  call void @_ZN5RNMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %89) #7
  %90 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 6
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %90) #7
  %91 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 5
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %91) #7
  %92 = getelementptr inbounds %class.R3SceneNode, ptr %9, i32 0, i32 4
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %92) #7
  ret void

93:                                               ; preds = %75, %67, %57, %53, %46, %39, %35, %28, %21, %17, %10
  %94 = landingpad { ptr, i32 }
          catch ptr null
  %95 = extractvalue { ptr, i32 } %94, 0
  call void @__clang_call_terminate(ptr %95) #8
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11R3SceneNode13RemoveElementEP14R3SceneElement(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef) #5 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
declare dso_local noundef ptr @_ZNK7RNArrayIP16R3SceneReferenceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11R3SceneNode15RemoveReferenceEP16R3SceneReference(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11R3SceneNode11RemoveChildEPS_(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef) #5 align 2

declare void @_ZN7R3Scene10RemoveNodeEP11R3SceneNode(ptr noundef nonnull align 8 dereferenceable(352), ptr noundef) #6

; Function Attrs: nounwind
declare void @free(ptr noundef) #0

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 = { 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 = { 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 = { noinline noreturn nounwind uwtable "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 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 = { "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 #7 = { nounwind }
attributes #8 = { noreturn 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}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTS11R3SceneNode", !6, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !17, i64 32, !19, i64 48, !20, i64 64, !21, i64 80, !23, i64 88, !28, i64 360, !6, i64 416, !6, i64 424}
!17 = !{!"_ZTS7RNArrayIP11R3SceneNodeE", !18, i64 0}
!18 = !{!"_ZTS8RNVArray", !6, i64 0, !10, i64 8, !10, i64 12}
!19 = !{!"_ZTS7RNArrayIP14R3SceneElementE", !18, i64 0}
!20 = !{!"_ZTS7RNArrayIP16R3SceneReferenceE", !18, i64 0}
!21 = !{!"_ZTS13RNSymbolTableIPKcE", !22, i64 0}
!22 = !{!"_ZTS5RNMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcE", !6, i64 0}
!23 = !{!"_ZTS8R3Affine", !24, i64 0, !25, i64 8, !25, i64 136, !26, i64 264}
!24 = !{!"_ZTS16R3Transformation"}
!25 = !{!"_ZTS8R4Matrix", !7, i64 0}
!26 = !{!"_ZTS7RNFlags", !27, i64 0}
!27 = !{!"long", !7, i64 0}
!28 = !{!"_ZTS5R3Box", !29, i64 0, !31, i64 8, !31, i64 32}
!29 = !{!"_ZTS7R3Solid", !30, i64 0}
!30 = !{!"_ZTS7R3Shape"}
!31 = !{!"_ZTS7R3Point", !7, i64 0}
!32 = !{!16, !6, i64 0}
!33 = !{!16, !6, i64 416}


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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN11R3SceneNodeD2Ev(ptr noundef nonnull align 8 dereferenceable(432) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 48
  %3 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.preheader19

.preheader19:                                     ; preds = %10, %1
  %5 = getelementptr inbounds i8, ptr %0, i64 64
  %6 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph32, label %.preheader

.lr.ph:                                           ; preds = %1, %10
  %.030 = phi i32 [ %11, %10 ], [ 0, %1 ]
  %8 = invoke noundef ptr @_ZNK7RNArrayIP14R3SceneElementE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.030)
          to label %9 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit

9:                                                ; preds = %.lr.ph
  invoke void @_ZN11R3SceneNode13RemoveElementEP14R3SceneElement(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef %8)
          to label %10 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit

10:                                               ; preds = %9
  %11 = add nuw nsw i32 %.030, 1
  %12 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %.lr.ph, label %.preheader19, !llvm.loop !5

.preheader:                                       ; preds = %19, %.preheader19
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph35, label %._crit_edge

.lr.ph32:                                         ; preds = %.preheader19, %19
  %.01331 = phi i32 [ %20, %19 ], [ 0, %.preheader19 ]
  %17 = invoke noundef ptr @_ZNK7RNArrayIP16R3SceneReferenceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %.01331)
          to label %18 unwind label %.loopexit.split-lp.loopexit

18:                                               ; preds = %.lr.ph32
  invoke void @_ZN11R3SceneNode15RemoveReferenceEP16R3SceneReference(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef %17)
          to label %19 unwind label %.loopexit.split-lp.loopexit

19:                                               ; preds = %18
  %20 = add nuw nsw i32 %.01331, 1
  %21 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %.lr.ph32, label %.preheader, !llvm.loop !7

._crit_edge:                                      ; preds = %27, %.preheader
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !8
  %.not = icmp eq ptr %24, null
  br i1 %.not, label %32, label %31

.lr.ph35:                                         ; preds = %.preheader, %27
  %.01234 = phi i32 [ %28, %27 ], [ 0, %.preheader ]
  %25 = invoke noundef ptr @_ZNK7RNArrayIP11R3SceneNodeE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef %.01234)
          to label %26 unwind label %.loopexit

26:                                               ; preds = %.lr.ph35
  invoke void @_ZN11R3SceneNode11RemoveChildEPS_(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef %25)
          to label %27 unwind label %.loopexit

27:                                               ; preds = %26
  %28 = add nuw nsw i32 %.01234, 1
  %29 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %.lr.ph35, label %._crit_edge, !llvm.loop !29

31:                                               ; preds = %._crit_edge
  invoke void @_ZN11R3SceneNode11RemoveChildEPS_(ptr noundef nonnull align 8 dereferenceable(432) %24, ptr noundef nonnull %0)
          to label %32 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp

32:                                               ; preds = %31, %._crit_edge
  %33 = load ptr, ptr %0, align 8, !tbaa !30
  %.not17 = icmp eq ptr %33, null
  br i1 %.not17, label %35, label %34

34:                                               ; preds = %32
  invoke void @_ZN7R3Scene10RemoveNodeEP11R3SceneNode(ptr noundef nonnull align 8 dereferenceable(352) %33, ptr noundef nonnull %0)
          to label %35 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp

35:                                               ; preds = %34, %32
  %36 = getelementptr inbounds i8, ptr %0, i64 416
  %37 = load ptr, ptr %36, align 8, !tbaa !31
  %.not18 = icmp eq ptr %37, null
  br i1 %.not18, label %39, label %38

38:                                               ; preds = %35
  tail call void @free(ptr noundef nonnull %37) #7
  br label %39

39:                                               ; preds = %38, %35
  %40 = getelementptr inbounds i8, ptr %0, i64 360
  tail call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %40) #7
  %41 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %41) #7
  %42 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZN5RNMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %42) #7
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #7
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  ret void

.loopexit:                                        ; preds = %.lr.ph35, %26
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %18, %.lr.ph32
  %lpad.loopexit20 = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit:    ; preds = %.lr.ph, %9
  %lpad.loopexit23 = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp: ; preds = %31, %34
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit20, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit23, %.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp ]
  %43 = extractvalue { ptr, i32 } %lpad.phi, 0
  tail call void @__clang_call_terminate(ptr %43) #8
  unreachable
}

; 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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11R3SceneNode13RemoveElementEP14R3SceneElement(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11R3SceneNode15RemoveReferenceEP16R3SceneReference(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11R3SceneNode11RemoveChildEPS_(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef) local_unnamed_addr #4 align 2

declare void @_ZN7R3Scene10RemoveNodeEP11R3SceneNode(ptr noundef nonnull align 8 dereferenceable(352), ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

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 = { 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 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 = { noinline noreturn nounwind uwtable "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!9, !10, i64 16}
!9 = !{!"_ZTS11R3SceneNode", !10, i64 0, !13, i64 8, !10, i64 16, !13, i64 24, !14, i64 32, !16, i64 48, !17, i64 64, !18, i64 80, !20, i64 88, !25, i64 360, !10, i64 416, !10, i64 424}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"int", !11, i64 0}
!14 = !{!"_ZTS7RNArrayIP11R3SceneNodeE", !15, i64 0}
!15 = !{!"_ZTS8RNVArray", !10, i64 0, !13, i64 8, !13, i64 12}
!16 = !{!"_ZTS7RNArrayIP14R3SceneElementE", !15, i64 0}
!17 = !{!"_ZTS7RNArrayIP16R3SceneReferenceE", !15, i64 0}
!18 = !{!"_ZTS13RNSymbolTableIPKcE", !19, i64 0}
!19 = !{!"_ZTS5RNMapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcE", !10, i64 0}
!20 = !{!"_ZTS8R3Affine", !21, i64 0, !22, i64 8, !22, i64 136, !23, i64 264}
!21 = !{!"_ZTS16R3Transformation"}
!22 = !{!"_ZTS8R4Matrix", !11, i64 0}
!23 = !{!"_ZTS7RNFlags", !24, i64 0}
!24 = !{!"long", !11, i64 0}
!25 = !{!"_ZTS5R3Box", !26, i64 0, !28, i64 8, !28, i64 32}
!26 = !{!"_ZTS7R3Solid", !27, i64 0}
!27 = !{!"_ZTS7R3Shape"}
!28 = !{!"_ZTS7R3Point", !11, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!9, !10, i64 0}
!31 = !{!9, !10, i64 416}


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