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

%"class.vl::Ptr.39" = type { ptr, ptr, ptr, ptr }
%"struct.vl::database::IdObject.17" = type { i64 }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }
%"struct.vl::database::IdObject" = type { i32 }
%"class.vl::database::LogManager" = type { %"class.vl::Object", ptr, %"struct.vl::database::IdObject", i8, %"class.vl::database::log_internal::LogAddressItem", %"class.vl::database::log_internal::LogBlocks", %"class.vl::database::log_internal::LogTransactions", %"class.vl::SpinLock" }
%"class.vl::database::log_internal::LogAddressItem" = type { %"class.vl::Object", ptr, %"struct.vl::database::IdObject", i64, i64, %"class.vl::collections::List" }
%"class.vl::collections::List" = type { %"class.vl::collections::ListBase.base", %"class.vl::collections::IEnumerable" }
%"class.vl::collections::ListBase.base" = type <{ %"class.vl::collections::ArrayBase.base", i64, i8 }>
%"class.vl::collections::ArrayBase.base" = type { %"class.vl::collections::ListStore", ptr, i64 }
%"class.vl::collections::ListStore" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::database::log_internal::LogBlocks" = type { %"class.vl::Object", ptr, %"struct.vl::database::IdObject", i64, %"struct.vl::database::IdObject.16" }
%"struct.vl::database::IdObject.16" = type { i64 }
%"class.vl::database::log_internal::LogTransactions" = type { %"class.vl::Object", i64, %"class.vl::collections::Dictionary.18", ptr }
%"class.vl::collections::Dictionary.18" = type { %"class.vl::Object", %"class.vl::collections::SortedList.19", %"class.vl::collections::List.27", %"class.vl::collections::IEnumerable.35" }
%"class.vl::collections::SortedList.19" = type { %"class.vl::collections::ListBase.base.25", %"class.vl::collections::IEnumerable.23" }
%"class.vl::collections::ListBase.base.25" = type <{ %"class.vl::collections::ArrayBase.base.24", i64, i8 }>
%"class.vl::collections::ArrayBase.base.24" = type { %"class.vl::collections::ListStore.22", ptr, i64 }
%"class.vl::collections::ListStore.22" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.23" = type { %"class.vl::Interface" }
%"class.vl::collections::List.27" = type { %"class.vl::collections::ListBase.base.33", %"class.vl::collections::IEnumerable.31" }
%"class.vl::collections::ListBase.base.33" = type <{ %"class.vl::collections::ArrayBase.base.32", i64, i8 }>
%"class.vl::collections::ArrayBase.base.32" = type { %"class.vl::collections::ListStore.30", ptr, i64 }
%"class.vl::collections::ListStore.30" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.31" = type { %"class.vl::Interface" }
%"class.vl::collections::IEnumerable.35" = type { %"class.vl::Interface" }
%"class.vl::SpinLock" = type { %"class.vl::Object", i64 }

; 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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl8database12log_internal9LogReaderC1ERNS_8SpinLockEPNS0_13BufferManagerENS0_8IdObjectIiLl0EEEPNS1_14LogAddressItemEPNS1_15LogTransactionsENS7_ImLl3EEE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32, ptr noundef, ptr noundef, i64) unnamed_addr #2 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl8database10LogManager11EnumLogItemENS0_8IdObjectImLl3EEE(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr.39") align 8 %0, ptr noundef nonnull align 8 dereferenceable(304) %1, i64 %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.vl::database::IdObject.17", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca %"class.vl::SpinLock::Scope", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.vl::database::IdObject.17", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.vl::database::IdObject", align 4
  %15 = alloca %"struct.vl::database::IdObject.17", align 8
  store ptr %0, ptr %4, align 8
  %16 = getelementptr inbounds %"struct.vl::database::IdObject.17", ptr %5, i32 0, i32 0
  store i64 %2, ptr %16, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  store i8 1, ptr %7, align 1, !tbaa !9
  %18 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %19 = trunc i8 %18 to i1
  br i1 %19, label %20, label %66

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  %21 = getelementptr inbounds %"class.vl::database::LogManager", ptr %17, i32 0, i32 7
  call void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %21)
  store ptr %9, ptr %8, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %61, %20
  %23 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %24 = trunc i8 %23 to i1
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  store i32 2, ptr %10, align 4
  br label %62

26:                                               ; preds = %22
  %27 = getelementptr inbounds %"class.vl::database::LogManager", ptr %17, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !13
  %28 = getelementptr inbounds %"struct.vl::database::IdObject.17", ptr %11, i32 0, i32 0
  %29 = load i64, ptr %28, align 8
  %30 = invoke noundef zeroext i1 @_ZN2vl8database12log_internal15LogTransactions8IsActiveENS0_8IdObjectImLl3EEE(ptr noundef nonnull align 8 dereferenceable(136) %27, i64 %29)
          to label %31 unwind label %52

31:                                               ; preds = %26
  br i1 %30, label %32, label %60

32:                                               ; preds = %31
  %33 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #8
          to label %34 unwind label %52

34:                                               ; preds = %32
  %35 = getelementptr inbounds %"class.vl::database::LogManager", ptr %17, i32 0, i32 7
  %36 = getelementptr inbounds %"class.vl::database::LogManager", ptr %17, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = getelementptr inbounds %"class.vl::database::LogManager", ptr %17, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %38, i64 4, i1 false), !tbaa.struct !39
  %39 = getelementptr inbounds %"class.vl::database::LogManager", ptr %17, i32 0, i32 4
  %40 = getelementptr inbounds %"class.vl::database::LogManager", ptr %17, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !13
  %41 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %14, i32 0, i32 0
  %42 = load i32, ptr %41, align 4
  %43 = getelementptr inbounds %"struct.vl::database::IdObject.17", ptr %15, i32 0, i32 0
  %44 = load i64, ptr %43, align 8
  invoke void @_ZN2vl8database12log_internal9LogReaderC1ERNS_8SpinLockEPNS0_13BufferManagerENS0_8IdObjectIiLl0EEEPNS1_14LogAddressItemEPNS1_15LogTransactionsENS7_ImLl3EEE(ptr noundef nonnull align 8 dereferenceable(104) %33, ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef %37, i32 %42, ptr noundef %39, ptr noundef %40, i64 %44)
          to label %45 unwind label %56

45:                                               ; preds = %34
  %46 = icmp eq ptr %33, null
  br i1 %46, label %49, label %47

47:                                               ; preds = %45
  %48 = getelementptr inbounds i8, ptr %33, i64 8
  br label %49

49:                                               ; preds = %47, %45
  %50 = phi ptr [ %48, %47 ], [ null, %45 ]
  invoke void @_ZN2vl3PtrINS_8database10ILogReaderEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %50)
          to label %51 unwind label %52

51:                                               ; preds = %49
  store i32 1, ptr %10, align 4
  br label %62

52:                                               ; preds = %49, %32, %26
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %12, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %13, align 4
  br label %64

56:                                               ; preds = %34
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %12, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %33, i64 noundef 104) #9
  br label %64

60:                                               ; preds = %31
  br label %61

61:                                               ; preds = %60
  store i8 0, ptr %7, align 1, !tbaa !9
  br label %22, !llvm.loop !41

62:                                               ; preds = %51, %25
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %63 = load i32, ptr %10, align 4
  switch i32 %63, label %67 [
    i32 2, label %65
  ]

64:                                               ; preds = %56, %52
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  br label %71

65:                                               ; preds = %62
  br label %66

66:                                               ; preds = %65, %3
  store i32 0, ptr %10, align 4
  br label %67

67:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  %68 = load i32, ptr %10, align 4
  switch i32 %68, label %76 [
    i32 0, label %69
    i32 1, label %70
  ]

69:                                               ; preds = %67
  call void @_ZN2vl3PtrINS_8database10ILogReaderEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef null)
  br label %70

70:                                               ; preds = %69, %67
  ret void

71:                                               ; preds = %64
  %72 = load ptr, ptr %12, align 8
  %73 = load i32, ptr %13, align 4
  %74 = insertvalue { ptr, i32 } poison, ptr %72, 0
  %75 = insertvalue { ptr, i32 } %74, i32 %73, 1
  resume { ptr, i32 } %75

76:                                               ; preds = %67
  unreachable
}

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nobuiltin 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 #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 "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 = { nobuiltin allocsize(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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{i64 0, i64 8, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !6, i64 8}
!17 = !{!"_ZTSN2vl8database10LogManagerE", !18, i64 0, !6, i64 8, !19, i64 16, !10, i64 20, !21, i64 24, !26, i64 112, !28, i64 152, !38, i64 288}
!18 = !{!"_ZTSN2vl6ObjectE"}
!19 = !{!"_ZTSN2vl8database8IdObjectIiLl0EEE", !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTSN2vl8database12log_internal14LogAddressItemE", !18, i64 0, !6, i64 8, !19, i64 16, !15, i64 24, !15, i64 32, !22, i64 40}
!22 = !{!"_ZTSN2vl11collections4ListINS_8database8IdObjectImLl1EEES4_EE", !23, i64 0}
!23 = !{!"_ZTSN2vl11collections8ListBaseINS_8database8IdObjectImLl1EEES4_EE", !24, i64 0, !15, i64 24, !10, i64 32}
!24 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database8IdObjectImLl1EEEEE", !25, i64 0, !6, i64 8, !15, i64 16}
!25 = !{!"_ZTSN2vl11collections9ListStoreINS_8database8IdObjectImLl1EEELb1EEE", !18, i64 0}
!26 = !{!"_ZTSN2vl8database12log_internal9LogBlocksE", !18, i64 0, !6, i64 8, !19, i64 16, !15, i64 24, !27, i64 32}
!27 = !{!"_ZTSN2vl8database8IdObjectImLl2EEE", !15, i64 0}
!28 = !{!"_ZTSN2vl8database12log_internal15LogTransactionsE", !18, i64 0, !15, i64 8, !29, i64 16, !6, i64 128}
!29 = !{!"_ZTSN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_12log_internal12LogTransDescEEES4_PS7_EE", !18, i64 0, !30, i64 8, !34, i64 56}
!30 = !{!"_ZTSN2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_EE", !31, i64 0}
!31 = !{!"_ZTSN2vl11collections8ListBaseINS_8database8IdObjectImLl3EEES4_EE", !32, i64 0, !15, i64 24, !10, i64 32}
!32 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database8IdObjectImLl3EEEEE", !33, i64 0, !6, i64 8, !15, i64 16}
!33 = !{!"_ZTSN2vl11collections9ListStoreINS_8database8IdObjectImLl3EEELb1EEE", !18, i64 0}
!34 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database12log_internal12LogTransDescEEEPS5_EE", !35, i64 0}
!35 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database12log_internal12LogTransDescEEEPS5_EE", !36, i64 0, !15, i64 24, !10, i64 32}
!36 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database12log_internal12LogTransDescEEEEE", !37, i64 0, !6, i64 8, !15, i64 16}
!37 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database12log_internal12LogTransDescEEELb0EEE", !18, i64 0}
!38 = !{!"_ZTSN2vl8SpinLockE", !18, i64 0, !15, i64 8}
!39 = !{i64 0, i64 4, !40}
!40 = !{!20, !20, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}


; 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.39" = type { ptr, ptr, ptr, ptr }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl8database12log_internal9LogReaderC1ERNS_8SpinLockEPNS0_13BufferManagerENS0_8IdObjectIiLl0EEEPNS1_14LogAddressItemEPNS1_15LogTransactionsENS7_ImLl3EEE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32, ptr noundef, ptr noundef, i64) unnamed_addr #1 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl8database10LogManager11EnumLogItemENS0_8IdObjectImLl3EEE(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr.39") align 8 %0, ptr noundef nonnull align 8 dereferenceable(304) %1, i64 %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
.critedge:
  %3 = alloca %"class.vl::SpinLock::Scope", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %4 = getelementptr inbounds i8, ptr %1, i64 288
  call void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %5 = getelementptr inbounds i8, ptr %1, i64 152
  %6 = invoke noundef zeroext i1 @_ZN2vl8database12log_internal15LogTransactions8IsActiveENS0_8IdObjectImLl3EEE(ptr noundef nonnull align 8 dereferenceable(136) %5, i64 %2)
          to label %7 unwind label %17

7:                                                ; preds = %.critedge
  br i1 %6, label %8, label %23, !llvm.loop !5

8:                                                ; preds = %7
  %9 = invoke noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #7
          to label %10 unwind label %17

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !7
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.01.0.copyload = load i32, ptr %13, align 8, !tbaa !35
  %14 = getelementptr inbounds i8, ptr %1, i64 24
  invoke void @_ZN2vl8database12log_internal9LogReaderC1ERNS_8SpinLockEPNS0_13BufferManagerENS0_8IdObjectIiLl0EEEPNS1_14LogAddressItemEPNS1_15LogTransactionsENS7_ImLl3EEE(ptr noundef nonnull align 8 dereferenceable(104) %9, ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef %12, i32 %.sroa.01.0.copyload, ptr noundef nonnull %14, ptr noundef nonnull %5, i64 %2)
          to label %15 unwind label %19

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %9, i64 8
  invoke void @_ZN2vl3PtrINS_8database10ILogReaderEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %16)
          to label %22 unwind label %17

17:                                               ; preds = %15, %8, %.critedge
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %21

19:                                               ; preds = %10
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 104) #8
  br label %21

21:                                               ; preds = %19, %17
  %.pn = phi { ptr, i32 } [ %18, %17 ], [ %20, %19 ]
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn

22:                                               ; preds = %15
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br label %24

23:                                               ; preds = %7
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  call void @_ZN2vl3PtrINS_8database10ILogReaderEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef null)
  br label %24

24:                                               ; preds = %22, %23
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl3PtrINS_8database10ILogReaderEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nobuiltin 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 #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 "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 = { nobuiltin allocsize(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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !10, i64 8}
!8 = !{!"_ZTSN2vl8database10LogManagerE", !9, i64 0, !10, i64 8, !13, i64 16, !15, i64 20, !16, i64 24, !22, i64 112, !24, i64 152, !34, i64 288}
!9 = !{!"_ZTSN2vl6ObjectE"}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSN2vl8database8IdObjectIiLl0EEE", !14, i64 0}
!14 = !{!"int", !11, i64 0}
!15 = !{!"bool", !11, i64 0}
!16 = !{!"_ZTSN2vl8database12log_internal14LogAddressItemE", !9, i64 0, !10, i64 8, !13, i64 16, !17, i64 24, !17, i64 32, !18, i64 40}
!17 = !{!"long", !11, i64 0}
!18 = !{!"_ZTSN2vl11collections4ListINS_8database8IdObjectImLl1EEES4_EE", !19, i64 0}
!19 = !{!"_ZTSN2vl11collections8ListBaseINS_8database8IdObjectImLl1EEES4_EE", !20, i64 0, !17, i64 24, !15, i64 32}
!20 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database8IdObjectImLl1EEEEE", !21, i64 0, !10, i64 8, !17, i64 16}
!21 = !{!"_ZTSN2vl11collections9ListStoreINS_8database8IdObjectImLl1EEELb1EEE", !9, i64 0}
!22 = !{!"_ZTSN2vl8database12log_internal9LogBlocksE", !9, i64 0, !10, i64 8, !13, i64 16, !17, i64 24, !23, i64 32}
!23 = !{!"_ZTSN2vl8database8IdObjectImLl2EEE", !17, i64 0}
!24 = !{!"_ZTSN2vl8database12log_internal15LogTransactionsE", !9, i64 0, !17, i64 8, !25, i64 16, !10, i64 128}
!25 = !{!"_ZTSN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_12log_internal12LogTransDescEEES4_PS7_EE", !9, i64 0, !26, i64 8, !30, i64 56}
!26 = !{!"_ZTSN2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_EE", !27, i64 0}
!27 = !{!"_ZTSN2vl11collections8ListBaseINS_8database8IdObjectImLl3EEES4_EE", !28, i64 0, !17, i64 24, !15, i64 32}
!28 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database8IdObjectImLl3EEEEE", !29, i64 0, !10, i64 8, !17, i64 16}
!29 = !{!"_ZTSN2vl11collections9ListStoreINS_8database8IdObjectImLl3EEELb1EEE", !9, i64 0}
!30 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database12log_internal12LogTransDescEEEPS5_EE", !31, i64 0}
!31 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database12log_internal12LogTransDescEEEPS5_EE", !32, i64 0, !17, i64 24, !15, i64 32}
!32 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database12log_internal12LogTransDescEEEEE", !33, i64 0, !10, i64 8, !17, i64 16}
!33 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database12log_internal12LogTransDescEEELb0EEE", !9, i64 0}
!34 = !{!"_ZTSN2vl8SpinLockE", !9, i64 0, !17, i64 8}
!35 = !{!14, !14, i64 0}


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