; LLVM IR from nbdd0121/GenerationalGC :: Heap.ll (ZN6norlit2gc4Heap4DumpERKNS0_12HeapIteratorE)

; 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.norlit::gc::Heap::Iterable" = type { %"class.norlit::gc::Heap::MemorySpaceIterator" }
%"class.norlit::gc::Heap::MemorySpaceIterator" = type <{ ptr, ptr, ptr, i8, [7 x i8] }>
%"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator" = type { ptr }
%"class.norlit::gc::Heap::Iterable.3" = type { %"class.norlit::gc::Heap::LargeObjectSpaceIterator" }
%"class.norlit::gc::Heap::LargeObjectSpaceIterator" = type { ptr, ptr }
%"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::LargeObjectSpaceIterator>::Iterator" = type { ptr }

@_ZN6norlit2gc4Heap10eden_spaceE = external dso_local global ptr, align 8
@_ZN6norlit2gc4Heap19survivor_from_spaceE = external dso_local global ptr, align 8
@_ZN6norlit2gc4Heap13tenured_spaceE = external dso_local global ptr, 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 uwtable
declare dso_local void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEEC2IJRPNS0_11MemorySpaceEEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6norlit2gc4Heap4DumpERKNS0_12HeapIteratorE(ptr noundef nonnull align 8 dereferenceable(8) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.norlit::gc::Heap::Iterable", align 8
  %5 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %6 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.norlit::gc::Heap::Iterable", align 8
  %10 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %11 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.norlit::gc::Heap::Iterable", align 8
  %15 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %16 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"class.norlit::gc::Heap::Iterable.3", align 8
  %20 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::LargeObjectSpaceIterator>::Iterator", align 8
  %21 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::LargeObjectSpaceIterator>::Iterator", align 8
  %22 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #3
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEEC2IJRPNS0_11MemorySpaceEEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(8) @_ZN6norlit2gc4Heap10eden_spaceE)
  store ptr %4, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  %25 = getelementptr inbounds %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", ptr %5, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %26)
  %28 = getelementptr inbounds %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", ptr %6, i32 0, i32 0
  store ptr %27, ptr %28, align 8
  br label %29

29:                                               ; preds = %39, %1
  %30 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  br i1 %30, label %32, label %31

31:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  br label %40

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %33 = call noundef ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  store ptr %33, ptr %7, align 8, !tbaa !5
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %34, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %36, i64 0
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef %35)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %39

39:                                               ; preds = %32
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %29

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #3
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEEC2IJRPNS0_11MemorySpaceEEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(8) @_ZN6norlit2gc4Heap19survivor_from_spaceE)
  store ptr %9, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %41)
  %43 = getelementptr inbounds %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", ptr %10, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %44)
  %46 = getelementptr inbounds %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", ptr %11, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  br label %47

47:                                               ; preds = %57, %40
  %48 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  br i1 %48, label %50, label %49

49:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %58

50:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %51 = call noundef ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  store ptr %51, ptr %12, align 8, !tbaa !5
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = load ptr, ptr %52, align 8, !tbaa !9
  %55 = getelementptr inbounds ptr, ptr %54, i64 0
  %56 = load ptr, ptr %55, align 8
  call void %56(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef %53)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %57

57:                                               ; preds = %50
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  br label %47

58:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #3
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEEC2IJRPNS0_11MemorySpaceEEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(8) @_ZN6norlit2gc4Heap13tenured_spaceE)
  store ptr %14, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %59)
  %61 = getelementptr inbounds %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", ptr %15, i32 0, i32 0
  store ptr %60, ptr %61, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %62)
  %64 = getelementptr inbounds %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", ptr %16, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  br label %65

65:                                               ; preds = %75, %58
  %66 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  br i1 %66, label %68, label %67

67:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %76

68:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %69 = call noundef ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  store ptr %69, ptr %17, align 8, !tbaa !5
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = load ptr, ptr %17, align 8, !tbaa !5
  %72 = load ptr, ptr %70, align 8, !tbaa !9
  %73 = getelementptr inbounds ptr, ptr %72, i64 0
  %74 = load ptr, ptr %73, align 8
  call void %74(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef %71)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %75

75:                                               ; preds = %68
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  br label %65

76:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #3
  call void @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEEC2IJEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16) %19)
  store ptr %19, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %77 = load ptr, ptr %18, align 8, !tbaa !5
  %78 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %77)
  %79 = getelementptr inbounds %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::LargeObjectSpaceIterator>::Iterator", ptr %20, i32 0, i32 0
  store ptr %78, ptr %79, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %80 = load ptr, ptr %18, align 8, !tbaa !5
  %81 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %80)
  %82 = getelementptr inbounds %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::LargeObjectSpaceIterator>::Iterator", ptr %21, i32 0, i32 0
  store ptr %81, ptr %82, align 8
  br label %83

83:                                               ; preds = %93, %76
  %84 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21)
  br i1 %84, label %86, label %85

85:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %94

86:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %87 = call noundef ptr @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
  store ptr %87, ptr %22, align 8, !tbaa !5
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = load ptr, ptr %22, align 8, !tbaa !5
  %90 = load ptr, ptr %88, align 8, !tbaa !9
  %91 = getelementptr inbounds ptr, ptr %90, i64 0
  %92 = load ptr, ptr %91, align 8
  call void %92(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef %89)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  br label %93

93:                                               ; preds = %86
  call void @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
  br label %83

94:                                               ; preds = %85
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

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

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

%"class.norlit::gc::Heap::Iterable" = type { %"class.norlit::gc::Heap::MemorySpaceIterator" }
%"class.norlit::gc::Heap::MemorySpaceIterator" = type <{ ptr, ptr, ptr, i8, [7 x i8] }>
%"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator" = type { ptr }
%"class.norlit::gc::Heap::Iterable.3" = type { %"class.norlit::gc::Heap::LargeObjectSpaceIterator" }
%"class.norlit::gc::Heap::LargeObjectSpaceIterator" = type { ptr, ptr }
%"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::LargeObjectSpaceIterator>::Iterator" = type { ptr }

@_ZN6norlit2gc4Heap10eden_spaceE = external dso_local global ptr, align 8
@_ZN6norlit2gc4Heap19survivor_from_spaceE = external dso_local global ptr, align 8
@_ZN6norlit2gc4Heap13tenured_spaceE = external dso_local global ptr, align 8

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6norlit2gc4Heap4DumpERKNS0_12HeapIteratorE(ptr noundef nonnull align 8 dereferenceable(8) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"class.norlit::gc::Heap::Iterable", align 8
  %3 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %4 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %5 = alloca %"class.norlit::gc::Heap::Iterable", align 8
  %6 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %7 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %8 = alloca %"class.norlit::gc::Heap::Iterable", align 8
  %9 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %10 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::MemorySpaceIterator>::Iterator", align 8
  %11 = alloca %"class.norlit::gc::Heap::Iterable.3", align 8
  %12 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::LargeObjectSpaceIterator>::Iterator", align 8
  %13 = alloca %"class.norlit::gc::Heap::Iterable<norlit::gc::Heap::LargeObjectSpaceIterator>::Iterator", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #3
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEEC2IJRPNS0_11MemorySpaceEEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) @_ZN6norlit2gc4Heap10eden_spaceE)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %14 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  store ptr %14, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %15 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  store ptr %15, ptr %4, align 8
  %16 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEEC2IJRPNS0_11MemorySpaceEEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(8) @_ZN6norlit2gc4Heap19survivor_from_spaceE)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %17 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  store ptr %17, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %18 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  store ptr %18, ptr %7, align 8
  %19 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  br i1 %19, label %.lr.ph17, label %._crit_edge18

.lr.ph:                                           ; preds = %1, %.lr.ph
  %20 = call noundef ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %21 = load ptr, ptr %0, align 8, !tbaa !5
  %22 = load ptr, ptr %21, align 8
  call void %22(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %20)
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %23 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  br i1 %23, label %.lr.ph, label %._crit_edge

._crit_edge18:                                    ; preds = %.lr.ph17, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #3
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEEC2IJRPNS0_11MemorySpaceEEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(8) @_ZN6norlit2gc4Heap13tenured_spaceE)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %24 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  store ptr %24, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %25 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE3endEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  store ptr %25, ptr %10, align 8
  %26 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  br i1 %26, label %.lr.ph20, label %._crit_edge21

.lr.ph17:                                         ; preds = %._crit_edge, %.lr.ph17
  %27 = call noundef ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %28 = load ptr, ptr %0, align 8, !tbaa !5
  %29 = load ptr, ptr %28, align 8
  call void %29(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %27)
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %30 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  br i1 %30, label %.lr.ph17, label %._crit_edge18

._crit_edge21:                                    ; preds = %.lr.ph20, %._crit_edge18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #3
  call void @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEEC2IJEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  %31 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  store ptr %31, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  %32 = call ptr @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  store ptr %32, ptr %13, align 8
  %33 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  br i1 %33, label %.lr.ph23, label %._crit_edge24

.lr.ph20:                                         ; preds = %._crit_edge18, %.lr.ph20
  %34 = call noundef ptr @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %35 = load ptr, ptr %0, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8
  call void %36(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %34)
  call void @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %37 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_19MemorySpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  br i1 %37, label %.lr.ph20, label %._crit_edge21

._crit_edge24:                                    ; preds = %.lr.ph23, %._crit_edge21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #3
  ret void

.lr.ph23:                                         ; preds = %._crit_edge21, %.lr.ph23
  %38 = call noundef ptr @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
  %39 = load ptr, ptr %0, align 8, !tbaa !5
  %40 = load ptr, ptr %39, align 8
  call void %40(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %38)
  call void @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
  %41 = call noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  br i1 %41, label %.lr.ph23, label %._crit_edge24
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6norlit2gc4Heap8IterableINS1_24LargeObjectSpaceIteratorEE8IteratorneERKS5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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