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

; 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.0" = type { i32 }
%"struct.vl::database::IdObject.97" = type { i32 }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }
%"struct.vl::database::IdObject.1" = type { i64 }
%"class.vl::Ptr.117" = type { ptr, ptr, ptr, ptr }
%"class.vl::database::LockManager" = type { %"class.vl::Object", ptr, %"class.vl::SpinLock", %"class.vl::collections::Dictionary", %"class.vl::collections::Dictionary.10", %"class.vl::collections::Array", %"class.vl::collections::Dictionary.33" }
%"class.vl::SpinLock" = type { %"class.vl::Object", i64 }
%"class.vl::collections::Dictionary" = type { %"class.vl::Object", %"class.vl::collections::SortedList", %"class.vl::collections::List", %"class.vl::collections::IEnumerable.9" }
%"class.vl::collections::SortedList" = 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::collections::List" = type { %"class.vl::collections::ListBase.base.8", %"class.vl::collections::IEnumerable.6" }
%"class.vl::collections::ListBase.base.8" = type <{ %"class.vl::collections::ArrayBase.base.7", i64, i8 }>
%"class.vl::collections::ArrayBase.base.7" = type { %"class.vl::collections::ListStore.5", ptr, i64 }
%"class.vl::collections::ListStore.5" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.6" = type { %"class.vl::Interface" }
%"class.vl::collections::IEnumerable.9" = type { %"class.vl::Interface" }
%"class.vl::collections::Dictionary.10" = type { %"class.vl::Object", %"class.vl::collections::SortedList.11", %"class.vl::collections::List.19", %"class.vl::collections::IEnumerable.27" }
%"class.vl::collections::SortedList.11" = type { %"class.vl::collections::ListBase.base.17", %"class.vl::collections::IEnumerable.15" }
%"class.vl::collections::ListBase.base.17" = type <{ %"class.vl::collections::ArrayBase.base.16", i64, i8 }>
%"class.vl::collections::ArrayBase.base.16" = type { %"class.vl::collections::ListStore.14", ptr, i64 }
%"class.vl::collections::ListStore.14" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.15" = type { %"class.vl::Interface" }
%"class.vl::collections::List.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::IEnumerable.27" = type { %"class.vl::Interface" }
%"class.vl::collections::Array" = type { %"class.vl::collections::ArrayBase.base.32", %"class.vl::collections::IEnumerable.31" }
%"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::Dictionary.33" = type { %"class.vl::Object", %"class.vl::collections::SortedList.34", %"class.vl::collections::List.42", %"class.vl::collections::IEnumerable.50" }
%"class.vl::collections::SortedList.34" = type { %"class.vl::collections::ListBase.base.40", %"class.vl::collections::IEnumerable.38" }
%"class.vl::collections::ListBase.base.40" = type <{ %"class.vl::collections::ArrayBase.base.39", i64, i8 }>
%"class.vl::collections::ArrayBase.base.39" = type { %"class.vl::collections::ListStore.37", ptr, i64 }
%"class.vl::collections::ListStore.37" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.38" = type { %"class.vl::Interface" }
%"class.vl::collections::List.42" = type { %"class.vl::collections::ListBase.base.48", %"class.vl::collections::IEnumerable.46" }
%"class.vl::collections::ListBase.base.48" = type <{ %"class.vl::collections::ArrayBase.base.47", i64, i8 }>
%"class.vl::collections::ArrayBase.base.47" = type { %"class.vl::collections::ListStore.45", ptr, i64 }
%"class.vl::collections::ListStore.45" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.46" = type { %"class.vl::Interface" }
%"class.vl::collections::IEnumerable.50" = type { %"class.vl::Interface" }
%"struct.vl::database::LockManager::TableInfo" = type { %"struct.vl::database::IdObject.0", %"struct.vl::database::IdObject.97" }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_8database8IdObjectIiLl4EEES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %23 = getelementptr inbounds %"class.vl::database::LockManager", ptr %19, i32 0, i32 2
  call void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %23)
  store ptr %10, ptr %9, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %66, %22
  %25 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %26 = trunc i8 %25 to i1
  br i1 %26, label %28, label %27

27:                                               ; preds = %24
  store i32 2, ptr %11, align 4
  br label %76

28:                                               ; preds = %24
  %29 = getelementptr inbounds %"class.vl::database::LockManager", ptr %19, i32 0, i32 3
  %30 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %29)
          to label %31 unwind label %35

31:                                               ; preds = %28
  %32 = invoke noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_8database8IdObjectIiLl4EEES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %30, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %33 unwind label %35

33:                                               ; preds = %31
  br i1 %32, label %34, label %39

34:                                               ; preds = %33
  store i1 false, ptr %4, align 1
  store i32 1, ptr %11, align 4
  br label %76

35:                                               ; preds = %31, %28
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %12, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %13, align 4
  br label %78

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %40 = getelementptr inbounds %"class.vl::database::LockManager", ptr %19, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %6, i64 4, i1 false), !tbaa.struct !48
  %42 = getelementptr inbounds %"struct.vl::database::IdObject.97", ptr %15, i32 0, i32 0
  %43 = load i32, ptr %42, align 4
  %44 = invoke i64 @_ZN2vl8database13BufferManager12GetIndexPageENS0_8IdObjectIiLl0EEE(ptr noundef nonnull align 8 dereferenceable(168) %41, i32 %43)
          to label %45 unwind label %51

45:                                               ; preds = %39
  %46 = getelementptr inbounds %"struct.vl::database::IdObject.1", ptr %14, i32 0, i32 0
  store i64 %44, ptr %46, align 8
  %47 = invoke noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl1EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %48 unwind label %51

48:                                               ; preds = %45
  %49 = xor i1 %47, true
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br i1 %49, label %50, label %55

50:                                               ; preds = %48
  store i1 false, ptr %4, align 1
  store i32 1, ptr %11, align 4
  br label %76

51:                                               ; preds = %45, %39
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %12, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %78

55:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  invoke void @_ZN2vl7MakePtrINS_8database11LockManager9TableInfoEJEEENS_3PtrIT_EEDpT0_(ptr dead_on_unwind writable sret(%"class.vl::Ptr.117") align 8 %16)
          to label %56 unwind label %67

56:                                               ; preds = %55
  %57 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TableInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %58 unwind label %71

58:                                               ; preds = %56
  %59 = getelementptr inbounds %"struct.vl::database::LockManager::TableInfo", ptr %57, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %59, ptr align 4 %5, i64 4, i1 false), !tbaa.struct !48
  %60 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TableInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %61 unwind label %71

61:                                               ; preds = %58
  %62 = getelementptr inbounds %"struct.vl::database::LockManager::TableInfo", ptr %60, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %62, ptr align 4 %6, i64 4, i1 false), !tbaa.struct !48
  %63 = getelementptr inbounds %"class.vl::database::LockManager", ptr %19, i32 0, i32 3
  %64 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_E3AddERKS4_RKS8_(ptr noundef nonnull align 8 dereferenceable(104) %63, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %65 unwind label %71

65:                                               ; preds = %61
  call void @_ZN2vl3PtrINS_8database11LockManager9TableInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  br label %66

66:                                               ; preds = %65
  store i8 0, ptr %8, align 1, !tbaa !9
  br label %24, !llvm.loop !51

67:                                               ; preds = %55
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %12, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %13, align 4
  br label %75

71:                                               ; preds = %61, %58, %56
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %12, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %13, align 4
  call void @_ZN2vl3PtrINS_8database11LockManager9TableInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  br label %75

75:                                               ; preds = %71, %67
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  br label %78

76:                                               ; preds = %50, %34, %27
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %77 = load i32, ptr %11, align 4
  switch i32 %77, label %81 [
    i32 2, label %79
  ]

78:                                               ; preds = %75, %51, %35
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  br label %86

79:                                               ; preds = %76
  br label %80

80:                                               ; preds = %79, %3
  store i32 0, ptr %11, align 4
  br label %81

81:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  %82 = load i32, ptr %11, align 4
  switch i32 %82, label %91 [
    i32 0, label %83
    i32 1, label %84
  ]

83:                                               ; preds = %81
  store i1 true, ptr %4, align 1
  br label %84

84:                                               ; preds = %83, %81
  %85 = load i1, ptr %4, align 1
  ret i1 %85

86:                                               ; preds = %78
  %87 = load ptr, ptr %12, align 8
  %88 = load i32, ptr %13, align 4
  %89 = insertvalue { ptr, i32 } poison, ptr %87, 0
  %90 = insertvalue { ptr, i32 } %89, i32 %88, 1
  resume { ptr, i32 } %90

91:                                               ; preds = %81
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl7MakePtrINS_8database11LockManager9TableInfoEJEEENS_3PtrIT_EEDpT0_(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr.117") align 8) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_E3AddERKS4_RKS8_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

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

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!14, !6, i64 8}
!14 = !{!"_ZTSN2vl8database11LockManagerE", !15, i64 0, !6, i64 8, !16, i64 16, !18, i64 32, !27, i64 144, !36, i64 256, !39, i64 288}
!15 = !{!"_ZTSN2vl6ObjectE"}
!16 = !{!"_ZTSN2vl8SpinLockE", !15, i64 0, !17, i64 8}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_EE", !15, i64 0, !19, i64 8, !23, i64 56}
!19 = !{!"_ZTSN2vl11collections10SortedListINS_8database8IdObjectIiLl4EEES4_EE", !20, i64 0}
!20 = !{!"_ZTSN2vl11collections8ListBaseINS_8database8IdObjectIiLl4EEES4_EE", !21, i64 0, !17, i64 24, !10, i64 32}
!21 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database8IdObjectIiLl4EEEEE", !22, i64 0, !6, i64 8, !17, i64 16}
!22 = !{!"_ZTSN2vl11collections9ListStoreINS_8database8IdObjectIiLl4EEELb1EEE", !15, i64 0}
!23 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database11LockManager9TableInfoEEEPS5_EE", !24, i64 0}
!24 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database11LockManager9TableInfoEEEPS5_EE", !25, i64 0, !17, i64 24, !10, i64 32}
!25 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager9TableInfoEEEEE", !26, i64 0, !6, i64 8, !17, i64 16}
!26 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database11LockManager9TableInfoEEELb0EEE", !15, i64 0}
!27 = !{!"_ZTSN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_EE", !15, i64 0, !28, i64 8, !32, i64 56}
!28 = !{!"_ZTSN2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_EE", !29, i64 0}
!29 = !{!"_ZTSN2vl11collections8ListBaseINS_8database8IdObjectImLl3EEES4_EE", !30, i64 0, !17, i64 24, !10, i64 32}
!30 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database8IdObjectImLl3EEEEE", !31, i64 0, !6, i64 8, !17, i64 16}
!31 = !{!"_ZTSN2vl11collections9ListStoreINS_8database8IdObjectImLl3EEELb1EEE", !15, i64 0}
!32 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database11LockManager9TransInfoEEEPS5_EE", !33, i64 0}
!33 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database11LockManager9TransInfoEEEPS5_EE", !34, i64 0, !17, i64 24, !10, i64 32}
!34 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager9TransInfoEEEEE", !35, i64 0, !6, i64 8, !17, i64 16}
!35 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database11LockManager9TransInfoEEELb0EEE", !15, i64 0}
!36 = !{!"_ZTSN2vl11collections5ArrayINS_3PtrINS_8database11LockManager13TableLockInfoEEEPS5_EE", !37, i64 0}
!37 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager13TableLockInfoEEEEE", !38, i64 0, !6, i64 8, !17, i64 16}
!38 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database11LockManager13TableLockInfoEEELb0EEE", !15, i64 0}
!39 = !{!"_ZTSN2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_EE", !15, i64 0, !40, i64 8, !44, i64 56}
!40 = !{!"_ZTSN2vl11collections10SortedListImmEE", !41, i64 0}
!41 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !42, i64 0, !17, i64 24, !10, i64 32}
!42 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !43, i64 0, !6, i64 8, !17, i64 16}
!43 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !15, i64 0}
!44 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database11LockManager11PendingInfoEEEPS5_EE", !45, i64 0}
!45 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEPS5_EE", !46, i64 0, !17, i64 24, !10, i64 32}
!46 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEEE", !47, i64 0, !6, i64 8, !17, i64 16}
!47 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database11LockManager11PendingInfoEEELb0EEE", !15, i64 0}
!48 = !{i64 0, i64 4, !49}
!49 = !{!50, !50, i64 0}
!50 = !{!"int", !7, i64 0}
!51 = distinct !{!51, !52}
!52 = !{!"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"

%"struct.vl::database::IdObject.0" = type { i32 }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }
%"struct.vl::database::IdObject.1" = type { i64 }
%"class.vl::Ptr.117" = type { ptr, ptr, ptr, ptr }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #0 align 2

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database11LockManager13RegisterTableENS0_8IdObjectIiLl4EEENS2_IiLl0EEE(ptr noundef nonnull align 8 dereferenceable(400) %0, i32 %1, i32 %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.vl::database::IdObject.0", align 4
  %5 = alloca %"class.vl::SpinLock::Scope", align 8
  %6 = alloca %"struct.vl::database::IdObject.1", align 8
  %7 = alloca %"class.vl::Ptr.117", align 8
  store i32 %1, ptr %4, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %8)
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %9)
  %12 = invoke noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_8database8IdObjectIiLl4EEES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %11, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %13 unwind label %14

13:                                               ; preds = %3
  br i1 %12, label %35, label %16

14:                                               ; preds = %3
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %36

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  %18 = invoke i64 @_ZN2vl8database13BufferManager12GetIndexPageENS0_8IdObjectIiLl0EEE(ptr noundef nonnull align 8 dereferenceable(168) %17, i32 %2)
          to label %19 unwind label %21

19:                                               ; preds = %16
  store i64 %18, ptr %6, align 8
  %20 = call noundef zeroext i1 @_ZNK2vl8database8IdObjectImLl1EE7IsValidEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br i1 %20, label %23, label %35

21:                                               ; preds = %16
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %36

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  invoke void @_ZN2vl7MakePtrINS_8database11LockManager9TableInfoEJEEENS_3PtrIT_EEDpT0_(ptr dead_on_unwind nonnull writable sret(%"class.vl::Ptr.117") align 8 %7)
          to label %24 unwind label %30

24:                                               ; preds = %23
  %25 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TableInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
  %26 = load i32, ptr %4, align 4, !tbaa !44
  store i32 %26, ptr %25, align 4, !tbaa !44
  %27 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TableInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %7)
  %28 = getelementptr inbounds i8, ptr %27, i64 4
  store i32 %2, ptr %28, align 4, !tbaa !44
  %29 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_E3AddERKS4_RKS8_(ptr noundef nonnull align 8 dereferenceable(104) %9, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %.critedge unwind label %32

.critedge:                                        ; preds = %24
  call void @_ZN2vl3PtrINS_8database11LockManager9TableInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %37

30:                                               ; preds = %23
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %34

32:                                               ; preds = %24
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl3PtrINS_8database11LockManager9TableInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  br label %34

34:                                               ; preds = %32, %30
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %36

35:                                               ; preds = %19, %13
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %37

36:                                               ; preds = %34, %21, %14
  %.pn.pn = phi { ptr, i32 } [ %.pn, %34 ], [ %22, %21 ], [ %15, %14 ]
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn.pn

37:                                               ; preds = %35, %.critedge
  %.3 = phi i1 [ false, %35 ], [ true, %.critedge ]
  ret i1 %.3
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl7MakePtrINS_8database11LockManager9TableInfoEJEEENS_3PtrIT_EEDpT0_(ptr dead_on_unwind noalias writable sret(%"class.vl::Ptr.117") align 8) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_E3AddERKS4_RKS8_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

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

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

attributes #0 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !8, i64 8}
!6 = !{!"_ZTSN2vl8database11LockManagerE", !7, i64 0, !8, i64 8, !11, i64 16, !13, i64 32, !23, i64 144, !32, i64 256, !35, i64 288}
!7 = !{!"_ZTSN2vl6ObjectE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN2vl8SpinLockE", !7, i64 0, !12, i64 8}
!12 = !{!"long", !9, i64 0}
!13 = !{!"_ZTSN2vl11collections10DictionaryINS_8database8IdObjectIiLl4EEENS_3PtrINS2_11LockManager9TableInfoEEES4_PS7_EE", !7, i64 0, !14, i64 8, !19, i64 56}
!14 = !{!"_ZTSN2vl11collections10SortedListINS_8database8IdObjectIiLl4EEES4_EE", !15, i64 0}
!15 = !{!"_ZTSN2vl11collections8ListBaseINS_8database8IdObjectIiLl4EEES4_EE", !16, i64 0, !12, i64 24, !18, i64 32}
!16 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database8IdObjectIiLl4EEEEE", !17, i64 0, !8, i64 8, !12, i64 16}
!17 = !{!"_ZTSN2vl11collections9ListStoreINS_8database8IdObjectIiLl4EEELb1EEE", !7, i64 0}
!18 = !{!"bool", !9, i64 0}
!19 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database11LockManager9TableInfoEEEPS5_EE", !20, i64 0}
!20 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database11LockManager9TableInfoEEEPS5_EE", !21, i64 0, !12, i64 24, !18, i64 32}
!21 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager9TableInfoEEEEE", !22, i64 0, !8, i64 8, !12, i64 16}
!22 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database11LockManager9TableInfoEEELb0EEE", !7, i64 0}
!23 = !{!"_ZTSN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_EE", !7, i64 0, !24, i64 8, !28, i64 56}
!24 = !{!"_ZTSN2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_EE", !25, i64 0}
!25 = !{!"_ZTSN2vl11collections8ListBaseINS_8database8IdObjectImLl3EEES4_EE", !26, i64 0, !12, i64 24, !18, i64 32}
!26 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database8IdObjectImLl3EEEEE", !27, i64 0, !8, i64 8, !12, i64 16}
!27 = !{!"_ZTSN2vl11collections9ListStoreINS_8database8IdObjectImLl3EEELb1EEE", !7, i64 0}
!28 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database11LockManager9TransInfoEEEPS5_EE", !29, i64 0}
!29 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database11LockManager9TransInfoEEEPS5_EE", !30, i64 0, !12, i64 24, !18, i64 32}
!30 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager9TransInfoEEEEE", !31, i64 0, !8, i64 8, !12, i64 16}
!31 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database11LockManager9TransInfoEEELb0EEE", !7, i64 0}
!32 = !{!"_ZTSN2vl11collections5ArrayINS_3PtrINS_8database11LockManager13TableLockInfoEEEPS5_EE", !33, i64 0}
!33 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager13TableLockInfoEEEEE", !34, i64 0, !8, i64 8, !12, i64 16}
!34 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database11LockManager13TableLockInfoEEELb0EEE", !7, i64 0}
!35 = !{!"_ZTSN2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_EE", !7, i64 0, !36, i64 8, !40, i64 56}
!36 = !{!"_ZTSN2vl11collections10SortedListImmEE", !37, i64 0}
!37 = !{!"_ZTSN2vl11collections8ListBaseImmEE", !38, i64 0, !12, i64 24, !18, i64 32}
!38 = !{!"_ZTSN2vl11collections9ArrayBaseImEE", !39, i64 0, !8, i64 8, !12, i64 16}
!39 = !{!"_ZTSN2vl11collections9ListStoreImLb1EEE", !7, i64 0}
!40 = !{!"_ZTSN2vl11collections4ListINS_3PtrINS_8database11LockManager11PendingInfoEEEPS5_EE", !41, i64 0}
!41 = !{!"_ZTSN2vl11collections8ListBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEPS5_EE", !42, i64 0, !12, i64 24, !18, i64 32}
!42 = !{!"_ZTSN2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEEE", !43, i64 0, !8, i64 8, !12, i64 16}
!43 = !{!"_ZTSN2vl11collections9ListStoreINS_3PtrINS_8database11LockManager11PendingInfoEEELb0EEE", !7, i64 0}
!44 = !{!45, !45, i64 0}
!45 = !{!"int", !9, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass