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

%"class.vl::Ptr.60" = type { ptr, ptr, ptr, ptr }
%"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 }
%"struct.vl::database::LockManager::TransInfo" = type { %"struct.vl::database::IdObject", i64, %"class.vl::collections::SortedList.52", %"struct.vl::database::LockTarget" }
%"struct.vl::database::IdObject" = type { i64 }
%"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::Object" = type { ptr }
%"class.vl::collections::IEnumerable.56" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { 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::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::PendingInfo" = type { %"class.vl::collections::SortedList.11", 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 uwtable
declare dso_local noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) #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)) #2 align 2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK2vl11collections10SortedListImmE7IndexOfERKm(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; 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 nounwind uwtable
declare dso_local void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database11LockManager23RemovePendingLockUnsafeENS_3PtrINS1_9TransInfoEEERKNS0_10LockTargetE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.vl::Ptr.60", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.vl::database::LockTarget", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8
  %15 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %16 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %15, i32 0, i32 3
  %17 = call noundef zeroext i1 @_ZN2vl8database10LockTarget7IsValidEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  br i1 %17, label %18, label %23

18:                                               ; preds = %3
  %19 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %20 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = call noundef zeroext i1 @_ZNK2vl8database10LockTargetneERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %21)
  br i1 %22, label %23, label %24

23:                                               ; preds = %18, %3
  store i1 false, ptr %4, align 1
  br label %71

24:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %25 = getelementptr inbounds %"class.vl::database::LockManager", ptr %14, i32 0, i32 6
  %26 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %25)
  %27 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %28 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %27, i32 0, i32 1
  %29 = call noundef i64 @_ZNK2vl11collections10SortedListImmE7IndexOfERKm(ptr noundef nonnull align 8 dereferenceable(33) %26, ptr noundef nonnull align 8 dereferenceable(8) %28)
  store i64 %29, ptr %8, align 8, !tbaa !9
  %30 = load i64, ptr %8, align 8, !tbaa !9
  %31 = icmp eq i64 %30, -1
  br i1 %31, label %32, label %33

32:                                               ; preds = %24
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %70

33:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  %34 = getelementptr inbounds %"class.vl::database::LockManager", ptr %14, i32 0, i32 6
  %35 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %34)
  %36 = load i64, ptr %8, align 8, !tbaa !9
  %37 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %36)
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %37)
  %38 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager11PendingInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %39 unwind label %49

39:                                               ; preds = %33
  %40 = getelementptr inbounds %"struct.vl::database::LockManager::PendingInfo", ptr %38, i32 0, i32 0
  %41 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %42 unwind label %49

42:                                               ; preds = %39
  %43 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %41, i32 0, i32 0
  %44 = invoke noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %40, ptr noundef nonnull align 8 dereferenceable(8) %43)
          to label %45 unwind label %49

45:                                               ; preds = %42
  store i64 %44, ptr %8, align 8, !tbaa !9
  %46 = load i64, ptr %8, align 8, !tbaa !9
  %47 = icmp eq i64 %46, -1
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %68

49:                                               ; preds = %55, %53, %42, %39, %33
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %11, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %12, align 4
  br label %69

53:                                               ; preds = %45
  %54 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager11PendingInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %55 unwind label %49

55:                                               ; preds = %53
  %56 = getelementptr inbounds %"struct.vl::database::LockManager::PendingInfo", ptr %54, i32 0, i32 0
  %57 = load i64, ptr %8, align 8, !tbaa !9
  %58 = invoke noundef zeroext i1 @_ZN2vl11collections8ListBaseINS_8database8IdObjectImLl3EEES4_E8RemoveAtEl(ptr noundef nonnull align 8 dereferenceable(33) %56, i64 noundef %57)
          to label %59 unwind label %49

59:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  invoke void @_ZN2vl8database10LockTargetC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %60 unwind label %64

60:                                               ; preds = %59
  %61 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %62 unwind label %64

62:                                               ; preds = %60
  %63 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %61, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %63, ptr align 8 %13, i64 24, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %68

64:                                               ; preds = %60, %59
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %11, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  br label %69

68:                                               ; preds = %62, %48
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  br label %70

69:                                               ; preds = %64, %49
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %73

70:                                               ; preds = %68, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %71

71:                                               ; preds = %70, %23
  %72 = load i1, ptr %4, align 1
  ret i1 %72

73:                                               ; preds = %69
  %74 = load ptr, ptr %11, align 8
  %75 = load i32, ptr %12, align 4
  %76 = insertvalue { ptr, i32 } poison, ptr %74, 0
  %77 = insertvalue { ptr, i32 } %76, i32 %75, 1
  resume { ptr, i32 } %77
}

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

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

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

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

attributes #0 = { 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !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 = !{i64 0, i64 4, !12, i64 4, i64 4, !14, i64 8, i64 4, !16, i64 16, i64 8, !18}
!12 = !{!13, !13, i64 0}
!13 = !{!"_ZTSN2vl8database14LockTargetTypeE", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTSN2vl8database16LockTargetAccessE", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!7, !7, i64 0}


; 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.60" = type { ptr, ptr, ptr, ptr }
%"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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) 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 #2 align 2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK2vl11collections10SortedListImmE7IndexOfERKm(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database11LockManager23RemovePendingLockUnsafeENS_3PtrINS1_9TransInfoEEERKNS0_10LockTargetE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.vl::Ptr.60", align 8
  %5 = alloca %"struct.vl::database::LockTarget", align 8
  %6 = tail call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %7 = getelementptr inbounds i8, ptr %6, i64 64
  %8 = tail call noundef zeroext i1 @_ZN2vl8database10LockTarget7IsValidEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  br i1 %8, label %9, label %41

9:                                                ; preds = %3
  %10 = tail call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %11 = getelementptr inbounds i8, ptr %10, i64 64
  %12 = tail call noundef zeroext i1 @_ZNK2vl8database10LockTargetneERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %2)
  br i1 %12, label %41, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 288
  %15 = tail call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %14)
  %16 = tail call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = tail call noundef i64 @_ZNK2vl11collections10SortedListImmE7IndexOfERKm(ptr noundef nonnull align 8 dereferenceable(33) %15, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %19 = icmp eq i64 %18, -1
  br i1 %19, label %41, label %20

20:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  %21 = tail call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %14)
  %22 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %18)
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %22)
  %23 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager11PendingInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %24 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %25 = invoke noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %23, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %26 unwind label %28

26:                                               ; preds = %20
  %27 = icmp ne i64 %25, -1
  br i1 %27, label %30, label %39

28:                                               ; preds = %30, %20
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %40

30:                                               ; preds = %26
  %31 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager11PendingInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %32 = invoke noundef zeroext i1 @_ZN2vl11collections8ListBaseINS_8database8IdObjectImLl3EEES4_E8RemoveAtEl(ptr noundef nonnull align 8 dereferenceable(33) %31, i64 noundef %25)
          to label %33 unwind label %28

33:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  invoke void @_ZN2vl8database10LockTargetC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %34 unwind label %37

34:                                               ; preds = %33
  %35 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %36 = getelementptr inbounds i8, ptr %35, i64 64
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(24) %5, i64 24, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  br label %39

37:                                               ; preds = %33
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  br label %40

39:                                               ; preds = %26, %34
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %41

40:                                               ; preds = %37, %28
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %29, %28 ]
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn

41:                                               ; preds = %39, %13, %3, %9
  %.2 = phi i1 [ false, %9 ], [ false, %3 ], [ %27, %39 ], [ false, %13 ]
  ret i1 %.2
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl8database10LockTargetC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 4, !6, i64 4, i64 4, !10, i64 8, i64 4, !12, i64 16, i64 8, !14}
!6 = !{!7, !7, i64 0}
!7 = !{!"_ZTSN2vl8database14LockTargetTypeE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"_ZTSN2vl8database16LockTargetAccessE", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!8, !8, i64 0}


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