; LLVM IR from aap/librw :: src/clump.ll (ZN2rw5Clump7destroyEv)

; 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.rw::PluginList" = type { i32, i32, %"struct.rw::LinkList" }
%"struct.rw::LinkList" = type { %"struct.rw::LLLink" }
%"struct.rw::LLLink" = type { ptr, ptr }
%"struct.rw::MemoryFunctions" = type { ptr, ptr, ptr, ptr, ptr }
%"struct.rw::Clump" = type { %"struct.rw::Object", %"struct.rw::LinkList", %"struct.rw::LinkList", %"struct.rw::LinkList", ptr, %"struct.rw::LLLink" }
%"struct.rw::Object" = type { i8, i8, i8, i8, ptr }

@_ZN2rw5Clump12numAllocatedE = external dso_local global i32, align 4
@_ZN2rw5Clump9s_plglistE = external dso_local global %"struct.rw::PluginList", align 8
@.str.3 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN2rw5Clump7destroyEv = external hidden unnamed_addr constant [26 x i8], align 1
@_ZN2rw6Engine8memfuncsE = external global %"struct.rw::MemoryFunctions", align 8

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw6Atomic9fromClumpEPNS_6LLLinkE(ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw5Clump7destroyEv(ptr noundef nonnull align 8 dereferenceable(88) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @_ZN2rw10PluginList8destructEPv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2rw5Clump9s_plglistE, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %14 = getelementptr inbounds %"struct.rw::Clump", ptr %13, i32 0, i32 1
  %15 = getelementptr inbounds %"struct.rw::LinkList", ptr %14, i32 0, i32 0
  %16 = getelementptr inbounds %"struct.rw::LLLink", ptr %15, i32 0, i32 0
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  store ptr %17, ptr %5, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %32, %1
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.rw::LLLink", ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !14
  store ptr %21, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.rw::Clump", ptr %13, i32 0, i32 1
  %24 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
  %25 = icmp ne ptr %22, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noundef ptr @_ZN2rw6Atomic9fromClumpEPNS_6LLLinkE(ptr noundef %28)
  store ptr %29, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN2rw5Clump12removeAtomicEPNS_6AtomicE(ptr noundef nonnull align 8 dereferenceable(88) %13, ptr noundef %30)
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN2rw6Atomic7destroyEv(ptr noundef nonnull align 8 dereferenceable(136) %31)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %32

32:                                               ; preds = %27
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %33, ptr %5, align 8, !tbaa !5
  br label %18, !llvm.loop !15

34:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %35 = getelementptr inbounds %"struct.rw::Clump", ptr %13, i32 0, i32 2
  %36 = getelementptr inbounds %"struct.rw::LinkList", ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %"struct.rw::LLLink", ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  store ptr %38, ptr %8, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %53, %34
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.rw::LLLink", ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  store ptr %42, ptr %7, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.rw::Clump", ptr %13, i32 0, i32 2
  %45 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %44)
  %46 = icmp ne ptr %43, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = call noundef ptr @_ZN2rw5Light9fromClumpEPNS_6LLLinkE(ptr noundef %49)
  store ptr %50, ptr %9, align 8, !tbaa !5
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN2rw5Clump11removeLightEPNS_5LightE(ptr noundef nonnull align 8 dereferenceable(88) %13, ptr noundef %51)
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN2rw5Light7destroyEv(ptr noundef nonnull align 8 dereferenceable(120) %52)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %53

53:                                               ; preds = %48
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %54, ptr %8, align 8, !tbaa !5
  br label %39, !llvm.loop !18

55:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %56 = getelementptr inbounds %"struct.rw::Clump", ptr %13, i32 0, i32 3
  %57 = getelementptr inbounds %"struct.rw::LinkList", ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %"struct.rw::LLLink", ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  store ptr %59, ptr %11, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %74, %55
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.rw::LLLink", ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !14
  store ptr %63, ptr %10, align 8, !tbaa !5
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.rw::Clump", ptr %13, i32 0, i32 3
  %66 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %65)
  %67 = icmp ne ptr %64, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %76

69:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = call noundef ptr @_ZN2rw6Camera9fromClumpEPNS_6LLLinkE(ptr noundef %70)
  store ptr %71, ptr %12, align 8, !tbaa !5
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN2rw5Clump12removeCameraEPNS_6CameraE(ptr noundef nonnull align 8 dereferenceable(88) %13, ptr noundef %72)
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN2rw6Camera7destroyEv(ptr noundef nonnull align 8 dereferenceable(600) %73)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %74

74:                                               ; preds = %69
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %75, ptr %11, align 8, !tbaa !5
  br label %60, !llvm.loop !20

76:                                               ; preds = %68
  %77 = call noundef ptr @_ZNK2rw5Clump8getFrameEv(ptr noundef nonnull align 8 dereferenceable(88) %13)
  store ptr %77, ptr %3, align 8, !tbaa !5
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %82

80:                                               ; preds = %76
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN2rw5Frame16destroyHierarchyEv(ptr noundef nonnull align 8 dereferenceable(200) %81)
  br label %82

82:                                               ; preds = %80, %76
  %83 = getelementptr inbounds %"struct.rw::Clump", ptr %13, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !21
  %85 = icmp eq ptr %84, null
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  br label %89

87:                                               ; preds = %82
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 93, ptr noundef @__PRETTY_FUNCTION__._ZN2rw5Clump7destroyEv) #6
  unreachable

88:                                               ; No predecessors!
  br label %89

89:                                               ; preds = %88, %86
  %90 = load ptr, ptr getelementptr inbounds (%"struct.rw::MemoryFunctions", ptr @_ZN2rw6Engine8memfuncsE, i32 0, i32 2), align 8, !tbaa !22
  call void %90(ptr noundef %13)
  %91 = load i32, ptr @_ZN2rw5Clump12numAllocatedE, align 4, !tbaa !24
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr @_ZN2rw5Clump12numAllocatedE, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void
}

declare void @_ZN2rw10PluginList8destructEPv(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw5Light9fromClumpEPNS_6LLLinkE(ptr noundef) #1 align 2

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

declare void @_ZN2rw5Light7destroyEv(ptr noundef nonnull align 8 dereferenceable(120)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw6Camera9fromClumpEPNS_6LLLinkE(ptr noundef) #1 align 2

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

declare void @_ZN2rw6Camera7destroyEv(ptr noundef nonnull align 8 dereferenceable(600)) #3

declare void @_ZN2rw5Frame16destroyHierarchyEv(ptr noundef nonnull align 8 dereferenceable(200)) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { "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 = { noreturn 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 = { 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 = !{!10, !6, i64 16}
!10 = !{!"_ZTSN2rw5ClumpE", !11, i64 0, !12, i64 16, !12, i64 32, !12, i64 48, !6, i64 64, !13, i64 72}
!11 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!12 = !{!"_ZTSN2rw8LinkListE", !13, i64 0}
!13 = !{!"_ZTSN2rw6LLLinkE", !6, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!10, !6, i64 32}
!18 = distinct !{!18, !16}
!19 = !{!10, !6, i64 48}
!20 = distinct !{!20, !16}
!21 = !{!10, !6, i64 64}
!22 = !{!23, !6, i64 16}
!23 = !{!"_ZTSN2rw15MemoryFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !7, i64 0}


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

%"struct.rw::PluginList" = type { i32, i32, %"struct.rw::LinkList" }
%"struct.rw::LinkList" = type { %"struct.rw::LLLink" }
%"struct.rw::LLLink" = type { ptr, ptr }
%"struct.rw::MemoryFunctions" = type { ptr, ptr, ptr, ptr, ptr }

@_ZN2rw5Clump12numAllocatedE = external dso_local local_unnamed_addr global i32, align 4
@_ZN2rw5Clump9s_plglistE = external dso_local global %"struct.rw::PluginList", align 8
@.str.3 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN2rw5Clump7destroyEv = external hidden unnamed_addr constant [26 x i8], align 1
@_ZN2rw6Engine8memfuncsE = external local_unnamed_addr global %"struct.rw::MemoryFunctions", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK2rw5Clump8getFrameEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw6Atomic9fromClumpEPNS_6LLLinkE(ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw5Clump7destroyEv(ptr noundef nonnull align 8 dereferenceable(88) %0) local_unnamed_addr #1 align 2 {
  tail call void @_ZN2rw10PluginList8destructEPv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2rw5Clump9s_plglistE, ptr noundef nonnull %0)
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8, !tbaa !13
  %5 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %.not27 = icmp eq ptr %3, %5
  br i1 %.not27, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %1
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !14
  %8 = load ptr, ptr %7, align 8, !tbaa !13
  %9 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %.not2429 = icmp eq ptr %7, %9
  br i1 %.not2429, label %._crit_edge33, label %.lr.ph32

.lr.ph:                                           ; preds = %1, %.lr.ph
  %10 = phi ptr [ %12, %.lr.ph ], [ %4, %1 ]
  %.02128 = phi ptr [ %10, %.lr.ph ], [ %3, %1 ]
  %11 = tail call noundef ptr @_ZN2rw6Atomic9fromClumpEPNS_6LLLinkE(ptr noundef nonnull %.02128)
  tail call void @_ZN2rw5Clump12removeAtomicEPNS_6AtomicE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef %11)
  tail call void @_ZN2rw6Atomic7destroyEv(ptr noundef nonnull align 8 dereferenceable(136) %11)
  %12 = load ptr, ptr %10, align 8, !tbaa !13
  %13 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %.not = icmp eq ptr %10, %13
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge33:                                    ; preds = %.lr.ph32, %._crit_edge
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  %15 = load ptr, ptr %14, align 8, !tbaa !17
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %17 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %.not2534 = icmp eq ptr %15, %17
  br i1 %.not2534, label %._crit_edge38, label %.lr.ph37

.lr.ph32:                                         ; preds = %._crit_edge, %.lr.ph32
  %18 = phi ptr [ %20, %.lr.ph32 ], [ %8, %._crit_edge ]
  %.02230 = phi ptr [ %18, %.lr.ph32 ], [ %7, %._crit_edge ]
  %19 = tail call noundef ptr @_ZN2rw5Light9fromClumpEPNS_6LLLinkE(ptr noundef nonnull %.02230)
  tail call void @_ZN2rw5Clump11removeLightEPNS_5LightE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef %19)
  tail call void @_ZN2rw5Light7destroyEv(ptr noundef nonnull align 8 dereferenceable(120) %19)
  %20 = load ptr, ptr %18, align 8, !tbaa !13
  %21 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %.not24 = icmp eq ptr %18, %21
  br i1 %.not24, label %._crit_edge33, label %.lr.ph32, !llvm.loop !18

._crit_edge38:                                    ; preds = %.lr.ph37, %._crit_edge33
  %22 = tail call noundef ptr @_ZNK2rw5Clump8getFrameEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  %.not26 = icmp eq ptr %22, null
  br i1 %.not26, label %28, label %27

.lr.ph37:                                         ; preds = %._crit_edge33, %.lr.ph37
  %23 = phi ptr [ %25, %.lr.ph37 ], [ %16, %._crit_edge33 ]
  %.035 = phi ptr [ %23, %.lr.ph37 ], [ %15, %._crit_edge33 ]
  %24 = tail call noundef ptr @_ZN2rw6Camera9fromClumpEPNS_6LLLinkE(ptr noundef nonnull %.035)
  tail call void @_ZN2rw5Clump12removeCameraEPNS_6CameraE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef %24)
  tail call void @_ZN2rw6Camera7destroyEv(ptr noundef nonnull align 8 dereferenceable(600) %24)
  %25 = load ptr, ptr %23, align 8, !tbaa !13
  %26 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %.not25 = icmp eq ptr %23, %26
  br i1 %.not25, label %._crit_edge38, label %.lr.ph37, !llvm.loop !19

27:                                               ; preds = %._crit_edge38
  tail call void @_ZN2rw5Frame16destroyHierarchyEv(ptr noundef nonnull align 8 dereferenceable(200) %22)
  br label %28

28:                                               ; preds = %27, %._crit_edge38
  %29 = getelementptr inbounds i8, ptr %0, i64 64
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  %31 = icmp eq ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 93, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN2rw5Clump7destroyEv) #4
  unreachable

33:                                               ; preds = %28
  %34 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 16), align 8, !tbaa !21
  tail call void %34(ptr noundef nonnull %0)
  %35 = load i32, ptr @_ZN2rw5Clump12numAllocatedE, align 4, !tbaa !23
  %36 = add nsw i32 %35, -1
  store i32 %36, ptr @_ZN2rw5Clump12numAllocatedE, align 4, !tbaa !23
  ret void
}

declare void @_ZN2rw10PluginList8destructEPv(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2rw6Atomic7destroyEv(ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw5Light9fromClumpEPNS_6LLLinkE(ptr noundef) local_unnamed_addr #0 align 2

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

declare void @_ZN2rw5Light7destroyEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw6Camera9fromClumpEPNS_6LLLinkE(ptr noundef) local_unnamed_addr #0 align 2

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

declare void @_ZN2rw6Camera7destroyEv(ptr noundef nonnull align 8 dereferenceable(600)) local_unnamed_addr #2

declare void @_ZN2rw5Frame16destroyHierarchyEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { 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 #2 = { "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 = { noreturn 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 #4 = { 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, !10, i64 16}
!6 = !{!"_ZTSN2rw5ClumpE", !7, i64 0, !11, i64 16, !11, i64 32, !11, i64 48, !10, i64 64, !12, i64 72}
!7 = !{!"_ZTSN2rw6ObjectE", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !10, i64 8}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN2rw8LinkListE", !12, i64 0}
!12 = !{!"_ZTSN2rw6LLLinkE", !10, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 0}
!14 = !{!6, !10, i64 32}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!6, !10, i64 48}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = !{!6, !10, i64 64}
!21 = !{!22, !10, i64 16}
!22 = !{!"_ZTSN2rw15MemoryFunctionsE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!23 = !{!24, !24, i64 0}
!24 = !{!"int", !8, i64 0}


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