; 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::Ptr" = type { ptr, ptr, ptr, ptr }
%"struct.vl::database::IdObject" = type { i64 }
%"class.vl::database::buffer_internal::FileUseMasks" = type { %"class.vl::Object", i32, i64, %"class.vl::collections::List.8", i64, ptr }
%"class.vl::Object" = type { ptr }
%"class.vl::collections::List.8" = 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::database::BufferPageDesc" = type <{ ptr, i64, i8, [7 x i8], i64, i8, [7 x i8] }>

@_ZTIN2vl5ErrorE = external dso_local constant { ptr, ptr }, align 8
@.str.7 = external hidden unnamed_addr constant [127 x i32], align 4
@.str.8 = external hidden unnamed_addr constant [100 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 uwtable
declare dso_local void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr") align 8, ptr noundef nonnull align 8 dereferenceable(152), i64) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare i32 @msync(ptr noundef, i64 noundef, i32 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database15buffer_internal12FileUseMasks10GetUseMaskENS0_8IdObjectImLl1EEE(ptr noundef nonnull align 8 dereferenceable(88) %0, i64 %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.vl::database::IdObject", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.vl::database::IdObject", align 8
  %11 = alloca %"class.vl::Ptr", align 8
  %12 = alloca %"struct.vl::database::IdObject", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  %18 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %3, i32 0, i32 0
  store i64 %1, ptr %18, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 64, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %20 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %3, i32 0, i32 0
  %21 = load i64, ptr %20, align 8, !tbaa !11
  %22 = load i64, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %19, i32 0, i32 4
  %24 = load i64, ptr %23, align 8, !tbaa !13
  %25 = mul i64 %22, %24
  %26 = udiv i64 %21, %25
  store i64 %26, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %27 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %3, i32 0, i32 0
  %28 = load i64, ptr %27, align 8, !tbaa !11
  %29 = load i64, ptr %5, align 8, !tbaa !9
  %30 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %19, i32 0, i32 4
  %31 = load i64, ptr %30, align 8, !tbaa !13
  %32 = mul i64 %29, %31
  %33 = urem i64 %28, %32
  store i64 %33, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %34 = load i64, ptr %7, align 8, !tbaa !9
  %35 = load i64, ptr %5, align 8, !tbaa !9
  %36 = udiv i64 %34, %35
  %37 = add i64 1, %36
  store i64 %37, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %38 = load i64, ptr %7, align 8, !tbaa !9
  %39 = load i64, ptr %5, align 8, !tbaa !9
  %40 = urem i64 %38, %39
  store i64 %40, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %41 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %19, i32 0, i32 3
  %42 = load i64, ptr %6, align 8, !tbaa !9
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %41, i64 noundef %42)
  %44 = load i64, ptr %43, align 8, !tbaa !9
  call void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef %44)
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  %45 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %19, i32 0, i32 5
  %46 = load ptr, ptr %45, align 8, !tbaa !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %10, i64 8, i1 false), !tbaa.struct !23
  %47 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %12, i32 0, i32 0
  %48 = load i64, ptr %47, align 8
  call void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind writable sret(%"class.vl::Ptr") align 8 %11, ptr noundef nonnull align 8 dereferenceable(152) %46, i64 %48)
  br label %49

49:                                               ; preds = %2
  %50 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef null)
          to label %51 unwind label %55

51:                                               ; preds = %49
  br i1 %50, label %63, label %52

52:                                               ; preds = %51
  %53 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef @.str.7)
          to label %54 unwind label %59

54:                                               ; preds = %52
  invoke void @__cxa_throw(ptr %53, ptr @_ZTIN2vl5ErrorE, ptr null) #6
          to label %115 unwind label %55

55:                                               ; preds = %54, %49
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %13, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %14, align 4
  br label %109

59:                                               ; preds = %52
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %13, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %14, align 4
  call void @__cxa_free_exception(ptr %53) #5
  br label %109

63:                                               ; preds = %51
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %66 = invoke noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %67 unwind label %90

67:                                               ; preds = %65
  %68 = getelementptr inbounds %"class.vl::database::BufferPageDesc", ptr %66, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !24
  store ptr %69, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = load i64, ptr %8, align 8, !tbaa !9
  %72 = getelementptr inbounds i64, ptr %70, i64 %71
  store ptr %72, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = load i64, ptr %73, align 8, !tbaa !9
  %75 = load i64, ptr %9, align 8, !tbaa !9
  %76 = lshr i64 %74, %75
  %77 = and i64 %76, 1
  %78 = icmp eq i64 %77, 1
  %79 = zext i1 %78 to i8
  store i8 %79, ptr %17, align 1, !tbaa !26
  br label %80

80:                                               ; preds = %67
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %19, i32 0, i32 2
  %83 = load i64, ptr %82, align 8, !tbaa !27
  %84 = invoke i32 @msync(ptr noundef %81, i64 noundef %83, i32 noundef 4)
          to label %85 unwind label %94

85:                                               ; preds = %80
  %86 = icmp ne i32 %84, -1
  br i1 %86, label %102, label %87

87:                                               ; preds = %85
  %88 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef @.str.8)
          to label %89 unwind label %98

89:                                               ; preds = %87
  invoke void @__cxa_throw(ptr %88, ptr @_ZTIN2vl5ErrorE, ptr null) #6
          to label %115 unwind label %94

90:                                               ; preds = %65
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %13, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %14, align 4
  br label %108

94:                                               ; preds = %89, %80
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %13, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %14, align 4
  br label %107

98:                                               ; preds = %87
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %13, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %14, align 4
  call void @__cxa_free_exception(ptr %88) #5
  br label %107

102:                                              ; preds = %85
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = load i8, ptr %17, align 1, !tbaa !26, !range !28, !noundef !29
  %106 = trunc i8 %105 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i1 %106

107:                                              ; preds = %98, %94
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %108

108:                                              ; preds = %107, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %109

109:                                              ; preds = %108, %59, %55
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %13, align 8
  %112 = load i32, ptr %14, align 4
  %113 = insertvalue { ptr, i32 } poison, ptr %111, 0
  %114 = insertvalue { ptr, i32 } %113, i32 %112, 1
  resume { ptr, i32 } %114

115:                                              ; preds = %89, %54
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) #2 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN2vl8database8IdObjectImLl1EEE", !10, i64 0}
!13 = !{!14, !10, i64 72}
!14 = !{!"_ZTSN2vl8database15buffer_internal12FileUseMasksE", !15, i64 0, !16, i64 8, !10, i64 16, !17, i64 24, !10, i64 72, !6, i64 80}
!15 = !{!"_ZTSN2vl6ObjectE"}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSN2vl11collections4ListImmEE", !18, i64 0}
!18 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !19, i64 0, !10, i64 24, !21, i64 32}
!19 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !20, i64 0, !6, i64 8, !10, i64 16}
!20 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !15, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!14, !6, i64 80}
!23 = !{i64 0, i64 8, !9}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTSN2vl8database14BufferPageDescE", !6, i64 0, !10, i64 8, !21, i64 16, !10, i64 24, !21, i64 32}
!26 = !{!21, !21, i64 0}
!27 = !{!14, !10, i64 16}
!28 = !{i8 0, i8 2}
!29 = !{}


; 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::Ptr" = type { ptr, ptr, ptr, ptr }
%"struct.vl::database::IdObject" = type { i64 }

@_ZTIN2vl5ErrorE = external dso_local constant { ptr, ptr }, align 8
@.str.7 = external hidden unnamed_addr constant [127 x i32], align 4
@.str.8 = external hidden unnamed_addr constant [100 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 uwtable
declare dso_local void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr") align 8, ptr noundef nonnull align 8 dereferenceable(152), i64) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #3 align 2

declare i32 @msync(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database15buffer_internal12FileUseMasks10GetUseMaskENS0_8IdObjectImLl1EEE(ptr noundef nonnull align 8 dereferenceable(88) %0, i64 %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.vl::database::IdObject", align 8
  %4 = alloca %"class.vl::Ptr", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = shl i64 %6, 6
  %8 = udiv i64 %1, %7
  %9 = urem i64 %1, %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %10, i64 noundef %8)
  %12 = load i64, ptr %11, align 8, !tbaa !18
  call void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %12)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  %14 = load ptr, ptr %13, align 8, !tbaa !19
  %.sroa.0.0.copyload = load i64, ptr %3, align 8, !tbaa !18
  call void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind nonnull writable sret(%"class.vl::Ptr") align 8 %4, ptr noundef nonnull align 8 dereferenceable(152) %14, i64 %.sroa.0.0.copyload)
  %15 = call noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef null)
  br i1 %15, label %23, label %16

16:                                               ; preds = %2
  %17 = call ptr @__cxa_allocate_exception(i64 8) #4
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull @.str.7)
          to label %18 unwind label %21

18:                                               ; preds = %16
  invoke void @__cxa_throw(ptr nonnull %17, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #5
          to label %47 unwind label %19

19:                                               ; preds = %18
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %46

21:                                               ; preds = %16
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %17) #4
  br label %46

23:                                               ; preds = %2
  %24 = lshr i64 %9, 6
  %25 = call noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %26 = load ptr, ptr %25, align 8, !tbaa !20
  %27 = getelementptr inbounds i64, ptr %26, i64 %24
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = load i64, ptr %30, align 8, !tbaa !22
  %32 = invoke i32 @msync(ptr noundef nonnull %26, i64 noundef %31, i32 noundef 4)
          to label %33 unwind label %37

33:                                               ; preds = %23
  %.not = icmp eq i32 %32, -1
  br i1 %.not, label %34, label %41

34:                                               ; preds = %33
  %35 = call ptr @__cxa_allocate_exception(i64 8) #4
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @.str.8)
          to label %36 unwind label %39

36:                                               ; preds = %34
  invoke void @__cxa_throw(ptr nonnull %35, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #5
          to label %47 unwind label %37

37:                                               ; preds = %36, %23
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %46

39:                                               ; preds = %34
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %35) #4
  br label %46

41:                                               ; preds = %33
  %42 = and i64 %9, 63
  %43 = shl nuw i64 1, %42
  %44 = and i64 %29, %43
  %45 = icmp ne i64 %44, 0
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i1 %45

46:                                               ; preds = %37, %39, %21, %19
  %.pn.pn = phi { ptr, i32 } [ %20, %19 ], [ %22, %21 ], [ %38, %37 ], [ %40, %39 ]
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn.pn

47:                                               ; preds = %36, %18
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) local_unnamed_addr #2 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 }
attributes #5 = { 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, !11, i64 72}
!6 = !{!"_ZTSN2vl8database15buffer_internal12FileUseMasksE", !7, i64 0, !8, i64 8, !11, i64 16, !12, i64 24, !11, i64 72, !16, i64 80}
!7 = !{!"_ZTSN2vl6ObjectE"}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!"_ZTSN2vl11collections4ListImmEE", !13, i64 0}
!13 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !14, i64 0, !11, i64 24, !17, i64 32}
!14 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !15, i64 0, !16, i64 8, !11, i64 16}
!15 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !7, i64 0}
!16 = !{!"any pointer", !9, i64 0}
!17 = !{!"bool", !9, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!6, !16, i64 80}
!20 = !{!21, !16, i64 0}
!21 = !{!"_ZTSN2vl8database14BufferPageDescE", !16, i64 0, !11, i64 8, !17, i64 16, !11, i64 24, !17, i64 32}
!22 = !{!6, !11, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass