; 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::FileFreePages" = type { %"class.vl::Object", i64, %"class.vl::collections::List.8", i64, i64, ptr, 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.15 = external hidden unnamed_addr constant [131 x i32], align 4
@.str.16 = external hidden unnamed_addr constant [124 x i32], align 4
@.str.17 = external hidden unnamed_addr constant [103 x i32], align 4
@.str.18 = external hidden unnamed_addr constant [127 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 i64 @_ZN2vl8database15buffer_internal11FileMapping17GetTotalPageCountEv(ptr noundef nonnull align 8 dereferenceable(152)) #2 align 2

; 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) #3 align 2

; 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 void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #2 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) #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN2vl11collections4ListImmE3AddERKm(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl8database15buffer_internal12FileUseMasks10SetUseMaskENS0_8IdObjectImLl1EEEb(ptr noundef nonnull align 8 dereferenceable(88), i64, i1 noundef zeroext) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl8database15buffer_internal13FileFreePages12PushFreePageENS0_8IdObjectImLl1EEE(ptr noundef nonnull align 8 dereferenceable(96) %0, i64 %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.vl::database::IdObject", align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.vl::database::IdObject", align 8
  %6 = alloca %"class.vl::Ptr", align 8
  %7 = alloca %"struct.vl::database::IdObject", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"struct.vl::database::IdObject", align 8
  %13 = alloca %"class.vl::Ptr", align 8
  %14 = alloca %"struct.vl::database::IdObject", align 8
  %15 = alloca %"struct.vl::database::IdObject", align 8
  %16 = alloca %"struct.vl::database::IdObject", align 8
  %17 = alloca %"class.vl::Ptr", align 8
  %18 = alloca %"struct.vl::database::IdObject", align 8
  %19 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %3, i32 0, i32 0
  store i64 %1, ptr %19, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %21 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 2
  %22 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 3
  %23 = load i64, ptr %22, align 8, !tbaa !9
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %21, i64 noundef %23)
  %25 = load i64, ptr %24, align 8, !tbaa !18
  call void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %25)
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #6
  %26 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 5
  %27 = load ptr, ptr %26, align 8, !tbaa !19
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !20
  %28 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %7, i32 0, i32 0
  %29 = load i64, ptr %28, align 8
  call void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind writable sret(%"class.vl::Ptr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(152) %27, i64 %29)
  br label %30

30:                                               ; preds = %2
  %31 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef null)
          to label %32 unwind label %36

32:                                               ; preds = %30
  br i1 %31, label %44, label %33

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

35:                                               ; preds = %33
  invoke void @__cxa_throw(ptr %34, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %272 unwind label %36

36:                                               ; preds = %35, %30
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %8, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %9, align 4
  br label %266

40:                                               ; preds = %33
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %8, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %9, align 4
  call void @__cxa_free_exception(ptr %34) #6
  br label %266

44:                                               ; preds = %32
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %47 = invoke noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %48 unwind label %91

48:                                               ; preds = %46
  %49 = getelementptr inbounds %"class.vl::database::BufferPageDesc", ptr %47, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  store ptr %50, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = getelementptr inbounds i64, ptr %51, i64 1
  store ptr %52, ptr %11, align 8, !tbaa !5
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load i64, ptr %53, align 8, !tbaa !18
  %55 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 4
  %56 = load i64, ptr %55, align 8, !tbaa !23
  %57 = icmp eq i64 %54, %56
  br i1 %57, label %58, label %235

58:                                               ; preds = %48
  %59 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 3
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 2
  %62 = invoke noundef i64 @_ZNK2vl11collections9ArrayBaseImE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %61)
          to label %63 unwind label %95

63:                                               ; preds = %58
  %64 = sub nsw i64 %62, 1
  %65 = icmp eq i64 %60, %64
  br i1 %65, label %66, label %162

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %67 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 5
  %68 = load ptr, ptr %67, align 8, !tbaa !19
  %69 = call noundef i64 @_ZN2vl8database15buffer_internal11FileMapping17GetTotalPageCountEv(ptr noundef nonnull align 8 dereferenceable(152) %68)
  invoke void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef %69)
          to label %70 unwind label %99

70:                                               ; preds = %66
  %71 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %12, i32 0, i32 0
  %72 = load i64, ptr %71, align 8, !tbaa !24
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds i64, ptr %73, i64 0
  store i64 %72, ptr %74, align 8, !tbaa !18
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 1
  %77 = load i64, ptr %76, align 8, !tbaa !26
  %78 = invoke i32 @msync(ptr noundef %75, i64 noundef %77, i32 noundef 4)
          to label %79 unwind label %99

79:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  %80 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 5
  %81 = load ptr, ptr %80, align 8, !tbaa !19
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %12, i64 8, i1 false), !tbaa.struct !20
  %82 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %14, i32 0, i32 0
  %83 = load i64, ptr %82, align 8
  invoke void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind writable sret(%"class.vl::Ptr") align 8 %13, ptr noundef nonnull align 8 dereferenceable(152) %81, i64 %83)
          to label %84 unwind label %103

84:                                               ; preds = %79
  br label %85

85:                                               ; preds = %84
  %86 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef null)
          to label %87 unwind label %107

87:                                               ; preds = %85
  br i1 %86, label %115, label %88

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

90:                                               ; preds = %88
  invoke void @__cxa_throw(ptr %89, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %272 unwind label %107

91:                                               ; preds = %46
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %8, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %9, align 4
  br label %265

95:                                               ; preds = %255, %246, %58
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %8, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %9, align 4
  br label %264

99:                                               ; preds = %70, %66
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %8, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %9, align 4
  br label %161

103:                                              ; preds = %79
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %8, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %9, align 4
  br label %160

107:                                              ; preds = %153, %149, %142, %133, %117, %90, %85
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %8, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %9, align 4
  br label %159

111:                                              ; preds = %88
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %8, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %9, align 4
  call void @__cxa_free_exception(ptr %89) #6
  br label %159

115:                                              ; preds = %87
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  %118 = invoke noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %119 unwind label %107

119:                                              ; preds = %117
  %120 = getelementptr inbounds %"class.vl::database::BufferPageDesc", ptr %118, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !21
  store ptr %121, ptr %10, align 8, !tbaa !5
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 1
  %124 = load i64, ptr %123, align 8, !tbaa !26
  call void @llvm.memset.p0.i64(ptr align 8 %122, i8 0, i64 %124, i1 false)
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = getelementptr inbounds i64, ptr %125, i64 0
  store i64 -1, ptr %126, align 8, !tbaa !18
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = getelementptr inbounds i64, ptr %127, i64 1
  store i64 1, ptr %128, align 8, !tbaa !18
  %129 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %3, i32 0, i32 0
  %130 = load i64, ptr %129, align 8, !tbaa !24
  %131 = load ptr, ptr %10, align 8, !tbaa !5
  %132 = getelementptr inbounds i64, ptr %131, i64 2
  store i64 %130, ptr %132, align 8, !tbaa !18
  br label %133

133:                                              ; preds = %119
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 1
  %136 = load i64, ptr %135, align 8, !tbaa !26
  %137 = invoke i32 @msync(ptr noundef %134, i64 noundef %136, i32 noundef 4)
          to label %138 unwind label %107

138:                                              ; preds = %133
  %139 = icmp ne i32 %137, -1
  br i1 %139, label %147, label %140

140:                                              ; preds = %138
  %141 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef @.str.17)
          to label %142 unwind label %143

142:                                              ; preds = %140
  invoke void @__cxa_throw(ptr %141, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %272 unwind label %107

143:                                              ; preds = %140
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %8, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %9, align 4
  call void @__cxa_free_exception(ptr %141) #6
  br label %159

147:                                              ; preds = %138
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  %150 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 2
  %151 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %12, i32 0, i32 0
  %152 = invoke noundef i64 @_ZN2vl11collections4ListImmE3AddERKm(ptr noundef nonnull align 8 dereferenceable(33) %150, ptr noundef nonnull align 8 dereferenceable(8) %151)
          to label %153 unwind label %107

153:                                              ; preds = %149
  %154 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 6
  %155 = load ptr, ptr %154, align 8, !tbaa !27
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %12, i64 8, i1 false), !tbaa.struct !20
  %156 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %15, i32 0, i32 0
  %157 = load i64, ptr %156, align 8
  invoke void @_ZN2vl8database15buffer_internal12FileUseMasks10SetUseMaskENS0_8IdObjectImLl1EEEb(ptr noundef nonnull align 8 dereferenceable(88) %155, i64 %157, i1 noundef zeroext true)
          to label %158 unwind label %107

158:                                              ; preds = %153
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %231

159:                                              ; preds = %143, %111, %107
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br label %160

160:                                              ; preds = %159, %103
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  br label %161

161:                                              ; preds = %160, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %264

162:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %163 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 2
  %164 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 3
  %165 = load i64, ptr %164, align 8, !tbaa !9
  %166 = add nsw i64 %165, 1
  %167 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %163, i64 noundef %166)
          to label %168 unwind label %182

168:                                              ; preds = %162
  %169 = load i64, ptr %167, align 8, !tbaa !18
  invoke void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef %169)
          to label %170 unwind label %182

170:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #6
  %171 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 5
  %172 = load ptr, ptr %171, align 8, !tbaa !19
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %16, i64 8, i1 false), !tbaa.struct !20
  %173 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %18, i32 0, i32 0
  %174 = load i64, ptr %173, align 8
  invoke void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind writable sret(%"class.vl::Ptr") align 8 %17, ptr noundef nonnull align 8 dereferenceable(152) %172, i64 %174)
          to label %175 unwind label %186

175:                                              ; preds = %170
  br label %176

176:                                              ; preds = %175
  %177 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef null)
          to label %178 unwind label %190

178:                                              ; preds = %176
  br i1 %177, label %198, label %179

179:                                              ; preds = %178
  %180 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %180, ptr noundef @.str.18)
          to label %181 unwind label %194

181:                                              ; preds = %179
  invoke void @__cxa_throw(ptr %180, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %272 unwind label %190

182:                                              ; preds = %168, %162
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %8, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %9, align 4
  br label %230

186:                                              ; preds = %170
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %8, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %9, align 4
  br label %229

190:                                              ; preds = %220, %211, %200, %181, %176
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %8, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %9, align 4
  br label %228

194:                                              ; preds = %179
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %8, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %9, align 4
  call void @__cxa_free_exception(ptr %180) #6
  br label %228

198:                                              ; preds = %178
  br label %199

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199
  %201 = invoke noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %202 unwind label %190

202:                                              ; preds = %200
  %203 = getelementptr inbounds %"class.vl::database::BufferPageDesc", ptr %201, i32 0, i32 0
  %204 = load ptr, ptr %203, align 8, !tbaa !21
  store ptr %204, ptr %10, align 8, !tbaa !5
  %205 = load ptr, ptr %10, align 8, !tbaa !5
  %206 = getelementptr inbounds i64, ptr %205, i64 1
  store i64 1, ptr %206, align 8, !tbaa !18
  %207 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %3, i32 0, i32 0
  %208 = load i64, ptr %207, align 8, !tbaa !24
  %209 = load ptr, ptr %10, align 8, !tbaa !5
  %210 = getelementptr inbounds i64, ptr %209, i64 2
  store i64 %208, ptr %210, align 8, !tbaa !18
  br label %211

211:                                              ; preds = %202
  %212 = load ptr, ptr %10, align 8, !tbaa !5
  %213 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 1
  %214 = load i64, ptr %213, align 8, !tbaa !26
  %215 = invoke i32 @msync(ptr noundef %212, i64 noundef %214, i32 noundef 4)
          to label %216 unwind label %190

216:                                              ; preds = %211
  %217 = icmp ne i32 %215, -1
  br i1 %217, label %225, label %218

218:                                              ; preds = %216
  %219 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %219, ptr noundef @.str.17)
          to label %220 unwind label %221

220:                                              ; preds = %218
  invoke void @__cxa_throw(ptr %219, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %272 unwind label %190

221:                                              ; preds = %218
  %222 = landingpad { ptr, i32 }
          cleanup
  %223 = extractvalue { ptr, i32 } %222, 0
  store ptr %223, ptr %8, align 8
  %224 = extractvalue { ptr, i32 } %222, 1
  store i32 %224, ptr %9, align 4
  call void @__cxa_free_exception(ptr %219) #6
  br label %228

225:                                              ; preds = %216
  br label %226

226:                                              ; preds = %225
  br label %227

227:                                              ; preds = %226
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %231

228:                                              ; preds = %221, %194, %190
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  br label %229

229:                                              ; preds = %228, %186
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  br label %230

230:                                              ; preds = %229, %182
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %264

231:                                              ; preds = %227, %158
  %232 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 3
  %233 = load i64, ptr %232, align 8, !tbaa !9
  %234 = add nsw i64 %233, 1
  store i64 %234, ptr %232, align 8, !tbaa !9
  br label %263

235:                                              ; preds = %48
  %236 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %3, i32 0, i32 0
  %237 = load i64, ptr %236, align 8, !tbaa !24
  %238 = load ptr, ptr %10, align 8, !tbaa !5
  %239 = load ptr, ptr %11, align 8, !tbaa !5
  %240 = load i64, ptr %239, align 8, !tbaa !18
  %241 = add i64 2, %240
  %242 = getelementptr inbounds i64, ptr %238, i64 %241
  store i64 %237, ptr %242, align 8, !tbaa !18
  %243 = load ptr, ptr %11, align 8, !tbaa !5
  %244 = load i64, ptr %243, align 8, !tbaa !18
  %245 = add i64 %244, 1
  store i64 %245, ptr %243, align 8, !tbaa !18
  br label %246

246:                                              ; preds = %235
  %247 = load ptr, ptr %10, align 8, !tbaa !5
  %248 = getelementptr inbounds %"class.vl::database::buffer_internal::FileFreePages", ptr %20, i32 0, i32 1
  %249 = load i64, ptr %248, align 8, !tbaa !26
  %250 = invoke i32 @msync(ptr noundef %247, i64 noundef %249, i32 noundef 4)
          to label %251 unwind label %95

251:                                              ; preds = %246
  %252 = icmp ne i32 %250, -1
  br i1 %252, label %260, label %253

253:                                              ; preds = %251
  %254 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %254, ptr noundef @.str.17)
          to label %255 unwind label %256

255:                                              ; preds = %253
  invoke void @__cxa_throw(ptr %254, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %272 unwind label %95

256:                                              ; preds = %253
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %8, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %9, align 4
  call void @__cxa_free_exception(ptr %254) #6
  br label %264

260:                                              ; preds = %251
  br label %261

261:                                              ; preds = %260
  br label %262

262:                                              ; preds = %261
  br label %263

263:                                              ; preds = %262, %231
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

264:                                              ; preds = %256, %230, %161, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %265

265:                                              ; preds = %264, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %266

266:                                              ; preds = %265, %40, %36
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %267

267:                                              ; preds = %266
  %268 = load ptr, ptr %8, align 8
  %269 = load i32, ptr %9, align 4
  %270 = insertvalue { ptr, i32 } poison, ptr %268, 0
  %271 = insertvalue { ptr, i32 } %270, i32 %269, 1
  resume { ptr, i32 } %271

272:                                              ; preds = %255, %220, %181, %142, %90, %35
  unreachable
}

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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !12, i64 64}
!10 = !{!"_ZTSN2vl8database15buffer_internal13FileFreePagesE", !11, i64 0, !12, i64 8, !13, i64 16, !12, i64 64, !12, i64 72, !6, i64 80, !6, i64 88}
!11 = !{!"_ZTSN2vl6ObjectE"}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSN2vl11collections4ListImmEE", !14, i64 0}
!14 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !15, i64 0, !12, i64 24, !17, i64 32}
!15 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !16, i64 0, !6, i64 8, !12, i64 16}
!16 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !11, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!12, !12, i64 0}
!19 = !{!10, !6, i64 80}
!20 = !{i64 0, i64 8, !18}
!21 = !{!22, !6, i64 0}
!22 = !{!"_ZTSN2vl8database14BufferPageDescE", !6, i64 0, !12, i64 8, !17, i64 16, !12, i64 24, !17, i64 32}
!23 = !{!10, !12, i64 72}
!24 = !{!25, !12, i64 0}
!25 = !{!"_ZTSN2vl8database8IdObjectImLl1EEE", !12, i64 0}
!26 = !{!10, !12, i64 8}
!27 = !{!10, !6, i64 88}


; 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.15 = external hidden unnamed_addr constant [131 x i32], align 4
@.str.16 = external hidden unnamed_addr constant [124 x i32], align 4
@.str.17 = external hidden unnamed_addr constant [103 x i32], align 4
@.str.18 = external hidden unnamed_addr constant [127 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 i64 @_ZN2vl8database15buffer_internal11FileMapping17GetTotalPageCountEv(ptr noundef nonnull align 8 dereferenceable(152)) local_unnamed_addr #2 align 2

; 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 #3 align 2

; 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 void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #2 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 #2 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN2vl11collections4ListImmE3AddERKm(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; 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 #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl8database15buffer_internal12FileUseMasks10SetUseMaskENS0_8IdObjectImLl1EEEb(ptr noundef nonnull align 8 dereferenceable(88), i64, i1 noundef zeroext) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl8database15buffer_internal13FileFreePages12PushFreePageENS0_8IdObjectImLl1EEE(ptr noundef nonnull align 8 dereferenceable(96) %0, i64 %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.vl::database::IdObject", align 8
  %4 = alloca %"class.vl::Ptr", align 8
  %5 = alloca %"struct.vl::database::IdObject", align 8
  %6 = alloca %"class.vl::Ptr", align 8
  %7 = alloca %"struct.vl::database::IdObject", align 8
  %8 = alloca %"class.vl::Ptr", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %9, i64 noundef %11)
  %13 = load i64, ptr %12, align 8, !tbaa !17
  call void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %13)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  %14 = getelementptr inbounds i8, ptr %0, i64 80
  %15 = load ptr, ptr %14, align 8, !tbaa !18
  %.sroa.019.0.copyload = load i64, ptr %3, align 8, !tbaa !17
  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) %15, i64 %.sroa.019.0.copyload)
  %16 = call noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef null)
  br i1 %16, label %24, label %17

17:                                               ; preds = %2
  %18 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @.str.15)
          to label %19 unwind label %22

19:                                               ; preds = %17
  invoke void @__cxa_throw(ptr nonnull %18, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #6
          to label %139 unwind label %20

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

22:                                               ; preds = %17
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %18) #5
  br label %138

24:                                               ; preds = %2
  %25 = call noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %26 = load ptr, ptr %25, align 8, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load i64, ptr %27, align 8, !tbaa !17
  %29 = getelementptr inbounds i8, ptr %0, i64 72
  %30 = load i64, ptr %29, align 8, !tbaa !21
  %31 = icmp eq i64 %28, %30
  br i1 %31, label %32, label %123

32:                                               ; preds = %24
  %33 = load i64, ptr %10, align 8, !tbaa !5
  %34 = call noundef i64 @_ZNK2vl11collections9ArrayBaseImE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %35 = add nsw i64 %34, -1
  %36 = icmp eq i64 %33, %35
  br i1 %36, label %37, label %83

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %38 = load ptr, ptr %14, align 8, !tbaa !18
  %39 = call noundef i64 @_ZN2vl8database15buffer_internal11FileMapping17GetTotalPageCountEv(ptr noundef nonnull align 8 dereferenceable(152) %38)
  call void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %39)
  %40 = load i64, ptr %5, align 8, !tbaa !22
  store i64 %40, ptr %26, align 8, !tbaa !17
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !24
  %43 = invoke i32 @msync(ptr noundef nonnull %26, i64 noundef %42, i32 noundef 4)
          to label %44 unwind label %52

44:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  %45 = load ptr, ptr %14, align 8, !tbaa !18
  %.sroa.02.0.copyload = load i64, ptr %5, align 8, !tbaa !17
  invoke void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind nonnull writable sret(%"class.vl::Ptr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(152) %45, i64 %.sroa.02.0.copyload)
          to label %46 unwind label %54

46:                                               ; preds = %44
  %47 = call noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef null)
  br i1 %47, label %60, label %48

48:                                               ; preds = %46
  %49 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull @.str.16)
          to label %.invoke unwind label %58

50:                                               ; preds = %134, %123
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %138

52:                                               ; preds = %37
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %82

54:                                               ; preds = %44
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %81

56:                                               ; preds = %.invoke, %76, %74, %60
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %80

58:                                               ; preds = %48
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %49) #5
  br label %80

60:                                               ; preds = %46
  %61 = call noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %62 = load ptr, ptr %61, align 8, !tbaa !19
  %63 = load i64, ptr %41, align 8, !tbaa !24
  call void @llvm.memset.p0.i64(ptr align 8 %62, i8 0, i64 %63, i1 false)
  store i64 -1, ptr %62, align 8, !tbaa !17
  %64 = getelementptr inbounds i8, ptr %62, i64 8
  store i64 1, ptr %64, align 8, !tbaa !17
  %65 = getelementptr inbounds i8, ptr %62, i64 16
  store i64 %1, ptr %65, align 8, !tbaa !17
  %66 = load i64, ptr %41, align 8, !tbaa !24
  %67 = invoke i32 @msync(ptr noundef nonnull %62, i64 noundef %66, i32 noundef 4)
          to label %68 unwind label %56

68:                                               ; preds = %60
  %.not37 = icmp eq i32 %67, -1
  br i1 %.not37, label %69, label %74

69:                                               ; preds = %68
  %70 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @.str.17)
          to label %.invoke unwind label %72

.invoke:                                          ; preds = %48, %69
  %71 = phi ptr [ %70, %69 ], [ %49, %48 ]
  invoke void @__cxa_throw(ptr nonnull %71, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #6
          to label %.cont unwind label %56

.cont:                                            ; preds = %.invoke
  unreachable

72:                                               ; preds = %69
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %70) #5
  br label %80

74:                                               ; preds = %68
  %75 = invoke noundef i64 @_ZN2vl11collections4ListImmE3AddERKm(ptr noundef nonnull align 8 dereferenceable(33) %9, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %76 unwind label %56

76:                                               ; preds = %74
  %77 = getelementptr inbounds i8, ptr %0, i64 88
  %78 = load ptr, ptr %77, align 8, !tbaa !25
  %.sroa.01.0.copyload = load i64, ptr %5, align 8, !tbaa !17
  invoke void @_ZN2vl8database15buffer_internal12FileUseMasks10SetUseMaskENS0_8IdObjectImLl1EEEb(ptr noundef nonnull align 8 dereferenceable(88) %78, i64 %.sroa.01.0.copyload, i1 noundef zeroext true)
          to label %79 unwind label %56

79:                                               ; preds = %76
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %120

80:                                               ; preds = %72, %58, %56
  %.pn38 = phi { ptr, i32 } [ %57, %56 ], [ %73, %72 ], [ %59, %58 ]
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %81

81:                                               ; preds = %80, %54
  %.pn38.pn = phi { ptr, i32 } [ %.pn38, %80 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %82

82:                                               ; preds = %81, %52
  %.pn38.pn.pn = phi { ptr, i32 } [ %.pn38.pn, %81 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %138

83:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %84 = load i64, ptr %10, align 8, !tbaa !5
  %85 = add nsw i64 %84, 1
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %9, i64 noundef %85)
          to label %87 unwind label %94

87:                                               ; preds = %83
  %88 = load i64, ptr %86, align 8, !tbaa !17
  call void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef %88)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  %89 = load ptr, ptr %14, align 8, !tbaa !18
  %.sroa.0.0.copyload = load i64, ptr %7, align 8, !tbaa !17
  invoke void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind nonnull writable sret(%"class.vl::Ptr") align 8 %8, ptr noundef nonnull align 8 dereferenceable(152) %89, i64 %.sroa.0.0.copyload)
          to label %90 unwind label %96

90:                                               ; preds = %87
  %91 = call noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef null)
  br i1 %91, label %102, label %92

92:                                               ; preds = %90
  %93 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull @.str.18)
          to label %.invoke44 unwind label %100

94:                                               ; preds = %83
  %95 = landingpad { ptr, i32 }
          cleanup
  br label %119

96:                                               ; preds = %87
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %118

98:                                               ; preds = %.invoke44, %102
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %117

100:                                              ; preds = %92
  %101 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %93) #5
  br label %117

102:                                              ; preds = %90
  %103 = call noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %104 = load ptr, ptr %103, align 8, !tbaa !19
  %105 = getelementptr inbounds i8, ptr %104, i64 8
  store i64 1, ptr %105, align 8, !tbaa !17
  %106 = getelementptr inbounds i8, ptr %104, i64 16
  store i64 %1, ptr %106, align 8, !tbaa !17
  %107 = getelementptr inbounds i8, ptr %0, i64 8
  %108 = load i64, ptr %107, align 8, !tbaa !24
  %109 = invoke i32 @msync(ptr noundef nonnull %104, i64 noundef %108, i32 noundef 4)
          to label %110 unwind label %98

110:                                              ; preds = %102
  %.not33 = icmp eq i32 %109, -1
  br i1 %.not33, label %111, label %116

111:                                              ; preds = %110
  %112 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef nonnull @.str.17)
          to label %.invoke44 unwind label %114

.invoke44:                                        ; preds = %92, %111
  %113 = phi ptr [ %112, %111 ], [ %93, %92 ]
  invoke void @__cxa_throw(ptr nonnull %113, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #6
          to label %.cont45 unwind label %98

.cont45:                                          ; preds = %.invoke44
  unreachable

114:                                              ; preds = %111
  %115 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %112) #5
  br label %117

116:                                              ; preds = %110
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %120

117:                                              ; preds = %114, %100, %98
  %.pn = phi { ptr, i32 } [ %99, %98 ], [ %115, %114 ], [ %101, %100 ]
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %118

118:                                              ; preds = %117, %96
  %.pn.pn = phi { ptr, i32 } [ %.pn, %117 ], [ %97, %96 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %119

119:                                              ; preds = %118, %94
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %118 ], [ %95, %94 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %138

120:                                              ; preds = %116, %79
  %121 = load i64, ptr %10, align 8, !tbaa !5
  %122 = add nsw i64 %121, 1
  store i64 %122, ptr %10, align 8, !tbaa !5
  br label %137

123:                                              ; preds = %24
  %124 = getelementptr i64, ptr %26, i64 %28
  %125 = getelementptr i8, ptr %124, i64 16
  store i64 %1, ptr %125, align 8, !tbaa !17
  %126 = load i64, ptr %27, align 8, !tbaa !17
  %127 = add i64 %126, 1
  store i64 %127, ptr %27, align 8, !tbaa !17
  %128 = getelementptr inbounds i8, ptr %0, i64 8
  %129 = load i64, ptr %128, align 8, !tbaa !24
  %130 = invoke i32 @msync(ptr noundef nonnull %26, i64 noundef %129, i32 noundef 4)
          to label %131 unwind label %50

131:                                              ; preds = %123
  %.not = icmp eq i32 %130, -1
  br i1 %.not, label %132, label %137

132:                                              ; preds = %131
  %133 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef nonnull @.str.17)
          to label %134 unwind label %135

134:                                              ; preds = %132
  invoke void @__cxa_throw(ptr nonnull %133, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #6
          to label %139 unwind label %50

135:                                              ; preds = %132
  %136 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %133) #5
  br label %138

137:                                              ; preds = %131, %120
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret void

138:                                              ; preds = %50, %82, %119, %135, %22, %20
  %.pn38.pn.pn.pn.pn = phi { ptr, i32 } [ %21, %20 ], [ %23, %22 ], [ %.pn38.pn.pn, %82 ], [ %.pn.pn.pn, %119 ], [ %51, %50 ], [ %136, %135 ]
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn38.pn.pn.pn.pn

139:                                              ; preds = %134, %19
  unreachable
}

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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !8, i64 64}
!6 = !{!"_ZTSN2vl8database15buffer_internal13FileFreePagesE", !7, i64 0, !8, i64 8, !11, i64 16, !8, i64 64, !8, i64 72, !15, i64 80, !15, i64 88}
!7 = !{!"_ZTSN2vl6ObjectE"}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN2vl11collections4ListImmEE", !12, i64 0}
!12 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !13, i64 0, !8, i64 24, !16, i64 32}
!13 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !14, i64 0, !15, i64 8, !8, i64 16}
!14 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !7, i64 0}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{!"bool", !9, i64 0}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !15, i64 80}
!19 = !{!20, !15, i64 0}
!20 = !{!"_ZTSN2vl8database14BufferPageDescE", !15, i64 0, !8, i64 8, !16, i64 16, !8, i64 24, !16, i64 32}
!21 = !{!6, !8, i64 72}
!22 = !{!23, !8, i64 0}
!23 = !{!"_ZTSN2vl8database8IdObjectImLl1EEE", !8, i64 0}
!24 = !{!6, !8, i64 8}
!25 = !{!6, !15, i64 88}


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