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

; 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] }
%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 }

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11R3SceneNode10UpdateBBoxEv(ptr noundef nonnull align 8 dereferenceable(432) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %class.R3Box, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %class.R3Box, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %class.R3Box, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8
  %17 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 9
  %18 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(56) @R3null_box)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %35, %1
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 5
  %22 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %21)
  %23 = icmp slt i32 %20, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %42

25:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %26 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 5
  %27 = load i32, ptr %3, align 4, !tbaa !9
  %28 = call noundef ptr @_ZNK7RNArrayIP14R3SceneElementE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %26, i32 noundef %27)
  store ptr %28, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %5) #6
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK14R3SceneElement4BBoxEv(ptr noundef nonnull align 8 dereferenceable(96) %29)
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(56) %30)
  %31 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 8
  invoke void @_ZN5R3Box9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %32 unwind label %38

32:                                               ; preds = %25
  %33 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 9
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %33, ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %34 unwind label %38

34:                                               ; preds = %32
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %35

35:                                               ; preds = %34
  %36 = load i32, ptr %3, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !9
  br label %19, !llvm.loop !11

38:                                               ; preds = %32, %25
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %6, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %7, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %100

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

43:                                               ; preds = %68, %42
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 6
  %46 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %45)
  %47 = icmp slt i32 %44, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %75

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %50 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 6
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = call noundef ptr @_ZNK7RNArrayIP16R3SceneReferenceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %50, i32 noundef %51)
  store ptr %52, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = call noundef ptr @_ZNK16R3SceneReference15ReferencedSceneEv(ptr noundef nonnull align 8 dereferenceable(48) %53)
  store ptr %54, ptr %11, align 8, !tbaa !5
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %58, label %57

57:                                               ; preds = %49
  store i32 7, ptr %9, align 4
  br label %65

58:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 56, ptr %12) #6
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK7R3Scene4BBoxEv(ptr noundef nonnull align 8 dereferenceable(352) %59)
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef nonnull align 8 dereferenceable(56) %60)
  %61 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 8
  invoke void @_ZN5R3Box9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef nonnull align 8 dereferenceable(8) %61)
          to label %62 unwind label %71

62:                                               ; preds = %58
  %63 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 9
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %63, ptr noundef nonnull align 8 dereferenceable(56) %12)
          to label %64 unwind label %71

64:                                               ; preds = %62
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #6
  store i32 0, ptr %9, align 4
  br label %65

65:                                               ; preds = %64, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %66 = load i32, ptr %9, align 4
  switch i32 %66, label %105 [
    i32 0, label %67
    i32 7, label %68
  ]

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67, %65
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %8, align 4, !tbaa !9
  br label %43, !llvm.loop !13

71:                                               ; preds = %62, %58
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %6, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %7, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %100

75:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %92, %75
  %77 = load i32, ptr %13, align 4, !tbaa !9
  %78 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 4
  %79 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
  %80 = icmp slt i32 %77, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %99

82:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %83 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 4
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = call noundef ptr @_ZNK7RNArrayIP11R3SceneNodeE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %83, i32 noundef %84)
  store ptr %85, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %15) #6
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK11R3SceneNode4BBoxEv(ptr noundef nonnull align 8 dereferenceable(432) %86)
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 8 dereferenceable(56) %87)
  %88 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 8
  invoke void @_ZN5R3Box9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 8 dereferenceable(8) %88)
          to label %89 unwind label %95

89:                                               ; preds = %82
  %90 = getelementptr inbounds %class.R3SceneNode, ptr %16, i32 0, i32 9
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %90, ptr noundef nonnull align 8 dereferenceable(56) %15)
          to label %91 unwind label %95

91:                                               ; preds = %89
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %15) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %13, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %13, align 4, !tbaa !9
  br label %76, !llvm.loop !14

95:                                               ; preds = %89, %82
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %6, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %7, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %15) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %100

99:                                               ; preds = %81
  ret void

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

105:                                              ; preds = %65
  unreachable
}

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

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

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

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)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNK7R3Scene4BBoxEv(ptr noundef nonnull align 8 dereferenceable(352)) #5 align 2

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 = { 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 = { 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 #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 ptr @_ZNK7RNArrayIP14R3SceneElementE3KthEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11R3SceneNode10UpdateBBoxEv(ptr noundef nonnull align 8 dereferenceable(432) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.R3Box, align 8
  %3 = alloca %class.R3Box, align 8
  %4 = alloca %class.R3Box, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 360
  %6 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(56) @R3null_box)
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  %8 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.preheader22

.lr.ph:                                           ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 88
  br label %15

.preheader22:                                     ; preds = %19, %1
  %11 = getelementptr inbounds i8, ptr %0, i64 64
  %12 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph25, label %.preheader

.lr.ph25:                                         ; preds = %.preheader22
  %14 = getelementptr inbounds i8, ptr %0, i64 88
  br label %29

15:                                               ; preds = %.lr.ph, %19
  %.023 = phi i32 [ 0, %.lr.ph ], [ %20, %19 ]
  %16 = call noundef ptr @_ZNK7RNArrayIP14R3SceneElementE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %.023)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #6
  %17 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK14R3SceneElement4BBoxEv(ptr noundef nonnull align 8 dereferenceable(96) %16)
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(56) %17)
  invoke void @_ZN5R3Box9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %18 unwind label %23

18:                                               ; preds = %15
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(56) %2)
          to label %19 unwind label %23

19:                                               ; preds = %18
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #6
  %20 = add nuw nsw i32 %.023, 1
  %21 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %15, label %.preheader22, !llvm.loop !5

23:                                               ; preds = %18, %15
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #6
  br label %52

.preheader:                                       ; preds = %36, %.preheader22
  %25 = getelementptr inbounds i8, ptr %0, i64 32
  %26 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %25)
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph27, label %._crit_edge

.lr.ph27:                                         ; preds = %.preheader
  %28 = getelementptr inbounds i8, ptr %0, i64 88
  br label %42

29:                                               ; preds = %.lr.ph25, %36
  %.01924 = phi i32 [ 0, %.lr.ph25 ], [ %37, %36 ]
  %30 = call noundef ptr @_ZNK7RNArrayIP16R3SceneReferenceE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %.01924)
  %31 = call noundef ptr @_ZNK16R3SceneReference15ReferencedSceneEv(ptr noundef nonnull align 8 dereferenceable(48) %30)
  %.not = icmp eq ptr %31, null
  br i1 %.not, label %36, label %32

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #6
  %33 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK7R3Scene4BBoxEv(ptr noundef nonnull align 8 dereferenceable(352) %31)
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 8 dereferenceable(56) %33)
  invoke void @_ZN5R3Box9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %34 unwind label %40

34:                                               ; preds = %32
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(56) %3)
          to label %35 unwind label %40

35:                                               ; preds = %34
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #6
  br label %36

36:                                               ; preds = %29, %35
  %37 = add nuw nsw i32 %.01924, 1
  %38 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %29, label %.preheader, !llvm.loop !7

40:                                               ; preds = %34, %32
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #6
  br label %52

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

42:                                               ; preds = %.lr.ph27, %46
  %.01626 = phi i32 [ 0, %.lr.ph27 ], [ %47, %46 ]
  %43 = call noundef ptr @_ZNK7RNArrayIP11R3SceneNodeE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %25, i32 noundef %.01626)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #6
  %44 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK11R3SceneNode4BBoxEv(ptr noundef nonnull align 8 dereferenceable(432) %43)
  call void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 8 dereferenceable(56) %44)
  invoke void @_ZN5R3Box9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %45 unwind label %50

45:                                               ; preds = %42
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %5, ptr noundef nonnull align 8 dereferenceable(56) %4)
          to label %46 unwind label %50

46:                                               ; preds = %45
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #6
  %47 = add nuw nsw i32 %.01626, 1
  %48 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %25)
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %42, label %._crit_edge, !llvm.loop !8

50:                                               ; preds = %45, %42
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #6
  br label %52

52:                                               ; preds = %50, %40, %23
  %.pn = phi { ptr, i32 } [ %24, %23 ], [ %41, %40 ], [ %51, %50 ]
  resume { ptr, i32 } %.pn
}

; 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

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

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 #5 align 2

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

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

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 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 = { 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 = { 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


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