; LLVM IR from vczh/herodb :: Kernel/Source/Utility/Log.ll (ZN2vl8database12log_internal9LogWriter5CloseEv)

; 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 }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }
%"struct.vl::database::IdObject.17" = type { i64 }
%"struct.vl::database::IdObject.16" = type { i64 }
%"struct.vl::database::IdObject.15" = type { i64 }
%"struct.vl::database::IdObject" = type { i32 }
%"class.vl::database::log_internal::LogWriter" = type <{ %"class.vl::Object", %"class.vl::database::ILogWriter", ptr, ptr, %"struct.vl::database::IdObject", [4 x i8], ptr, ptr, ptr, %"class.vl::stream::MemoryStream", %"struct.vl::database::IdObject.17", i8, [7 x i8] }>
%"class.vl::database::ILogWriter" = type { %"class.vl::database::ILogAccessor" }
%"class.vl::database::ILogAccessor" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::stream::MemoryStream" = type { %"class.vl::Object", i64, ptr, i64, i64, i64, %"class.vl::stream::IStream" }
%"class.vl::stream::IStream" = type { %"class.vl::Interface" }
%"class.vl::database::log_internal::LogTransDesc" = type { %"struct.vl::database::IdObject.16", %"struct.vl::database::IdObject.16", %"class.vl::Ptr.37" }
%"class.vl::Ptr.37" = type { ptr, ptr, ptr, ptr }

@_ZTIN2vl5ErrorE = external dso_local constant { ptr, ptr }, align 8
@.str.1 = external hidden unnamed_addr constant [106 x i32], align 4
@.str.2 = external hidden unnamed_addr constant [111 x i32], align 4
@.str.3 = external hidden unnamed_addr constant [102 x i32], align 4
@.str.4 = external hidden unnamed_addr constant [84 x i32], align 4
@.str.5 = external hidden unnamed_addr constant [111 x i32], align 4

; 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) #0

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) #1

declare noundef ptr @_ZN2vl8database13BufferManager8LockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEE(ptr noundef nonnull align 8 dereferenceable(168), i32, i64) #2

declare noundef zeroext i1 @_ZN2vl8database13BufferManager10UnlockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEEPvNS0_15PersistanceTypeE(ptr noundef nonnull align 8 dereferenceable(168), i32, i64, ptr noundef, i32 noundef) #2

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

declare ptr @__cxa_allocate_exception(i64)

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

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl8database12log_internal15LogTransactions12GetTransDescENS0_8IdObjectImLl3EEE(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr") align 8, ptr noundef nonnull align 8 dereferenceable(136), i64) #3 align 2

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

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

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

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

declare noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(8), i64, i64 noundef) #2

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

declare noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168), i64, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database12log_internal9LogWriter5CloseEv(ptr noundef nonnull align 8 dereferenceable(129) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca %"class.vl::SpinLock::Scope", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.vl::Ptr", align 8
  %9 = alloca %"struct.vl::database::IdObject.17", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"struct.vl::database::IdObject.16", align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.vl::database::IdObject.15", align 8
  %20 = alloca i64, align 8
  %21 = alloca %"struct.vl::database::IdObject.16", align 8
  %22 = alloca ptr, align 8
  %23 = alloca %"struct.vl::database::IdObject", align 4
  %24 = alloca %"struct.vl::database::IdObject.15", align 8
  %25 = alloca ptr, align 8
  %26 = alloca %"struct.vl::database::IdObject", align 4
  %27 = alloca %"struct.vl::database::IdObject.15", align 8
  %28 = alloca %"struct.vl::database::IdObject.17", align 8
  %29 = alloca %"struct.vl::database::IdObject.16", align 8
  %30 = alloca %"struct.vl::database::IdObject.15", align 8
  %31 = alloca i64, align 8
  %32 = alloca %"struct.vl::database::IdObject.16", align 8
  %33 = alloca ptr, align 8
  %34 = alloca %"struct.vl::database::IdObject", align 4
  %35 = alloca %"struct.vl::database::IdObject.15", align 8
  %36 = alloca %"struct.vl::database::IdObject", align 4
  %37 = alloca %"struct.vl::database::IdObject.15", align 8
  %38 = alloca %"struct.vl::database::IdObject.15", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %39 = load ptr, ptr %3, align 8
  %40 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 11
  %41 = load i8, ptr %40, align 8, !tbaa !9, !range !19, !noundef !20
  %42 = trunc i8 %41 to i1
  br i1 %42, label %44, label %43

43:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %381

44:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  store i8 1, ptr %4, align 1, !tbaa !21
  %45 = load i8, ptr %4, align 1, !tbaa !21, !range !19, !noundef !20
  %46 = trunc i8 %45 to i1
  br i1 %46, label %47, label %380

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  %48 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !22
  call void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %49)
  store ptr %6, ptr %5, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %375, %47
  %51 = load i8, ptr %4, align 1, !tbaa !21, !range !19, !noundef !20
  %52 = trunc i8 %51 to i1
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  store i32 2, ptr %7, align 4
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %379

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  %55 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 7
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 10
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %57, i64 8, i1 false), !tbaa.struct !24
  %58 = getelementptr inbounds %"struct.vl::database::IdObject.17", ptr %9, i32 0, i32 0
  %59 = load i64, ptr %58, align 8
  invoke void @_ZN2vl8database12log_internal15LogTransactions12GetTransDescENS0_8IdObjectImLl3EEE(ptr dead_on_unwind writable sret(%"class.vl::Ptr") align 8 %8, ptr noundef nonnull align 8 dereferenceable(136) %56, i64 %59)
          to label %60 unwind label %91

60:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %61 = invoke noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %62 unwind label %95

62:                                               ; preds = %60
  %63 = getelementptr inbounds %"class.vl::database::log_internal::LogTransDesc", ptr %61, i32 0, i32 0
  %64 = invoke noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %63)
          to label %65 unwind label %95

65:                                               ; preds = %62
  %66 = zext i1 %64 to i64
  %67 = select i1 %64, i32 3, i32 4
  %68 = sext i32 %67 to i64
  store i64 %68, ptr %12, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %69 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 9
  %70 = invoke noundef i64 @_ZNK2vl6stream12MemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(48) %69)
          to label %71 unwind label %99

71:                                               ; preds = %65
  store i64 %70, ptr %14, align 8, !tbaa !25
  %72 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 9
  invoke void @_ZN2vl6stream12MemoryStream13SeekFromBeginEl(ptr noundef nonnull align 8 dereferenceable(48) %72, i64 noundef 0)
          to label %73 unwind label %99

73:                                               ; preds = %71
  br label %74

74:                                               ; preds = %362, %73
  br label %75

75:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %76 = load i64, ptr %12, align 8, !tbaa !25
  %77 = mul i64 %76, 8
  store i64 %77, ptr %15, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %78 = load i64, ptr %15, align 8, !tbaa !25
  %79 = load i64, ptr %14, align 8, !tbaa !25
  %80 = add i64 %78, %79
  store i64 %80, ptr %16, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  invoke void @_ZN2vl8database8IdObjectImLl2EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %81 unwind label %103

81:                                               ; preds = %75
  br label %82

82:                                               ; preds = %81
  %83 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 8
  %84 = load ptr, ptr %83, align 8, !tbaa !26
  %85 = load i64, ptr %15, align 8, !tbaa !25
  %86 = invoke noundef zeroext i1 @_ZN2vl8database12log_internal9LogBlocks13AllocateBlockEmRmRNS0_8IdObjectImLl2EEE(ptr noundef nonnull align 8 dereferenceable(40) %84, i64 noundef %85, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %87 unwind label %103

87:                                               ; preds = %82
  br i1 %86, label %111, 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.1)
          to label %90 unwind label %107

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

91:                                               ; preds = %54
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %10, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %11, align 4
  br label %378

95:                                               ; preds = %62, %60
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %10, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %11, align 4
  br label %377

99:                                               ; preds = %371, %368, %71, %65
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %10, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %11, align 4
  br label %376

103:                                              ; preds = %90, %82, %75
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %10, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %11, align 4
  br label %367

107:                                              ; preds = %88
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %10, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %11, align 4
  call void @__cxa_free_exception(ptr %89) #6
  br label %367

111:                                              ; preds = %87
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %114 = load i64, ptr %16, align 8, !tbaa !25
  %115 = load i64, ptr %15, align 8, !tbaa !25
  %116 = sub i64 %114, %115
  store i64 %116, ptr %18, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  invoke void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %117 unwind label %128

117:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  br label %118

118:                                              ; preds = %117
  %119 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 3
  %120 = load ptr, ptr %119, align 8, !tbaa !27
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %17, i64 8, i1 false), !tbaa.struct !24
  %121 = getelementptr inbounds %"struct.vl::database::IdObject.16", ptr %21, i32 0, i32 0
  %122 = load i64, ptr %121, align 8
  %123 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168) %120, i64 %122, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %124 unwind label %132

124:                                              ; preds = %118
  br i1 %123, label %140, label %125

125:                                              ; preds = %124
  %126 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef @.str.2)
          to label %127 unwind label %136

127:                                              ; preds = %125
  invoke void @__cxa_throw(ptr %126, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %388 unwind label %132

128:                                              ; preds = %113
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %10, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %11, align 4
  br label %366

132:                                              ; preds = %127, %118
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %10, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %11, align 4
  br label %365

136:                                              ; preds = %125
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %10, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %11, align 4
  call void @__cxa_free_exception(ptr %126) #6
  br label %365

140:                                              ; preds = %124
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %143 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 3
  %144 = load ptr, ptr %143, align 8, !tbaa !27
  %145 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %145, i64 4, i1 false), !tbaa.struct !28
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !24
  %146 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %23, i32 0, i32 0
  %147 = load i32, ptr %146, align 4
  %148 = getelementptr inbounds %"struct.vl::database::IdObject.15", ptr %24, i32 0, i32 0
  %149 = load i64, ptr %148, align 8
  %150 = invoke noundef ptr @_ZN2vl8database13BufferManager8LockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEE(ptr noundef nonnull align 8 dereferenceable(168) %144, i32 %147, i64 %149)
          to label %151 unwind label %156

151:                                              ; preds = %142
  store ptr %150, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %152 = load ptr, ptr %22, align 8, !tbaa !5
  %153 = load i64, ptr %20, align 8, !tbaa !25
  %154 = getelementptr inbounds i8, ptr %152, i64 %153
  store ptr %154, ptr %25, align 8, !tbaa !5
  %155 = load i64, ptr %12, align 8, !tbaa !25
  switch i64 %155, label %178 [
    i64 4, label %160
    i64 3, label %166
    i64 2, label %172
  ]

156:                                              ; preds = %142
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %10, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %11, align 4
  br label %364

160:                                              ; preds = %151
  %161 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 10
  %162 = getelementptr inbounds %"struct.vl::database::IdObject.17", ptr %161, i32 0, i32 0
  %163 = load i64, ptr %162, align 8, !tbaa !30
  %164 = load ptr, ptr %25, align 8, !tbaa !5
  %165 = getelementptr inbounds i64, ptr %164, i32 1
  store ptr %165, ptr %25, align 8, !tbaa !5
  store i64 %163, ptr %164, align 8, !tbaa !25
  br label %166

166:                                              ; preds = %160, %151
  %167 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 9
  %168 = invoke noundef i64 @_ZNK2vl6stream12MemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(48) %167)
          to label %169 unwind label %206

169:                                              ; preds = %166
  %170 = load ptr, ptr %25, align 8, !tbaa !5
  %171 = getelementptr inbounds i64, ptr %170, i32 1
  store ptr %171, ptr %25, align 8, !tbaa !5
  store i64 %168, ptr %170, align 8, !tbaa !25
  br label %172

172:                                              ; preds = %169, %151
  %173 = load i64, ptr %18, align 8, !tbaa !25
  %174 = load ptr, ptr %25, align 8, !tbaa !5
  %175 = getelementptr inbounds i64, ptr %174, i32 1
  store ptr %175, ptr %25, align 8, !tbaa !5
  store i64 %173, ptr %174, align 8, !tbaa !25
  %176 = load ptr, ptr %25, align 8, !tbaa !5
  %177 = getelementptr inbounds i64, ptr %176, i32 1
  store ptr %177, ptr %25, align 8, !tbaa !5
  store i64 -1, ptr %176, align 8, !tbaa !25
  br label %178

178:                                              ; preds = %172, %151
  %179 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 9
  %180 = load ptr, ptr %25, align 8, !tbaa !5
  %181 = load i64, ptr %14, align 8, !tbaa !25
  %182 = load i64, ptr %18, align 8, !tbaa !25
  %183 = icmp ult i64 %181, %182
  br i1 %183, label %184, label %186

184:                                              ; preds = %178
  %185 = load i64, ptr %14, align 8, !tbaa !25
  br label %188

186:                                              ; preds = %178
  %187 = load i64, ptr %18, align 8, !tbaa !25
  br label %188

188:                                              ; preds = %186, %184
  %189 = phi i64 [ %185, %184 ], [ %187, %186 ]
  %190 = invoke noundef i64 @_ZN2vl6stream12MemoryStream4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(48) %179, ptr noundef %180, i64 noundef %189)
          to label %191 unwind label %206

191:                                              ; preds = %188
  br label %192

192:                                              ; preds = %191
  %193 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 3
  %194 = load ptr, ptr %193, align 8, !tbaa !27
  %195 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 8 %195, i64 4, i1 false), !tbaa.struct !28
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !24
  %196 = load ptr, ptr %22, align 8, !tbaa !5
  %197 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %26, i32 0, i32 0
  %198 = load i32, ptr %197, align 4
  %199 = getelementptr inbounds %"struct.vl::database::IdObject.15", ptr %27, i32 0, i32 0
  %200 = load i64, ptr %199, align 8
  %201 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager10UnlockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEEPvNS0_15PersistanceTypeE(ptr noundef nonnull align 8 dereferenceable(168) %194, i32 %198, i64 %200, ptr noundef %196, i32 noundef 2)
          to label %202 unwind label %206

202:                                              ; preds = %192
  br i1 %201, label %214, label %203

203:                                              ; preds = %202
  %204 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %204, ptr noundef @.str.3)
          to label %205 unwind label %210

205:                                              ; preds = %203
  invoke void @__cxa_throw(ptr %204, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %388 unwind label %206

206:                                              ; preds = %340, %327, %323, %245, %243, %235, %223, %219, %205, %192, %188, %166
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %10, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %11, align 4
  br label %363

210:                                              ; preds = %203
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %10, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %11, align 4
  call void @__cxa_free_exception(ptr %204) #6
  br label %363

214:                                              ; preds = %202
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  %217 = load i64, ptr %12, align 8, !tbaa !25
  %218 = icmp eq i64 %217, 4
  br i1 %218, label %219, label %243

219:                                              ; preds = %216
  %220 = invoke noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %221 unwind label %206

221:                                              ; preds = %219
  %222 = getelementptr inbounds %"class.vl::database::log_internal::LogTransDesc", ptr %220, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %222, ptr align 8 %17, i64 8, i1 false), !tbaa.struct !24
  br label %223

223:                                              ; preds = %221
  %224 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 6
  %225 = load ptr, ptr %224, align 8, !tbaa !31
  %226 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 10
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %226, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %17, i64 8, i1 false), !tbaa.struct !24
  %227 = getelementptr inbounds %"struct.vl::database::IdObject.17", ptr %28, i32 0, i32 0
  %228 = load i64, ptr %227, align 8
  %229 = getelementptr inbounds %"struct.vl::database::IdObject.16", ptr %29, i32 0, i32 0
  %230 = load i64, ptr %229, align 8
  %231 = invoke noundef zeroext i1 @_ZN2vl8database12log_internal14LogAddressItem16WriteAddressItemENS0_8IdObjectImLl3EEENS3_ImLl2EEE(ptr noundef nonnull align 8 dereferenceable(88) %225, i64 %228, i64 %230)
          to label %232 unwind label %206

232:                                              ; preds = %223
  br i1 %231, label %240, label %233

233:                                              ; preds = %232
  %234 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %234, ptr noundef @.str.4)
          to label %235 unwind label %236

235:                                              ; preds = %233
  invoke void @__cxa_throw(ptr %234, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %388 unwind label %206

236:                                              ; preds = %233
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %10, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %11, align 4
  call void @__cxa_free_exception(ptr %234) #6
  br label %363

240:                                              ; preds = %232
  br label %241

241:                                              ; preds = %240
  br label %242

242:                                              ; preds = %241
  br label %322

243:                                              ; preds = %216
  %244 = invoke noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %245 unwind label %206

245:                                              ; preds = %243
  %246 = getelementptr inbounds %"class.vl::database::log_internal::LogTransDesc", ptr %244, i32 0, i32 1
  %247 = invoke noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %246)
          to label %248 unwind label %206

248:                                              ; preds = %245
  br i1 %247, label %249, label %321

249:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  invoke void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %250 unwind label %264

250:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  br label %251

251:                                              ; preds = %250
  %252 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 3
  %253 = load ptr, ptr %252, align 8, !tbaa !27
  %254 = invoke noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %255 unwind label %268

255:                                              ; preds = %251
  %256 = getelementptr inbounds %"class.vl::database::log_internal::LogTransDesc", ptr %254, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %256, i64 8, i1 false), !tbaa.struct !24
  %257 = getelementptr inbounds %"struct.vl::database::IdObject.16", ptr %32, i32 0, i32 0
  %258 = load i64, ptr %257, align 8
  %259 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168) %253, i64 %258, ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %260 unwind label %268

260:                                              ; preds = %255
  br i1 %259, label %276, label %261

261:                                              ; preds = %260
  %262 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %262, ptr noundef @.str.2)
          to label %263 unwind label %272

263:                                              ; preds = %261
  invoke void @__cxa_throw(ptr %262, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %388 unwind label %268

264:                                              ; preds = %249
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %10, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %11, align 4
  br label %320

268:                                              ; preds = %263, %255, %251
  %269 = landingpad { ptr, i32 }
          cleanup
  %270 = extractvalue { ptr, i32 } %269, 0
  store ptr %270, ptr %10, align 8
  %271 = extractvalue { ptr, i32 } %269, 1
  store i32 %271, ptr %11, align 4
  br label %319

272:                                              ; preds = %261
  %273 = landingpad { ptr, i32 }
          cleanup
  %274 = extractvalue { ptr, i32 } %273, 0
  store ptr %274, ptr %10, align 8
  %275 = extractvalue { ptr, i32 } %273, 1
  store i32 %275, ptr %11, align 4
  call void @__cxa_free_exception(ptr %262) #6
  br label %319

276:                                              ; preds = %260
  br label %277

277:                                              ; preds = %276
  br label %278

278:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %279 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 3
  %280 = load ptr, ptr %279, align 8, !tbaa !27
  %281 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 8 %281, i64 4, i1 false), !tbaa.struct !28
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %30, i64 8, i1 false), !tbaa.struct !24
  %282 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %34, i32 0, i32 0
  %283 = load i32, ptr %282, align 4
  %284 = getelementptr inbounds %"struct.vl::database::IdObject.15", ptr %35, i32 0, i32 0
  %285 = load i64, ptr %284, align 8
  %286 = invoke noundef ptr @_ZN2vl8database13BufferManager8LockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEE(ptr noundef nonnull align 8 dereferenceable(168) %280, i32 %283, i64 %285)
          to label %287 unwind label %307

287:                                              ; preds = %278
  store ptr %286, ptr %33, align 8, !tbaa !5
  %288 = getelementptr inbounds %"struct.vl::database::IdObject.16", ptr %17, i32 0, i32 0
  %289 = load i64, ptr %288, align 8, !tbaa !32
  %290 = load ptr, ptr %33, align 8, !tbaa !5
  %291 = load i64, ptr %31, align 8, !tbaa !25
  %292 = getelementptr inbounds i8, ptr %290, i64 %291
  store i64 %289, ptr %292, align 8, !tbaa !25
  br label %293

293:                                              ; preds = %287
  %294 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 3
  %295 = load ptr, ptr %294, align 8, !tbaa !27
  %296 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 8 %296, i64 4, i1 false), !tbaa.struct !28
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %30, i64 8, i1 false), !tbaa.struct !24
  %297 = load ptr, ptr %33, align 8, !tbaa !5
  %298 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %36, i32 0, i32 0
  %299 = load i32, ptr %298, align 4
  %300 = getelementptr inbounds %"struct.vl::database::IdObject.15", ptr %37, i32 0, i32 0
  %301 = load i64, ptr %300, align 8
  %302 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager10UnlockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEEPvNS0_15PersistanceTypeE(ptr noundef nonnull align 8 dereferenceable(168) %295, i32 %299, i64 %301, ptr noundef %297, i32 noundef 2)
          to label %303 unwind label %307

303:                                              ; preds = %293
  br i1 %302, label %315, label %304

304:                                              ; preds = %303
  %305 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %305, ptr noundef @.str.4)
          to label %306 unwind label %311

306:                                              ; preds = %304
  invoke void @__cxa_throw(ptr %305, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %388 unwind label %307

307:                                              ; preds = %306, %293, %278
  %308 = landingpad { ptr, i32 }
          cleanup
  %309 = extractvalue { ptr, i32 } %308, 0
  store ptr %309, ptr %10, align 8
  %310 = extractvalue { ptr, i32 } %308, 1
  store i32 %310, ptr %11, align 4
  br label %318

311:                                              ; preds = %304
  %312 = landingpad { ptr, i32 }
          cleanup
  %313 = extractvalue { ptr, i32 } %312, 0
  store ptr %313, ptr %10, align 8
  %314 = extractvalue { ptr, i32 } %312, 1
  store i32 %314, ptr %11, align 4
  call void @__cxa_free_exception(ptr %305) #6
  br label %318

315:                                              ; preds = %303
  br label %316

316:                                              ; preds = %315
  br label %317

317:                                              ; preds = %316
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %321

318:                                              ; preds = %311, %307
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  br label %319

319:                                              ; preds = %318, %272, %268
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  br label %320

320:                                              ; preds = %319, %264
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %363

321:                                              ; preds = %317, %248
  br label %322

322:                                              ; preds = %321, %242
  br label %323

323:                                              ; preds = %322
  %324 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 3
  %325 = load ptr, ptr %324, align 8, !tbaa !27
  %326 = invoke noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %327 unwind label %206

327:                                              ; preds = %323
  %328 = getelementptr inbounds %"class.vl::database::log_internal::LogTransDesc", ptr %326, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !24
  %329 = load i64, ptr %20, align 8, !tbaa !25
  %330 = load i64, ptr %12, align 8, !tbaa !25
  %331 = sub nsw i64 %330, 1
  %332 = mul i64 %331, 8
  %333 = add i64 %329, %332
  %334 = getelementptr inbounds %"struct.vl::database::IdObject.15", ptr %38, i32 0, i32 0
  %335 = load i64, ptr %334, align 8
  %336 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168) %325, ptr noundef nonnull align 8 dereferenceable(8) %328, i64 %335, i64 noundef %333)
          to label %337 unwind label %206

337:                                              ; preds = %327
  br i1 %336, label %345, label %338

338:                                              ; preds = %337
  %339 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %339, ptr noundef @.str.5)
          to label %340 unwind label %341

340:                                              ; preds = %338
  invoke void @__cxa_throw(ptr %339, ptr @_ZTIN2vl5ErrorE, ptr null) #7
          to label %388 unwind label %206

341:                                              ; preds = %338
  %342 = landingpad { ptr, i32 }
          cleanup
  %343 = extractvalue { ptr, i32 } %342, 0
  store ptr %343, ptr %10, align 8
  %344 = extractvalue { ptr, i32 } %342, 1
  store i32 %344, ptr %11, align 4
  call void @__cxa_free_exception(ptr %339) #6
  br label %363

345:                                              ; preds = %337
  br label %346

346:                                              ; preds = %345
  br label %347

347:                                              ; preds = %346
  %348 = load i64, ptr %14, align 8, !tbaa !25
  %349 = load i64, ptr %18, align 8, !tbaa !25
  %350 = icmp ugt i64 %348, %349
  br i1 %350, label %351, label %358

351:                                              ; preds = %347
  %352 = load i64, ptr %18, align 8, !tbaa !25
  %353 = load i64, ptr %13, align 8, !tbaa !25
  %354 = add i64 %353, %352
  store i64 %354, ptr %13, align 8, !tbaa !25
  %355 = load i64, ptr %18, align 8, !tbaa !25
  %356 = load i64, ptr %14, align 8, !tbaa !25
  %357 = sub i64 %356, %355
  store i64 %357, ptr %14, align 8, !tbaa !25
  store i64 2, ptr %12, align 8, !tbaa !25
  br label %359

358:                                              ; preds = %347
  store i32 6, ptr %7, align 4
  br label %360

359:                                              ; preds = %351
  store i32 0, ptr %7, align 4
  br label %360

360:                                              ; preds = %359, %358
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %361 = load i32, ptr %7, align 4
  switch i32 %361, label %388 [
    i32 0, label %362
    i32 6, label %368
  ]

362:                                              ; preds = %360
  br label %74, !llvm.loop !34

363:                                              ; preds = %341, %320, %236, %210, %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %364

364:                                              ; preds = %363, %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %365

365:                                              ; preds = %364, %136, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %366

366:                                              ; preds = %365, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %367

367:                                              ; preds = %366, %107, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %376

368:                                              ; preds = %360
  %369 = getelementptr inbounds %"class.vl::database::log_internal::LogWriter", ptr %39, i32 0, i32 11
  store i8 0, ptr %369, align 8, !tbaa !9
  %370 = invoke noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %371 unwind label %99

371:                                              ; preds = %368
  %372 = getelementptr inbounds %"class.vl::database::log_internal::LogTransDesc", ptr %370, i32 0, i32 2
  %373 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database10ILogWriterEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(32) %372, ptr noundef null)
          to label %374 unwind label %99

374:                                              ; preds = %371
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @_ZN2vl3PtrINS_8database12log_internal12LogTransDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  br label %375

375:                                              ; preds = %374
  store i8 0, ptr %4, align 1, !tbaa !21
  br label %50, !llvm.loop !36

376:                                              ; preds = %367, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %377

377:                                              ; preds = %376, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @_ZN2vl3PtrINS_8database12log_internal12LogTransDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %378

378:                                              ; preds = %377, %91
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  br label %383

379:                                              ; preds = %53
  br label %380

380:                                              ; preds = %379, %44
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  store i1 true, ptr %2, align 1
  br label %381

381:                                              ; preds = %380, %43
  %382 = load i1, ptr %2, align 1
  ret i1 %382

383:                                              ; preds = %378
  %384 = load ptr, ptr %10, align 8
  %385 = load i32, ptr %11, align 4
  %386 = insertvalue { ptr, i32 } poison, ptr %384, 0
  %387 = insertvalue { ptr, i32 } %386, i32 %385, 1
  resume { ptr, i32 } %387

388:                                              ; preds = %360, %340, %306, %263, %235, %205, %127, %90
  unreachable
}

declare void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare noundef i64 @_ZNK2vl6stream12MemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2

declare void @_ZN2vl6stream12MemoryStream13SeekFromBeginEl(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) unnamed_addr #2

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

declare noundef i64 @_ZN2vl6stream12MemoryStream4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i64 noundef) unnamed_addr #2

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

; Function Attrs: nounwind
declare void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !18, i64 128}
!10 = !{!"_ZTSN2vl8database12log_internal9LogWriterE", !11, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !15, i64 64, !17, i64 120, !18, i64 128}
!11 = !{!"_ZTSN2vl6ObjectE"}
!12 = !{!"_ZTSN2vl8database10ILogWriterE"}
!13 = !{!"_ZTSN2vl8database8IdObjectIiLl0EEE", !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN2vl6stream12MemoryStreamE", !11, i64 0, !16, i64 8, !6, i64 16, !16, i64 24, !16, i64 32, !16, i64 40}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN2vl8database8IdObjectImLl3EEE", !16, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!18, !18, i64 0}
!22 = !{!10, !6, i64 16}
!23 = !{!10, !6, i64 48}
!24 = !{i64 0, i64 8, !25}
!25 = !{!16, !16, i64 0}
!26 = !{!10, !6, i64 56}
!27 = !{!10, !6, i64 24}
!28 = !{i64 0, i64 4, !29}
!29 = !{!14, !14, i64 0}
!30 = !{!10, !16, i64 120}
!31 = !{!10, !6, i64 40}
!32 = !{!33, !16, i64 0}
!33 = !{!"_ZTSN2vl8database8IdObjectImLl2EEE", !16, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}


; 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 }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }
%"struct.vl::database::IdObject.16" = type { i64 }
%"struct.vl::database::IdObject.15" = type { i64 }

@_ZTIN2vl5ErrorE = external dso_local constant { ptr, ptr }, align 8
@.str.1 = external hidden unnamed_addr constant [106 x i32], align 4
@.str.2 = external hidden unnamed_addr constant [111 x i32], align 4
@.str.3 = external hidden unnamed_addr constant [102 x i32], align 4
@.str.4 = external hidden unnamed_addr constant [84 x i32], align 4
@.str.5 = external hidden unnamed_addr constant [111 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 noundef ptr @_ZN2vl8database13BufferManager8LockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEE(ptr noundef nonnull align 8 dereferenceable(168), i32, i64) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN2vl8database13BufferManager10UnlockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEEPvNS0_15PersistanceTypeE(ptr noundef nonnull align 8 dereferenceable(168), i32, i64, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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 uwtable
declare dso_local noundef zeroext i1 @_ZN2vl8database12log_internal14LogAddressItem16WriteAddressItemENS0_8IdObjectImLl3EEENS3_ImLl2EEE(ptr noundef nonnull align 8 dereferenceable(88), i64, i64) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl8database12log_internal15LogTransactions12GetTransDescENS0_8IdObjectImLl3EEE(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr") align 8, ptr noundef nonnull align 8 dereferenceable(136), i64) local_unnamed_addr #2 align 2

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

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

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

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

declare noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(8), i64, i64 noundef) local_unnamed_addr #1

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

declare noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168), i64, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database12log_internal9LogWriter5CloseEv(ptr noundef nonnull align 8 dereferenceable(129) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.vl::SpinLock::Scope", align 8
  %3 = alloca %"class.vl::Ptr", align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.vl::database::IdObject.16", align 8
  %6 = alloca %"struct.vl::database::IdObject.15", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.vl::database::IdObject.15", align 8
  %9 = alloca i64, align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 128
  %11 = load i8, ptr %10, align 8, !tbaa !5, !range !18, !noundef !19
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %.critedge, label %194

.critedge:                                        ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !20
  call void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = load ptr, ptr %15, align 8, !tbaa !21
  %17 = getelementptr inbounds i8, ptr %0, i64 120
  %.sroa.041.0.copyload = load i64, ptr %17, align 8, !tbaa !22
  invoke void @_ZN2vl8database12log_internal15LogTransactions12GetTransDescENS0_8IdObjectImLl3EEE(ptr dead_on_unwind nonnull writable sret(%"class.vl::Ptr") align 8 %3, ptr noundef nonnull align 8 dereferenceable(136) %16, i64 %.sroa.041.0.copyload)
          to label %18 unwind label %106

18:                                               ; preds = %.critedge
  %19 = call noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %20 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %21 = getelementptr inbounds i8, ptr %0, i64 64
  %22 = invoke noundef i64 @_ZNK2vl6stream12MemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(48) %21)
          to label %23 unwind label %108

23:                                               ; preds = %18
  invoke void @_ZN2vl6stream12MemoryStream13SeekFromBeginEl(ptr noundef nonnull align 8 dereferenceable(48) %21, i64 noundef 0)
          to label %.preheader unwind label %108

.preheader:                                       ; preds = %23
  %24 = select i1 %20, i64 24, i64 32
  %25 = getelementptr inbounds i8, ptr %0, i64 56
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  %27 = getelementptr inbounds i8, ptr %0, i64 32
  %28 = getelementptr inbounds i8, ptr %0, i64 40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %29 = add i64 %24, %22
  store i64 %29, ptr %4, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN2vl8database8IdObjectImLl2EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %30 = load ptr, ptr %25, align 8, !tbaa !23
  %31 = invoke noundef zeroext i1 @_ZN2vl8database12log_internal9LogBlocks13AllocateBlockEmRmRNS0_8IdObjectImLl2EEE(ptr noundef nonnull align 8 dereferenceable(40) %30, i64 noundef %24, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %32 unwind label %.loopexit.loopexit.split-lp

32:                                               ; preds = %.preheader
  br i1 %31, label %33, label %.loopexit106

33:                                               ; preds = %32
  %34 = load i64, ptr %4, align 8, !tbaa !22
  %35 = sub i64 %34, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %36 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.020.0.copyload.peel = load i64, ptr %5, align 8, !tbaa !22
  %37 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168) %36, i64 %.sroa.020.0.copyload.peel, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %38 unwind label %.loopexit83.loopexit.split-lp

38:                                               ; preds = %33
  br i1 %37, label %39, label %.loopexit109

39:                                               ; preds = %38
  %40 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.017.0.copyload.peel = load i32, ptr %27, align 8, !tbaa !25
  %.sroa.016.0.copyload.peel = load i64, ptr %6, align 8, !tbaa !22
  %41 = invoke noundef ptr @_ZN2vl8database13BufferManager8LockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEE(ptr noundef nonnull align 8 dereferenceable(168) %40, i32 %.sroa.017.0.copyload.peel, i64 %.sroa.016.0.copyload.peel)
          to label %42 unwind label %.loopexit.split-lp111

42:                                               ; preds = %39
  %43 = load i64, ptr %7, align 8, !tbaa !22
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  br i1 %20, label %48, label %45

45:                                               ; preds = %42
  %46 = load i64, ptr %17, align 8, !tbaa !26
  %47 = getelementptr inbounds i8, ptr %44, i64 8
  store i64 %46, ptr %44, align 8, !tbaa !22
  br label %48

48:                                               ; preds = %42, %45
  %.064.peel = phi ptr [ %44, %42 ], [ %47, %45 ]
  %49 = invoke noundef i64 @_ZNK2vl6stream12MemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(48) %21)
          to label %50 unwind label %.loopexit88.loopexit.split-lp

50:                                               ; preds = %48
  store i64 %49, ptr %.064.peel, align 8, !tbaa !22
  %51 = getelementptr inbounds i8, ptr %.064.peel, i64 8
  %52 = getelementptr inbounds i8, ptr %.064.peel, i64 16
  store i64 %35, ptr %51, align 8, !tbaa !22
  store i64 -1, ptr %52, align 8, !tbaa !22
  %53 = getelementptr inbounds i8, ptr %.064.peel, i64 24
  %54 = call i64 @llvm.umin.i64(i64 %22, i64 %35)
  %55 = invoke noundef i64 @_ZN2vl6stream12MemoryStream4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull %53, i64 noundef %54)
          to label %56 unwind label %.loopexit88.loopexit.split-lp

56:                                               ; preds = %50
  %57 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.010.0.copyload.peel = load i32, ptr %27, align 8, !tbaa !25
  %.sroa.09.0.copyload.peel = load i64, ptr %6, align 8, !tbaa !22
  %58 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager10UnlockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEEPvNS0_15PersistanceTypeE(ptr noundef nonnull align 8 dereferenceable(168) %57, i32 %.sroa.010.0.copyload.peel, i64 %.sroa.09.0.copyload.peel, ptr noundef %41, i32 noundef 2)
          to label %59 unwind label %.loopexit88.loopexit.split-lp

59:                                               ; preds = %56
  br i1 %58, label %60, label %.loopexit118

60:                                               ; preds = %59
  %61 = call noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  br i1 %20, label %62, label %82

62:                                               ; preds = %60
  %63 = getelementptr inbounds i8, ptr %61, i64 8
  %64 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %63)
  br i1 %64, label %65, label %87

65:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %66 = load ptr, ptr %26, align 8, !tbaa !24
  %67 = call noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %.sroa.06.0.copyload.peel = load i64, ptr %68, align 8, !tbaa !22
  %69 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168) %66, i64 %.sroa.06.0.copyload.peel, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %70 unwind label %.loopexit93.loopexit.split-lp

70:                                               ; preds = %65
  br i1 %69, label %71, label %.loopexit122

71:                                               ; preds = %70
  %72 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.04.0.copyload.peel = load i32, ptr %27, align 8, !tbaa !25
  %.sroa.03.0.copyload.peel = load i64, ptr %8, align 8, !tbaa !22
  %73 = invoke noundef ptr @_ZN2vl8database13BufferManager8LockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEE(ptr noundef nonnull align 8 dereferenceable(168) %72, i32 %.sroa.04.0.copyload.peel, i64 %.sroa.03.0.copyload.peel)
          to label %74 unwind label %.loopexit98.loopexit.split-lp

74:                                               ; preds = %71
  %75 = load i64, ptr %5, align 8, !tbaa !27
  %76 = load i64, ptr %9, align 8, !tbaa !22
  %77 = getelementptr inbounds i8, ptr %73, i64 %76
  store i64 %75, ptr %77, align 8, !tbaa !22
  %78 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.02.0.copyload.peel = load i32, ptr %27, align 8, !tbaa !25
  %.sroa.01.0.copyload.peel = load i64, ptr %8, align 8, !tbaa !22
  %79 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager10UnlockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEEPvNS0_15PersistanceTypeE(ptr noundef nonnull align 8 dereferenceable(168) %78, i32 %.sroa.02.0.copyload.peel, i64 %.sroa.01.0.copyload.peel, ptr noundef nonnull %73, i32 noundef 2)
          to label %80 unwind label %.loopexit98.loopexit.split-lp

80:                                               ; preds = %74
  br i1 %79, label %81, label %.loopexit126

81:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %87

82:                                               ; preds = %60
  %83 = load i64, ptr %5, align 8, !tbaa !22
  store i64 %83, ptr %61, align 8, !tbaa !22
  %84 = load ptr, ptr %28, align 8, !tbaa !29
  %.sroa.08.0.copyload.peel = load i64, ptr %17, align 8, !tbaa !22
  %85 = invoke noundef zeroext i1 @_ZN2vl8database12log_internal14LogAddressItem16WriteAddressItemENS0_8IdObjectImLl3EEENS3_ImLl2EEE(ptr noundef nonnull align 8 dereferenceable(88) %84, i64 %.sroa.08.0.copyload.peel, i64 %83)
          to label %86 unwind label %.loopexit88.loopexit.split-lp

86:                                               ; preds = %82
  br i1 %85, label %87, label %140

87:                                               ; preds = %86, %81, %62
  %88 = load ptr, ptr %26, align 8, !tbaa !24
  %89 = call noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %.sroa.0.0.copyload.peel = load i64, ptr %6, align 8, !tbaa !22
  %91 = load i64, ptr %7, align 8, !tbaa !22
  %92 = add nsw i64 %24, -8
  %93 = add i64 %92, %91
  %94 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168) %88, ptr noundef nonnull align 8 dereferenceable(8) %90, i64 %.sroa.0.0.copyload.peel, i64 noundef %93)
          to label %95 unwind label %.loopexit88.loopexit.split-lp

95:                                               ; preds = %87
  br i1 %94, label %96, label %.loopexit128

96:                                               ; preds = %95
  %97 = icmp ugt i64 %22, %35
  br i1 %97, label %.peel.next, label %.loopexit129

.peel.next:                                       ; preds = %96
  %98 = sub i64 %22, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %99

99:                                               ; preds = %.peel.next, %186
  %.062 = phi i64 [ %187, %186 ], [ %98, %.peel.next ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %100 = add i64 %.062, 16
  store i64 %100, ptr %4, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN2vl8database8IdObjectImLl2EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %101 = load ptr, ptr %25, align 8, !tbaa !23
  %102 = invoke noundef zeroext i1 @_ZN2vl8database12log_internal9LogBlocks13AllocateBlockEmRmRNS0_8IdObjectImLl2EEE(ptr noundef nonnull align 8 dereferenceable(40) %101, i64 noundef 16, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %103 unwind label %.loopexit.loopexit

103:                                              ; preds = %99
  br i1 %102, label %112, label %.loopexit106

.loopexit106:                                     ; preds = %103, %32
  %104 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef nonnull @.str.1)
          to label %105 unwind label %110

105:                                              ; preds = %.loopexit106
  invoke void @__cxa_throw(ptr nonnull %104, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #7
          to label %195 unwind label %.loopexit.split-lp

106:                                              ; preds = %.critedge
  %107 = landingpad { ptr, i32 }
          cleanup
  br label %193

108:                                              ; preds = %.loopexit129, %23, %18
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %192

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

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

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

110:                                              ; preds = %.loopexit106
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %104) #6
  br label %.loopexit

112:                                              ; preds = %103
  %113 = load i64, ptr %4, align 8, !tbaa !22
  %114 = add i64 %113, -16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %115 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.020.0.copyload = load i64, ptr %5, align 8, !tbaa !22
  %116 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168) %115, i64 %.sroa.020.0.copyload, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %117 unwind label %.loopexit83.loopexit

117:                                              ; preds = %112
  br i1 %116, label %122, label %.loopexit109

.loopexit109:                                     ; preds = %117, %38
  %118 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef nonnull @.str.2)
          to label %119 unwind label %120

119:                                              ; preds = %.loopexit109
  invoke void @__cxa_throw(ptr nonnull %118, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #7
          to label %195 unwind label %.loopexit.split-lp84

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

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

.loopexit.split-lp84:                             ; preds = %119
  %lpad.loopexit.split-lp86 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit83

120:                                              ; preds = %.loopexit109
  %121 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %118) #6
  br label %.loopexit83

122:                                              ; preds = %117
  %123 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.017.0.copyload = load i32, ptr %27, align 8, !tbaa !25
  %.sroa.016.0.copyload = load i64, ptr %6, align 8, !tbaa !22
  %124 = invoke noundef ptr @_ZN2vl8database13BufferManager8LockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEE(ptr noundef nonnull align 8 dereferenceable(168) %123, i32 %.sroa.017.0.copyload, i64 %.sroa.016.0.copyload)
          to label %125 unwind label %.loopexit110

.loopexit110:                                     ; preds = %122
  %lpad.loopexit112 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit83

.loopexit.split-lp111:                            ; preds = %39
  %lpad.loopexit.split-lp113 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit83

125:                                              ; preds = %122
  %126 = load i64, ptr %7, align 8, !tbaa !22
  %127 = getelementptr inbounds i8, ptr %124, i64 %126
  %128 = getelementptr inbounds i8, ptr %127, i64 8
  store i64 %114, ptr %127, align 8, !tbaa !22
  store i64 -1, ptr %128, align 8, !tbaa !22
  %129 = getelementptr inbounds i8, ptr %127, i64 16
  %130 = call i64 @llvm.umin.i64(i64 %.062, i64 %114)
  %131 = invoke noundef i64 @_ZN2vl6stream12MemoryStream4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull %129, i64 noundef %130)
          to label %132 unwind label %.loopexit88.loopexit

132:                                              ; preds = %125
  %133 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.010.0.copyload = load i32, ptr %27, align 8, !tbaa !25
  %.sroa.09.0.copyload = load i64, ptr %6, align 8, !tbaa !22
  %134 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager10UnlockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEEPvNS0_15PersistanceTypeE(ptr noundef nonnull align 8 dereferenceable(168) %133, i32 %.sroa.010.0.copyload, i64 %.sroa.09.0.copyload, ptr noundef nonnull %124, i32 noundef 2)
          to label %135 unwind label %.loopexit88.loopexit

135:                                              ; preds = %132
  br i1 %134, label %144, label %.loopexit118

.loopexit118:                                     ; preds = %135, %59
  %136 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %136, ptr noundef nonnull @.str.3)
          to label %.invoke unwind label %138

.invoke:                                          ; preds = %.loopexit118, %.loopexit128, %140
  %137 = phi ptr [ %141, %140 ], [ %181, %.loopexit128 ], [ %136, %.loopexit118 ]
  invoke void @__cxa_throw(ptr nonnull %137, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #7
          to label %.cont unwind label %.loopexit.split-lp89

.cont:                                            ; preds = %.invoke
  unreachable

.loopexit88.loopexit:                             ; preds = %173, %132, %125
  %lpad.loopexit115 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit83

.loopexit88.loopexit.split-lp:                    ; preds = %48, %50, %56, %82, %87
  %lpad.loopexit.split-lp116 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit83

.loopexit.split-lp89:                             ; preds = %.invoke
  %lpad.loopexit.split-lp91 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit83

138:                                              ; preds = %.loopexit118
  %139 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %136) #6
  br label %.loopexit83

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

142:                                              ; preds = %140
  %143 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %141) #6
  br label %.loopexit83

144:                                              ; preds = %135
  %145 = call noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %146 = getelementptr inbounds i8, ptr %145, i64 8
  %147 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %146)
  br i1 %147, label %148, label %173

148:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %149 = load ptr, ptr %26, align 8, !tbaa !24
  %150 = call noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %151 = getelementptr inbounds i8, ptr %150, i64 8
  %.sroa.06.0.copyload = load i64, ptr %151, align 8, !tbaa !22
  %152 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168) %149, i64 %.sroa.06.0.copyload, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %153 unwind label %.loopexit93.loopexit

153:                                              ; preds = %148
  br i1 %152, label %158, label %.loopexit122

.loopexit122:                                     ; preds = %153, %70
  %154 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef nonnull @.str.2)
          to label %155 unwind label %156

155:                                              ; preds = %.loopexit122
  invoke void @__cxa_throw(ptr nonnull %154, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #7
          to label %195 unwind label %.loopexit.split-lp94

.loopexit93.loopexit:                             ; preds = %148
  %lpad.loopexit119 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit93

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

.loopexit.split-lp94:                             ; preds = %155
  %lpad.loopexit.split-lp96 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit93

156:                                              ; preds = %.loopexit122
  %157 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %154) #6
  br label %.loopexit93

158:                                              ; preds = %153
  %159 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.04.0.copyload = load i32, ptr %27, align 8, !tbaa !25
  %.sroa.03.0.copyload = load i64, ptr %8, align 8, !tbaa !22
  %160 = invoke noundef ptr @_ZN2vl8database13BufferManager8LockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEE(ptr noundef nonnull align 8 dereferenceable(168) %159, i32 %.sroa.04.0.copyload, i64 %.sroa.03.0.copyload)
          to label %161 unwind label %.loopexit98.loopexit

161:                                              ; preds = %158
  %162 = load i64, ptr %5, align 8, !tbaa !27
  %163 = load i64, ptr %9, align 8, !tbaa !22
  %164 = getelementptr inbounds i8, ptr %160, i64 %163
  store i64 %162, ptr %164, align 8, !tbaa !22
  %165 = load ptr, ptr %26, align 8, !tbaa !24
  %.sroa.02.0.copyload = load i32, ptr %27, align 8, !tbaa !25
  %.sroa.01.0.copyload = load i64, ptr %8, align 8, !tbaa !22
  %166 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager10UnlockPageENS0_8IdObjectIiLl0EEENS2_ImLl1EEEPvNS0_15PersistanceTypeE(ptr noundef nonnull align 8 dereferenceable(168) %165, i32 %.sroa.02.0.copyload, i64 %.sroa.01.0.copyload, ptr noundef nonnull %160, i32 noundef 2)
          to label %167 unwind label %.loopexit98.loopexit

167:                                              ; preds = %161
  br i1 %166, label %172, label %.loopexit126

.loopexit126:                                     ; preds = %167, %80
  %168 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %168, ptr noundef nonnull @.str.4)
          to label %169 unwind label %170

169:                                              ; preds = %.loopexit126
  invoke void @__cxa_throw(ptr nonnull %168, ptr nonnull @_ZTIN2vl5ErrorE, ptr null) #7
          to label %195 unwind label %.loopexit.split-lp99

.loopexit98.loopexit:                             ; preds = %161, %158
  %lpad.loopexit123 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit93

.loopexit98.loopexit.split-lp:                    ; preds = %71, %74
  %lpad.loopexit.split-lp124 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit93

.loopexit.split-lp99:                             ; preds = %169
  %lpad.loopexit.split-lp101 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit93

170:                                              ; preds = %.loopexit126
  %171 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %168) #6
  br label %.loopexit93

172:                                              ; preds = %167
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %173

.loopexit93:                                      ; preds = %.loopexit98.loopexit, %.loopexit98.loopexit.split-lp, %.loopexit93.loopexit, %.loopexit93.loopexit.split-lp, %.loopexit.split-lp99, %.loopexit.split-lp94, %170, %156
  %.pn.pn = phi { ptr, i32 } [ %157, %156 ], [ %171, %170 ], [ %lpad.loopexit.split-lp96, %.loopexit.split-lp94 ], [ %lpad.loopexit.split-lp101, %.loopexit.split-lp99 ], [ %lpad.loopexit119, %.loopexit93.loopexit ], [ %lpad.loopexit.split-lp120, %.loopexit93.loopexit.split-lp ], [ %lpad.loopexit123, %.loopexit98.loopexit ], [ %lpad.loopexit.split-lp124, %.loopexit98.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %.loopexit83

173:                                              ; preds = %172, %144
  %174 = load ptr, ptr %26, align 8, !tbaa !24
  %175 = call noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %176 = getelementptr inbounds i8, ptr %175, i64 8
  %.sroa.0.0.copyload = load i64, ptr %6, align 8, !tbaa !22
  %177 = load i64, ptr %7, align 8, !tbaa !22
  %178 = add i64 %177, 8
  %179 = invoke noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168) %174, ptr noundef nonnull align 8 dereferenceable(8) %176, i64 %.sroa.0.0.copyload, i64 noundef %178)
          to label %180 unwind label %.loopexit88.loopexit

180:                                              ; preds = %173
  br i1 %179, label %184, label %.loopexit128

.loopexit128:                                     ; preds = %180, %95
  %181 = call ptr @__cxa_allocate_exception(i64 8) #6
  invoke void @_ZN2vl5ErrorC1EPKw(ptr noundef nonnull align 8 dereferenceable(8) %181, ptr noundef nonnull @.str.5)
          to label %.invoke unwind label %182

182:                                              ; preds = %.loopexit128
  %183 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %181) #6
  br label %.loopexit83

184:                                              ; preds = %180
  %185 = icmp ugt i64 %.062, %114
  br i1 %185, label %186, label %.loopexit129

186:                                              ; preds = %184
  %187 = sub i64 %.062, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %99, !llvm.loop !30

.loopexit83:                                      ; preds = %.loopexit88.loopexit, %.loopexit88.loopexit.split-lp, %.loopexit110, %.loopexit.split-lp111, %.loopexit83.loopexit, %.loopexit83.loopexit.split-lp, %.loopexit.split-lp89, %.loopexit.split-lp84, %182, %.loopexit93, %142, %138, %120
  %.pn70.pn.pn = phi { ptr, i32 } [ %121, %120 ], [ %183, %182 ], [ %143, %142 ], [ %.pn.pn, %.loopexit93 ], [ %139, %138 ], [ %lpad.loopexit.split-lp86, %.loopexit.split-lp84 ], [ %lpad.loopexit.split-lp91, %.loopexit.split-lp89 ], [ %lpad.loopexit, %.loopexit83.loopexit ], [ %lpad.loopexit.split-lp107, %.loopexit83.loopexit.split-lp ], [ %lpad.loopexit112, %.loopexit110 ], [ %lpad.loopexit.split-lp113, %.loopexit.split-lp111 ], [ %lpad.loopexit115, %.loopexit88.loopexit ], [ %lpad.loopexit.split-lp116, %.loopexit88.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.loopexit.loopexit.split-lp, %.loopexit.split-lp, %.loopexit83, %110
  %.pn70.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn, %.loopexit83 ], [ %111, %110 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit104, %.loopexit.loopexit ], [ %lpad.loopexit.split-lp105, %.loopexit.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %192

.loopexit129:                                     ; preds = %184, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  store i8 0, ptr %10, align 8, !tbaa !5
  %188 = call noundef ptr @_ZNK2vl3PtrINS_8database12log_internal12LogTransDescEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %189 = getelementptr inbounds i8, ptr %188, i64 16
  %190 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database10ILogWriterEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(32) %189, ptr noundef null)
          to label %191 unwind label %108

191:                                              ; preds = %.loopexit129
  call void @_ZN2vl3PtrINS_8database12log_internal12LogTransDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  br label %194

192:                                              ; preds = %.loopexit, %108
  %.pn75 = phi { ptr, i32 } [ %109, %108 ], [ %.pn70.pn.pn.pn, %.loopexit ]
  call void @_ZN2vl3PtrINS_8database12log_internal12LogTransDescEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  br label %193

193:                                              ; preds = %192, %106
  %.pn75.pn = phi { ptr, i32 } [ %.pn75, %192 ], [ %107, %106 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn75.pn

194:                                              ; preds = %1, %191
  ret i1 %12

195:                                              ; preds = %169, %155, %119, %105
  unreachable
}

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

declare noundef i64 @_ZNK2vl6stream12MemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1

declare void @_ZN2vl6stream12MemoryStream13SeekFromBeginEl(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) unnamed_addr #1

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

declare noundef i64 @_ZN2vl6stream12MemoryStream4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i64 noundef) unnamed_addr #1

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

; Function Attrs: nounwind
declare void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !17, i64 128}
!6 = !{!"_ZTSN2vl8database12log_internal9LogWriterE", !7, i64 0, !8, i64 8, !9, i64 16, !9, i64 24, !12, i64 32, !9, i64 40, !9, i64 48, !9, i64 56, !14, i64 64, !16, i64 120, !17, i64 128}
!7 = !{!"_ZTSN2vl6ObjectE"}
!8 = !{!"_ZTSN2vl8database10ILogWriterE"}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN2vl8database8IdObjectIiLl0EEE", !13, i64 0}
!13 = !{!"int", !10, i64 0}
!14 = !{!"_ZTSN2vl6stream12MemoryStreamE", !7, i64 0, !15, i64 8, !9, i64 16, !15, i64 24, !15, i64 32, !15, i64 40}
!15 = !{!"long", !10, i64 0}
!16 = !{!"_ZTSN2vl8database8IdObjectImLl3EEE", !15, i64 0}
!17 = !{!"bool", !10, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!6, !9, i64 16}
!21 = !{!6, !9, i64 48}
!22 = !{!15, !15, i64 0}
!23 = !{!6, !9, i64 56}
!24 = !{!6, !9, i64 24}
!25 = !{!13, !13, i64 0}
!26 = !{!6, !15, i64 120}
!27 = !{!28, !15, i64 0}
!28 = !{!"_ZTSN2vl8database8IdObjectImLl2EEE", !15, i64 0}
!29 = !{!6, !9, i64 40}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass