; LLVM IR from vczh/herodb :: Kernel/Source/Utility (FileBuffer)

; 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.vl::collections::EnumerableForEachIterator" = type { %"class.vl::collections::ForEachIterator", %"class.vl::Ptr.7" }
%"class.vl::collections::ForEachIterator" = type { %"class.vl::Object" }
%"class.vl::Object" = type { ptr }
%"class.vl::Ptr.7" = type { ptr, ptr, ptr, ptr }
%"class.vl::Ptr" = type { ptr, ptr, ptr, ptr }
%"class.vl::database::buffer_internal::FileMapping" = type { %"class.vl::Object", i64, i32, ptr, %"class.vl::collections::Dictionary", i64 }
%"class.vl::collections::Dictionary" = type { %"class.vl::Object", %"class.vl::collections::SortedList", %"class.vl::collections::List", %"class.vl::collections::IEnumerable.6" }
%"class.vl::collections::SortedList" = type { %"class.vl::collections::ListBase.base", %"class.vl::collections::IEnumerable" }
%"class.vl::collections::ListBase.base" = type <{ %"class.vl::collections::ArrayBase.base", i64, i8 }>
%"class.vl::collections::ArrayBase.base" = type { %"class.vl::collections::ListStore", ptr, i64 }
%"class.vl::collections::ListStore" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::collections::List" = type { %"class.vl::collections::ListBase.base.5", %"class.vl::collections::IEnumerable.3" }
%"class.vl::collections::ListBase.base.5" = type <{ %"class.vl::collections::ArrayBase.base.4", i64, i8 }>
%"class.vl::collections::ArrayBase.base.4" = type { %"class.vl::collections::ListStore.2", ptr, i64 }
%"class.vl::collections::ListStore.2" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.3" = type { %"class.vl::Interface" }
%"class.vl::collections::IEnumerable.6" = type { %"class.vl::Interface" }
%"class.vl::database::BufferPageDesc" = type <{ ptr, i64, i8, [7 x i8], i64, i8, [7 x i8] }>

@_ZTIN2vl5ErrorE = external dso_local constant { ptr, ptr }, align 8
@.str.4 = external hidden unnamed_addr constant [109 x i32], align 4

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

; 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 @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

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

; Function Attrs: nounwind
declare i32 @munmap(ptr noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl8database15buffer_internal11FileMapping13UnmapAllPagesEv(ptr noundef nonnull align 8 dereferenceable(152) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca ptr, align 8
  %5 = alloca %"class.vl::collections::EnumerableForEachIterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.vl::Ptr", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #6
  store i8 1, ptr %3, align 1, !tbaa !9
  %11 = load i8, ptr %3, align 1, !tbaa !9, !range !11, !noundef !12
  %12 = trunc i8 %11 to i1
  br i1 %12, label %13, label %71

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #6
  %14 = getelementptr inbounds %"class.vl::database::buffer_internal::FileMapping", ptr %10, i32 0, i32 4
  %15 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database14BufferPageDescEEEmPS4_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %14)
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr %15, i64 %18
  call void @_ZN2vl11collections21CreateForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEEENS0_25EnumerableForEachIteratorIT_EERKNS0_11IEnumerableIS7_EE(ptr dead_on_unwind writable sret(%"class.vl::collections::EnumerableForEachIterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %19)
  store ptr %5, ptr %4, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %69, %13
  %21 = load i8, ptr %3, align 1, !tbaa !9, !range !11, !noundef !12
  %22 = trunc i8 %21 to i1
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  store i32 2, ptr %6, align 4
  call void @_ZN2vl11collections25EnumerableForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %70

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  invoke void @_ZN2vl3PtrINS_8database14BufferPageDescEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %25 unwind label %34

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %65, %25
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = getelementptr inbounds ptr, ptr %28, i64 2
  %30 = load ptr, ptr %29, align 8
  %31 = invoke noundef zeroext i1 %30(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %32 unwind label %38

32:                                               ; preds = %26
  br i1 %31, label %42, label %33

33:                                               ; preds = %32
  store i32 5, ptr %6, align 4
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  br label %68

34:                                               ; preds = %24
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %8, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %9, align 4
  br label %67

38:                                               ; preds = %58, %47, %26
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %8, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %9, align 4
  br label %66

42:                                               ; preds = %32
  %43 = getelementptr inbounds %"class.vl::database::buffer_internal::FileMapping", ptr %10, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  %45 = atomicrmw sub ptr %44, i64 1 seq_cst, align 8
  %46 = sub i64 %45, 1
  br label %47

47:                                               ; preds = %42
  %48 = invoke noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %49 unwind label %38

49:                                               ; preds = %47
  %50 = getelementptr inbounds %"class.vl::database::BufferPageDesc", ptr %48, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !29
  %52 = getelementptr inbounds %"class.vl::database::buffer_internal::FileMapping", ptr %10, i32 0, i32 1
  %53 = load i64, ptr %52, align 8, !tbaa !31
  %54 = call i32 @munmap(ptr noundef %51, i64 noundef %53) #6
  %55 = icmp ne i32 %54, -1
  br i1 %55, label %63, label %56

56:                                               ; preds = %49
  %57 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef @.str.4)
          to label %58 unwind label %59

58:                                               ; preds = %56
  invoke void @__cxa_throw(ptr %57, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %77 unwind label %38

59:                                               ; preds = %56
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %8, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %9, align 4
  call void @__cxa_free_exception(ptr %57) #6
  br label %66

63:                                               ; preds = %49
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  br label %26, !llvm.loop !32

66:                                               ; preds = %59, %38
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  br label %67

67:                                               ; preds = %66, %34
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  call void @_ZN2vl11collections25EnumerableForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  br label %72

68:                                               ; preds = %33
  br label %69

69:                                               ; preds = %68
  store i8 0, ptr %3, align 1, !tbaa !9
  br label %20, !llvm.loop !34

70:                                               ; preds = %23
  br label %71

71:                                               ; preds = %70, %1
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  ret void

72:                                               ; preds = %67
  %73 = load ptr, ptr %8, align 8
  %74 = load i32, ptr %9, align 4
  %75 = insertvalue { ptr, i32 } poison, ptr %73, 0
  %76 = insertvalue { ptr, i32 } %75, i32 %74, 1
  resume { ptr, i32 } %76

77:                                               ; preds = %58
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl11collections21CreateForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEEENS0_25EnumerableForEachIteratorIT_EERKNS0_11IEnumerableIS7_EE(ptr dead_on_unwind noalias writable sret(%"class.vl::collections::EnumerableForEachIterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2vl11collections25EnumerableForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !6, i64 24}
!16 = !{!"_ZTSN2vl8database15buffer_internal11FileMappingE", !17, i64 0, !18, i64 8, !19, i64 16, !6, i64 24, !20, i64 32, !18, i64 144}
!17 = !{!"_ZTSN2vl6ObjectE"}
!18 = !{!"long", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTSN2vl11collections10DictionaryImNS_3PtrINS_8database14BufferPageDescEEEmPS4_EE", !17, i64 0, !21, i64 8, !25, i64 56}
!21 = !{!"_ZTSN2vl11collections10SortedListImmEE", !22, i64 0}
!22 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !23, i64 0, !18, i64 24, !10, i64 32}
!23 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !24, i64 0, !6, i64 8, !18, i64 16}
!24 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !17, i64 0}
!25 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database14BufferPageDescEEEPS4_EE", !26, i64 0}
!26 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database14BufferPageDescEEEPS4_EE", !27, i64 0, !18, i64 24, !10, i64 32}
!27 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database14BufferPageDescEEEEE", !28, i64 0, !6, i64 8, !18, i64 16}
!28 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database14BufferPageDescEEELb0EEE", !17, i64 0}
!29 = !{!30, !6, i64 0}
!30 = !{!"_ZTSN2vl8database14BufferPageDescE", !6, i64 0, !18, i64 8, !10, i64 16, !18, i64 24, !10, i64 32}
!31 = !{!16, !18, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}


; 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.vl::collections::EnumerableForEachIterator" = type { %"class.vl::collections::ForEachIterator", %"class.vl::Ptr.7" }
%"class.vl::collections::ForEachIterator" = type { %"class.vl::Object" }
%"class.vl::Object" = type { ptr }
%"class.vl::Ptr.7" = type { ptr, ptr, ptr, ptr }
%"class.vl::Ptr" = type { ptr, ptr, ptr, ptr }

@_ZTIN2vl5ErrorE = external dso_local constant { ptr, ptr }, align 8
@.str.4 = external hidden unnamed_addr constant [109 x i32], align 4

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: nounwind
declare i32 @munmap(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl8database15buffer_internal11FileMapping13UnmapAllPagesEv(ptr noundef nonnull align 8 dereferenceable(152) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
.critedge:
  %1 = alloca %"class.vl::collections::EnumerableForEachIterator", align 8
  %2 = alloca %"class.vl::Ptr", align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %1) #6
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = tail call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database14BufferPageDescEEEmPS4_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %3)
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr %4, i64 %7
  call void @_ZN2vl11collections21CreateForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEEENS0_25EnumerableForEachIteratorIT_EERKNS0_11IEnumerableIS7_EE(ptr dead_on_unwind nonnull writable sret(%"class.vl::collections::EnumerableForEachIterator") align 8 %1, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  br label %11

11:                                               ; preds = %18, %.critedge
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8
  %15 = invoke noundef zeroext i1 %14(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %16 unwind label %.loopexit

16:                                               ; preds = %11
  br i1 %15, label %18, label %17

17:                                               ; preds = %16
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  call void @_ZN2vl11collections25EnumerableForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %1) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %1) #6
  ret void

.loopexit:                                        ; preds = %11
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %30

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

18:                                               ; preds = %16
  %19 = load ptr, ptr %9, align 8, !tbaa !8
  %20 = atomicrmw sub ptr %19, i64 1 seq_cst, align 8
  %21 = call noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %22 = load ptr, ptr %21, align 8, !tbaa !25
  %23 = load i64, ptr %10, align 8, !tbaa !27
  %24 = call i32 @munmap(ptr noundef %22, i64 noundef %23) #6
  %.not = icmp eq i32 %24, -1
  br i1 %.not, label %25, label %11, !llvm.loop !28

25:                                               ; preds = %18
  %26 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull @.str.4)
          to label %27 unwind label %28

27:                                               ; preds = %25
  invoke void @__cxa_throw(ptr nonnull %26, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #7
          to label %31 unwind label %.loopexit.split-lp

28:                                               ; preds = %25
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %26) #6
  br label %30

30:                                               ; preds = %.loopexit, %.loopexit.split-lp, %28
  %.pn = phi { ptr, i32 } [ %29, %28 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  call void @_ZN2vl11collections25EnumerableForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %1) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn

31:                                               ; preds = %27
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl11collections21CreateForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEEENS0_25EnumerableForEachIteratorIT_EERKNS0_11IEnumerableIS7_EE(ptr dead_on_unwind noalias writable sret(%"class.vl::collections::EnumerableForEachIterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2vl11collections25EnumerableForEachIteratorINS_3PtrINS_8database14BufferPageDescEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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"}
!8 = !{!9, !14, i64 24}
!9 = !{!"_ZTSN2vl8database15buffer_internal11FileMappingE", !10, i64 0, !11, i64 8, !13, i64 16, !14, i64 24, !15, i64 32, !11, i64 144}
!10 = !{!"_ZTSN2vl6ObjectE"}
!11 = !{!"long", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"int", !12, i64 0}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!"_ZTSN2vl11collections10DictionaryImNS_3PtrINS_8database14BufferPageDescEEEmPS4_EE", !10, i64 0, !16, i64 8, !21, i64 56}
!16 = !{!"_ZTSN2vl11collections10SortedListImmEE", !17, i64 0}
!17 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !18, i64 0, !11, i64 24, !20, i64 32}
!18 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !19, i64 0, !14, i64 8, !11, i64 16}
!19 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !10, i64 0}
!20 = !{!"bool", !12, i64 0}
!21 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database14BufferPageDescEEEPS4_EE", !22, i64 0}
!22 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database14BufferPageDescEEEPS4_EE", !23, i64 0, !11, i64 24, !20, i64 32}
!23 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database14BufferPageDescEEEEE", !24, i64 0, !14, i64 8, !11, i64 16}
!24 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database14BufferPageDescEEELb0EEE", !10, i64 0}
!25 = !{!26, !14, i64 0}
!26 = !{!"_ZTSN2vl8database14BufferPageDescE", !14, i64 0, !11, i64 8, !20, i64 16, !11, i64 24, !20, i64 32}
!27 = !{!9, !11, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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