; LLVM IR from niessner/Matterport :: code/gaps/apps/mpview/mp.ll (ZN8MPRegionD2Ev)

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

%struct.MPRegion = type { ptr, i32, ptr, i32, %class.RNArray.1, %class.RNArray.6, %class.RNArray.4, %class.RNArray.8, %class.R3Point, double, %class.R3Box, ptr }
%class.RNArray.1 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.RNArray.6 = type { %class.RNVArray }
%class.RNArray.4 = type { %class.RNVArray }
%class.RNArray.8 = type { %class.RNVArray }
%class.R3Point = type { [3 x double] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8MPRegion14RemovePanoramaEP10MPPanorama(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef) #2 align 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 void @_ZN8MPRegion12RemoveObjectEP8MPObject(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef) #2 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8MPRegionD2Ev(ptr noundef nonnull align 8 dereferenceable(192) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  br label %4

4:                                                ; preds = %13, %1
  %5 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 4
  %6 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %7 unwind label %76

7:                                                ; preds = %4
  %8 = icmp sgt i32 %6, 0
  br i1 %8, label %9, label %14

9:                                                ; preds = %7
  %10 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 4
  %11 = invoke noundef ptr @_ZNK7RNArrayIP10MPPanoramaE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %12 unwind label %76

12:                                               ; preds = %9
  invoke void @_ZN8MPRegion14RemovePanoramaEP10MPPanorama(ptr noundef nonnull align 8 dereferenceable(192) %3, ptr noundef %11)
          to label %13 unwind label %76

13:                                               ; preds = %12
  br label %4, !llvm.loop !9

14:                                               ; preds = %7
  br label %15

15:                                               ; preds = %24, %14
  %16 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 5
  %17 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %18 unwind label %76

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

20:                                               ; preds = %18
  %21 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 5
  %22 = invoke noundef ptr @_ZNK7RNArrayIP9MPSurfaceE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %23 unwind label %76

23:                                               ; preds = %20
  invoke void @_ZN8MPRegion13RemoveSurfaceEP9MPSurface(ptr noundef nonnull align 8 dereferenceable(192) %3, ptr noundef %22)
          to label %24 unwind label %76

24:                                               ; preds = %23
  br label %15, !llvm.loop !11

25:                                               ; preds = %18
  br label %26

26:                                               ; preds = %35, %25
  %27 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 6
  %28 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %27)
          to label %29 unwind label %76

29:                                               ; preds = %26
  %30 = icmp sgt i32 %28, 0
  br i1 %30, label %31, label %36

31:                                               ; preds = %29
  %32 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 6
  %33 = invoke noundef ptr @_ZNK7RNArrayIP8MPObjectE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %32)
          to label %34 unwind label %76

34:                                               ; preds = %31
  invoke void @_ZN8MPRegion12RemoveObjectEP8MPObject(ptr noundef nonnull align 8 dereferenceable(192) %3, ptr noundef %33)
          to label %35 unwind label %76

35:                                               ; preds = %34
  br label %26, !llvm.loop !12

36:                                               ; preds = %29
  br label %37

37:                                               ; preds = %46, %36
  %38 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 7
  %39 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %38)
          to label %40 unwind label %76

40:                                               ; preds = %37
  %41 = icmp sgt i32 %39, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %40
  %43 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 7
  %44 = invoke noundef ptr @_ZNK7RNArrayIP8MPPortalE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %43)
          to label %45 unwind label %76

45:                                               ; preds = %42
  invoke void @_ZN8MPRegion12RemovePortalEP8MPPortal(ptr noundef nonnull align 8 dereferenceable(192) %3, ptr noundef %44)
          to label %46 unwind label %76

46:                                               ; preds = %45
  br label %37, !llvm.loop !13

47:                                               ; preds = %40
  %48 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %55

51:                                               ; preds = %47
  %52 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  invoke void @_ZN7MPLevel12RemoveRegionEP8MPRegion(ptr noundef nonnull align 8 dereferenceable(120) %53, ptr noundef %3)
          to label %54 unwind label %76

54:                                               ; preds = %51
  br label %55

55:                                               ; preds = %54, %47
  %56 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !27
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %63

59:                                               ; preds = %55
  %60 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !27
  invoke void @_ZN7MPHouse12RemoveRegionEP8MPRegion(ptr noundef nonnull align 8 dereferenceable(376) %61, ptr noundef %3)
          to label %62 unwind label %76

62:                                               ; preds = %59
  br label %63

63:                                               ; preds = %62, %55
  %64 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 11
  %65 = load ptr, ptr %64, align 8, !tbaa !28
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %70

67:                                               ; preds = %63
  %68 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 11
  %69 = load ptr, ptr %68, align 8, !tbaa !28
  call void @free(ptr noundef %69) #5
  br label %70

70:                                               ; preds = %67, %63
  %71 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 10
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %71) #5
  %72 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 7
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %72) #5
  %73 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 6
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %73) #5
  %74 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 5
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %74) #5
  %75 = getelementptr inbounds %struct.MPRegion, ptr %3, i32 0, i32 4
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %75) #5
  ret void

76:                                               ; preds = %59, %51, %45, %42, %37, %34, %31, %26, %23, %20, %15, %12, %9, %4
  %77 = landingpad { ptr, i32 }
          catch ptr null
  %78 = extractvalue { ptr, i32 } %77, 0
  call void @__clang_call_terminate(ptr %78) #6
  unreachable
}

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 = { 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 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 #5 = { nounwind }
attributes #6 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !6, i64 16}
!15 = !{!"_ZTS8MPRegion", !6, i64 0, !16, i64 8, !6, i64 16, !16, i64 24, !17, i64 32, !19, i64 48, !20, i64 64, !21, i64 80, !22, i64 96, !23, i64 120, !24, i64 128, !6, i64 184}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTS7RNArrayIP10MPPanoramaE", !18, i64 0}
!18 = !{!"_ZTS8RNVArray", !6, i64 0, !16, i64 8, !16, i64 12}
!19 = !{!"_ZTS7RNArrayIP9MPSurfaceE", !18, i64 0}
!20 = !{!"_ZTS7RNArrayIP8MPObjectE", !18, i64 0}
!21 = !{!"_ZTS7RNArrayIP8MPPortalE", !18, i64 0}
!22 = !{!"_ZTS7R3Point", !7, i64 0}
!23 = !{!"double", !7, i64 0}
!24 = !{!"_ZTS5R3Box", !25, i64 0, !22, i64 8, !22, i64 32}
!25 = !{!"_ZTS7R3Solid", !26, i64 0}
!26 = !{!"_ZTS7R3Shape"}
!27 = !{!15, !6, i64 0}
!28 = !{!15, !6, i64 184}


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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8MPRegionD2Ev(ptr noundef nonnull align 8 dereferenceable(192) %0) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  br label %3

3:                                                ; preds = %9, %1
  %4 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %7, label %.preheader9

.preheader9:                                      ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  br label %10

7:                                                ; preds = %3
  %8 = invoke noundef ptr @_ZNK7RNArrayIP10MPPanoramaE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %9 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

9:                                                ; preds = %7
  invoke void @_ZN8MPRegion14RemovePanoramaEP10MPPanorama(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %8)
          to label %3 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, !llvm.loop !5

10:                                               ; preds = %.preheader9, %16
  %11 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %14, label %.preheader5

.preheader5:                                      ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 64
  br label %17

14:                                               ; preds = %10
  %15 = invoke noundef ptr @_ZNK7RNArrayIP9MPSurfaceE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %16 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit

16:                                               ; preds = %14
  invoke void @_ZN8MPRegion13RemoveSurfaceEP9MPSurface(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %15)
          to label %10 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit, !llvm.loop !7

17:                                               ; preds = %.preheader5, %23
  %18 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %21, label %.preheader

.preheader:                                       ; preds = %17
  %20 = getelementptr inbounds i8, ptr %0, i64 80
  br label %24

21:                                               ; preds = %17
  %22 = invoke noundef ptr @_ZNK7RNArrayIP8MPObjectE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %23 unwind label %.loopexit.split-lp.loopexit

23:                                               ; preds = %21
  invoke void @_ZN8MPRegion12RemoveObjectEP8MPObject(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %22)
          to label %17 unwind label %.loopexit.split-lp.loopexit, !llvm.loop !8

24:                                               ; preds = %.preheader, %29
  %25 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %27, label %30

27:                                               ; preds = %24
  %28 = invoke noundef ptr @_ZNK7RNArrayIP8MPPortalE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %29 unwind label %.loopexit

29:                                               ; preds = %27
  invoke void @_ZN8MPRegion12RemovePortalEP8MPPortal(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %28)
          to label %24 unwind label %.loopexit, !llvm.loop !9

30:                                               ; preds = %24
  %31 = getelementptr inbounds i8, ptr %0, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !10
  %.not = icmp eq ptr %32, null
  br i1 %.not, label %34, label %33

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

34:                                               ; preds = %33, %30
  %35 = load ptr, ptr %0, align 8, !tbaa !26
  %.not3 = icmp eq ptr %35, null
  br i1 %.not3, label %37, label %36

36:                                               ; preds = %34
  invoke void @_ZN7MPHouse12RemoveRegionEP8MPRegion(ptr noundef nonnull align 8 dereferenceable(376) %35, ptr noundef nonnull %0)
          to label %37 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp

37:                                               ; preds = %36, %34
  %38 = getelementptr inbounds i8, ptr %0, i64 184
  %39 = load ptr, ptr %38, align 8, !tbaa !27
  %.not4 = icmp eq ptr %39, null
  br i1 %.not4, label %41, label %40

40:                                               ; preds = %37
  tail call void @free(ptr noundef nonnull %39) #6
  br label %41

41:                                               ; preds = %40, %37
  %42 = getelementptr inbounds i8, ptr %0, i64 128
  tail call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %42) #6
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #6
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  ret void

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

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

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

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

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp: ; preds = %36, %33
  %lpad.loopexit.split-lp13 = 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, %.loopexit.split-lp.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.loopexit6, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit10, %.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit12, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp13, %.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) #7
  unreachable
}

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 = { 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { 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 = distinct !{!8, !6}
!9 = distinct !{!9, !6}
!10 = !{!11, !12, i64 16}
!11 = !{!"_ZTS8MPRegion", !12, i64 0, !15, i64 8, !12, i64 16, !15, i64 24, !16, i64 32, !18, i64 48, !19, i64 64, !20, i64 80, !21, i64 96, !22, i64 120, !23, i64 128, !12, i64 184}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"int", !13, i64 0}
!16 = !{!"_ZTS7RNArrayIP10MPPanoramaE", !17, i64 0}
!17 = !{!"_ZTS8RNVArray", !12, i64 0, !15, i64 8, !15, i64 12}
!18 = !{!"_ZTS7RNArrayIP9MPSurfaceE", !17, i64 0}
!19 = !{!"_ZTS7RNArrayIP8MPObjectE", !17, i64 0}
!20 = !{!"_ZTS7RNArrayIP8MPPortalE", !17, i64 0}
!21 = !{!"_ZTS7R3Point", !13, i64 0}
!22 = !{!"double", !13, i64 0}
!23 = !{!"_ZTS5R3Box", !24, i64 0, !21, i64 8, !21, i64 32}
!24 = !{!"_ZTS7R3Solid", !25, i64 0}
!25 = !{!"_ZTS7R3Shape"}
!26 = !{!11, !12, i64 0}
!27 = !{!11, !12, i64 184}


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