; 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" = type { i64 }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }
%"class.vl::Ptr" = 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::TransInfo" = type { %"struct.vl::database::IdObject", i64, %"class.vl::collections::SortedList.52", %"struct.vl::database::LockTarget" }
%"class.vl::collections::SortedList.52" = type { %"class.vl::collections::ListBase.base.58", %"class.vl::collections::IEnumerable.56" }
%"class.vl::collections::ListBase.base.58" = type <{ %"class.vl::collections::ArrayBase.base.57", i64, i8 }>
%"class.vl::collections::ArrayBase.base.57" = type { %"class.vl::collections::ListStore.55", ptr, i64 }
%"class.vl::collections::ListStore.55" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.56" = type { %"class.vl::Interface" }
%"struct.vl::database::LockTarget" = type { i32, i32, %"struct.vl::database::IdObject.0", %union.anon }
%"struct.vl::database::IdObject.0" = type { i32 }
%union.anon = type { %"struct.vl::database::IdObject.1" }
%"struct.vl::database::IdObject.1" = type { i64 }

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

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

; Function Attrs: 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 ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 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) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 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
define dso_local noundef zeroext i1 @_ZN2vl8database11LockManager19RegisterTransactionENS0_8IdObjectImLl3EEEm(ptr noundef nonnull align 8 dereferenceable(400) %0, i64 %1, i64 noundef %2) #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca %"struct.vl::database::IdObject", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, 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 %"class.vl::Ptr", align 8
  %15 = getelementptr inbounds %"struct.vl::database::IdObject", ptr %5, i32 0, i32 0
  store i64 %1, ptr %15, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  %16 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 1, ptr %8, align 1, !tbaa !11
  %17 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %18 = trunc i8 %17 to i1
  br i1 %18, label %19, label %62

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

21:                                               ; preds = %48, %19
  %22 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %23 = trunc i8 %22 to i1
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %21
  %26 = getelementptr inbounds %"class.vl::database::LockManager", ptr %16, i32 0, i32 4
  %27 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %26)
          to label %28 unwind label %32

28:                                               ; preds = %25
  %29 = invoke noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %27, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %30 unwind label %32

30:                                               ; preds = %28
  br i1 %29, label %31, label %36

31:                                               ; preds = %30
  store i1 false, ptr %4, align 1
  store i32 1, ptr %11, align 4
  br label %58

32:                                               ; preds = %28, %25
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %12, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %13, align 4
  br label %60

36:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  invoke void @_ZN2vl7MakePtrINS_8database11LockManager9TransInfoEJEEENS_3PtrIT_EEDpT0_(ptr dead_on_unwind writable sret(%"class.vl::Ptr") align 8 %14)
          to label %37 unwind label %49

37:                                               ; preds = %36
  %38 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %39 unwind label %53

39:                                               ; preds = %37
  %40 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %38, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %40, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !15
  %41 = load i64, ptr %7, align 8, !tbaa !9
  %42 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %43 unwind label %53

43:                                               ; preds = %39
  %44 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %42, i32 0, i32 1
  store i64 %41, ptr %44, align 8, !tbaa !16
  %45 = getelementptr inbounds %"class.vl::database::LockManager", ptr %16, i32 0, i32 4
  %46 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E3AddERKS4_RKS8_(ptr noundef nonnull align 8 dereferenceable(104) %45, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %47 unwind label %53

47:                                               ; preds = %43
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %48

48:                                               ; preds = %47
  store i8 0, ptr %8, align 1, !tbaa !11
  br label %21, !llvm.loop !29

49:                                               ; preds = %36
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %12, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %13, align 4
  br label %57

53:                                               ; preds = %43, %39, %37
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %12, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %13, align 4
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %57

57:                                               ; preds = %53, %49
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %60

58:                                               ; preds = %31, %24
  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
  %59 = load i32, ptr %11, align 4
  switch i32 %59, label %63 [
    i32 2, label %61
  ]

60:                                               ; preds = %57, %32
  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 %68

61:                                               ; preds = %58
  br label %62

62:                                               ; preds = %61, %3
  store i32 0, ptr %11, align 4
  br label %63

63:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  %64 = load i32, ptr %11, align 4
  switch i32 %64, label %73 [
    i32 0, label %65
    i32 1, label %66
  ]

65:                                               ; preds = %63
  store i1 true, ptr %4, align 1
  br label %66

66:                                               ; preds = %65, %63
  %67 = load i1, ptr %4, align 1
  ret i1 %67

68:                                               ; preds = %60
  %69 = load ptr, ptr %12, align 8
  %70 = load i32, ptr %13, align 4
  %71 = insertvalue { ptr, i32 } poison, ptr %69, 0
  %72 = insertvalue { ptr, i32 } %71, i32 %70, 1
  resume { ptr, i32 } %72

73:                                               ; preds = %63
  unreachable
}

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

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

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

attributes #0 = { 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 = { nocallback nofree 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 = { 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 #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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{i64 0, i64 8, !9}
!16 = !{!17, !10, i64 8}
!17 = !{!"_ZTSN2vl8database11LockManager9TransInfoE", !18, i64 0, !10, i64 8, !19, i64 16, !24, i64 64}
!18 = !{!"_ZTSN2vl8database8IdObjectImLl3EEE", !10, i64 0}
!19 = !{!"_ZTSN2vl11collections10SortedListINS_8database10LockTargetES3_EE", !20, i64 0}
!20 = !{!"_ZTSN2vl11collections8ListBaseINS_8database10LockTargetES3_EE", !21, i64 0, !10, i64 24, !12, i64 32}
!21 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database10LockTargetEEE", !22, i64 0, !6, i64 8, !10, i64 16}
!22 = !{!"_ZTSN2vl11collections9ListStoreINS_8database10LockTargetELb0EEE", !23, i64 0}
!23 = !{!"_ZTSN2vl6ObjectE"}
!24 = !{!"_ZTSN2vl8database10LockTargetE", !25, i64 0, !26, i64 4, !27, i64 8, !7, i64 16}
!25 = !{!"_ZTSN2vl8database14LockTargetTypeE", !7, i64 0}
!26 = !{!"_ZTSN2vl8database16LockTargetAccessE", !7, i64 0}
!27 = !{!"_ZTSN2vl8database8IdObjectIiLl4EEE", !28, i64 0}
!28 = !{!"int", !7, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"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" = type { i64 }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }
%"class.vl::Ptr" = type { ptr, ptr, ptr, ptr }

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

; 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 ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database11LockManager19RegisterTransactionENS0_8IdObjectImLl3EEEm(ptr noundef nonnull align 8 dereferenceable(400) %0, i64 %1, i64 noundef %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.vl::database::IdObject", align 8
  %5 = alloca %"class.vl::SpinLock::Scope", align 8
  %6 = alloca %"class.vl::Ptr", align 8
  store i64 %1, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %7 = 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) %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 144
  %9 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %8)
  %10 = invoke noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %9, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %11 unwind label %12

11:                                               ; preds = %3
  br i1 %10, label %26, label %14

12:                                               ; preds = %3
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %27

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  invoke void @_ZN2vl7MakePtrINS_8database11LockManager9TransInfoEJEEENS_3PtrIT_EEDpT0_(ptr dead_on_unwind nonnull writable sret(%"class.vl::Ptr") align 8 %6)
          to label %15 unwind label %21

15:                                               ; preds = %14
  %16 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %17 = load i64, ptr %4, align 8, !tbaa !5
  store i64 %17, ptr %16, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  store i64 %2, ptr %19, align 8, !tbaa !9
  %20 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E3AddERKS4_RKS8_(ptr noundef nonnull align 8 dereferenceable(104) %8, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %.critedge unwind label %23

.critedge:                                        ; preds = %15
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #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 %28

21:                                               ; preds = %14
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %25

23:                                               ; preds = %15
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  br label %25

25:                                               ; preds = %23, %21
  %.pn = phi { ptr, i32 } [ %24, %23 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  br label %27

26:                                               ; preds = %11
  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 %28

27:                                               ; preds = %25, %12
  %.pn.pn = phi { ptr, i32 } [ %.pn, %25 ], [ %13, %12 ]
  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

28:                                               ; preds = %26, %.critedge
  %.3 = xor i1 %10, true
  ret i1 %.3
}

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

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

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

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 = { "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 = { 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 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN2vl8database11LockManager9TransInfoE", !11, i64 0, !6, i64 8, !12, i64 16, !19, i64 64}
!11 = !{!"_ZTSN2vl8database8IdObjectImLl3EEE", !6, i64 0}
!12 = !{!"_ZTSN2vl11collections10SortedListINS_8database10LockTargetES3_EE", !13, i64 0}
!13 = !{!"_ZTSN2vl11collections8ListBaseINS_8database10LockTargetES3_EE", !14, i64 0, !6, i64 24, !18, i64 32}
!14 = !{!"_ZTSN2vl11collections9ArrayBaseINS_8database10LockTargetEEE", !15, i64 0, !17, i64 8, !6, i64 16}
!15 = !{!"_ZTSN2vl11collections9ListStoreINS_8database10LockTargetELb0EEE", !16, i64 0}
!16 = !{!"_ZTSN2vl6ObjectE"}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTSN2vl8database10LockTargetE", !20, i64 0, !21, i64 4, !22, i64 8, !7, i64 16}
!20 = !{!"_ZTSN2vl8database14LockTargetTypeE", !7, i64 0}
!21 = !{!"_ZTSN2vl8database16LockTargetAccessE", !7, i64 0}
!22 = !{!"_ZTSN2vl8database8IdObjectIiLl4EEE", !23, i64 0}
!23 = !{!"int", !7, i64 0}


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