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

; 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"

%"struct.vl::database::IdObject.15" = type { i64 }
%"struct.vl::database::IdObject" = type { i32 }
%"struct.vl::database::IdObject.16" = type { i64 }
%"class.vl::database::log_internal::LogBlocks" = type { %"class.vl::Object", ptr, %"struct.vl::database::IdObject", i64, %"struct.vl::database::IdObject.16" }
%"class.vl::Object" = type { ptr }

; 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

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

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

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

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

declare i64 @_ZN2vl8database13BufferManager12AllocatePageENS0_8IdObjectIiLl0EEE(ptr noundef nonnull align 8 dereferenceable(168), i32) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database12log_internal9LogBlocks13AllocateBlockEmRmRNS0_8IdObjectImLl2EEE(ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.vl::database::IdObject.15", align 8
  %11 = alloca %"struct.vl::database::IdObject", align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.vl::database::IdObject.15", align 8
  %14 = alloca %"struct.vl::database::IdObject.15", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.vl::database::IdObject.16", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.vl::database::IdObject.16", align 8
  %19 = alloca %"struct.vl::database::IdObject.16", align 8
  %20 = alloca %"struct.vl::database::IdObject.15", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8
  %22 = load i64, ptr %7, align 8, !tbaa !9
  %23 = icmp eq i64 %22, 0
  br i1 %23, label %33, label %24

24:                                               ; preds = %4
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = icmp eq i64 %26, 0
  br i1 %27, label %33, label %28

28:                                               ; preds = %24
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load i64, ptr %29, align 8, !tbaa !9
  %31 = load i64, ptr %7, align 8, !tbaa !9
  %32 = icmp ult i64 %30, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %28, %24, %4
  store i1 false, ptr %5, align 1
  br label %132

34:                                               ; preds = %28
  %35 = load i64, ptr %7, align 8, !tbaa !9
  %36 = call noundef i64 @_ZN2vl8database13IntUpperBoundImEET_S2_S2_(i64 noundef %35, i64 noundef 8)
  store i64 %36, ptr %7, align 8, !tbaa !9
  %37 = load i64, ptr %7, align 8, !tbaa !9
  %38 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 3
  %39 = load i64, ptr %38, align 8, !tbaa !11
  %40 = icmp ugt i64 %37, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %34
  store i1 false, ptr %5, align 1
  br label %132

42:                                               ; preds = %34
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load i64, ptr %43, align 8, !tbaa !9
  %45 = call noundef i64 @_ZN2vl8database13IntUpperBoundImEET_S2_S2_(i64 noundef %44, i64 noundef 8)
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  store i64 %45, ptr %46, align 8, !tbaa !9
  %47 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 4
  %48 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %47)
  br i1 %48, label %71, label %49

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %50 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  %52 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 8 %52, i64 4, i1 false), !tbaa.struct !18
  %53 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %11, i32 0, i32 0
  %54 = load i32, ptr %53, align 4
  %55 = call i64 @_ZN2vl8database13BufferManager12AllocatePageENS0_8IdObjectIiLl0EEE(ptr noundef nonnull align 8 dereferenceable(168) %51, i32 %54)
  %56 = getelementptr inbounds %"struct.vl::database::IdObject.15", ptr %10, i32 0, i32 0
  store i64 %55, ptr %56, align 8
  %57 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl1EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  br i1 %57, label %59, label %58

58:                                               ; preds = %49
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %68

59:                                               ; preds = %49
  %60 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !17
  %62 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %10, i64 8, i1 false), !tbaa.struct !20
  %63 = getelementptr inbounds %"struct.vl::database::IdObject.15", ptr %13, i32 0, i32 0
  %64 = load i64, ptr %63, align 8
  %65 = call noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168) %61, ptr noundef nonnull align 8 dereferenceable(8) %62, i64 %64, i64 noundef 0)
  br i1 %65, label %67, label %66

66:                                               ; preds = %59
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %68

67:                                               ; preds = %59
  store i32 0, ptr %12, align 4
  br label %68

68:                                               ; preds = %67, %66, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %69 = load i32, ptr %12, align 4
  switch i32 %69, label %134 [
    i32 0, label %70
    i32 1, label %132
  ]

70:                                               ; preds = %68
  br label %71

71:                                               ; preds = %70, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %72 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !17
  %74 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %74, i64 8, i1 false), !tbaa.struct !20
  %75 = getelementptr inbounds %"struct.vl::database::IdObject.16", ptr %16, i32 0, i32 0
  %76 = load i64, ptr %75, align 8
  %77 = call noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168) %73, i64 %76, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  br i1 %77, label %79, label %78

78:                                               ; preds = %71
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %131

79:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %80 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 3
  %81 = load i64, ptr %80, align 8, !tbaa !11
  %82 = load i64, ptr %15, align 8, !tbaa !9
  %83 = sub i64 %81, %82
  store i64 %83, ptr %17, align 8, !tbaa !9
  %84 = load i64, ptr %17, align 8, !tbaa !9
  %85 = load i64, ptr %7, align 8, !tbaa !9
  %86 = icmp ult i64 %84, %85
  br i1 %86, label %87, label %95

87:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %88 = call i64 @_ZN2vl8database8IdObjectImLl2EE7InvalidEv()
  %89 = getelementptr inbounds %"struct.vl::database::IdObject.16", ptr %18, i32 0, i32 0
  store i64 %88, ptr %89, align 8
  %90 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %90, ptr align 8 %18, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %91 = load i64, ptr %7, align 8, !tbaa !9
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = call noundef zeroext i1 @_ZN2vl8database12log_internal9LogBlocks13AllocateBlockEmRmRNS0_8IdObjectImLl2EEE(ptr noundef nonnull align 8 dereferenceable(40) %21, i64 noundef %91, ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull align 8 dereferenceable(8) %93)
  store i1 %94, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %130

95:                                               ; preds = %79
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = load i64, ptr %96, align 8, !tbaa !9
  %98 = load i64, ptr %17, align 8, !tbaa !9
  %99 = icmp ugt i64 %97, %98
  br i1 %99, label %100, label %103

100:                                              ; preds = %95
  %101 = load i64, ptr %17, align 8, !tbaa !9
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  store i64 %101, ptr %102, align 8, !tbaa !9
  br label %103

103:                                              ; preds = %100, %95
  %104 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 4
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %105, ptr align 8 %104, i64 8, i1 false), !tbaa.struct !20
  %106 = load i64, ptr %15, align 8, !tbaa !9
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = add i64 %106, %108
  %110 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 3
  %111 = load i64, ptr %110, align 8, !tbaa !11
  %112 = icmp uge i64 %109, %111
  br i1 %112, label %113, label %117

113:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %114 = call i64 @_ZN2vl8database8IdObjectImLl2EE7InvalidEv()
  %115 = getelementptr inbounds %"struct.vl::database::IdObject.16", ptr %19, i32 0, i32 0
  store i64 %114, ptr %115, align 8
  %116 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %116, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %128

117:                                              ; preds = %103
  %118 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !17
  %120 = getelementptr inbounds %"class.vl::database::log_internal::LogBlocks", ptr %21, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %14, i64 8, i1 false), !tbaa.struct !20
  %121 = load i64, ptr %15, align 8, !tbaa !9
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = add i64 %121, %123
  %125 = getelementptr inbounds %"struct.vl::database::IdObject.15", ptr %20, i32 0, i32 0
  %126 = load i64, ptr %125, align 8
  %127 = call noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168) %119, ptr noundef nonnull align 8 dereferenceable(8) %120, i64 %126, i64 noundef %124)
  br label %128

128:                                              ; preds = %117, %113
  br label %129

129:                                              ; preds = %128
  store i1 true, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %130

130:                                              ; preds = %129, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %131

131:                                              ; preds = %130, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %132

132:                                              ; preds = %131, %68, %41, %33
  %133 = load i1, ptr %5, align 1
  ret i1 %133

134:                                              ; preds = %68
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2vl8database13IntUpperBoundImEET_S2_S2_(i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 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) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 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)) #4

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTSN2vl8database12log_internal9LogBlocksE", !13, i64 0, !6, i64 8, !14, i64 16, !10, i64 24, !16, i64 32}
!13 = !{!"_ZTSN2vl6ObjectE"}
!14 = !{!"_ZTSN2vl8database8IdObjectIiLl0EEE", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN2vl8database8IdObjectImLl2EEE", !10, i64 0}
!17 = !{!12, !6, i64 8}
!18 = !{i64 0, i64 4, !19}
!19 = !{!15, !15, i64 0}
!20 = !{i64 0, i64 8, !9}


; 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"

%"struct.vl::database::IdObject.15" = type { i64 }

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

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

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

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

declare i64 @_ZN2vl8database13BufferManager12AllocatePageENS0_8IdObjectIiLl0EEE(ptr noundef nonnull align 8 dereferenceable(168), i32) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database12log_internal9LogBlocks13AllocateBlockEmRmRNS0_8IdObjectImLl2EEE(ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef %1, ptr nocapture noundef nonnull align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %"struct.vl::database::IdObject.15", align 8
  %6 = alloca %"struct.vl::database::IdObject.15", align 8
  %7 = alloca i64, align 8
  %8 = load i64, ptr %2, align 8
  %9 = freeze i64 %8
  %10 = add i64 %1, -1
  %or.cond.not = icmp ult i64 %10, %9
  br i1 %or.cond.not, label %11, label %58

11:                                               ; preds = %4
  %12 = tail call noundef i64 @_ZN2vl8database13IntUpperBoundImEET_S2_S2_(i64 noundef %1, i64 noundef 8)
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = icmp ugt i64 %12, %14
  br i1 %15, label %58, label %16

16:                                               ; preds = %11
  %17 = load i64, ptr %2, align 8, !tbaa !15
  %18 = tail call noundef i64 @_ZN2vl8database13IntUpperBoundImEET_S2_S2_(i64 noundef %17, i64 noundef 8)
  store i64 %18, ptr %2, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %0, i64 32
  %20 = tail call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  br i1 %20, label %31, label %21

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.08.0.copyload = load i32, ptr %24, align 8, !tbaa !17
  %25 = tail call i64 @_ZN2vl8database13BufferManager12AllocatePageENS0_8IdObjectIiLl0EEE(ptr noundef nonnull align 8 dereferenceable(168) %23, i32 %.sroa.08.0.copyload)
  store i64 %25, ptr %5, align 8
  %26 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl1EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %26, label %27, label %.thread

27:                                               ; preds = %21
  %28 = load ptr, ptr %22, align 8, !tbaa !16
  %.sroa.06.0.copyload = load i64, ptr %5, align 8, !tbaa !15
  %29 = call noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168) %28, ptr noundef nonnull align 8 dereferenceable(8) %19, i64 %.sroa.06.0.copyload, i64 noundef 0)
  br i1 %29, label %30, label %.thread

.thread:                                          ; preds = %21, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %58

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %31

31:                                               ; preds = %30, %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %32 = getelementptr inbounds i8, ptr %0, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %.sroa.05.0.copyload = load i64, ptr %19, align 8, !tbaa !15
  %34 = call noundef zeroext i1 @_ZN2vl8database13BufferManager13DecodePointerENS0_8IdObjectImLl2EEERNS2_ImLl1EEERm(ptr noundef nonnull align 8 dereferenceable(168) %33, i64 %.sroa.05.0.copyload, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  br i1 %34, label %35, label %57

35:                                               ; preds = %31
  %36 = load i64, ptr %13, align 8, !tbaa !5
  %37 = load i64, ptr %7, align 8, !tbaa !15
  %38 = sub i64 %36, %37
  %39 = icmp ult i64 %38, %12
  br i1 %39, label %40, label %43

40:                                               ; preds = %35
  %41 = call i64 @_ZN2vl8database8IdObjectImLl2EE7InvalidEv()
  store i64 %41, ptr %19, align 8, !tbaa !15
  %42 = call noundef zeroext i1 @_ZN2vl8database12log_internal9LogBlocks13AllocateBlockEmRmRNS0_8IdObjectImLl2EEE(ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef %12, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br label %57

43:                                               ; preds = %35
  %44 = load i64, ptr %2, align 8, !tbaa !15
  %45 = icmp ugt i64 %44, %38
  br i1 %45, label %46, label %47

46:                                               ; preds = %43
  store i64 %38, ptr %2, align 8, !tbaa !15
  br label %47

47:                                               ; preds = %46, %43
  %48 = load i64, ptr %19, align 8, !tbaa !15
  store i64 %48, ptr %3, align 8, !tbaa !15
  %49 = load i64, ptr %2, align 8, !tbaa !15
  %50 = add i64 %49, %37
  %51 = load i64, ptr %13, align 8, !tbaa !5
  %.not = icmp ult i64 %50, %51
  br i1 %.not, label %54, label %52

52:                                               ; preds = %47
  %53 = call i64 @_ZN2vl8database8IdObjectImLl2EE7InvalidEv()
  store i64 %53, ptr %19, align 8, !tbaa !15
  br label %57

54:                                               ; preds = %47
  %55 = load ptr, ptr %32, align 8, !tbaa !16
  %.sroa.0.0.copyload = load i64, ptr %6, align 8, !tbaa !15
  %56 = call noundef zeroext i1 @_ZN2vl8database13BufferManager13EncodePointerERNS0_8IdObjectImLl2EEENS2_ImLl1EEEm(ptr noundef nonnull align 8 dereferenceable(168) %55, ptr noundef nonnull align 8 dereferenceable(8) %19, i64 %.sroa.0.0.copyload, i64 noundef %50)
  br label %57

57:                                               ; preds = %40, %52, %54, %31
  %.2 = phi i1 [ false, %31 ], [ %42, %40 ], [ true, %52 ], [ true, %54 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %58

58:                                               ; preds = %.thread, %11, %4, %57
  %.3 = phi i1 [ %.2, %57 ], [ false, %4 ], [ false, %11 ], [ false, %.thread ]
  ret i1 %.3
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2vl8database13IntUpperBoundImEET_S2_S2_(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl2EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 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 #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl8database8IdObjectImLl1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 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 #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 }

!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, !13, i64 24}
!6 = !{!"_ZTSN2vl8database12log_internal9LogBlocksE", !7, i64 0, !8, i64 8, !11, i64 16, !13, i64 24, !14, i64 32}
!7 = !{!"_ZTSN2vl6ObjectE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN2vl8database8IdObjectIiLl0EEE", !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{!"_ZTSN2vl8database8IdObjectImLl2EEE", !13, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!6, !8, i64 8}
!17 = !{!12, !12, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass