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

; 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 { i32 }
%"class.vl::Ptr.15" = type { ptr, ptr, ptr, ptr }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }
%"class.vl::database::BufferManager" = type { i64, i64, i64, i64, %"class.vl::SpinLock", i64, %"class.vl::collections::Dictionary" }
%"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.6" }
%"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.5", %"class.vl::collections::IEnumerable.3" }
%"class.vl::collections::ListBase.base.5" = type <{ %"class.vl::collections::ArrayBase.base.4", i64, i8 }>
%"class.vl::collections::ArrayBase.base.4" = type { %"class.vl::collections::ListStore.2", ptr, i64 }
%"class.vl::collections::ListStore.2" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.3" = type { %"class.vl::Interface" }
%"class.vl::collections::IEnumerable.6" = type { %"class.vl::Interface" }

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

21:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %22 = getelementptr inbounds %"class.vl::database::BufferManager", ptr %18, i32 0, i32 4
  invoke void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %23 unwind label %28

23:                                               ; preds = %21
  store ptr %9, ptr %8, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %60, %23
  %25 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %26 = trunc i8 %25 to i1
  br i1 %26, label %32, label %27

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

28:                                               ; preds = %21
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %10, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %11, align 4
  br label %63

32:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %33 = getelementptr inbounds %"class.vl::database::BufferManager", ptr %18, i32 0, i32 6
  %34 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectIiLl0EEENS_3PtrINS2_13IBufferSourceEEES4_PS6_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %33)
          to label %35 unwind label %41

35:                                               ; preds = %32
  %36 = invoke noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectIiLl0EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %34, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %37 unwind label %41

37:                                               ; preds = %35
  store i64 %36, ptr %13, align 8, !tbaa !13
  %38 = load i64, ptr %13, align 8, !tbaa !13
  %39 = icmp eq i64 %38, -1
  br i1 %39, label %40, label %45

40:                                               ; preds = %37
  store i1 false, ptr %3, align 1
  store i32 1, ptr %12, align 4
  br label %57

41:                                               ; preds = %53, %51, %48, %45, %35, %32
  %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
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %63

45:                                               ; preds = %37
  %46 = getelementptr inbounds %"class.vl::database::BufferManager", ptr %18, i32 0, i32 6
  %47 = invoke noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectIiLl0EEENS_3PtrINS2_13IBufferSourceEEES4_PS6_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %46)
          to label %48 unwind label %41

48:                                               ; preds = %45
  %49 = load i64, ptr %13, align 8, !tbaa !13
  %50 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database13IBufferSourceEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %49)
          to label %51 unwind label %41

51:                                               ; preds = %48
  %52 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database13IBufferSourceEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %50)
          to label %53 unwind label %41

53:                                               ; preds = %51
  %54 = getelementptr inbounds %"class.vl::database::BufferManager", ptr %18, i32 0, i32 6
  %55 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectIiLl0EEENS_3PtrINS2_13IBufferSourceEEES4_PS6_E6RemoveERKS4_(ptr noundef nonnull align 8 dereferenceable(104) %54, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %56 unwind label %41

56:                                               ; preds = %53
  store i32 0, ptr %12, align 4
  br label %57

57:                                               ; preds = %56, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %58 = load i32, ptr %12, align 4
  switch i32 %58, label %61 [
    i32 0, label %59
  ]

59:                                               ; preds = %57
  br label %60

60:                                               ; preds = %59
  store i8 0, ptr %7, align 1, !tbaa !9
  br label %24, !llvm.loop !15

61:                                               ; preds = %57, %27
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %62 = load i32, ptr %12, align 4
  switch i32 %62, label %66 [
    i32 2, label %64
  ]

63:                                               ; preds = %41, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  br label %105

64:                                               ; preds = %61
  br label %65

65:                                               ; preds = %64, %2
  store i32 0, ptr %12, align 4
  br label %66

66:                                               ; preds = %65, %61
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  %67 = load i32, ptr %12, align 4
  switch i32 %67, label %103 [
    i32 0, label %68
  ]

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  store i8 1, ptr %14, align 1, !tbaa !9
  %69 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %70 = trunc i8 %69 to i1
  br i1 %70, label %71, label %102

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %72 = invoke noundef ptr @_ZNK2vl3PtrINS_8database13IBufferSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %73 unwind label %84

73:                                               ; preds = %71
  %74 = load ptr, ptr %72, align 8, !tbaa !17
  %75 = getelementptr inbounds ptr, ptr %74, i64 4
  %76 = load ptr, ptr %75, align 8
  %77 = invoke noundef nonnull align 8 dereferenceable(16) ptr %76(ptr noundef nonnull align 8 dereferenceable(8) %72)
          to label %78 unwind label %84

78:                                               ; preds = %73
  invoke void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %77)
          to label %79 unwind label %84

79:                                               ; preds = %78
  store ptr %16, ptr %15, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %95, %79
  %81 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %82 = trunc i8 %81 to i1
  br i1 %82, label %88, label %83

83:                                               ; preds = %80
  store i32 5, ptr %12, align 4
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %101

84:                                               ; preds = %78, %73, %71
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %10, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %11, align 4
  br label %100

88:                                               ; preds = %80
  %89 = invoke noundef ptr @_ZNK2vl3PtrINS_8database13IBufferSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %90 unwind label %96

90:                                               ; preds = %88
  %91 = load ptr, ptr %89, align 8, !tbaa !17
  %92 = getelementptr inbounds ptr, ptr %91, i64 2
  %93 = load ptr, ptr %92, align 8
  invoke void %93(ptr noundef nonnull align 8 dereferenceable(8) %89)
          to label %94 unwind label %96

94:                                               ; preds = %90
  br label %95

95:                                               ; preds = %94
  store i8 0, ptr %14, align 1, !tbaa !9
  br label %80, !llvm.loop !19

96:                                               ; preds = %90, %88
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %10, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %11, align 4
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  br label %100

100:                                              ; preds = %96, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  br label %105

101:                                              ; preds = %83
  br label %102

102:                                              ; preds = %101, %68
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  store i1 true, ptr %3, align 1
  store i32 1, ptr %12, align 4
  br label %103

103:                                              ; preds = %102, %66
  call void @_ZN2vl3PtrINS_8database13IBufferSourceEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  %104 = load i1, ptr %3, align 1
  ret i1 %104

105:                                              ; preds = %100, %63
  call void @_ZN2vl3PtrINS_8database13IBufferSourceEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %10, align 8
  %108 = load i32, ptr %11, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110
}

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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"}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = distinct !{!19, !16}


; 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 { i32 }
%"class.vl::Ptr.15" = type { ptr, ptr, ptr, ptr }
%"class.vl::SpinLock::Scope" = type { %"class.vl::Object", ptr }
%"class.vl::Object" = type { ptr }

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

.preheader:                                       ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  br label %9

9:                                                ; preds = %.preheader, %23
  %.015 = phi i1 [ false, %23 ], [ true, %.preheader ]
  br i1 %.015, label %12, label %25

10:                                               ; preds = %2
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %42

12:                                               ; preds = %9
  %13 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectIiLl0EEENS_3PtrINS2_13IBufferSourceEEES4_PS6_E4KeysEv(ptr noundef nonnull align 8 dereferenceable(104) %8)
  %14 = invoke noundef i64 @_ZNK2vl11collections10SortedListINS_8database8IdObjectIiLl0EEES4_E7IndexOfERKS4_(ptr noundef nonnull align 8 dereferenceable(33) %13, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %15 unwind label %16

15:                                               ; preds = %12
  %.not = icmp eq i64 %14, -1
  br i1 %.not, label %.thread, label %18

16:                                               ; preds = %23, %21, %18, %12
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %42

18:                                               ; preds = %15
  %19 = call noundef nonnull align 8 dereferenceable(33) ptr @_ZNK2vl11collections10DictionaryINS_8database8IdObjectIiLl0EEENS_3PtrINS2_13IBufferSourceEEES4_PS6_E6ValuesEv(ptr noundef nonnull align 8 dereferenceable(104) %8)
  %20 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK2vl11collections9ArrayBaseINS_3PtrINS_8database13IBufferSourceEEEEixEl(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %14)
          to label %21 unwind label %16

21:                                               ; preds = %18
  %22 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN2vl3PtrINS_8database13IBufferSourceEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %23 unwind label %16

23:                                               ; preds = %21
  %24 = invoke noundef zeroext i1 @_ZN2vl11collections10DictionaryINS_8database8IdObjectIiLl0EEENS_3PtrINS2_13IBufferSourceEEES4_PS6_E6RemoveERKS4_(ptr noundef nonnull align 8 dereferenceable(104) %8, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %9 unwind label %16, !llvm.loop !5

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

25:                                               ; preds = %9
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %26 = call noundef ptr @_ZNK2vl3PtrINS_8database13IBufferSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %27 = load ptr, ptr %26, align 8, !tbaa !7
  %28 = getelementptr inbounds i8, ptr %27, i64 32
  %29 = load ptr, ptr %28, align 8
  %30 = invoke noundef nonnull align 8 dereferenceable(16) ptr %29(ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %31 unwind label %32

31:                                               ; preds = %25
  invoke void @_ZN2vl8SpinLock5ScopeC1ERS0_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %30)
          to label %34 unwind label %32

32:                                               ; preds = %31, %25
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %42

34:                                               ; preds = %31
  %35 = call noundef ptr @_ZNK2vl3PtrINS_8database13IBufferSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %36 = load ptr, ptr %35, align 8, !tbaa !7
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load ptr, ptr %37, align 8
  invoke void %38(ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %.critedge32 unwind label %39

.critedge32:                                      ; preds = %34
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %41

39:                                               ; preds = %34
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2vl8SpinLock5ScopeD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %42

41:                                               ; preds = %.thread, %.critedge32
  %.5 = xor i1 %.015, true
  call void @_ZN2vl3PtrINS_8database13IBufferSourceEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  ret i1 %.5

42:                                               ; preds = %32, %39, %10, %16
  %.pn27.pn = phi { ptr, i32 } [ %17, %16 ], [ %11, %10 ], [ %40, %39 ], [ %33, %32 ]
  call void @_ZN2vl3PtrINS_8database13IBufferSourceEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn27.pn
}

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"vtable pointer", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass