; 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.9 = external hidden unnamed_addr constant [128 x i32], align 4
@.str.10 = external hidden unnamed_addr constant [128 x i32], align 4
@.str.11 = external hidden unnamed_addr constant [106 x i32], align 4
@.str.12 = external hidden unnamed_addr constant [133 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 uwtable
declare dso_local i64 @_ZN2vl8database15buffer_internal11FileMapping10AppendPageEv(ptr noundef nonnull align 8 dereferenceable(152)) #2 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: 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)) #2 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) #2 align 2

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

58:                                               ; preds = %3
  store i8 1, ptr %12, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %59 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 3
  %60 = load i64, ptr %8, align 8, !tbaa !11
  %61 = sub i64 %60, 1
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %59, i64 noundef %61)
  %63 = load i64, ptr %62, align 8, !tbaa !11
  call void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %14, i64 noundef %63)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %64 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 5
  %65 = load ptr, ptr %64, align 8, !tbaa !23
  %66 = call i64 @_ZN2vl8database15buffer_internal11FileMapping10AppendPageEv(ptr noundef nonnull align 8 dereferenceable(152) %65)
  %67 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %15, i32 0, i32 0
  store i64 %66, ptr %67, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %15, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %68

68:                                               ; preds = %58
  %69 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl1EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
  br i1 %69, label %77, label %70

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

72:                                               ; preds = %70
  call void @__cxa_throw(ptr %71, ptr @_ZTIN2vl5ErrorE, ptr null) #7
  unreachable

73:                                               ; preds = %70
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %16, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %17, align 4
  call void @__cxa_free_exception(ptr %71) #6
  br label %137

77:                                               ; preds = %68
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %13, i64 8, i1 false), !tbaa.struct !24
  %80 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %18, i32 0, i32 0
  %81 = load i64, ptr %80, align 8
  call void @_ZN2vl8database15buffer_internal12FileUseMasks10SetUseMaskENS0_8IdObjectImLl1EEEb(ptr noundef nonnull align 8 dereferenceable(88) %30, i64 %81, i1 noundef zeroext true)
  %82 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 3
  %83 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %13, i32 0, i32 0
  %84 = call noundef i64 @_ZN2vl11collections4ListImmE3AddERKm(ptr noundef nonnull align 8 dereferenceable(33) %82, ptr noundef nonnull align 8 dereferenceable(8) %83)
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #6
  %85 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 5
  %86 = load ptr, ptr %85, align 8, !tbaa !23
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %14, i64 8, i1 false), !tbaa.struct !24
  %87 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %20, i32 0, i32 0
  %88 = load i64, ptr %87, align 8
  call void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind writable sret(%"class.vl::Ptr") align 8 %19, ptr noundef nonnull align 8 dereferenceable(152) %86, i64 %88)
  br label %89

89:                                               ; preds = %79
  %90 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef null)
          to label %91 unwind label %95

91:                                               ; preds = %89
  br i1 %90, label %103, label %92

92:                                               ; preds = %91
  %93 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef @.str.10)
          to label %94 unwind label %99

94:                                               ; preds = %92
  invoke void @__cxa_throw(ptr %93, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %234 unwind label %95

95:                                               ; preds = %94, %89
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %16, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %17, align 4
  br label %136

99:                                               ; preds = %92
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %16, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %17, align 4
  call void @__cxa_free_exception(ptr %93) #6
  br label %136

103:                                              ; preds = %91
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %106 = invoke noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %19)
          to label %107 unwind label %124

107:                                              ; preds = %105
  %108 = getelementptr inbounds %"class.vl::database::BufferPageDesc", ptr %106, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !25
  store ptr %109, ptr %21, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %13, i32 0, i32 0
  %111 = load i64, ptr %110, align 8, !tbaa !13
  %112 = load ptr, ptr %21, align 8, !tbaa !5
  %113 = getelementptr inbounds i64, ptr %112, i64 0
  store i64 %111, ptr %113, align 8, !tbaa !11
  br label %114

114:                                              ; preds = %107
  %115 = load ptr, ptr %21, align 8, !tbaa !5
  %116 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 2
  %117 = load i64, ptr %116, align 8, !tbaa !27
  %118 = invoke i32 @msync(ptr noundef %115, i64 noundef %117, i32 noundef 4)
          to label %119 unwind label %124

119:                                              ; preds = %114
  %120 = icmp ne i32 %118, -1
  br i1 %120, label %132, label %121

121:                                              ; preds = %119
  %122 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef @.str.11)
          to label %123 unwind label %128

123:                                              ; preds = %121
  invoke void @__cxa_throw(ptr %122, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %234 unwind label %124

124:                                              ; preds = %123, %114, %105
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %16, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %17, align 4
  br label %135

128:                                              ; preds = %121
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %16, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %17, align 4
  call void @__cxa_free_exception(ptr %122) #6
  br label %135

132:                                              ; preds = %119
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %144

135:                                              ; preds = %128, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %136

136:                                              ; preds = %135, %99, %95
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  br label %137

137:                                              ; preds = %136, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %228

138:                                              ; preds = %3
  %139 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 3
  %140 = load i64, ptr %8, align 8, !tbaa !11
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %139, i64 noundef %140)
  %142 = load i64, ptr %141, align 8, !tbaa !11
  %143 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %13, i32 0, i32 0
  store i64 %142, ptr %143, align 8, !tbaa !13
  br label %144

144:                                              ; preds = %138, %134
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #6
  %145 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 5
  %146 = load ptr, ptr %145, align 8, !tbaa !23
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %13, i64 8, i1 false), !tbaa.struct !24
  %147 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %23, i32 0, i32 0
  %148 = load i64, ptr %147, align 8
  call void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind writable sret(%"class.vl::Ptr") align 8 %22, ptr noundef nonnull align 8 dereferenceable(152) %146, i64 %148)
  br label %149

149:                                              ; preds = %144
  %150 = invoke noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef null)
          to label %151 unwind label %155

151:                                              ; preds = %149
  br i1 %150, label %163, label %152

152:                                              ; preds = %151
  %153 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef @.str.12)
          to label %154 unwind label %159

154:                                              ; preds = %152
  invoke void @__cxa_throw(ptr %153, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %234 unwind label %155

155:                                              ; preds = %154, %149
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %16, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %17, align 4
  br label %227

159:                                              ; preds = %152
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %16, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %17, align 4
  call void @__cxa_free_exception(ptr %153) #6
  br label %227

163:                                              ; preds = %151
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %166 = invoke noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %167 unwind label %178

167:                                              ; preds = %165
  %168 = getelementptr inbounds %"class.vl::database::BufferPageDesc", ptr %166, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !25
  store ptr %169, ptr %24, align 8, !tbaa !5
  %170 = load i8, ptr %12, align 1, !tbaa !9, !range !28, !noundef !29
  %171 = trunc i8 %170 to i1
  br i1 %171, label %172, label %182

172:                                              ; preds = %167
  %173 = load ptr, ptr %24, align 8, !tbaa !5
  %174 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 2
  %175 = load i64, ptr %174, align 8, !tbaa !27
  call void @llvm.memset.p0.i64(ptr align 8 %173, i8 0, i64 %175, i1 false)
  %176 = load ptr, ptr %24, align 8, !tbaa !5
  %177 = getelementptr inbounds i64, ptr %176, i64 0
  store i64 -1, ptr %177, align 8, !tbaa !11
  br label %182

178:                                              ; preds = %165
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %16, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %17, align 4
  br label %226

182:                                              ; preds = %172, %167
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %183 = load ptr, ptr %24, align 8, !tbaa !5
  %184 = load i64, ptr %10, align 8, !tbaa !11
  %185 = getelementptr inbounds i64, ptr %183, i64 %184
  store ptr %185, ptr %25, align 8, !tbaa !5
  %186 = load i8, ptr %6, align 1, !tbaa !9, !range !28, !noundef !29
  %187 = trunc i8 %186 to i1
  br i1 %187, label %188, label %195

188:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %189 = load i64, ptr %11, align 8, !tbaa !11
  %190 = shl i64 1, %189
  store i64 %190, ptr %26, align 8, !tbaa !11
  %191 = load i64, ptr %26, align 8, !tbaa !11
  %192 = load ptr, ptr %25, align 8, !tbaa !5
  %193 = load i64, ptr %192, align 8, !tbaa !11
  %194 = or i64 %193, %191
  store i64 %194, ptr %192, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %203

195:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %196 = load i64, ptr %11, align 8, !tbaa !11
  %197 = shl i64 1, %196
  %198 = xor i64 %197, -1
  store i64 %198, ptr %27, align 8, !tbaa !11
  %199 = load i64, ptr %27, align 8, !tbaa !11
  %200 = load ptr, ptr %25, align 8, !tbaa !5
  %201 = load i64, ptr %200, align 8, !tbaa !11
  %202 = and i64 %201, %199
  store i64 %202, ptr %200, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %203

203:                                              ; preds = %195, %188
  br label %204

204:                                              ; preds = %203
  %205 = load ptr, ptr %24, align 8, !tbaa !5
  %206 = getelementptr inbounds %"class.vl::database::buffer_internal::FileUseMasks", ptr %30, i32 0, i32 2
  %207 = load i64, ptr %206, align 8, !tbaa !27
  %208 = invoke i32 @msync(ptr noundef %205, i64 noundef %207, i32 noundef 4)
          to label %209 unwind label %214

209:                                              ; preds = %204
  %210 = icmp ne i32 %208, -1
  br i1 %210, label %222, label %211

211:                                              ; preds = %209
  %212 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %212, ptr noundef @.str.11)
          to label %213 unwind label %218

213:                                              ; preds = %211
  invoke void @__cxa_throw(ptr %212, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %234 unwind label %214

214:                                              ; preds = %213, %204
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %16, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %17, align 4
  br label %225

218:                                              ; preds = %211
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %16, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %17, align 4
  call void @__cxa_free_exception(ptr %212) #6
  br label %225

222:                                              ; preds = %209
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret void

225:                                              ; preds = %218, %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %226

226:                                              ; preds = %225, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %227

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

228:                                              ; preds = %227, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %229

229:                                              ; preds = %228
  %230 = load ptr, ptr %16, align 8
  %231 = load i32, ptr %17, align 4
  %232 = insertvalue { ptr, i32 } poison, ptr %230, 0
  %233 = insertvalue { ptr, i32 } %232, i32 %231, 1
  resume { ptr, i32 } %233

234:                                              ; preds = %213, %154, %123, %94
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN2vl8database8IdObjectImLl1EE7InvalidEv() #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl1EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 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 = { 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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTSN2vl8database8IdObjectImLl1EEE", !12, i64 0}
!15 = !{!16, !12, i64 72}
!16 = !{!"_ZTSN2vl8database15buffer_internal12FileUseMasksE", !17, i64 0, !18, i64 8, !12, i64 16, !19, i64 24, !12, i64 72, !6, i64 80}
!17 = !{!"_ZTSN2vl6ObjectE"}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN2vl11collections4ListImmEE", !20, i64 0}
!20 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !21, i64 0, !12, i64 24, !10, i64 32}
!21 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !22, i64 0, !6, i64 8, !12, i64 16}
!22 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !17, i64 0}
!23 = !{!16, !6, i64 80}
!24 = !{i64 0, i64 8, !11}
!25 = !{!26, !6, i64 0}
!26 = !{!"_ZTSN2vl8database14BufferPageDescE", !6, i64 0, !12, i64 8, !10, i64 16, !12, i64 24, !10, i64 32}
!27 = !{!16, !12, 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.9 = external hidden unnamed_addr constant [128 x i32], align 4
@.str.10 = external hidden unnamed_addr constant [128 x i32], align 4
@.str.11 = external hidden unnamed_addr constant [106 x i32], align 4
@.str.12 = external hidden unnamed_addr constant [133 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 uwtable
declare dso_local i64 @_ZN2vl8database15buffer_internal11FileMapping10AppendPageEv(ptr noundef nonnull align 8 dereferenceable(152)) local_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 #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 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 #2 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 #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl8database15buffer_internal12FileUseMasks10SetUseMaskENS0_8IdObjectImLl1EEEb(ptr noundef nonnull align 8 dereferenceable(88) %0, i64 %1, i1 noundef zeroext %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.vl::database::IdObject", align 8
  %5 = alloca %"struct.vl::database::IdObject", align 8
  %6 = alloca %"class.vl::Ptr", align 8
  %7 = alloca %"class.vl::Ptr", align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = shl i64 %9, 6
  %11 = udiv i64 %1, %10
  %12 = urem i64 %1, %10
  %13 = lshr i64 %12, 6
  %14 = and i64 %12, 63
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %15 = tail call i64 @_ZN2vl8database8IdObjectImLl1EE7InvalidEv()
  store i64 %15, ptr %4, align 8
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  %17 = tail call noundef i64 @_ZNK2vl11collections9ArrayBaseImE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = icmp eq i64 %11, %17
  br i1 %18, label %19, label %61

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %20 = add i64 %11, -1
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %16, i64 noundef %20)
  %22 = load i64, ptr %21, align 8, !tbaa !18
  call void @_ZN2vl8database8IdObjectImLl1EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %22)
  %23 = getelementptr inbounds i8, ptr %0, i64 80
  %24 = load ptr, ptr %23, align 8, !tbaa !19
  %25 = call i64 @_ZN2vl8database15buffer_internal11FileMapping10AppendPageEv(ptr noundef nonnull align 8 dereferenceable(152) %24)
  store i64 %25, ptr %4, align 8, !tbaa !18
  %26 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl1EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  br i1 %26, label %32, label %27

27:                                               ; preds = %19
  %28 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @.str.9)
          to label %29 unwind label %30

29:                                               ; preds = %27
  call void @__cxa_throw(ptr nonnull %28, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #6
  unreachable

30:                                               ; preds = %27
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %28) #5
  br label %60

32:                                               ; preds = %19
  %.sroa.010.0.copyload = load i64, ptr %4, align 8, !tbaa !18
  call void @_ZN2vl8database15buffer_internal12FileUseMasks10SetUseMaskENS0_8IdObjectImLl1EEEb(ptr noundef nonnull align 8 dereferenceable(88) %0, i64 %.sroa.010.0.copyload, i1 noundef zeroext true)
  %33 = call noundef i64 @_ZN2vl11collections4ListImmE3AddERKm(ptr noundef nonnull align 8 dereferenceable(33) %16, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  %34 = load ptr, ptr %23, align 8, !tbaa !19
  %.sroa.09.0.copyload = load i64, ptr %5, align 8, !tbaa !18
  call void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind nonnull writable sret(%"class.vl::Ptr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(152) %34, i64 %.sroa.09.0.copyload)
  %35 = call noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef null)
  br i1 %35, label %43, label %36

36:                                               ; preds = %32
  %37 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull @.str.10)
          to label %38 unwind label %41

38:                                               ; preds = %36
  invoke void @__cxa_throw(ptr nonnull %37, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #6
          to label %107 unwind label %39

39:                                               ; preds = %38
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %59

41:                                               ; preds = %36
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %37) #5
  br label %59

43:                                               ; preds = %32
  %44 = call noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %45 = load ptr, ptr %44, align 8, !tbaa !20
  %46 = load i64, ptr %4, align 8, !tbaa !22
  store i64 %46, ptr %45, align 8, !tbaa !18
  %47 = getelementptr inbounds i8, ptr %0, i64 16
  %48 = load i64, ptr %47, align 8, !tbaa !24
  %49 = invoke i32 @msync(ptr noundef nonnull %45, i64 noundef %48, i32 noundef 4)
          to label %50 unwind label %54

50:                                               ; preds = %43
  %.not = icmp eq i32 %49, -1
  br i1 %.not, label %51, label %58

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

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

54:                                               ; preds = %53, %43
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %59

56:                                               ; preds = %51
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %52) #5
  br label %59

58:                                               ; preds = %50
  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
  %.sroa.0.0.copyload.pre = load i64, ptr %4, align 8, !tbaa !18
  br label %64

59:                                               ; preds = %54, %56, %41, %39
  %.pn.pn = phi { ptr, i32 } [ %40, %39 ], [ %42, %41 ], [ %55, %54 ], [ %57, %56 ]
  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
  br label %60

60:                                               ; preds = %59, %30
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %59 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %106

61:                                               ; preds = %3
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListImmEixEl(ptr noundef nonnull align 8 dereferenceable(33) %16, i64 noundef %11)
  %63 = load i64, ptr %62, align 8, !tbaa !18
  store i64 %63, ptr %4, align 8, !tbaa !22
  br label %64

64:                                               ; preds = %61, %58
  %.sroa.0.0.copyload = phi i64 [ %63, %61 ], [ %.sroa.0.0.copyload.pre, %58 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  %65 = getelementptr inbounds i8, ptr %0, i64 80
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  call void @_ZN2vl8database15buffer_internal11FileMapping7MapPageENS0_8IdObjectImLl1EEE(ptr dead_on_unwind nonnull writable sret(%"class.vl::Ptr") align 8 %7, ptr noundef nonnull align 8 dereferenceable(152) %66, i64 %.sroa.0.0.copyload)
  %67 = call noundef zeroext i1 @_ZNK2vl3PtrINS_8database14BufferPageDescEEneEPKS2_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef null)
  br i1 %67, label %75, label %68

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

70:                                               ; preds = %68
  invoke void @__cxa_throw(ptr nonnull %69, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #6
          to label %107 unwind label %71

71:                                               ; preds = %70
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %105

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

75:                                               ; preds = %64
  %76 = call noundef ptr @_ZNK2vl3PtrINS_8database14BufferPageDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  br i1 %18, label %78, label %81

78:                                               ; preds = %75
  %79 = getelementptr inbounds i8, ptr %0, i64 16
  %80 = load i64, ptr %79, align 8, !tbaa !24
  call void @llvm.memset.p0.i64(ptr align 8 %77, i8 0, i64 %80, i1 false)
  store i64 -1, ptr %77, align 8, !tbaa !18
  br label %81

81:                                               ; preds = %78, %75
  %82 = getelementptr inbounds i64, ptr %77, i64 %13
  %83 = getelementptr inbounds i8, ptr %82, i64 8
  %84 = shl nuw i64 1, %14
  br i1 %2, label %85, label %88

85:                                               ; preds = %81
  %86 = load i64, ptr %83, align 8, !tbaa !18
  %87 = or i64 %86, %84
  br label %92

88:                                               ; preds = %81
  %89 = xor i64 %84, -1
  %90 = load i64, ptr %83, align 8, !tbaa !18
  %91 = and i64 %90, %89
  br label %92

92:                                               ; preds = %85, %88
  %storemerge = phi i64 [ %91, %88 ], [ %87, %85 ]
  store i64 %storemerge, ptr %83, align 8, !tbaa !18
  %93 = getelementptr inbounds i8, ptr %0, i64 16
  %94 = load i64, ptr %93, align 8, !tbaa !24
  %95 = invoke i32 @msync(ptr noundef nonnull %77, i64 noundef %94, i32 noundef 4)
          to label %96 unwind label %100

96:                                               ; preds = %92
  %.not43 = icmp eq i32 %95, -1
  br i1 %.not43, label %97, label %104

97:                                               ; preds = %96
  %98 = call ptr @__cxa_allocate_exception(i64 8) #5
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @.str.11)
          to label %99 unwind label %102

99:                                               ; preds = %97
  invoke void @__cxa_throw(ptr nonnull %98, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #6
          to label %107 unwind label %100

100:                                              ; preds = %99, %92
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %105

102:                                              ; preds = %97
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %98) #5
  br label %105

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

105:                                              ; preds = %100, %102, %73, %71
  %.pn44.pn = phi { ptr, i32 } [ %72, %71 ], [ %74, %73 ], [ %101, %100 ], [ %103, %102 ]
  call void @_ZN2vl3PtrINS_8database14BufferPageDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %106

106:                                              ; preds = %105, %60
  %.pn44.pn.pn = phi { ptr, i32 } [ %.pn44.pn, %105 ], [ %.pn.pn.pn, %60 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn44.pn.pn

107:                                              ; preds = %99, %70, %53, %38
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN2vl8database8IdObjectImLl1EE7InvalidEv() local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl1EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 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 = { 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, !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 = !{!23, !11, i64 0}
!23 = !{!"_ZTSN2vl8database8IdObjectImLl1EEE", !11, i64 0}
!24 = !{!6, !11, i64 16}


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