; LLVM IR from weicao/cascadb :: src/cache/cache.ll (ZN7cascadb5Cache10write_backEv)

; 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.timeval = type { i64, i64 }
%class.FirstWriteComparator = type { i8 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<cascadb::Node *, std::allocator<cascadb::Node *>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::Node *, std::allocator<cascadb::Node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::Node *, std::allocator<cascadb::Node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::Node *, std::allocator<cascadb::Node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator.12" = type { ptr }
%"class.cascadb::ScopedMutex" = type { i8, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.cascadb::Cache" = type { %"class.cascadb::Options", %"class.cascadb::RWLock", %"class.std::map", %"class.cascadb::Mutex", i64, %"class.cascadb::RWLock", %"class.std::map.0", %"class.cascadb::Mutex", i8, ptr }
%"class.cascadb::Options" = type <{ ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, cascadb::Cache::TableSettings>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, cascadb::Cache::TableSettings>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, cascadb::Cache::TableSettings>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, cascadb::Cache::TableSettings>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.cascadb::RWLock" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%"class.std::map.0" = type { %"class.std::_Rb_tree.1" }
%"class.std::_Rb_tree.1" = type { %"struct.std::_Rb_tree<cascadb::Cache::CacheKey, std::pair<const cascadb::Cache::CacheKey, cascadb::Node *>, std::_Select1st<std::pair<const cascadb::Cache::CacheKey, cascadb::Node *>>, std::less<cascadb::Cache::CacheKey>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<cascadb::Cache::CacheKey, std::pair<const cascadb::Cache::CacheKey, cascadb::Node *>, std::_Select1st<std::pair<const cascadb::Cache::CacheKey, cascadb::Node *>>, std::less<cascadb::Cache::CacheKey>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.cascadb::Mutex" = type { i8, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"struct.std::pair" = type { %"class.cascadb::Cache::CacheKey", ptr }
%"class.cascadb::Cache::CacheKey" = type { %"class.std::__cxx11::basic_string", i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

; 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) #0

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN7cascadb6RWLock6unlockEv(ptr noundef nonnull align 8 dereferenceable(56)) #2

declare { i64, i64 } @_ZN7cascadb3nowEv() #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200)) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7cascadb4Node3refEv(ptr noundef nonnull align 8 dereferenceable(200)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Cache5evictEv(ptr noundef nonnull align 8 dereferenceable(432)) #4 align 2

declare void @_ZN7cascadb6usleepEj(i32 noundef) #2

declare void @_ZN7cascadb6RWLock9read_lockEv(ptr noundef nonnull align 8 dereferenceable(56)) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb5Cache10write_backEv(ptr noundef nonnull align 8 dereferenceable(432) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.timeval, align 8
  %4 = alloca %class.FirstWriteComparator, align 1
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::vector", align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %17 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i8, align 1
  %21 = alloca %struct.timeval, align 8
  %22 = alloca %struct.timeval, align 8
  %23 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %24 = alloca %"class.cascadb::ScopedMutex", align 8
  %25 = alloca %"class.std::vector", align 8
  %26 = alloca i64, align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca %class.FirstWriteComparator, align 1
  %30 = alloca i64, align 8
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca %"class.std::vector", align 8
  %34 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %35 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %36 = alloca ptr, align 8
  %37 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %38 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %39 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %40 = alloca %class.FirstWriteComparator, align 1
  %41 = alloca i64, align 8
  %42 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %43 = load ptr, ptr %2, align 8
  br label %44

44:                                               ; preds = %401, %1
  %45 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 8
  %46 = load i8, ptr %45, align 8, !tbaa !9, !range !31, !noundef !32
  %47 = trunc i8 %46 to i1
  br i1 %47, label %48, label %406

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #6
  %49 = call { i64, i64 } @_ZN7cascadb3nowEv()
  %50 = getelementptr inbounds { i64, i64 }, ptr %3, i32 0, i32 0
  %51 = extractvalue { i64, i64 } %49, 0
  store i64 %51, ptr %50, align 8
  %52 = getelementptr inbounds { i64, i64 }, ptr %3, i32 0, i32 1
  %53 = extractvalue { i64, i64 } %49, 1
  store i64 %53, ptr %52, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %54 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 0
  %55 = getelementptr inbounds %"class.cascadb::Options", ptr %54, i32 0, i32 8
  %56 = load i64, ptr %55, align 8, !tbaa !33
  %57 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 0
  %58 = getelementptr inbounds %"class.cascadb::Options", ptr %57, i32 0, i32 11
  %59 = load i32, ptr %58, align 8, !tbaa !34
  %60 = zext i32 %59 to i64
  %61 = mul i64 %56, %60
  %62 = udiv i64 %61, 100
  store i64 %62, ptr %5, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !35
  %63 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 5
  invoke void @_ZN7cascadb6RWLock9read_lockEv(ptr noundef nonnull align 8 dereferenceable(56) %63)
          to label %64 unwind label %74

64:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %65 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 6
  %66 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %65) #6
  %67 = getelementptr inbounds %"struct.std::_Rb_tree_iterator.12", ptr %16, i32 0, i32 0
  store ptr %66, ptr %67, align 8
  br label %68

68:                                               ; preds = %172, %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %69 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 6
  %70 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %69) #6
  %71 = getelementptr inbounds %"struct.std::_Rb_tree_iterator.12", ptr %17, i32 0, i32 0
  store ptr %70, ptr %71, align 8
  %72 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br i1 %72, label %78, label %73

73:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %176

74:                                               ; preds = %48
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %14, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %15, align 4
  br label %405

78:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %79 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  %80 = getelementptr inbounds %"struct.std::pair", ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !36
  store ptr %81, ptr %18, align 8, !tbaa !5
  %82 = load ptr, ptr %18, align 8, !tbaa !5
  %83 = invoke noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200) %82)
          to label %84 unwind label %107

84:                                               ; preds = %78
  br i1 %83, label %171, label %85

85:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %86 = load ptr, ptr %18, align 8, !tbaa !5
  %87 = load ptr, ptr %86, align 8, !tbaa !41
  %88 = getelementptr inbounds ptr, ptr %87, i64 2
  %89 = load ptr, ptr %88, align 8
  %90 = invoke noundef i64 %89(ptr noundef nonnull align 8 dereferenceable(200) %86)
          to label %91 unwind label %111

91:                                               ; preds = %85
  store i64 %90, ptr %19, align 8, !tbaa !35
  %92 = load i64, ptr %19, align 8, !tbaa !35
  %93 = load i64, ptr %6, align 8, !tbaa !35
  %94 = add i64 %93, %92
  store i64 %94, ptr %6, align 8, !tbaa !35
  %95 = load i64, ptr %7, align 8, !tbaa !35
  %96 = add i64 %95, 1
  store i64 %96, ptr %7, align 8, !tbaa !35
  %97 = load ptr, ptr %18, align 8, !tbaa !5
  %98 = invoke noundef i32 @_ZN7cascadb4Node3refEv(ptr noundef nonnull align 8 dereferenceable(200) %97)
          to label %99 unwind label %111

99:                                               ; preds = %91
  %100 = icmp ne i32 %98, 0
  br i1 %100, label %101, label %115

101:                                              ; preds = %99
  %102 = load i64, ptr %19, align 8, !tbaa !35
  %103 = load i64, ptr %8, align 8, !tbaa !35
  %104 = add i64 %103, %102
  store i64 %104, ptr %8, align 8, !tbaa !35
  %105 = load i64, ptr %9, align 8, !tbaa !35
  %106 = add i64 %105, 1
  store i64 %106, ptr %9, align 8, !tbaa !35
  br label %115

107:                                              ; preds = %78
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %14, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %15, align 4
  br label %175

111:                                              ; preds = %115, %91, %85
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %14, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %15, align 4
  br label %170

115:                                              ; preds = %101, %99
  %116 = load ptr, ptr %18, align 8, !tbaa !5
  %117 = invoke noundef zeroext i1 @_ZN7cascadb4Node8is_dirtyEv(ptr noundef nonnull align 8 dereferenceable(200) %116)
          to label %118 unwind label %111

118:                                              ; preds = %115
  br i1 %117, label %119, label %169

119:                                              ; preds = %118
  %120 = load i64, ptr %19, align 8, !tbaa !35
  %121 = load i64, ptr %10, align 8, !tbaa !35
  %122 = add i64 %121, %120
  store i64 %122, ptr %10, align 8, !tbaa !35
  %123 = load i64, ptr %11, align 8, !tbaa !35
  %124 = add i64 %123, 1
  store i64 %124, ptr %11, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #6
  %125 = load ptr, ptr %18, align 8, !tbaa !5
  %126 = invoke { i64, i64 } @_ZN7cascadb4Node25get_first_write_timestampEv(ptr noundef nonnull align 8 dereferenceable(200) %125)
          to label %127 unwind label %164

127:                                              ; preds = %119
  %128 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %129 = extractvalue { i64, i64 } %126, 0
  store i64 %129, ptr %128, align 8
  %130 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %131 = extractvalue { i64, i64 } %126, 1
  store i64 %131, ptr %130, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %3, i64 16, i1 false), !tbaa.struct !43
  %132 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %133 = load i64, ptr %132, align 8
  %134 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %135 = load i64, ptr %134, align 8
  %136 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 0
  %137 = load i64, ptr %136, align 8
  %138 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 1
  %139 = load i64, ptr %138, align 8
  %140 = invoke noundef i32 @_ZN7cascadb11interval_usE7timevalS0_(i64 %133, i64 %135, i64 %137, i64 %139)
          to label %141 unwind label %164

141:                                              ; preds = %127
  %142 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 0
  %143 = getelementptr inbounds %"class.cascadb::Options", ptr %142, i32 0, i32 10
  %144 = load i32, ptr %143, align 4, !tbaa !44
  %145 = mul i32 %144, 1000
  %146 = icmp ugt i32 %140, %145
  %147 = zext i1 %146 to i8
  store i8 %147, ptr %20, align 1, !tbaa !45
  %148 = load i8, ptr %20, align 1, !tbaa !45, !range !31, !noundef !32
  %149 = trunc i8 %148 to i1
  br i1 %149, label %150, label %168

150:                                              ; preds = %141
  %151 = load ptr, ptr %18, align 8, !tbaa !5
  %152 = invoke noundef zeroext i1 @_ZN7cascadb4Node11is_flushingEv(ptr noundef nonnull align 8 dereferenceable(200) %151)
          to label %153 unwind label %164

153:                                              ; preds = %150
  br i1 %152, label %168, label %154

154:                                              ; preds = %153
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = invoke noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200) %155)
          to label %157 unwind label %164

157:                                              ; preds = %154
  %158 = icmp eq i32 %156, 0
  br i1 %158, label %159, label %168

159:                                              ; preds = %157
  invoke void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %160 unwind label %164

160:                                              ; preds = %159
  %161 = load i64, ptr %19, align 8, !tbaa !35
  %162 = load i64, ptr %13, align 8, !tbaa !35
  %163 = add i64 %162, %161
  store i64 %163, ptr %13, align 8, !tbaa !35
  br label %168

164:                                              ; preds = %159, %154, %150, %127, %119
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %14, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #6
  br label %170

168:                                              ; preds = %160, %157, %153, %141
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #6
  br label %169

169:                                              ; preds = %168, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %171

170:                                              ; preds = %164, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %175

171:                                              ; preds = %169, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %172

172:                                              ; preds = %171
  %173 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef 0) #6
  %174 = getelementptr inbounds %"struct.std::_Rb_tree_iterator.12", ptr %23, i32 0, i32 0
  store ptr %173, ptr %174, align 8
  br label %68, !llvm.loop !46

175:                                              ; preds = %170, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %405

176:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  %177 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 3
  invoke void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %177)
          to label %178 unwind label %198

178:                                              ; preds = %176
  %179 = load i64, ptr %6, align 8, !tbaa !35
  %180 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 4
  store i64 %179, ptr %180, align 8, !tbaa !48
  invoke void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %181 unwind label %202

181:                                              ; preds = %178
  %182 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 5
  invoke void @_ZN7cascadb6RWLock6unlockEv(ptr noundef nonnull align 8 dereferenceable(56) %182)
          to label %183 unwind label %202

183:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #6
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store i64 0, ptr %26, align 8, !tbaa !35
  %184 = call ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %185 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %184, ptr %185, align 8
  %186 = call ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %187 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %186, ptr %187, align 8
  %188 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  %189 = load ptr, ptr %188, align 8
  %190 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN7cascadb4NodeESt6vectorIS4_SaIS4_EEEE20FirstWriteComparatorEvT_SB_T0_(ptr %189, ptr %191)
          to label %192 unwind label %206

192:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  store i64 0, ptr %30, align 8, !tbaa !35
  br label %193

193:                                              ; preds = %252, %192
  %194 = load i64, ptr %30, align 8, !tbaa !35
  %195 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %196 = icmp ult i64 %194, %195
  br i1 %196, label %210, label %197

197:                                              ; preds = %193
  store i32 7, ptr %31, align 4
  br label %255

198:                                              ; preds = %176
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %14, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %15, align 4
  br label %404

202:                                              ; preds = %181, %178
  %203 = landingpad { ptr, i32 }
          cleanup
  %204 = extractvalue { ptr, i32 } %203, 0
  store ptr %204, ptr %14, align 8
  %205 = extractvalue { ptr, i32 } %203, 1
  store i32 %205, ptr %15, align 4
  br label %403

206:                                              ; preds = %395, %393, %390, %388, %183
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %14, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %15, align 4
  br label %402

210:                                              ; preds = %193
  %211 = load i64, ptr %26, align 8, !tbaa !35
  %212 = load i64, ptr %5, align 8, !tbaa !35
  %213 = icmp uge i64 %211, %212
  br i1 %213, label %214, label %215

214:                                              ; preds = %210
  store i32 7, ptr %31, align 4
  br label %255

215:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %216 = load i64, ptr %30, align 8, !tbaa !35
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %216) #6
  %218 = load ptr, ptr %217, align 8, !tbaa !5
  store ptr %218, ptr %32, align 8, !tbaa !5
  %219 = load ptr, ptr %32, align 8, !tbaa !5
  %220 = invoke noundef zeroext i1 @_ZN7cascadb4Node14try_write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %219)
          to label %221 unwind label %243

221:                                              ; preds = %215
  br i1 %220, label %222, label %251

222:                                              ; preds = %221
  %223 = load ptr, ptr %32, align 8, !tbaa !5
  %224 = invoke noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200) %223)
          to label %225 unwind label %243

225:                                              ; preds = %222
  %226 = icmp eq i32 %224, 0
  br i1 %226, label %227, label %247

227:                                              ; preds = %225
  %228 = load ptr, ptr %32, align 8, !tbaa !5
  %229 = invoke noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200) %228)
          to label %230 unwind label %243

230:                                              ; preds = %227
  br i1 %229, label %247, label %231

231:                                              ; preds = %230
  %232 = load ptr, ptr %32, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node12set_flushingEb(ptr noundef nonnull align 8 dereferenceable(200) %232, i1 noundef zeroext true)
          to label %233 unwind label %243

233:                                              ; preds = %231
  invoke void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %234 unwind label %243

234:                                              ; preds = %233
  %235 = load ptr, ptr %32, align 8, !tbaa !5
  %236 = load ptr, ptr %235, align 8, !tbaa !41
  %237 = getelementptr inbounds ptr, ptr %236, i64 2
  %238 = load ptr, ptr %237, align 8
  %239 = invoke noundef i64 %238(ptr noundef nonnull align 8 dereferenceable(200) %235)
          to label %240 unwind label %243

240:                                              ; preds = %234
  %241 = load i64, ptr %26, align 8, !tbaa !35
  %242 = add i64 %241, %239
  store i64 %242, ptr %26, align 8, !tbaa !35
  br label %250

243:                                              ; preds = %247, %234, %233, %231, %227, %222, %215
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %14, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %402

247:                                              ; preds = %230, %225
  %248 = load ptr, ptr %32, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %248)
          to label %249 unwind label %243

249:                                              ; preds = %247
  br label %250

250:                                              ; preds = %249, %240
  br label %251

251:                                              ; preds = %250, %221
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %252

252:                                              ; preds = %251
  %253 = load i64, ptr %30, align 8, !tbaa !35
  %254 = add i64 %253, 1
  store i64 %254, ptr %30, align 8, !tbaa !35
  br label %193, !llvm.loop !49

255:                                              ; preds = %214, %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %256

256:                                              ; preds = %255
  %257 = load i64, ptr %10, align 8, !tbaa !35
  %258 = load i64, ptr %26, align 8, !tbaa !35
  %259 = sub i64 %257, %258
  %260 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 0
  %261 = getelementptr inbounds %"class.cascadb::Options", ptr %260, i32 0, i32 8
  %262 = load i64, ptr %261, align 8, !tbaa !33
  %263 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 0
  %264 = getelementptr inbounds %"class.cascadb::Options", ptr %263, i32 0, i32 9
  %265 = load i32, ptr %264, align 8, !tbaa !50
  %266 = zext i32 %265 to i64
  %267 = mul i64 %262, %266
  %268 = udiv i64 %267, 100
  %269 = icmp uge i64 %259, %268
  br i1 %269, label %270, label %385

270:                                              ; preds = %256
  %271 = load i64, ptr %26, align 8, !tbaa !35
  %272 = load i64, ptr %5, align 8, !tbaa !35
  %273 = icmp ult i64 %271, %272
  br i1 %273, label %274, label %385

274:                                              ; preds = %270
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #6
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %275 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 5
  invoke void @_ZN7cascadb6RWLock9read_lockEv(ptr noundef nonnull align 8 dereferenceable(56) %275)
          to label %276 unwind label %286

276:                                              ; preds = %274
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %277 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 6
  %278 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %277) #6
  %279 = getelementptr inbounds %"struct.std::_Rb_tree_iterator.12", ptr %34, i32 0, i32 0
  store ptr %278, ptr %279, align 8
  br label %280

280:                                              ; preds = %317, %276
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %281 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 6
  %282 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %281) #6
  %283 = getelementptr inbounds %"struct.std::_Rb_tree_iterator.12", ptr %35, i32 0, i32 0
  store ptr %282, ptr %283, align 8
  %284 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  br i1 %284, label %290, label %285

285:                                              ; preds = %280
  store i32 10, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  br label %320

286:                                              ; preds = %322, %320, %274
  %287 = landingpad { ptr, i32 }
          cleanup
  %288 = extractvalue { ptr, i32 } %287, 0
  store ptr %288, ptr %14, align 8
  %289 = extractvalue { ptr, i32 } %287, 1
  store i32 %289, ptr %15, align 4
  br label %384

290:                                              ; preds = %280
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #6
  %291 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #6
  %292 = getelementptr inbounds %"struct.std::pair", ptr %291, i32 0, i32 1
  %293 = load ptr, ptr %292, align 8, !tbaa !36
  store ptr %293, ptr %36, align 8, !tbaa !5
  %294 = load ptr, ptr %36, align 8, !tbaa !5
  %295 = invoke noundef zeroext i1 @_ZN7cascadb4Node8is_dirtyEv(ptr noundef nonnull align 8 dereferenceable(200) %294)
          to label %296 unwind label %312

296:                                              ; preds = %290
  br i1 %295, label %297, label %316

297:                                              ; preds = %296
  %298 = load ptr, ptr %36, align 8, !tbaa !5
  %299 = invoke noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200) %298)
          to label %300 unwind label %312

300:                                              ; preds = %297
  %301 = icmp eq i32 %299, 0
  br i1 %301, label %302, label %316

302:                                              ; preds = %300
  %303 = load ptr, ptr %36, align 8, !tbaa !5
  %304 = invoke noundef zeroext i1 @_ZN7cascadb4Node11is_flushingEv(ptr noundef nonnull align 8 dereferenceable(200) %303)
          to label %305 unwind label %312

305:                                              ; preds = %302
  br i1 %304, label %316, label %306

306:                                              ; preds = %305
  %307 = load ptr, ptr %36, align 8, !tbaa !5
  %308 = invoke noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200) %307)
          to label %309 unwind label %312

309:                                              ; preds = %306
  br i1 %308, label %316, label %310

310:                                              ; preds = %309
  invoke void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(8) %36)
          to label %311 unwind label %312

311:                                              ; preds = %310
  br label %316

312:                                              ; preds = %310, %306, %302, %297, %290
  %313 = landingpad { ptr, i32 }
          cleanup
  %314 = extractvalue { ptr, i32 } %313, 0
  store ptr %314, ptr %14, align 8
  %315 = extractvalue { ptr, i32 } %313, 1
  store i32 %315, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  br label %384

316:                                              ; preds = %311, %309, %305, %300, %296
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  br label %317

317:                                              ; preds = %316
  %318 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %34, i32 noundef 0) #6
  %319 = getelementptr inbounds %"struct.std::_Rb_tree_iterator.12", ptr %37, i32 0, i32 0
  store ptr %318, ptr %319, align 8
  br label %280, !llvm.loop !51

320:                                              ; preds = %285
  %321 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 5
  invoke void @_ZN7cascadb6RWLock6unlockEv(ptr noundef nonnull align 8 dereferenceable(56) %321)
          to label %322 unwind label %286

322:                                              ; preds = %320
  %323 = call ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %324 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %38, i32 0, i32 0
  store ptr %323, ptr %324, align 8
  %325 = call ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %326 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %39, i32 0, i32 0
  store ptr %325, ptr %326, align 8
  %327 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %38, i32 0, i32 0
  %328 = load ptr, ptr %327, align 8
  %329 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %39, i32 0, i32 0
  %330 = load ptr, ptr %329, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN7cascadb4NodeESt6vectorIS4_SaIS4_EEEE20FirstWriteComparatorEvT_SB_T0_(ptr %328, ptr %330)
          to label %331 unwind label %286

331:                                              ; preds = %322
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #6
  store i64 0, ptr %41, align 8, !tbaa !35
  br label %332

332:                                              ; preds = %379, %331
  %333 = load i64, ptr %41, align 8, !tbaa !35
  %334 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %335 = icmp ult i64 %333, %334
  br i1 %335, label %337, label %336

336:                                              ; preds = %332
  store i32 13, ptr %31, align 4
  br label %382

337:                                              ; preds = %332
  %338 = load i64, ptr %26, align 8, !tbaa !35
  %339 = load i64, ptr %5, align 8, !tbaa !35
  %340 = icmp uge i64 %338, %339
  br i1 %340, label %341, label %342

341:                                              ; preds = %337
  store i32 13, ptr %31, align 4
  br label %382

342:                                              ; preds = %337
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  %343 = load i64, ptr %41, align 8, !tbaa !35
  %344 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %343) #6
  %345 = load ptr, ptr %344, align 8, !tbaa !5
  store ptr %345, ptr %42, align 8, !tbaa !5
  %346 = load ptr, ptr %42, align 8, !tbaa !5
  %347 = invoke noundef zeroext i1 @_ZN7cascadb4Node14try_write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %346)
          to label %348 unwind label %370

348:                                              ; preds = %342
  br i1 %347, label %349, label %378

349:                                              ; preds = %348
  %350 = load ptr, ptr %42, align 8, !tbaa !5
  %351 = invoke noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200) %350)
          to label %352 unwind label %370

352:                                              ; preds = %349
  %353 = icmp eq i32 %351, 0
  br i1 %353, label %354, label %374

354:                                              ; preds = %352
  %355 = load ptr, ptr %42, align 8, !tbaa !5
  %356 = invoke noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200) %355)
          to label %357 unwind label %370

357:                                              ; preds = %354
  br i1 %356, label %374, label %358

358:                                              ; preds = %357
  %359 = load ptr, ptr %42, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node12set_flushingEb(ptr noundef nonnull align 8 dereferenceable(200) %359, i1 noundef zeroext true)
          to label %360 unwind label %370

360:                                              ; preds = %358
  invoke void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %42)
          to label %361 unwind label %370

361:                                              ; preds = %360
  %362 = load ptr, ptr %42, align 8, !tbaa !5
  %363 = load ptr, ptr %362, align 8, !tbaa !41
  %364 = getelementptr inbounds ptr, ptr %363, i64 2
  %365 = load ptr, ptr %364, align 8
  %366 = invoke noundef i64 %365(ptr noundef nonnull align 8 dereferenceable(200) %362)
          to label %367 unwind label %370

367:                                              ; preds = %361
  %368 = load i64, ptr %26, align 8, !tbaa !35
  %369 = add i64 %368, %366
  store i64 %369, ptr %26, align 8, !tbaa !35
  br label %377

370:                                              ; preds = %374, %361, %360, %358, %354, %349, %342
  %371 = landingpad { ptr, i32 }
          cleanup
  %372 = extractvalue { ptr, i32 } %371, 0
  store ptr %372, ptr %14, align 8
  %373 = extractvalue { ptr, i32 } %371, 1
  store i32 %373, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  br label %384

374:                                              ; preds = %357, %352
  %375 = load ptr, ptr %42, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %375)
          to label %376 unwind label %370

376:                                              ; preds = %374
  br label %377

377:                                              ; preds = %376, %367
  br label %378

378:                                              ; preds = %377, %348
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  br label %379

379:                                              ; preds = %378
  %380 = load i64, ptr %41, align 8, !tbaa !35
  %381 = add i64 %380, 1
  store i64 %381, ptr %41, align 8, !tbaa !35
  br label %332, !llvm.loop !52

382:                                              ; preds = %341, %336
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  br label %383

383:                                              ; preds = %382
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #6
  br label %385

384:                                              ; preds = %370, %312, %286
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #6
  br label %402

385:                                              ; preds = %383, %270, %256
  %386 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #6
  %387 = icmp ne i64 %386, 0
  br i1 %387, label %388, label %390

388:                                              ; preds = %385
  invoke void @_ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(432) %43, ptr noundef nonnull align 8 dereferenceable(24) %25)
          to label %389 unwind label %206

389:                                              ; preds = %388
  br label %390

390:                                              ; preds = %389, %385
  %391 = invoke noundef zeroext i1 @_ZN7cascadb5Cache10need_evictEv(ptr noundef nonnull align 8 dereferenceable(432) %43)
          to label %392 unwind label %206

392:                                              ; preds = %390
  br i1 %391, label %393, label %395

393:                                              ; preds = %392
  invoke void @_ZN7cascadb5Cache5evictEv(ptr noundef nonnull align 8 dereferenceable(432) %43)
          to label %394 unwind label %206

394:                                              ; preds = %393
  br label %401

395:                                              ; preds = %392
  %396 = getelementptr inbounds %"class.cascadb::Cache", ptr %43, i32 0, i32 0
  %397 = getelementptr inbounds %"class.cascadb::Options", ptr %396, i32 0, i32 12
  %398 = load i32, ptr %397, align 4, !tbaa !53
  %399 = mul i32 %398, 1000
  invoke void @_ZN7cascadb6usleepEj(i32 noundef %399)
          to label %400 unwind label %206

400:                                              ; preds = %395
  br label %401

401:                                              ; preds = %400, %394
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  br label %44, !llvm.loop !54

402:                                              ; preds = %384, %243, %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  br label %403

403:                                              ; preds = %402, %202
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #6
  br label %404

404:                                              ; preds = %403, %198
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  br label %405

405:                                              ; preds = %404, %175, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  br label %407

406:                                              ; preds = %44
  ret void

407:                                              ; preds = %405
  %408 = load ptr, ptr %14, align 8
  %409 = load i32, ptr %15, align 4
  %410 = insertvalue { ptr, i32 } poison, ptr %408, 0
  %411 = insertvalue { ptr, i32 } %410, i32 %409, 1
  resume { ptr, i32 } %411
}

declare noundef i32 @_ZN7cascadb11interval_usE7timevalS0_(i64, i64, i64, i64) #2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZN7cascadb4Node25get_first_write_timestampEv(ptr noundef nonnull align 8 dereferenceable(200)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN7cascadb4NodeESt6vectorIS4_SaIS4_EEEE20FirstWriteComparatorEvT_SB_T0_(ptr, ptr) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200)) #4 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !15, i64 416}
!10 = !{!"_ZTSN7cascadb5CacheE", !11, i64 0, !16, i64 104, !17, i64 160, !25, i64 208, !12, i64 256, !16, i64 264, !26, i64 320, !25, i64 368, !15, i64 416, !6, i64 424}
!11 = !{!"_ZTSN7cascadb7OptionsE", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !14, i64 96, !15, i64 100}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!17 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN7cascadb5Cache13TableSettingsESt4lessIS5_ESaISt4pairIKS5_S8_EEE", !18, i64 0}
!18 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N7cascadb5Cache13TableSettingsEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE", !19, i64 0}
!19 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N7cascadb5Cache13TableSettingsEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE13_Rb_tree_implISF_Lb1EEE", !20, i64 0, !22, i64 8}
!20 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !21, i64 0}
!21 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!22 = !{!"_ZTSSt15_Rb_tree_header", !23, i64 0, !12, i64 32}
!23 = !{!"_ZTSSt18_Rb_tree_node_base", !24, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!24 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!25 = !{!"_ZTSN7cascadb5MutexE", !15, i64 0, !7, i64 8}
!26 = !{!"_ZTSSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE", !27, i64 0}
!27 = !{!"_ZTSSt8_Rb_treeIN7cascadb5Cache8CacheKeyESt4pairIKS2_PNS0_4NodeEESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE", !28, i64 0}
!28 = !{!"_ZTSNSt8_Rb_treeIN7cascadb5Cache8CacheKeyESt4pairIKS2_PNS0_4NodeEESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE13_Rb_tree_implISB_Lb1EEE", !29, i64 0, !22, i64 8}
!29 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN7cascadb5Cache8CacheKeyEEE", !30, i64 0}
!30 = !{!"_ZTSSt4lessIN7cascadb5Cache8CacheKeyEE"}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!10, !12, i64 64}
!34 = !{!10, !13, i64 80}
!35 = !{!12, !12, i64 0}
!36 = !{!37, !6, i64 40}
!37 = !{!"_ZTSSt4pairIKN7cascadb5Cache8CacheKeyEPNS0_4NodeEE", !38, i64 0, !6, i64 40}
!38 = !{!"_ZTSN7cascadb5Cache8CacheKeyE", !39, i64 0, !12, i64 32}
!39 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !40, i64 0, !12, i64 8, !7, i64 16}
!40 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!41 = !{!42, !42, i64 0}
!42 = !{!"vtable pointer", !8, i64 0}
!43 = !{i64 0, i64 8, !35, i64 8, i64 8, !35}
!44 = !{!10, !13, i64 76}
!45 = !{!15, !15, i64 0}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}
!48 = !{!10, !12, i64 256}
!49 = distinct !{!49, !47}
!50 = !{!10, !13, i64 72}
!51 = distinct !{!51, !47}
!52 = distinct !{!52, !47}
!53 = !{!10, !13, i64 84}
!54 = distinct !{!54, !47}


; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<cascadb::Node *, std::allocator<cascadb::Node *>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::Node *, std::allocator<cascadb::Node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::Node *, std::allocator<cascadb::Node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::Node *, std::allocator<cascadb::Node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator.12" = type { ptr }
%"class.cascadb::ScopedMutex" = type { i8, ptr }

declare i32 @__gxx_personality_v0(...)

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @_ZN7cascadb6RWLock6unlockEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1

declare { i64, i64 } @_ZN7cascadb3nowEv() local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb4Node8is_dirtyEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb4Node11is_flushingEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb4Node12set_flushingEb(ptr noundef nonnull align 8 dereferenceable(200), i1 noundef zeroext) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7cascadb4Node3refEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Cache5evictEv(ptr noundef nonnull align 8 dereferenceable(432)) local_unnamed_addr #3 align 2

declare void @_ZN7cascadb6usleepEj(i32 noundef) local_unnamed_addr #1

declare void @_ZN7cascadb6RWLock9read_lockEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb5Cache10need_evictEv(ptr noundef nonnull align 8 dereferenceable(432)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb5Cache10write_backEv(ptr noundef nonnull align 8 dereferenceable(432) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.cascadb::ScopedMutex", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator.12", align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = getelementptr inbounds i8, ptr %0, i64 416
  %15 = load i8, ptr %14, align 8, !tbaa !5, !range !30, !noundef !31
  %16 = trunc nuw i8 %15 to i1
  br i1 %16, label %.lr.ph124, label %._crit_edge125

.lr.ph124:                                        ; preds = %1
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  %18 = getelementptr inbounds i8, ptr %0, i64 80
  %19 = getelementptr inbounds i8, ptr %0, i64 264
  %20 = getelementptr inbounds i8, ptr %0, i64 320
  %21 = getelementptr inbounds i8, ptr %0, i64 76
  %22 = getelementptr inbounds i8, ptr %0, i64 208
  %23 = getelementptr inbounds i8, ptr %0, i64 256
  %24 = getelementptr inbounds i8, ptr %0, i64 72
  %25 = getelementptr inbounds i8, ptr %0, i64 84
  br label %26

26:                                               ; preds = %.lr.ph124, %224
  %27 = call { i64, i64 } @_ZN7cascadb3nowEv()
  %28 = extractvalue { i64, i64 } %27, 0
  %29 = extractvalue { i64, i64 } %27, 1
  %30 = load i64, ptr %17, align 8, !tbaa !32
  %31 = load i32, ptr %18, align 8, !tbaa !33
  %32 = zext i32 %31 to i64
  %33 = mul i64 %30, %32
  %34 = udiv i64 %33, 100
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  invoke void @_ZN7cascadb6RWLock9read_lockEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
          to label %35 unwind label %39

35:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %36 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %20) #5
  store ptr %36, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %37 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %20) #5
  store ptr %37, ptr %4, align 8
  %38 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %38, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %88, %35
  %.050.lcssa = phi i64 [ 0, %35 ], [ %.252, %88 ]
  %.041.lcssa = phi i64 [ 0, %35 ], [ %.1, %88 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  invoke void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull %22)
          to label %93 unwind label %100

39:                                               ; preds = %26
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %230

.lr.ph:                                           ; preds = %35, %88
  %.041104 = phi i64 [ %.1, %88 ], [ 0, %35 ]
  %.050100 = phi i64 [ %.252, %88 ], [ 0, %35 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %41 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %42 = getelementptr inbounds i8, ptr %41, i64 40
  %43 = load ptr, ptr %42, align 8, !tbaa !34
  store ptr %43, ptr %5, align 8, !tbaa !39
  %44 = invoke noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200) %43)
          to label %45 unwind label %59

45:                                               ; preds = %.lr.ph
  br i1 %44, label %88, label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %5, align 8, !tbaa !39
  %48 = load ptr, ptr %47, align 8, !tbaa !40
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load ptr, ptr %49, align 8
  %51 = invoke noundef i64 %50(ptr noundef nonnull align 8 dereferenceable(200) %47)
          to label %52 unwind label %61

52:                                               ; preds = %46
  %53 = add i64 %51, %.041104
  %54 = load ptr, ptr %5, align 8, !tbaa !39
  %55 = invoke noundef i32 @_ZN7cascadb4Node3refEv(ptr noundef nonnull align 8 dereferenceable(200) %54)
          to label %56 unwind label %61

56:                                               ; preds = %52
  %57 = load ptr, ptr %5, align 8, !tbaa !39
  %58 = invoke noundef zeroext i1 @_ZN7cascadb4Node8is_dirtyEv(ptr noundef nonnull align 8 dereferenceable(200) %57)
          to label %63 unwind label %61

59:                                               ; preds = %.lr.ph
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %92

61:                                               ; preds = %56, %52, %46
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %92

63:                                               ; preds = %56
  br i1 %58, label %64, label %88

64:                                               ; preds = %63
  %65 = add i64 %51, %.050100
  %66 = load ptr, ptr %5, align 8, !tbaa !39
  %67 = invoke { i64, i64 } @_ZN7cascadb4Node25get_first_write_timestampEv(ptr noundef nonnull align 8 dereferenceable(200) %66)
          to label %68 unwind label %86

68:                                               ; preds = %64
  %69 = extractvalue { i64, i64 } %67, 0
  %70 = extractvalue { i64, i64 } %67, 1
  %71 = invoke noundef i32 @_ZN7cascadb11interval_usE7timevalS0_(i64 %69, i64 %70, i64 %28, i64 %29)
          to label %72 unwind label %86

72:                                               ; preds = %68
  %73 = load i32, ptr %21, align 4, !tbaa !42
  %74 = mul i32 %73, 1000
  %75 = icmp ugt i32 %71, %74
  br i1 %75, label %76, label %88

76:                                               ; preds = %72
  %77 = load ptr, ptr %5, align 8, !tbaa !39
  %78 = invoke noundef zeroext i1 @_ZN7cascadb4Node11is_flushingEv(ptr noundef nonnull align 8 dereferenceable(200) %77)
          to label %79 unwind label %86

79:                                               ; preds = %76
  br i1 %78, label %88, label %80

80:                                               ; preds = %79
  %81 = load ptr, ptr %5, align 8, !tbaa !39
  %82 = invoke noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200) %81)
          to label %83 unwind label %86

83:                                               ; preds = %80
  %84 = icmp eq i32 %82, 0
  br i1 %84, label %85, label %88

85:                                               ; preds = %83
  invoke void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %88 unwind label %86

86:                                               ; preds = %85, %80, %76, %68, %64
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %92

88:                                               ; preds = %85, %63, %83, %79, %72, %45
  %.252 = phi i64 [ %.050100, %45 ], [ %.050100, %63 ], [ %65, %79 ], [ %65, %83 ], [ %65, %72 ], [ %65, %85 ]
  %.1 = phi i64 [ %.041104, %45 ], [ %53, %63 ], [ %53, %79 ], [ %53, %83 ], [ %53, %72 ], [ %53, %85 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %89 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %90 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %20) #5
  store ptr %90, ptr %4, align 8
  %91 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %91, label %.lr.ph, label %._crit_edge, !llvm.loop !43

92:                                               ; preds = %61, %86, %59
  %.pn83.pn = phi { ptr, i32 } [ %60, %59 ], [ %87, %86 ], [ %62, %61 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %230

93:                                               ; preds = %._crit_edge
  store i64 %.041.lcssa, ptr %23, align 8, !tbaa !45
  invoke void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %94 unwind label %102

94:                                               ; preds = %93
  invoke void @_ZN7cascadb6RWLock6unlockEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
          to label %95 unwind label %102

95:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %96 = call ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %97 = call ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN7cascadb4NodeESt6vectorIS4_SaIS4_EEEE20FirstWriteComparatorEvT_SB_T0_(ptr %96, ptr %97)
          to label %.preheader89 unwind label %104

.preheader89:                                     ; preds = %95
  %98 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %99 = icmp ne i64 %98, 0
  %.not106 = icmp ugt i64 %33, 99
  %or.cond87107 = select i1 %99, i1 %.not106, i1 false
  br i1 %or.cond87107, label %.lr.ph110, label %._crit_edge111

100:                                              ; preds = %._crit_edge
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %229

102:                                              ; preds = %94, %93
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %228

104:                                              ; preds = %221, %220, %217, %216, %95
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %227

.lr.ph110:                                        ; preds = %.preheader89, %134
  %.046109 = phi i64 [ %135, %134 ], [ 0, %.preheader89 ]
  %.053108 = phi i64 [ %.154, %134 ], [ 0, %.preheader89 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.046109) #5
  %107 = load ptr, ptr %106, align 8, !tbaa !39
  store ptr %107, ptr %8, align 8, !tbaa !39
  %108 = invoke noundef zeroext i1 @_ZN7cascadb4Node14try_write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %107)
          to label %109 unwind label %130

109:                                              ; preds = %.lr.ph110
  br i1 %108, label %110, label %134

110:                                              ; preds = %109
  %111 = load ptr, ptr %8, align 8, !tbaa !39
  %112 = invoke noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200) %111)
          to label %113 unwind label %130

113:                                              ; preds = %110
  %114 = icmp eq i32 %112, 0
  br i1 %114, label %115, label %132

115:                                              ; preds = %113
  %116 = load ptr, ptr %8, align 8, !tbaa !39
  %117 = invoke noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200) %116)
          to label %118 unwind label %130

118:                                              ; preds = %115
  br i1 %117, label %132, label %119

119:                                              ; preds = %118
  %120 = load ptr, ptr %8, align 8, !tbaa !39
  invoke void @_ZN7cascadb4Node12set_flushingEb(ptr noundef nonnull align 8 dereferenceable(200) %120, i1 noundef zeroext true)
          to label %121 unwind label %130

121:                                              ; preds = %119
  invoke void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %122 unwind label %130

122:                                              ; preds = %121
  %123 = load ptr, ptr %8, align 8, !tbaa !39
  %124 = load ptr, ptr %123, align 8, !tbaa !40
  %125 = getelementptr inbounds i8, ptr %124, i64 16
  %126 = load ptr, ptr %125, align 8
  %127 = invoke noundef i64 %126(ptr noundef nonnull align 8 dereferenceable(200) %123)
          to label %128 unwind label %130

128:                                              ; preds = %122
  %129 = add i64 %127, %.053108
  br label %134

130:                                              ; preds = %132, %122, %121, %119, %115, %110, %.lr.ph110
  %131 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %227

132:                                              ; preds = %118, %113
  %133 = load ptr, ptr %8, align 8, !tbaa !39
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %133)
          to label %134 unwind label %130

134:                                              ; preds = %128, %132, %109
  %.154 = phi i64 [ %.053108, %132 ], [ %129, %128 ], [ %.053108, %109 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %135 = add nuw i64 %.046109, 1
  %136 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %137 = icmp ult i64 %135, %136
  %.not = icmp ult i64 %.154, %34
  %or.cond87 = select i1 %137, i1 %.not, i1 false
  br i1 %or.cond87, label %.lr.ph110, label %._crit_edge111, !llvm.loop !46

._crit_edge111:                                   ; preds = %134, %.preheader89
  %.053.lcssa = phi i64 [ 0, %.preheader89 ], [ %.154, %134 ]
  %.not.lcssa = phi i1 [ %.not106, %.preheader89 ], [ %.not, %134 ]
  %138 = sub i64 %.050.lcssa, %.053.lcssa
  %139 = load i64, ptr %17, align 8, !tbaa !32
  %140 = load i32, ptr %24, align 8, !tbaa !47
  %141 = zext i32 %140 to i64
  %142 = mul i64 %139, %141
  %143 = udiv i64 %142, 100
  %.not75 = icmp uge i64 %138, %143
  %or.cond = select i1 %.not75, i1 %.not.lcssa, i1 false
  br i1 %or.cond, label %144, label %214

144:                                              ; preds = %._crit_edge111
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  invoke void @_ZN7cascadb6RWLock9read_lockEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
          to label %145 unwind label %149

145:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %146 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %20) #5
  store ptr %146, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %147 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %20) #5
  store ptr %147, ptr %11, align 8
  %148 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br i1 %148, label %.lr.ph115, label %._crit_edge116

._crit_edge116:                                   ; preds = %172, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  invoke void @_ZN7cascadb6RWLock6unlockEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
          to label %176 unwind label %149

149:                                              ; preds = %176, %._crit_edge116, %144
  %150 = landingpad { ptr, i32 }
          cleanup
  br label %213

.lr.ph115:                                        ; preds = %145, %172
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %151 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %152 = getelementptr inbounds i8, ptr %151, i64 40
  %153 = load ptr, ptr %152, align 8, !tbaa !34
  store ptr %153, ptr %12, align 8, !tbaa !39
  %154 = invoke noundef zeroext i1 @_ZN7cascadb4Node8is_dirtyEv(ptr noundef nonnull align 8 dereferenceable(200) %153)
          to label %155 unwind label %170

155:                                              ; preds = %.lr.ph115
  br i1 %154, label %156, label %172

156:                                              ; preds = %155
  %157 = load ptr, ptr %12, align 8, !tbaa !39
  %158 = invoke noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200) %157)
          to label %159 unwind label %170

159:                                              ; preds = %156
  %160 = icmp eq i32 %158, 0
  br i1 %160, label %161, label %172

161:                                              ; preds = %159
  %162 = load ptr, ptr %12, align 8, !tbaa !39
  %163 = invoke noundef zeroext i1 @_ZN7cascadb4Node11is_flushingEv(ptr noundef nonnull align 8 dereferenceable(200) %162)
          to label %164 unwind label %170

164:                                              ; preds = %161
  br i1 %163, label %172, label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %12, align 8, !tbaa !39
  %167 = invoke noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200) %166)
          to label %168 unwind label %170

168:                                              ; preds = %165
  br i1 %167, label %172, label %169

169:                                              ; preds = %168
  invoke void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %172 unwind label %170

170:                                              ; preds = %169, %165, %161, %156, %.lr.ph115
  %171 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %213

172:                                              ; preds = %169, %168, %164, %159, %155
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %173 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %174 = call ptr @_ZNSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %20) #5
  store ptr %174, ptr %11, align 8
  %175 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN7cascadb5Cache8CacheKeyEPNS1_4NodeEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br i1 %175, label %.lr.ph115, label %._crit_edge116, !llvm.loop !48

176:                                              ; preds = %._crit_edge116
  %177 = call ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %178 = call ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN7cascadb4NodeESt6vectorIS4_SaIS4_EEEE20FirstWriteComparatorEvT_SB_T0_(ptr %177, ptr %178)
          to label %.preheader unwind label %149

.preheader:                                       ; preds = %176
  %179 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %180 = icmp ne i64 %179, 0
  %.not76117 = icmp ult i64 %.053.lcssa, %34
  %or.cond88118 = select i1 %180, i1 %.not76117, i1 false
  br i1 %or.cond88118, label %.lr.ph121, label %._crit_edge122

.lr.ph121:                                        ; preds = %.preheader, %209
  %.0120 = phi i64 [ %210, %209 ], [ 0, %.preheader ]
  %.255119 = phi i64 [ %.3, %209 ], [ %.053.lcssa, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.0120) #5
  %182 = load ptr, ptr %181, align 8, !tbaa !39
  store ptr %182, ptr %13, align 8, !tbaa !39
  %183 = invoke noundef zeroext i1 @_ZN7cascadb4Node14try_write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %182)
          to label %184 unwind label %205

184:                                              ; preds = %.lr.ph121
  br i1 %183, label %185, label %209

185:                                              ; preds = %184
  %186 = load ptr, ptr %13, align 8, !tbaa !39
  %187 = invoke noundef i32 @_ZN7cascadb4Node3pinEv(ptr noundef nonnull align 8 dereferenceable(200) %186)
          to label %188 unwind label %205

188:                                              ; preds = %185
  %189 = icmp eq i32 %187, 0
  br i1 %189, label %190, label %207

190:                                              ; preds = %188
  %191 = load ptr, ptr %13, align 8, !tbaa !39
  %192 = invoke noundef zeroext i1 @_ZN7cascadb4Node7is_deadEv(ptr noundef nonnull align 8 dereferenceable(200) %191)
          to label %193 unwind label %205

193:                                              ; preds = %190
  br i1 %192, label %207, label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr %13, align 8, !tbaa !39
  invoke void @_ZN7cascadb4Node12set_flushingEb(ptr noundef nonnull align 8 dereferenceable(200) %195, i1 noundef zeroext true)
          to label %196 unwind label %205

196:                                              ; preds = %194
  invoke void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %197 unwind label %205

197:                                              ; preds = %196
  %198 = load ptr, ptr %13, align 8, !tbaa !39
  %199 = load ptr, ptr %198, align 8, !tbaa !40
  %200 = getelementptr inbounds i8, ptr %199, i64 16
  %201 = load ptr, ptr %200, align 8
  %202 = invoke noundef i64 %201(ptr noundef nonnull align 8 dereferenceable(200) %198)
          to label %203 unwind label %205

203:                                              ; preds = %197
  %204 = add i64 %202, %.255119
  br label %209

205:                                              ; preds = %207, %197, %196, %194, %190, %185, %.lr.ph121
  %206 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %213

207:                                              ; preds = %193, %188
  %208 = load ptr, ptr %13, align 8, !tbaa !39
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %208)
          to label %209 unwind label %205

209:                                              ; preds = %203, %207, %184
  %.3 = phi i64 [ %.255119, %207 ], [ %204, %203 ], [ %.255119, %184 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  %210 = add nuw i64 %.0120, 1
  %211 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %212 = icmp ult i64 %210, %211
  %.not76 = icmp ult i64 %.3, %34
  %or.cond88 = select i1 %212, i1 %.not76, i1 false
  br i1 %or.cond88, label %.lr.ph121, label %._crit_edge122, !llvm.loop !49

._crit_edge122:                                   ; preds = %209, %.preheader
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %214

213:                                              ; preds = %205, %170, %149
  %.pn = phi { ptr, i32 } [ %171, %170 ], [ %206, %205 ], [ %150, %149 ]
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %227

214:                                              ; preds = %._crit_edge122, %._crit_edge111
  %215 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %.not77 = icmp eq i64 %215, 0
  br i1 %.not77, label %217, label %216

216:                                              ; preds = %214
  invoke void @_ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %217 unwind label %104

217:                                              ; preds = %216, %214
  %218 = invoke noundef zeroext i1 @_ZN7cascadb5Cache10need_evictEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
          to label %219 unwind label %104

219:                                              ; preds = %217
  br i1 %218, label %220, label %221

220:                                              ; preds = %219
  invoke void @_ZN7cascadb5Cache5evictEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
          to label %224 unwind label %104

221:                                              ; preds = %219
  %222 = load i32, ptr %25, align 4, !tbaa !50
  %223 = mul i32 %222, 1000
  invoke void @_ZN7cascadb6usleepEj(i32 noundef %223)
          to label %224 unwind label %104

224:                                              ; preds = %221, %220
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  %225 = load i8, ptr %14, align 8, !tbaa !5, !range !30, !noundef !31
  %226 = trunc nuw i8 %225 to i1
  br i1 %226, label %26, label %._crit_edge125, !llvm.loop !51

227:                                              ; preds = %213, %130, %104
  %.pn.pn = phi { ptr, i32 } [ %.pn, %213 ], [ %105, %104 ], [ %131, %130 ]
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %228

228:                                              ; preds = %227, %102
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %227 ], [ %103, %102 ]
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  br label %229

229:                                              ; preds = %228, %100
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %228 ], [ %101, %100 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %230

230:                                              ; preds = %229, %92, %39
  %.pn83.pn.pn = phi { ptr, i32 } [ %.pn83.pn, %92 ], [ %.pn.pn.pn.pn, %229 ], [ %40, %39 ]
  call void @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn83.pn.pn

._crit_edge125:                                   ; preds = %224, %1
  ret void
}

declare noundef i32 @_ZN7cascadb11interval_usE7timevalS0_(i64, i64, i64, i64) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZN7cascadb4Node25get_first_write_timestampEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN7cascadb4NodeESt6vectorIS4_SaIS4_EEEE20FirstWriteComparatorEvT_SB_T0_(ptr, ptr) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb4Node14try_write_lockEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 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 = { 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 #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 = { 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, !14, i64 416}
!6 = !{!"_ZTSN7cascadb5CacheE", !7, i64 0, !15, i64 104, !16, i64 160, !24, i64 208, !11, i64 256, !15, i64 264, !25, i64 320, !24, i64 368, !14, i64 416, !8, i64 424}
!7 = !{!"_ZTSN7cascadb7OptionsE", !8, i64 0, !8, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !13, i64 96, !14, i64 100}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"_ZTSN7cascadb8CompressE", !9, i64 0}
!14 = !{!"bool", !9, i64 0}
!15 = !{!"_ZTSN7cascadb6RWLockE", !9, i64 0}
!16 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN7cascadb5Cache13TableSettingsESt4lessIS5_ESaISt4pairIKS5_S8_EEE", !17, i64 0}
!17 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N7cascadb5Cache13TableSettingsEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE", !18, i64 0}
!18 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N7cascadb5Cache13TableSettingsEESt10_Select1stISB_ESt4lessIS5_ESaISB_EE13_Rb_tree_implISF_Lb1EEE", !19, i64 0, !21, i64 8}
!19 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !20, i64 0}
!20 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!21 = !{!"_ZTSSt15_Rb_tree_header", !22, i64 0, !11, i64 32}
!22 = !{!"_ZTSSt18_Rb_tree_node_base", !23, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!23 = !{!"_ZTSSt14_Rb_tree_color", !9, i64 0}
!24 = !{!"_ZTSN7cascadb5MutexE", !14, i64 0, !9, i64 8}
!25 = !{!"_ZTSSt3mapIN7cascadb5Cache8CacheKeyEPNS0_4NodeESt4lessIS2_ESaISt4pairIKS2_S4_EEE", !26, i64 0}
!26 = !{!"_ZTSSt8_Rb_treeIN7cascadb5Cache8CacheKeyESt4pairIKS2_PNS0_4NodeEESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE", !27, i64 0}
!27 = !{!"_ZTSNSt8_Rb_treeIN7cascadb5Cache8CacheKeyESt4pairIKS2_PNS0_4NodeEESt10_Select1stIS7_ESt4lessIS2_ESaIS7_EE13_Rb_tree_implISB_Lb1EEE", !28, i64 0, !21, i64 8}
!28 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN7cascadb5Cache8CacheKeyEEE", !29, i64 0}
!29 = !{!"_ZTSSt4lessIN7cascadb5Cache8CacheKeyEE"}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!6, !11, i64 64}
!33 = !{!6, !12, i64 80}
!34 = !{!35, !8, i64 40}
!35 = !{!"_ZTSSt4pairIKN7cascadb5Cache8CacheKeyEPNS0_4NodeEE", !36, i64 0, !8, i64 40}
!36 = !{!"_ZTSN7cascadb5Cache8CacheKeyE", !37, i64 0, !11, i64 32}
!37 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !38, i64 0, !11, i64 8, !9, i64 16}
!38 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !8, i64 0}
!39 = !{!8, !8, i64 0}
!40 = !{!41, !41, i64 0}
!41 = !{!"vtable pointer", !10, i64 0}
!42 = !{!6, !12, i64 76}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = !{!6, !11, i64 256}
!46 = distinct !{!46, !44}
!47 = !{!6, !12, i64 72}
!48 = distinct !{!48, !44}
!49 = distinct !{!49, !44}
!50 = !{!6, !12, i64 84}
!51 = distinct !{!51, !44}


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