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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl8database10LockTarget7IsValidEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 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 #3

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

; 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)) #2 align 2

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

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

20:                                               ; preds = %81, %18
  %21 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %22 = trunc i8 %21 to i1
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  store i32 2, ptr %9, align 4
  br label %84

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %25 = getelementptr inbounds %"class.vl::database::LockManager", ptr %15, i32 0, i32 4
  %26 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %25)
          to label %27 unwind label %33

27:                                               ; preds = %24
  %28 = invoke noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %26, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %29 unwind label %33

29:                                               ; preds = %27
  store i64 %28, ptr %10, align 8, !tbaa !13
  %30 = load i64, ptr %10, align 8, !tbaa !13
  %31 = icmp eq i64 %30, -1
  br i1 %31, label %32, label %37

32:                                               ; preds = %29
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %78

33:                                               ; preds = %27, %24
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %11, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %12, align 4
  br label %83

37:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  %38 = getelementptr inbounds %"class.vl::database::LockManager", ptr %15, i32 0, i32 4
  %39 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %38)
          to label %40 unwind label %58

40:                                               ; preds = %37
  %41 = load i64, ptr %10, align 8, !tbaa !13
  %42 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager9TransInfoEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %41)
          to label %43 unwind label %58

43:                                               ; preds = %40
  invoke void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %42)
          to label %44 unwind label %58

44:                                               ; preds = %43
  %45 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %46 unwind label %62

46:                                               ; preds = %44
  %47 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %45, i32 0, i32 2
  %48 = invoke noundef i64 @_ZNK2vl11collections9ArrayBaseINS_8database10LockTargetEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %47)
          to label %49 unwind label %62

49:                                               ; preds = %46
  %50 = icmp sgt i64 %48, 0
  br i1 %50, label %57, label %51

51:                                               ; preds = %49
  %52 = invoke noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %53 unwind label %62

53:                                               ; preds = %51
  %54 = getelementptr inbounds %"struct.vl::database::LockManager::TransInfo", ptr %52, i32 0, i32 3
  %55 = invoke noundef zeroext i1 @_ZN2vl8database10LockTarget7IsValidEv(ptr noundef nonnull align 8 dereferenceable(24) %54)
          to label %56 unwind label %62

56:                                               ; preds = %53
  br i1 %55, label %57, label %66

57:                                               ; preds = %56, %49
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %77

58:                                               ; preds = %43, %40, %37
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %11, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %12, align 4
  br label %82

62:                                               ; preds = %73, %69, %66, %53, %51, %46, %44
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %11, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %12, align 4
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  br label %82

66:                                               ; preds = %56
  %67 = getelementptr inbounds %"class.vl::database::LockManager", ptr %15, i32 0, i32 4
  %68 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %67)
          to label %69 unwind label %62

69:                                               ; preds = %66
  %70 = invoke noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %68, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %71 unwind label %62

71:                                               ; preds = %69
  br i1 %70, label %73, label %72

72:                                               ; preds = %71
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %77

73:                                               ; preds = %71
  %74 = getelementptr inbounds %"class.vl::database::LockManager", ptr %15, i32 0, i32 4
  %75 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E6RemoveERKS4_(ptr noundef nonnull align 8 dereferenceable(104) %74, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %76 unwind label %62

76:                                               ; preds = %73
  store i32 0, ptr %9, align 4
  br label %77

77:                                               ; preds = %76, %72, %57
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  br label %78

78:                                               ; preds = %77, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %79 = load i32, ptr %9, align 4
  switch i32 %79, label %84 [
    i32 0, label %80
  ]

80:                                               ; preds = %78
  br label %81

81:                                               ; preds = %80
  store i8 0, ptr %6, align 1, !tbaa !9
  br label %20, !llvm.loop !15

82:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  br label %83

83:                                               ; preds = %82, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  br label %93

84:                                               ; preds = %78, %23
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %85 = load i32, ptr %9, align 4
  switch i32 %85, label %88 [
    i32 2, label %86
  ]

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86, %2
  store i32 0, ptr %9, align 4
  br label %88

88:                                               ; preds = %87, %84
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  %89 = load i32, ptr %9, align 4
  switch i32 %89, label %98 [
    i32 0, label %90
    i32 1, label %91
  ]

90:                                               ; preds = %88
  store i1 true, ptr %3, align 1
  br label %91

91:                                               ; preds = %90, %88
  %92 = load i1, ptr %3, align 1
  ret i1 %92

93:                                               ; preds = %83
  %94 = load ptr, ptr %11, align 8
  %95 = load i32, ptr %12, align 4
  %96 = insertvalue { ptr, i32 } poison, ptr %94, 0
  %97 = insertvalue { ptr, i32 } %96, i32 %95, 1
  resume { ptr, i32 } %97

98:                                               ; preds = %88
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E6RemoveERKS4_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(8)) #2 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl8database10LockTarget7IsValidEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 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 #3

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

; 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 #2 align 2

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

10:                                               ; preds = %2
  %11 = icmp eq i64 %9, -1
  br i1 %11, label %.thread, label %14

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

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  %15 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %7)
  %16 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database11LockManager9TransInfoEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %9)
          to label %17 unwind label %27

17:                                               ; preds = %14
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %16)
  %18 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %20 = call noundef i64 @_ZNK2vl11collections9ArrayBaseINS_8database10LockTargetEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %19)
  %21 = icmp sgt i64 %20, 0
  br i1 %21, label %.thread25, label %22

22:                                               ; preds = %17
  %23 = call noundef ptr @_ZNK2vl3PtrINS_8database11LockManager9TransInfoEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %24 = getelementptr inbounds i8, ptr %23, i64 64
  %25 = invoke noundef zeroext i1 @_ZN2vl8database10LockTarget7IsValidEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %26 unwind label %29

26:                                               ; preds = %22
  br i1 %25, label %.thread25, label %31

27:                                               ; preds = %14
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %37

29:                                               ; preds = %35, %31, %22
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br label %37

31:                                               ; preds = %26
  %32 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %7)
  %33 = invoke noundef zeroext i1 @_ZNK2vl11collections10SortedListINS_8database8IdObjectImLl3EEES4_E8ContainsERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %32, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %34 unwind label %29

34:                                               ; preds = %31
  br i1 %33, label %35, label %.thread25

35:                                               ; preds = %34
  %36 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E6RemoveERKS4_(ptr noundef nonnull align 8 dereferenceable(104) %7, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %.critedge unwind label %29

.thread25:                                        ; preds = %26, %17, %34
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %.thread

.critedge:                                        ; preds = %35
  call void @_ZN2vl3PtrINS_8database11LockManager9TransInfoEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %39

37:                                               ; preds = %29, %27
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %38

38:                                               ; preds = %37, %12
  %.pn.pn = phi { ptr, i32 } [ %.pn, %37 ], [ %13, %12 ]
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn

.thread:                                          ; preds = %10, %.thread25
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %39

39:                                               ; preds = %.thread, %.critedge
  %.6 = phi i1 [ false, %.thread ], [ true, %.critedge ]
  ret i1 %.6
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectImLl3EEENS_3PtrINS2_11LockManager9TransInfoEEES4_PS7_E6RemoveERKS4_(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}


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