; 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::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 }
%"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 }
%"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 uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database11LockManager20AddPendingLockUnsafeENS_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 %"class.vl::Ptr.60", align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  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
  %13 = load ptr, ptr %5, align 8
  %14 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %15 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %14, i32 0, i32 3
  %16 = call noundef zeroext i1 @_ZN2vl8database10LockTarget7IsValidEv(ptr noundef nonnull align 8 dereferenceable(24) %15)
  br i1 %16, label %17, label %18

17:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  br label %85

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %19 = getelementptr inbounds %"class.vl::database::LockManager", ptr %13, i32 0, i32 6
  %20 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %19)
          to label %21 unwind label %41

21:                                               ; preds = %18
  %22 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %23 unwind label %41

23:                                               ; preds = %21
  %24 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %22, i32 0, i32 1
  %25 = invoke noundef i64 @_ZNK2vl11collections10SortedListImmE7IndexOfERKm(ptr noundef nonnull align 8 dereferenceable(33) %20, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %26 unwind label %41

26:                                               ; preds = %23
  store i64 %25, ptr %9, align 8, !tbaa !9
  %27 = load i64, ptr %9, align 8, !tbaa !9
  %28 = icmp eq i64 %27, -1
  br i1 %28, label %29, label %49

29:                                               ; preds = %26
  %30 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 56) #8
          to label %31 unwind label %41

31:                                               ; preds = %29
  invoke void @_ZN2vl8database11LockManager11PendingInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %30)
          to label %32 unwind label %45

32:                                               ; preds = %31
  %33 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEaSEPS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef %30)
          to label %34 unwind label %41

34:                                               ; preds = %32
  %35 = getelementptr inbounds %"class.vl::database::LockManager", ptr %13, i32 0, i32 6
  %36 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %37 unwind label %41

37:                                               ; preds = %34
  %38 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %36, i32 0, i32 1
  %39 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E3AddERKmRKS6_(ptr noundef nonnull align 8 dereferenceable(104) %35, ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %40 unwind label %41

40:                                               ; preds = %37
  br label %58

41:                                               ; preds = %78, %75, %72, %70, %63, %60, %58, %55, %52, %49, %37, %34, %32, %29, %23, %21, %18
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %10, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %11, align 4
  br label %84

45:                                               ; preds = %31
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %10, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %11, align 4
  call void @_ZdlPvm(ptr noundef %30, i64 noundef 56) #9
  br label %84

49:                                               ; preds = %26
  %50 = getelementptr inbounds %"class.vl::database::LockManager", ptr %13, i32 0, i32 6
  %51 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %50)
          to label %52 unwind label %41

52:                                               ; preds = %49
  %53 = load i64, ptr %9, align 8, !tbaa !9
  %54 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %53)
          to label %55 unwind label %41

55:                                               ; preds = %52
  %56 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %54)
          to label %57 unwind label %41

57:                                               ; preds = %55
  br label %58

58:                                               ; preds = %57, %40
  %59 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager11PendingInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %60 unwind label %41

60:                                               ; preds = %58
  %61 = getelementptr inbounds %"struct.vl::database::LockManager::PendingInfo", ptr %59, i32 0, i32 0
  %62 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %63 unwind label %41

63:                                               ; preds = %60
  %64 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %62, i32 0, i32 0
  %65 = invoke noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %61, ptr noundef nonnull align 8 dereferenceable(8) %64)
          to label %66 unwind label %41

66:                                               ; preds = %63
  store i64 %65, ptr %9, align 8, !tbaa !9
  %67 = load i64, ptr %9, align 8, !tbaa !9
  %68 = icmp ne i64 %67, -1
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %83

70:                                               ; preds = %66
  %71 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager11PendingInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %72 unwind label %41

72:                                               ; preds = %70
  %73 = getelementptr inbounds %"struct.vl::database::LockManager::PendingInfo", ptr %71, i32 0, i32 0
  %74 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %75 unwind label %41

75:                                               ; preds = %72
  %76 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %74, i32 0, i32 0
  %77 = invoke noundef i64 @_ZN2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %73, ptr noundef nonnull align 8 dereferenceable(8) %76)
          to label %78 unwind label %41

78:                                               ; preds = %75
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %81 unwind label %41

81:                                               ; preds = %78
  %82 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %80, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %82, ptr align 8 %79, i64 24, i1 false), !tbaa.struct !11
  store i1 true, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %83

83:                                               ; preds = %81, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  br label %85

84:                                               ; preds = %45, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  br label %87

85:                                               ; preds = %83, %17
  %86 = load i1, ptr %4, align 1
  ret i1 %86

87:                                               ; preds = %84
  %88 = load ptr, ptr %10, align 8
  %89 = load i32, ptr %11, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91
}

; 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 void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl8database11LockManager11PendingInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E3AddERKmRKS6_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #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: mustprogress uwtable
declare dso_local noundef i64 @_ZN2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) #1 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) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint 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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"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 }

; 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 uwtable
define dso_local noundef zeroext i1 @_ZN2vl8database11LockManager20AddPendingLockUnsafeENS_3PtrINS1_9TransInfoEEERKNS0_10LockTargetE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %1, ptr nocapture noundef nonnull readonly 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 = tail call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %6 = getelementptr inbounds i8, ptr %5, i64 64
  %7 = tail call noundef zeroext i1 @_ZN2vl8database10LockTarget7IsValidEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  br i1 %7, label %48, label %8

8:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %9 = getelementptr inbounds i8, ptr %0, i64 288
  %10 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %9)
  %11 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %12 = getelementptr inbounds i8, ptr %11, i64 8
  %13 = invoke noundef i64 @_ZNK2vl11collections10SortedListImmE7IndexOfERKm(ptr noundef nonnull align 8 dereferenceable(33) %10, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %14 unwind label %25

14:                                               ; preds = %8
  %15 = icmp eq i64 %13, -1
  br i1 %15, label %16, label %29

16:                                               ; preds = %14
  %17 = invoke noalias noundef nonnull dereferenceable(56) ptr @_Znwm(i64 noundef 56) #8
          to label %18 unwind label %25

18:                                               ; preds = %16
  invoke void @_ZN2vl8database11LockManager11PendingInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %17)
          to label %19 unwind label %27

19:                                               ; preds = %18
  %20 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEaSEPS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull %17)
          to label %21 unwind label %25

21:                                               ; preds = %19
  %22 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E3AddERKmRKS6_(ptr noundef nonnull align 8 dereferenceable(104) %9, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %34 unwind label %25

25:                                               ; preds = %39, %34, %32, %29, %21, %19, %16, %8
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %47

27:                                               ; preds = %18
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %17, i64 noundef 56) #9
  br label %47

29:                                               ; preds = %14
  %30 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %9)
  %31 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager11PendingInfoEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %13)
          to label %32 unwind label %25

32:                                               ; preds = %29
  %33 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %34 unwind label %25

34:                                               ; preds = %32, %21
  %35 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager11PendingInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %36 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %37 = invoke noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %35, ptr noundef nonnull align 8 dereferenceable(8) %36)
          to label %38 unwind label %25

38:                                               ; preds = %34
  %.not = icmp eq i64 %37, -1
  br i1 %.not, label %39, label %46

39:                                               ; preds = %38
  %40 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager11PendingInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %41 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %42 = invoke noundef i64 @_ZN2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E3AddERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %40, ptr noundef nonnull align 8 dereferenceable(8) %41)
          to label %43 unwind label %25

43:                                               ; preds = %39
  %44 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %45 = getelementptr inbounds i8, ptr %44, i64 64
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 8 dereferenceable(24) %2, i64 24, i1 false), !tbaa.struct !5
  br label %46

46:                                               ; preds = %38, %43
  call void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %48

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

48:                                               ; preds = %3, %46
  %.1 = phi i1 [ %.not, %46 ], [ false, %3 ]
  ret i1 %.1
}

; 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 void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2vl8database11LockManager11PendingInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl11collections10DictionaryImNS_3PtrINS_8database11LockManager11PendingInfoEEEmPS5_E3AddERKmRKS6_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) 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 uwtable
declare dso_local noundef i64 @_ZN2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E3AddERKS4_(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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl3PtrINS_8database11LockManager11PendingInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint 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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass