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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.cascadb::LoggerFormat" = type { ptr, %"class.std::__cxx11::basic_ostringstream" }
%"class.std::__cxx11::basic_ostringstream" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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] }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree.24" }
%"class.std::_Rb_tree.24" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, 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 }
%"struct.cascadb::Cache::TableSettings" = type { ptr, ptr, %struct.timeval }
%struct.timeval = type { i64, i64 }
%"class.cascadb::BlockWriter" = type { ptr, i64 }
%"struct.std::pair.28" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.cascadb::Cache::WriteCompleteContext" = type { ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@_ZN7cascadb14g_logger_levelE = external global i32, align 4
@_ZN7cascadb8g_loggerE = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE = external hidden unnamed_addr constant [51 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [26 x i8], align 1

; 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384), i32 noundef) #6 align 2

; Function Attrs: nounwind willreturn memory(read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) #7

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #8

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb5Cache18get_table_settingsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS0_13TableSettingsE(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #6 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.cascadb::LoggerFormat", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::set", align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.cascadb::Cache::TableSettings", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"class.cascadb::BlockWriter", align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca { i64, i64 }, align 8
  %21 = alloca %"struct.std::pair.28", align 8
  %22 = alloca %struct.timeval, align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca %"struct.cascadb::Cache::TableSettings", align 8
  %26 = alloca %struct.timeval, align 8
  %27 = alloca %struct.timeval, align 8
  %28 = alloca %"class.cascadb::LoggerFormat", align 8
  %29 = alloca %struct.timeval, align 8
  %30 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %31 = load ptr, ptr %3, align 8
  %32 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !9
  %33 = icmp sge i32 0, %32
  br i1 %33, label %34, label %68

34:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 384, ptr %5) #11
  %35 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %5, ptr noundef %35)
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %5, i32 noundef 0)
          to label %37 unwind label %64

37:                                               ; preds = %34
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef @.str.2)
          to label %39 unwind label %64

39:                                               ; preds = %37
  %40 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #12
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #12
  %44 = getelementptr inbounds i8, ptr %43, i64 1
  br label %46

45:                                               ; preds = %39
  br label %46

46:                                               ; preds = %45, %42
  %47 = phi ptr [ %44, %42 ], [ @.str.1, %45 ]
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef %47)
          to label %49 unwind label %64

49:                                               ; preds = %46
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef @.str.3)
          to label %51 unwind label %64

51:                                               ; preds = %49
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %50, i32 noundef 573)
          to label %53 unwind label %64

53:                                               ; preds = %51
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef @.str.2)
          to label %55 unwind label %64

55:                                               ; preds = %53
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef @.str.23)
          to label %57 unwind label %64

57:                                               ; preds = %55
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %58) #11
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %56, i64 noundef %59)
          to label %61 unwind label %64

61:                                               ; preds = %57
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef @.str.13)
          to label %63 unwind label %64

63:                                               ; preds = %61
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %5) #11
  call void @llvm.lifetime.end.p0(i64 384, ptr %5) #11
  br label %68

64:                                               ; preds = %61, %57, %55, %53, %51, %49, %46, %37, %34
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %6, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %7, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %5) #11
  call void @llvm.lifetime.end.p0(i64 384, ptr %5) #11
  br label %326

68:                                               ; preds = %63, %2
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #11
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #11
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %69

69:                                               ; preds = %202, %68
  %70 = load i64, ptr %9, align 8, !tbaa !11
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #11
  %73 = icmp ult i64 %70, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #11
  br label %224

75:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #11
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = load i64, ptr %9, align 8, !tbaa !11
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %77) #11
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  store ptr %79, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #11
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = invoke noundef i64 @_ZN7cascadb4Node3nidEv(ptr noundef nonnull align 8 dereferenceable(200) %80)
          to label %82 unwind label %89

82:                                               ; preds = %75
  store i64 %81, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #11
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb4Node10table_nameB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(200) %83)
          to label %85 unwind label %93

85:                                               ; preds = %82
  %86 = invoke noundef zeroext i1 @_ZN7cascadb5Cache18get_table_settingsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS0_13TableSettingsE(ptr noundef nonnull align 8 dereferenceable(432) %31, ptr noundef nonnull align 8 dereferenceable(32) %84, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %87 unwind label %93

87:                                               ; preds = %85
  br i1 %86, label %97, label %88

88:                                               ; preds = %87
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 584, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #13
  unreachable

89:                                               ; preds = %75
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %6, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %7, align 4
  br label %223

93:                                               ; preds = %85, %82
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %6, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %7, align 4
  br label %222

97:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #11
  %98 = getelementptr inbounds %"struct.cascadb::Cache::TableSettings", ptr %12, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !13
  store ptr %99, ptr %13, align 8, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = icmp ne ptr %100, null
  br i1 %101, label %102, label %103

102:                                              ; preds = %97
  br label %105

103:                                              ; preds = %97
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str.1, i32 noundef 587, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #13
  unreachable

104:                                              ; No predecessors!
  br label %105

105:                                              ; preds = %104, %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #11
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = load ptr, ptr %106, align 8, !tbaa !16
  %108 = getelementptr inbounds ptr, ptr %107, i64 3
  %109 = load ptr, ptr %108, align 8
  %110 = invoke noundef i64 %109(ptr noundef nonnull align 8 dereferenceable(200) %106)
          to label %111 unwind label %120

111:                                              ; preds = %105
  store i64 %110, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #11
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = load i64, ptr %14, align 8, !tbaa !11
  %114 = invoke noundef ptr @_ZN7cascadb6Layout6createEm(ptr noundef nonnull align 8 dereferenceable(600) %112, i64 noundef %113)
          to label %115 unwind label %124

115:                                              ; preds = %111
  store ptr %114, ptr %15, align 8, !tbaa !5
  %116 = load ptr, ptr %15, align 8, !tbaa !5
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %119

118:                                              ; preds = %115
  br label %129

119:                                              ; preds = %115
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.1, i32 noundef 591, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #13
  unreachable

120:                                              ; preds = %105
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %6, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %7, align 4
  br label %221

124:                                              ; preds = %111
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %6, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %7, align 4
  br label %220

128:                                              ; No predecessors!
  br label %129

129:                                              ; preds = %128, %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #11
  %130 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZN7cascadb11BlockWriterC2EPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef %130)
          to label %131 unwind label %139

131:                                              ; preds = %129
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = load ptr, ptr %132, align 8, !tbaa !16
  %134 = getelementptr inbounds ptr, ptr %133, i64 5
  %135 = load ptr, ptr %134, align 8
  %136 = invoke noundef zeroext i1 %135(ptr noundef nonnull align 8 dereferenceable(200) %132, ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %137 unwind label %139

137:                                              ; preds = %131
  br i1 %136, label %143, label %138

138:                                              ; preds = %137
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 596, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #13
  unreachable

139:                                              ; preds = %164, %162, %158, %155, %152, %143, %131, %129
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %6, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %7, align 4
  br label %219

143:                                              ; preds = %137
  %144 = load i64, ptr %14, align 8, !tbaa !11
  %145 = load ptr, ptr %15, align 8, !tbaa !5
  %146 = invoke noundef i64 @_ZN7cascadb5Block4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %145)
          to label %147 unwind label %139

147:                                              ; preds = %143
  %148 = icmp uge i64 %144, %146
  br i1 %148, label %149, label %150

149:                                              ; preds = %147
  br label %152

150:                                              ; preds = %147
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.1, i32 noundef 598, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #13
  unreachable

151:                                              ; No predecessors!
  br label %152

152:                                              ; preds = %151, %149
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZN7cascadb5Block6bufferEv(ptr noundef nonnull align 8 dereferenceable(32) %153)
          to label %155 unwind label %139

155:                                              ; preds = %152
  %156 = load ptr, ptr %15, align 8, !tbaa !5
  %157 = invoke noundef i64 @_ZN7cascadb5Block4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %156)
          to label %158 unwind label %139

158:                                              ; preds = %155
  %159 = add i64 %157, 4096
  %160 = sub i64 %159, 1
  %161 = and i64 %160, -4096
  invoke void @_ZN7cascadb5Slice6resizeEm(ptr noundef nonnull align 8 dereferenceable(12) %154, i64 noundef %161)
          to label %162 unwind label %139

162:                                              ; preds = %158
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %163, i1 noundef zeroext false)
          to label %164 unwind label %139

164:                                              ; preds = %162
  %165 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %165)
          to label %166 unwind label %139

166:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #11
  %167 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #14
          to label %168 unwind label %205

168:                                              ; preds = %166
  call void @llvm.memset.p0.i64(ptr align 16 %167, i8 0, i64 24, i1 false)
  store ptr %167, ptr %18, align 8, !tbaa !5
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = load ptr, ptr %18, align 8, !tbaa !5
  %171 = getelementptr inbounds %"struct.cascadb::Cache::WriteCompleteContext", ptr %170, i32 0, i32 0
  store ptr %169, ptr %171, align 8, !tbaa !18
  %172 = load ptr, ptr %13, align 8, !tbaa !5
  %173 = load ptr, ptr %18, align 8, !tbaa !5
  %174 = getelementptr inbounds %"struct.cascadb::Cache::WriteCompleteContext", ptr %173, i32 0, i32 1
  store ptr %172, ptr %174, align 8, !tbaa !20
  %175 = load ptr, ptr %15, align 8, !tbaa !5
  %176 = load ptr, ptr %18, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.cascadb::Cache::WriteCompleteContext", ptr %176, i32 0, i32 2
  store ptr %175, ptr %177, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #11
  %178 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #14
          to label %179 unwind label %209

179:                                              ; preds = %168
  %180 = load ptr, ptr %18, align 8, !tbaa !5
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN7cascadb5Cache14write_completeEPNS0_20WriteCompleteContextEb to i64), i64 0 }, ptr %20, align 8, !tbaa !22
  %181 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %182 = load i64, ptr %181, align 8
  %183 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %184 = load i64, ptr %183, align 8
  invoke void @_ZN7cascadb8CallbackC2INS_5CacheEPNS2_20WriteCompleteContextEbEEPT_MS5_FvT0_T1_ES7_(ptr noundef nonnull align 8 dereferenceable(8) %178, ptr noundef %31, i64 %182, i64 %184, ptr noundef %180)
          to label %185 unwind label %213

185:                                              ; preds = %179
  store ptr %178, ptr %19, align 8, !tbaa !5
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  %187 = load i64, ptr %11, align 8, !tbaa !11
  %188 = load ptr, ptr %15, align 8, !tbaa !5
  %189 = load i64, ptr %16, align 8, !tbaa !11
  %190 = trunc i64 %189 to i32
  %191 = load ptr, ptr %19, align 8, !tbaa !5
  invoke void @_ZN7cascadb6Layout11async_writeEmPNS_5BlockEjPNS_8CallbackE(ptr noundef nonnull align 8 dereferenceable(600) %186, i64 noundef %187, ptr noundef %188, i32 noundef %190, ptr noundef %191)
          to label %192 unwind label %209

192:                                              ; preds = %185
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  %194 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb4Node10table_nameB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(200) %193)
          to label %195 unwind label %209

195:                                              ; preds = %192
  %196 = invoke { ptr, i8 } @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE6insertERKS5_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(32) %194)
          to label %197 unwind label %209

197:                                              ; preds = %195
  %198 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 0
  %199 = extractvalue { ptr, i8 } %196, 0
  store ptr %199, ptr %198, align 8
  %200 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 1
  %201 = extractvalue { ptr, i8 } %196, 1
  store i8 %201, ptr %200, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #11
  br label %202

202:                                              ; preds = %197
  %203 = load i64, ptr %9, align 8, !tbaa !11
  %204 = add i64 %203, 1
  store i64 %204, ptr %9, align 8, !tbaa !11
  br label %69, !llvm.loop !23

205:                                              ; preds = %166
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %6, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %7, align 4
  br label %218

209:                                              ; preds = %195, %192, %185, %168
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %6, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %7, align 4
  br label %217

213:                                              ; preds = %179
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %6, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %178, i64 noundef 8) #15
  br label %217

217:                                              ; preds = %213, %209
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #11
  br label %218

218:                                              ; preds = %217, %205
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #11
  br label %219

219:                                              ; preds = %218, %139
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #11
  br label %220

220:                                              ; preds = %219, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  br label %221

221:                                              ; preds = %220, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  br label %222

222:                                              ; preds = %221, %93
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #11
  br label %223

223:                                              ; preds = %222, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #11
  br label %325

224:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #11
  %225 = invoke { i64, i64 } @_ZN7cascadb3nowEv()
          to label %226 unwind label %238

226:                                              ; preds = %224
  %227 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 0
  %228 = extractvalue { i64, i64 } %225, 0
  store i64 %228, ptr %227, align 8
  %229 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 1
  %230 = extractvalue { i64, i64 } %225, 1
  store i64 %230, ptr %229, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #11
  %231 = call ptr @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #11
  %232 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %231, ptr %232, align 8
  br label %233

233:                                              ; preds = %319, %226
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #11
  %234 = call ptr @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #11
  %235 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %234, ptr %235, align 8
  %236 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES8_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #11
  br i1 %236, label %242, label %237

237:                                              ; preds = %233
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #11
  br label %323

238:                                              ; preds = %224
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %6, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %7, align 4
  br label %324

242:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #11
  %243 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #11
  %244 = invoke noundef zeroext i1 @_ZN7cascadb5Cache18get_table_settingsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS0_13TableSettingsE(ptr noundef nonnull align 8 dereferenceable(432) %31, ptr noundef nonnull align 8 dereferenceable(32) %243, ptr noundef nonnull align 8 dereferenceable(32) %25)
          to label %245 unwind label %247

245:                                              ; preds = %242
  br i1 %244, label %251, label %246

246:                                              ; preds = %245
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 619, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #13
  unreachable

247:                                              ; preds = %311, %308, %304, %251, %242
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %6, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %7, align 4
  br label %322

251:                                              ; preds = %245
  %252 = getelementptr inbounds %"struct.cascadb::Cache::TableSettings", ptr %25, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %252, i64 16, i1 false), !tbaa.struct !25
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %22, i64 16, i1 false), !tbaa.struct !25
  %253 = getelementptr inbounds { i64, i64 }, ptr %26, i32 0, i32 0
  %254 = load i64, ptr %253, align 8
  %255 = getelementptr inbounds { i64, i64 }, ptr %26, i32 0, i32 1
  %256 = load i64, ptr %255, align 8
  %257 = getelementptr inbounds { i64, i64 }, ptr %27, i32 0, i32 0
  %258 = load i64, ptr %257, align 8
  %259 = getelementptr inbounds { i64, i64 }, ptr %27, i32 0, i32 1
  %260 = load i64, ptr %259, align 8
  %261 = invoke noundef i32 @_ZN7cascadb11interval_usE7timevalS0_(i64 %254, i64 %256, i64 %258, i64 %260)
          to label %262 unwind label %247

262:                                              ; preds = %251
  %263 = icmp uge i32 %261, 60000000
  br i1 %263, label %264, label %318

264:                                              ; preds = %262
  %265 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !9
  %266 = icmp sge i32 1, %265
  br i1 %266, label %267, label %304

267:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 384, ptr %28) #11
  %268 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  invoke void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %28, ptr noundef %268)
          to label %269 unwind label %295

269:                                              ; preds = %267
  %270 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %28, i32 noundef 1)
          to label %271 unwind label %299

271:                                              ; preds = %269
  %272 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %270, ptr noundef @.str.2)
          to label %273 unwind label %299

273:                                              ; preds = %271
  %274 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #12
  %275 = icmp ne ptr %274, null
  br i1 %275, label %276, label %279

276:                                              ; preds = %273
  %277 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #12
  %278 = getelementptr inbounds i8, ptr %277, i64 1
  br label %280

279:                                              ; preds = %273
  br label %280

280:                                              ; preds = %279, %276
  %281 = phi ptr [ %278, %276 ], [ @.str.1, %279 ]
  %282 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %272, ptr noundef %281)
          to label %283 unwind label %299

283:                                              ; preds = %280
  %284 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %282, ptr noundef @.str.3)
          to label %285 unwind label %299

285:                                              ; preds = %283
  %286 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %284, i32 noundef 624)
          to label %287 unwind label %299

287:                                              ; preds = %285
  %288 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %286, ptr noundef @.str.2)
          to label %289 unwind label %299

289:                                              ; preds = %287
  %290 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %288, ptr noundef @.str.27)
          to label %291 unwind label %299

291:                                              ; preds = %289
  %292 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #11
  %293 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %290, ptr noundef nonnull align 8 dereferenceable(32) %292)
          to label %294 unwind label %299

294:                                              ; preds = %291
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %28) #11
  call void @llvm.lifetime.end.p0(i64 384, ptr %28) #11
  br label %304

295:                                              ; preds = %267
  %296 = landingpad { ptr, i32 }
          cleanup
  %297 = extractvalue { ptr, i32 } %296, 0
  store ptr %297, ptr %6, align 8
  %298 = extractvalue { ptr, i32 } %296, 1
  store i32 %298, ptr %7, align 4
  br label %303

299:                                              ; preds = %291, %289, %287, %285, %283, %280, %271, %269
  %300 = landingpad { ptr, i32 }
          cleanup
  %301 = extractvalue { ptr, i32 } %300, 0
  store ptr %301, ptr %6, align 8
  %302 = extractvalue { ptr, i32 } %300, 1
  store i32 %302, ptr %7, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %28) #11
  br label %303

303:                                              ; preds = %299, %295
  call void @llvm.lifetime.end.p0(i64 384, ptr %28) #11
  br label %322

304:                                              ; preds = %294, %264
  %305 = getelementptr inbounds %"struct.cascadb::Cache::TableSettings", ptr %25, i32 0, i32 1
  %306 = load ptr, ptr %305, align 8, !tbaa !13
  %307 = invoke noundef zeroext i1 @_ZN7cascadb6Layout10flush_metaEv(ptr noundef nonnull align 8 dereferenceable(600) %306)
          to label %308 unwind label %247

308:                                              ; preds = %304
  %309 = getelementptr inbounds %"struct.cascadb::Cache::TableSettings", ptr %25, i32 0, i32 1
  %310 = load ptr, ptr %309, align 8, !tbaa !13
  invoke void @_ZN7cascadb6Layout8truncateEv(ptr noundef nonnull align 8 dereferenceable(600) %310)
          to label %311 unwind label %247

311:                                              ; preds = %308
  %312 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %22, i64 16, i1 false), !tbaa.struct !25
  %313 = getelementptr inbounds { i64, i64 }, ptr %29, i32 0, i32 0
  %314 = load i64, ptr %313, align 8
  %315 = getelementptr inbounds { i64, i64 }, ptr %29, i32 0, i32 1
  %316 = load i64, ptr %315, align 8
  invoke void @_ZN7cascadb5Cache27update_last_checkpoint_timeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE7timeval(ptr noundef nonnull align 8 dereferenceable(432) %31, ptr noundef nonnull align 8 dereferenceable(32) %312, i64 %314, i64 %316)
          to label %317 unwind label %247

317:                                              ; preds = %311
  br label %318

318:                                              ; preds = %317, %262
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #11
  br label %319

319:                                              ; preds = %318
  %320 = call ptr @_ZNSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %23, i32 noundef 0) #11
  %321 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  store ptr %320, ptr %321, align 8
  br label %233, !llvm.loop !26

322:                                              ; preds = %303, %247
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #11
  br label %324

323:                                              ; preds = %237
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #11
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #11
  ret void

324:                                              ; preds = %322, %238
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #11
  br label %325

325:                                              ; preds = %324, %223
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #11
  br label %326

326:                                              ; preds = %325, %64
  %327 = load ptr, ptr %6, align 8
  %328 = load i32, ptr %7, align 4
  %329 = insertvalue { ptr, i32 } poison, ptr %327, 0
  %330 = insertvalue { ptr, i32 } %329, i32 %328, 1
  resume { ptr, i32 } %330
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Cache27update_last_checkpoint_timeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE7timeval(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef nonnull align 8 dereferenceable(32), i64, i64) #6 align 2

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

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

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

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

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

declare noundef ptr @_ZN7cascadb6Layout6createEm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef) #8

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7cascadb5Slice6resizeEm(ptr noundef nonnull align 8 dereferenceable(12), i64 noundef) #9 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #10

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Cache14write_completeEPNS0_20WriteCompleteContextEb(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef, i1 noundef zeroext) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8CallbackC2INS_5CacheEPNS2_20WriteCompleteContextEbEEPT_MS5_FvT0_T1_ES7_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64, i64, ptr noundef) unnamed_addr #6 align 2

declare void @_ZN7cascadb6Layout11async_writeEmPNS_5BlockEjPNS_8CallbackE(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef, ptr noundef, i32 noundef, ptr noundef) #8

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE6insertERKS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) #6 align 2

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

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

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

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

declare noundef zeroext i1 @_ZN7cascadb6Layout10flush_metaEv(ptr noundef nonnull align 8 dereferenceable(600)) #8

declare void @_ZN7cascadb6Layout8truncateEv(ptr noundef nonnull align 8 dereferenceable(600)) #8

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

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nounwind willreturn memory(read) "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 #8 = { "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 #9 = { 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 #10 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { noreturn nounwind }
attributes #14 = { builtin allocsize(0) }
attributes #15 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTSN7cascadb11LoggerLevelE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTSN7cascadb5Cache13TableSettingsE", !6, i64 0, !6, i64 8, !15, i64 16}
!15 = !{!"_ZTS7timeval", !12, i64 0, !12, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"_ZTSN7cascadb5Cache20WriteCompleteContextE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!19, !6, i64 8}
!21 = !{!19, !6, i64 16}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{i64 0, i64 8, !11, i64 8, i64 8, !11}
!26 = distinct !{!26, !24}


; 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.cascadb::LoggerFormat" = type { ptr, %"class.std::__cxx11::basic_ostringstream" }
%"class.std::__cxx11::basic_ostringstream" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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] }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree.24" }
%"class.std::_Rb_tree.24" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::_Identity<std::__cxx11::basic_string<char>>, 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 }
%"struct.cascadb::Cache::TableSettings" = type { ptr, ptr, %struct.timeval }
%struct.timeval = type { i64, i64 }
%"class.cascadb::BlockWriter" = type { ptr, i64 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@_ZN7cascadb14g_logger_levelE = external local_unnamed_addr global i32, align 4
@_ZN7cascadb8g_loggerE = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE = external hidden unnamed_addr constant [51 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [26 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #6

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb5Cache18get_table_settingsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS0_13TableSettingsE(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.cascadb::LoggerFormat", align 8
  %4 = alloca %"class.std::set", align 8
  %5 = alloca %"struct.cascadb::Cache::TableSettings", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.cascadb::BlockWriter", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.cascadb::Cache::TableSettings", align 8
  %11 = alloca %"class.cascadb::LoggerFormat", align 8
  %12 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 1
  br i1 %13, label %14, label %39

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %3) #9
  %15 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !9
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %3, ptr noundef %15)
  %16 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %3, i32 noundef 0)
          to label %17 unwind label %37

17:                                               ; preds = %14
  %18 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @.str.2)
          to label %19 unwind label %37

19:                                               ; preds = %17
  %20 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #10
  %.not = icmp eq ptr %20, null
  %21 = getelementptr inbounds i8, ptr %20, i64 1
  %spec.select = select i1 %.not, ptr @.str.1, ptr %21
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull %spec.select)
          to label %23 unwind label %37

23:                                               ; preds = %19
  %24 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull @.str.3)
          to label %25 unwind label %37

25:                                               ; preds = %23
  %26 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef 573)
          to label %27 unwind label %37

27:                                               ; preds = %25
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull @.str.2)
          to label %29 unwind label %37

29:                                               ; preds = %27
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @.str.23)
          to label %31 unwind label %37

31:                                               ; preds = %29
  %32 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 noundef %32)
          to label %34 unwind label %37

34:                                               ; preds = %31
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @.str.13)
          to label %36 unwind label %37

36:                                               ; preds = %34
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %3) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %3) #9
  br label %39

37:                                               ; preds = %34, %31, %29, %27, %25, %23, %19, %17, %14
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %3) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %3) #9
  br label %176

39:                                               ; preds = %36, %2
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #9
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #9
  %40 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %.not84 = icmp eq i64 %40, 0
  br i1 %.not84, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %39
  %41 = getelementptr inbounds i8, ptr %5, i64 8
  br label %43

._crit_edge:                                      ; preds = %100, %39
  %42 = invoke { i64, i64 } @_ZN7cascadb3nowEv()
          to label %112 unwind label %120

43:                                               ; preds = %.lr.ph, %100
  %.05780 = phi i64 [ 0, %.lr.ph ], [ %101, %100 ]
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.05780) #9
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = call noundef i64 @_ZN7cascadb4Node3nidEv(ptr noundef nonnull align 8 dereferenceable(200) %45)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #9
  %47 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb4Node10table_nameB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(200) %45)
  %48 = invoke noundef zeroext i1 @_ZN7cascadb5Cache18get_table_settingsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS0_13TableSettingsE(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %49 unwind label %51

49:                                               ; preds = %43
  br i1 %48, label %53, label %50

50:                                               ; preds = %49
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 584, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #11
  unreachable

51:                                               ; preds = %43
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %111

53:                                               ; preds = %49
  %54 = load ptr, ptr %41, align 8, !tbaa !11
  %.not67 = icmp eq ptr %54, null
  br i1 %.not67, label %55, label %56

55:                                               ; preds = %53
  call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, i32 noundef 587, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #11
  unreachable

56:                                               ; preds = %53
  %57 = load ptr, ptr %45, align 8, !tbaa !15
  %58 = getelementptr inbounds i8, ptr %57, i64 24
  %59 = load ptr, ptr %58, align 8
  %60 = invoke noundef i64 %59(ptr noundef nonnull align 8 dereferenceable(200) %45)
          to label %61 unwind label %65

61:                                               ; preds = %56
  %62 = invoke noundef ptr @_ZN7cascadb6Layout6createEm(ptr noundef nonnull align 8 dereferenceable(600) %54, i64 noundef %60)
          to label %63 unwind label %67

63:                                               ; preds = %61
  %.not68 = icmp eq ptr %62, null
  br i1 %.not68, label %64, label %69

64:                                               ; preds = %63
  call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.1, i32 noundef 591, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #11
  unreachable

65:                                               ; preds = %56
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %111

67:                                               ; preds = %61
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %111

69:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #9
  call void @_ZN7cascadb11BlockWriterC2EPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull %62)
  %70 = load ptr, ptr %45, align 8, !tbaa !15
  %71 = getelementptr inbounds i8, ptr %70, i64 40
  %72 = load ptr, ptr %71, align 8
  %73 = invoke noundef zeroext i1 %72(ptr noundef nonnull align 8 dereferenceable(200) %45, ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %74 unwind label %76

74:                                               ; preds = %69
  br i1 %73, label %78, label %75

75:                                               ; preds = %74
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 596, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #11
  unreachable

76:                                               ; preds = %86, %81, %69
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %110

78:                                               ; preds = %74
  %79 = call noundef i64 @_ZN7cascadb5Block4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %62)
  %.not69 = icmp ult i64 %60, %79
  br i1 %.not69, label %80, label %81

80:                                               ; preds = %78
  call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, i32 noundef 598, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #11
  unreachable

81:                                               ; preds = %78
  %82 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZN7cascadb5Block6bufferEv(ptr noundef nonnull align 8 dereferenceable(32) %62)
  %83 = call noundef i64 @_ZN7cascadb5Block4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %62)
  %84 = add i64 %83, 4095
  %85 = and i64 %84, -4096
  call void @_ZN7cascadb5Slice6resizeEm(ptr noundef nonnull align 8 dereferenceable(12) %82, i64 noundef %85)
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %45, i1 noundef zeroext false)
          to label %86 unwind label %76

86:                                               ; preds = %81
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %45)
          to label %87 unwind label %76

87:                                               ; preds = %86
  %88 = invoke noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #12
          to label %89 unwind label %104

89:                                               ; preds = %87
  store ptr %45, ptr %88, align 8, !tbaa !17
  %90 = getelementptr inbounds i8, ptr %88, i64 8
  store ptr %54, ptr %90, align 8, !tbaa !19
  %91 = getelementptr inbounds i8, ptr %88, i64 16
  store ptr %62, ptr %91, align 8, !tbaa !20
  %92 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #12
          to label %93 unwind label %106

93:                                               ; preds = %89
  invoke void @_ZN7cascadb8CallbackC2INS_5CacheEPNS2_20WriteCompleteContextEbEEPT_MS5_FvT0_T1_ES7_(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull %0, i64 ptrtoint (ptr @_ZN7cascadb5Cache14write_completeEPNS0_20WriteCompleteContextEb to i64), i64 0, ptr noundef nonnull %88)
          to label %94 unwind label %108

94:                                               ; preds = %93
  %95 = load i64, ptr %6, align 8, !tbaa !21
  %96 = trunc i64 %95 to i32
  invoke void @_ZN7cascadb6Layout11async_writeEmPNS_5BlockEjPNS_8CallbackE(ptr noundef nonnull align 8 dereferenceable(600) %54, i64 noundef %46, ptr noundef nonnull %62, i32 noundef %96, ptr noundef nonnull %92)
          to label %97 unwind label %106

97:                                               ; preds = %94
  %98 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb4Node10table_nameB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(200) %45)
  %99 = invoke { ptr, i8 } @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE6insertERKS5_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(32) %98)
          to label %100 unwind label %106

100:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  %101 = add nuw i64 %.05780, 1
  %102 = call noundef i64 @_ZNKSt6vectorIPN7cascadb4NodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %103 = icmp ult i64 %101, %102
  br i1 %103, label %43, label %._crit_edge, !llvm.loop !22

104:                                              ; preds = %87
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %110

106:                                              ; preds = %97, %94, %89
  %107 = landingpad { ptr, i32 }
          cleanup
  br label %110

108:                                              ; preds = %93
  %109 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %92, i64 noundef 8) #13
  br label %110

110:                                              ; preds = %104, %108, %106, %76
  %.pn70.pn.pn = phi { ptr, i32 } [ %77, %76 ], [ %105, %104 ], [ %107, %106 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  br label %111

111:                                              ; preds = %65, %110, %67, %51
  %.pn70.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %52, %51 ], [ %66, %65 ], [ %.pn70.pn.pn, %110 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  br label %175

112:                                              ; preds = %._crit_edge
  %113 = extractvalue { i64, i64 } %42, 0
  %114 = extractvalue { i64, i64 } %42, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  %115 = call ptr @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #9
  store ptr %115, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %116 = call ptr @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #9
  store ptr %116, ptr %9, align 8
  %117 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES8_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br i1 %117, label %.lr.ph82, label %._crit_edge83

.lr.ph82:                                         ; preds = %112
  %118 = getelementptr inbounds i8, ptr %10, i64 16
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 24
  %119 = getelementptr inbounds i8, ptr %10, i64 8
  br label %122

._crit_edge83:                                    ; preds = %170, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #9
  ret void

120:                                              ; preds = %._crit_edge
  %121 = landingpad { ptr, i32 }
          cleanup
  br label %175

122:                                              ; preds = %.lr.ph82, %170
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #9
  %123 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  %124 = invoke noundef zeroext i1 @_ZN7cascadb5Cache18get_table_settingsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERNS0_13TableSettingsE(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef nonnull align 8 dereferenceable(32) %123, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %125 unwind label %127

125:                                              ; preds = %122
  br i1 %124, label %129, label %126

126:                                              ; preds = %125
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 619, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb5Cache11flush_nodesERSt6vectorIPNS_4NodeESaIS3_EE) #11
  unreachable

127:                                              ; preds = %168, %166, %163, %129, %122
  %128 = landingpad { ptr, i32 }
          cleanup
  br label %174

129:                                              ; preds = %125
  %.sroa.04.0.copyload = load i64, ptr %118, align 8, !tbaa !21
  %.sroa.25.0.copyload = load i64, ptr %.sroa.25.0..sroa_idx, align 8, !tbaa !21
  %130 = invoke noundef i32 @_ZN7cascadb11interval_usE7timevalS0_(i64 %.sroa.04.0.copyload, i64 %.sroa.25.0.copyload, i64 %113, i64 %114)
          to label %131 unwind label %127

131:                                              ; preds = %129
  %132 = icmp ugt i32 %130, 59999999
  br i1 %132, label %133, label %170

133:                                              ; preds = %131
  %134 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !5
  %135 = icmp slt i32 %134, 2
  br i1 %135, label %136, label %163

136:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %11) #9
  %137 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !9
  invoke void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %11, ptr noundef %137)
          to label %138 unwind label %158

138:                                              ; preds = %136
  %139 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %11, i32 noundef 1)
          to label %140 unwind label %160

140:                                              ; preds = %138
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef nonnull @.str.2)
          to label %142 unwind label %160

142:                                              ; preds = %140
  %143 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #10
  %.not62 = icmp eq ptr %143, null
  %144 = getelementptr inbounds i8, ptr %143, i64 1
  %spec.select79 = select i1 %.not62, ptr @.str.1, ptr %144
  %145 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef nonnull %spec.select79)
          to label %146 unwind label %160

146:                                              ; preds = %142
  %147 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef nonnull @.str.3)
          to label %148 unwind label %160

148:                                              ; preds = %146
  %149 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %147, i32 noundef 624)
          to label %150 unwind label %160

150:                                              ; preds = %148
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef nonnull @.str.2)
          to label %152 unwind label %160

152:                                              ; preds = %150
  %153 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %151, ptr noundef nonnull @.str.27)
          to label %154 unwind label %160

154:                                              ; preds = %152
  %155 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  %156 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef nonnull align 8 dereferenceable(32) %155)
          to label %157 unwind label %160

157:                                              ; preds = %154
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %11) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %11) #9
  br label %163

158:                                              ; preds = %136
  %159 = landingpad { ptr, i32 }
          cleanup
  br label %162

160:                                              ; preds = %154, %152, %150, %148, %146, %142, %140, %138
  %161 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %11) #9
  br label %162

162:                                              ; preds = %160, %158
  %.pn = phi { ptr, i32 } [ %161, %160 ], [ %159, %158 ]
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %11) #9
  br label %174

163:                                              ; preds = %157, %133
  %164 = load ptr, ptr %119, align 8, !tbaa !11
  %165 = invoke noundef zeroext i1 @_ZN7cascadb6Layout10flush_metaEv(ptr noundef nonnull align 8 dereferenceable(600) %164)
          to label %166 unwind label %127

166:                                              ; preds = %163
  %167 = load ptr, ptr %119, align 8, !tbaa !11
  invoke void @_ZN7cascadb6Layout8truncateEv(ptr noundef nonnull align 8 dereferenceable(600) %167)
          to label %168 unwind label %127

168:                                              ; preds = %166
  %169 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  invoke void @_ZN7cascadb5Cache27update_last_checkpoint_timeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE7timeval(ptr noundef nonnull align 8 dereferenceable(432) %0, ptr noundef nonnull align 8 dereferenceable(32) %169, i64 %113, i64 %114)
          to label %170 unwind label %127

170:                                              ; preds = %168, %131
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #9
  %171 = call ptr @_ZNSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %172 = call ptr @_ZNKSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #9
  store ptr %172, ptr %9, align 8
  %173 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEES8_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br i1 %173, label %122, label %._crit_edge83, !llvm.loop !24

174:                                              ; preds = %162, %127
  %.pn64 = phi { ptr, i32 } [ %128, %127 ], [ %.pn, %162 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  br label %175

175:                                              ; preds = %120, %174, %111
  %.pn70.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn.pn, %111 ], [ %.pn64, %174 ], [ %121, %120 ]
  call void @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #9
  br label %176

176:                                              ; preds = %175, %37
  %.pn70.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn.pn.pn, %175 ], [ %38, %37 ]
  resume { ptr, i32 } %.pn70.pn.pn.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Cache27update_last_checkpoint_timeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE7timeval(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef nonnull align 8 dereferenceable(32), i64, i64) local_unnamed_addr #5 align 2

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

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

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

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

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

declare noundef ptr @_ZN7cascadb6Layout6createEm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef) local_unnamed_addr #7

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Cache14write_completeEPNS0_20WriteCompleteContextEb(ptr noundef nonnull align 8 dereferenceable(432), ptr noundef, i1 noundef zeroext) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8CallbackC2INS_5CacheEPNS2_20WriteCompleteContextEbEEPT_MS5_FvT0_T1_ES7_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64, i64, ptr noundef) unnamed_addr #5 align 2

declare void @_ZN7cascadb6Layout11async_writeEmPNS_5BlockEjPNS_8CallbackE(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS5_ESaIS5_EE6insertERKS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 align 2

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

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

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

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

declare noundef zeroext i1 @_ZN7cascadb6Layout10flush_metaEv(ptr noundef nonnull align 8 dereferenceable(600)) local_unnamed_addr #7

declare void @_ZN7cascadb6Layout8truncateEv(ptr noundef nonnull align 8 dereferenceable(600)) local_unnamed_addr #7

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

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

attributes #0 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #7 = { "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 #8 = { 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { noreturn nounwind }
attributes #12 = { builtin allocsize(0) }
attributes #13 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"_ZTSN7cascadb11LoggerLevelE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN7cascadb5Cache13TableSettingsE", !10, i64 0, !10, i64 8, !13, i64 16}
!13 = !{!"_ZTS7timeval", !14, i64 0, !14, i64 8}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !10, i64 0}
!18 = !{!"_ZTSN7cascadb5Cache20WriteCompleteContextE", !10, i64 0, !10, i64 8, !10, i64 16}
!19 = !{!18, !10, i64 8}
!20 = !{!18, !10, i64 16}
!21 = !{!14, !14, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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