; LLVM IR from weicao/cascadb :: src/tree/node.ll (ZN7cascadb8LeafNode7cascadeEPNS_6MsgBufEPNS_9InnerNodeE)

; 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::FastVector<cascadb::Msg>::Iterator" = type { ptr, i64, i64 }
%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.cascadb::RecordBuckets" = type { i64, %"class.std::vector.13", i64, i64, i64 }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::RecordBuckets::Iterator" = type { ptr, i64, i64 }
%"class.cascadb::Record" = type { %"class.cascadb::Slice", %"class.cascadb::Slice" }
%"class.cascadb::DataNode" = type <{ %"class.cascadb::Node", ptr, i32, [4 x i8] }>
%"class.cascadb::Node" = type { ptr, %"class.std::__cxx11::basic_string", i64, %"class.cascadb::Mutex", i8, i8, i8, %struct.timeval, %struct.timeval, i32, i32, %"class.cascadb::RWLock" }
%"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.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.timeval = type { i64, i64 }
%"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.cascadb::Msg" = type { i32, [4 x i8], %"class.cascadb::Slice", %"class.cascadb::Slice" }
%"class.cascadb::Tree" = type { %"class.std::__cxx11::basic_string", %"class.cascadb::Options", ptr, ptr, ptr, ptr, ptr, 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.cascadb::LeafNode" = type { %"class.cascadb::DataNode.base", i8, i64, i64, i64, %"class.std::vector.8", %"class.cascadb::RecordBuckets" }
%"class.cascadb::DataNode.base" = type <{ %"class.cascadb::Node", ptr, i32 }>
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::InnerNode" = type { %"class.cascadb::DataNode.base", i8, i64, ptr, %"class.cascadb::Slice", i32, i32, i32, i16, %"class.std::vector", i64, i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12)) #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6MsgBuf5beginEv(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7cascadb10FastVectorINS_3MsgELi32EE8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

declare void @_ZN7cascadb6MsgBuf5clearEv(ptr noundef nonnull align 8 dereferenceable(104)) #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12)) #1 align 2

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

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

; Function Attrs: nounwind
declare void @_ZN7cascadb13RecordBucketsD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode7cascadeEPNS_6MsgBufEPNS_9InnerNodeE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef %1, ptr noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.cascadb::Slice", align 8
  %10 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %11 = alloca { ptr, i32 }, align 8
  %12 = alloca %"class.cascadb::RecordBuckets", align 8
  %13 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.cascadb::RecordBuckets::Iterator", align 8
  %17 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.cascadb::Record", align 8
  %20 = alloca %"class.cascadb::Record", align 8
  %21 = alloca %"class.cascadb::Record", align 8
  %22 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %23 = alloca %"class.cascadb::Record", align 8
  %24 = alloca %"class.cascadb::Record", align 8
  %25 = alloca %"class.cascadb::Slice", align 8
  %26 = alloca %"class.cascadb::Slice", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8
  call void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %27)
  %28 = getelementptr inbounds %"class.cascadb::DataNode", ptr %27, i32 0, i32 2
  %29 = load i32, ptr %28, align 8, !tbaa !9
  %30 = icmp eq i32 %29, 2
  br i1 %30, label %31, label %33

31:                                               ; preds = %3
  %32 = call noundef zeroext i1 @_ZN7cascadb8LeafNode16load_all_bucketsEv(ptr noundef nonnull align 8 dereferenceable(320) %27)
  br label %33

33:                                               ; preds = %31, %3
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN7cascadb6MsgBuf10write_lockEv(ptr noundef nonnull align 8 dereferenceable(104) %34)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %35)
  store i64 %36, ptr %7, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %37)
  store i64 %38, ptr %8, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #7
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN7cascadb6MsgBuf5beginEv(ptr dead_on_unwind writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %10, ptr noundef nonnull align 8 dereferenceable(104) %39)
  %40 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %41 = getelementptr inbounds %"class.cascadb::Msg", ptr %40, i32 0, i32 2
  %42 = call { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12) %41)
  store { ptr, i32 } %42, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %11, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr %12) #7
  %43 = getelementptr inbounds %"class.cascadb::DataNode", ptr %27, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = getelementptr inbounds %"class.cascadb::Tree", ptr %44, i32 0, i32 1
  %46 = getelementptr inbounds %"class.cascadb::Options", ptr %45, i32 0, i32 5
  %47 = load i64, ptr %46, align 8, !tbaa !23
  call void @_ZN7cascadb13RecordBucketsC2Em(ptr noundef nonnull align 8 dereferenceable(56) %12, i64 noundef %47)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN7cascadb6MsgBuf5beginEv(ptr dead_on_unwind writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %13, ptr noundef nonnull align 8 dereferenceable(104) %48)
          to label %49 unwind label %92

49:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #7
  %50 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 6
  invoke void @_ZN7cascadb13RecordBuckets12get_iteratorEv(ptr dead_on_unwind writable sret(%"class.cascadb::RecordBuckets::Iterator") align 8 %16, ptr noundef nonnull align 8 dereferenceable(56) %50)
          to label %51 unwind label %96

51:                                               ; preds = %49
  br label %52

52:                                               ; preds = %147, %51
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #7
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %17, ptr noundef nonnull align 8 dereferenceable(104) %53)
          to label %54 unwind label %100

54:                                               ; preds = %52
  %55 = invoke noundef zeroext i1 @_ZNK7cascadb10FastVectorINS_3MsgELi32EE8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %56 unwind label %100

56:                                               ; preds = %54
  br i1 %55, label %57, label %60

57:                                               ; preds = %56
  %58 = invoke noundef zeroext i1 @_ZN7cascadb13RecordBuckets8Iterator5validEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %59 unwind label %100

59:                                               ; preds = %57
  br label %60

60:                                               ; preds = %59, %56
  %61 = phi i1 [ false, %56 ], [ %58, %59 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br i1 %61, label %62, label %148

62:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %63 = getelementptr inbounds %"class.cascadb::DataNode", ptr %27, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !22
  %65 = getelementptr inbounds %"class.cascadb::Tree", ptr %64, i32 0, i32 1
  %66 = getelementptr inbounds %"class.cascadb::Options", ptr %65, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8, !tbaa !27
  %68 = invoke noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %69 unwind label %104

69:                                               ; preds = %62
  %70 = getelementptr inbounds %"class.cascadb::Msg", ptr %68, i32 0, i32 2
  %71 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %72 unwind label %104

72:                                               ; preds = %69
  %73 = getelementptr inbounds %"class.cascadb::Record", ptr %71, i32 0, i32 0
  %74 = load ptr, ptr %67, align 8, !tbaa !28
  %75 = getelementptr inbounds ptr, ptr %74, i64 0
  %76 = load ptr, ptr %75, align 8
  %77 = invoke noundef i32 %76(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 8 dereferenceable(12) %70, ptr noundef nonnull align 8 dereferenceable(12) %73)
          to label %78 unwind label %104

78:                                               ; preds = %72
  store i32 %77, ptr %18, align 4, !tbaa !30
  %79 = load i32, ptr %18, align 4, !tbaa !30
  %80 = icmp slt i32 %79, 0
  br i1 %80, label %81, label %115

81:                                               ; preds = %78
  %82 = invoke noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %83 unwind label %104

83:                                               ; preds = %81
  %84 = getelementptr inbounds %"class.cascadb::Msg", ptr %82, i32 0, i32 0
  %85 = load i32, ptr %84, align 8, !tbaa !31
  %86 = icmp eq i32 %85, 1
  br i1 %86, label %87, label %108

87:                                               ; preds = %83
  %88 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %89 unwind label %104

89:                                               ; preds = %87
  invoke void @_ZN7cascadb8LeafNode9to_recordERKNS_3MsgE(ptr dead_on_unwind writable sret(%"class.cascadb::Record") align 8 %19, ptr noundef nonnull align 8 dereferenceable(320) %27, ptr noundef nonnull align 8 dereferenceable(40) %88)
          to label %90 unwind label %104

90:                                               ; preds = %89
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef byval(%"class.cascadb::Record") align 8 %19)
          to label %91 unwind label %104

91:                                               ; preds = %90
  br label %112

92:                                               ; preds = %33
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %14, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %15, align 4
  br label %264

96:                                               ; preds = %261, %258, %252, %240, %230, %225, %219, %214, %212, %205, %194, %188, %186, %185, %184, %182, %180, %179, %177, %174, %170, %163, %162, %160, %154, %49
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %14, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %15, align 4
  br label %263

100:                                              ; preds = %57, %54, %52
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %14, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %263

104:                                              ; preds = %144, %142, %140, %138, %136, %134, %132, %131, %129, %123, %121, %120, %118, %112, %110, %108, %90, %89, %87, %81, %72, %69, %62
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %14, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %263

108:                                              ; preds = %83
  %109 = invoke noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %110 unwind label %104

110:                                              ; preds = %108
  invoke void @_ZN7cascadb3Msg7destroyEv(ptr noundef nonnull align 8 dereferenceable(40) %109)
          to label %111 unwind label %104

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111, %91
  %113 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorppEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %114 unwind label %104

114:                                              ; preds = %112
  br label %147

115:                                              ; preds = %78
  %116 = load i32, ptr %18, align 4, !tbaa !30
  %117 = icmp sgt i32 %116, 0
  br i1 %117, label %118, label %123

118:                                              ; preds = %115
  %119 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %120 unwind label %104

120:                                              ; preds = %118
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %119, i64 32, i1 false), !tbaa.struct !35
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef byval(%"class.cascadb::Record") align 8 %20)
          to label %121 unwind label %104

121:                                              ; preds = %120
  invoke void @_ZN7cascadb13RecordBuckets8Iterator4nextEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %122 unwind label %104

122:                                              ; preds = %121
  br label %146

123:                                              ; preds = %115
  %124 = invoke noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %125 unwind label %104

125:                                              ; preds = %123
  %126 = getelementptr inbounds %"class.cascadb::Msg", ptr %124, i32 0, i32 0
  %127 = load i32, ptr %126, align 8, !tbaa !31
  %128 = icmp eq i32 %127, 1
  br i1 %128, label %129, label %134

129:                                              ; preds = %125
  %130 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %131 unwind label %104

131:                                              ; preds = %129
  invoke void @_ZN7cascadb8LeafNode9to_recordERKNS_3MsgE(ptr dead_on_unwind writable sret(%"class.cascadb::Record") align 8 %21, ptr noundef nonnull align 8 dereferenceable(320) %27, ptr noundef nonnull align 8 dereferenceable(40) %130)
          to label %132 unwind label %104

132:                                              ; preds = %131
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef byval(%"class.cascadb::Record") align 8 %21)
          to label %133 unwind label %104

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133, %125
  %135 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorppEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %136 unwind label %104

136:                                              ; preds = %134
  %137 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %138 unwind label %104

138:                                              ; preds = %136
  %139 = getelementptr inbounds %"class.cascadb::Record", ptr %137, i32 0, i32 0
  invoke void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %139)
          to label %140 unwind label %104

140:                                              ; preds = %138
  %141 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %142 unwind label %104

142:                                              ; preds = %140
  %143 = getelementptr inbounds %"class.cascadb::Record", ptr %141, i32 0, i32 1
  invoke void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %143)
          to label %144 unwind label %104

144:                                              ; preds = %142
  invoke void @_ZN7cascadb13RecordBuckets8Iterator4nextEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %145 unwind label %104

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145, %122
  br label %147

147:                                              ; preds = %146, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %52, !llvm.loop !36

148:                                              ; preds = %60
  br label %149

149:                                              ; preds = %172, %148
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #7
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %22, ptr noundef nonnull align 8 dereferenceable(104) %150)
          to label %151 unwind label %165

151:                                              ; preds = %149
  %152 = invoke noundef zeroext i1 @_ZNK7cascadb10FastVectorINS_3MsgELi32EE8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %153 unwind label %165

153:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  br i1 %152, label %154, label %173

154:                                              ; preds = %153
  %155 = invoke noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %156 unwind label %96

156:                                              ; preds = %154
  %157 = getelementptr inbounds %"class.cascadb::Msg", ptr %155, i32 0, i32 0
  %158 = load i32, ptr %157, align 8, !tbaa !31
  %159 = icmp eq i32 %158, 1
  br i1 %159, label %160, label %169

160:                                              ; preds = %156
  %161 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %162 unwind label %96

162:                                              ; preds = %160
  invoke void @_ZN7cascadb8LeafNode9to_recordERKNS_3MsgE(ptr dead_on_unwind writable sret(%"class.cascadb::Record") align 8 %23, ptr noundef nonnull align 8 dereferenceable(320) %27, ptr noundef nonnull align 8 dereferenceable(40) %161)
          to label %163 unwind label %96

163:                                              ; preds = %162
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef byval(%"class.cascadb::Record") align 8 %23)
          to label %164 unwind label %96

164:                                              ; preds = %163
  br label %169

165:                                              ; preds = %151, %149
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %14, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  br label %263

169:                                              ; preds = %164, %156
  br label %170

170:                                              ; preds = %169
  %171 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorppEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef 0)
          to label %172 unwind label %96

172:                                              ; preds = %170
  br label %149, !llvm.loop !38

173:                                              ; preds = %153
  br label %174

174:                                              ; preds = %181, %173
  %175 = invoke noundef zeroext i1 @_ZN7cascadb13RecordBuckets8Iterator5validEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %176 unwind label %96

176:                                              ; preds = %174
  br i1 %175, label %177, label %182

177:                                              ; preds = %176
  %178 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %179 unwind label %96

179:                                              ; preds = %177
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %178, i64 32, i1 false), !tbaa.struct !35
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef byval(%"class.cascadb::Record") align 8 %24)
          to label %180 unwind label %96

180:                                              ; preds = %179
  invoke void @_ZN7cascadb13RecordBuckets8Iterator4nextEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %181 unwind label %96

181:                                              ; preds = %180
  br label %174, !llvm.loop !39

182:                                              ; preds = %176
  %183 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 6
  invoke void @_ZN7cascadb13RecordBuckets4swapERS0_(ptr noundef nonnull align 8 dereferenceable(56) %183, ptr noundef nonnull align 8 dereferenceable(56) %12)
          to label %184 unwind label %96

184:                                              ; preds = %182
  invoke void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320) %27)
          to label %185 unwind label %96

185:                                              ; preds = %184
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %27, i1 noundef zeroext true)
          to label %186 unwind label %96

186:                                              ; preds = %185
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN7cascadb6MsgBuf5clearEv(ptr noundef nonnull align 8 dereferenceable(104) %187)
          to label %188 unwind label %96

188:                                              ; preds = %186
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %189, i32 0, i32 11
  %191 = load i64, ptr %190, align 8, !tbaa !40
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = invoke noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %192)
          to label %194 unwind label %96

194:                                              ; preds = %188
  %195 = add i64 %191, %193
  %196 = load i64, ptr %7, align 8, !tbaa !21
  %197 = sub i64 %195, %196
  %198 = load ptr, ptr %6, align 8, !tbaa !5
  %199 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %198, i32 0, i32 11
  store i64 %197, ptr %199, align 8, !tbaa !40
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %200, i32 0, i32 12
  %202 = load i64, ptr %201, align 8, !tbaa !47
  %203 = load ptr, ptr %5, align 8, !tbaa !5
  %204 = invoke noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %203)
          to label %205 unwind label %96

205:                                              ; preds = %194
  %206 = add i64 %202, %204
  %207 = load i64, ptr %8, align 8, !tbaa !21
  %208 = sub i64 %206, %207
  %209 = load ptr, ptr %6, align 8, !tbaa !5
  %210 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %209, i32 0, i32 12
  store i64 %208, ptr %210, align 8, !tbaa !47
  %211 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN7cascadb6MsgBuf6unlockEv(ptr noundef nonnull align 8 dereferenceable(104) %211)
          to label %212 unwind label %96

212:                                              ; preds = %205
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %213)
          to label %214 unwind label %96

214:                                              ; preds = %212
  %215 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 6
  %216 = invoke noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %215)
          to label %217 unwind label %96

217:                                              ; preds = %214
  %218 = icmp eq i64 %216, 0
  br i1 %218, label %219, label %225

219:                                              ; preds = %217
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !48
  %220 = getelementptr inbounds { ptr, i32 }, ptr %25, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8
  %222 = getelementptr inbounds { ptr, i32 }, ptr %25, i32 0, i32 1
  %223 = load i32, ptr %222, align 8
  invoke void @_ZN7cascadb8LeafNode5mergeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320) %27, ptr %221, i32 %223)
          to label %224 unwind label %96

224:                                              ; preds = %219
  br label %261

225:                                              ; preds = %217
  %226 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 6
  %227 = invoke noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %226)
          to label %228 unwind label %96

228:                                              ; preds = %225
  %229 = icmp ugt i64 %227, 1
  br i1 %229, label %230, label %258

230:                                              ; preds = %228
  %231 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 6
  %232 = invoke noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %231)
          to label %233 unwind label %96

233:                                              ; preds = %230
  %234 = getelementptr inbounds %"class.cascadb::DataNode", ptr %27, i32 0, i32 1
  %235 = load ptr, ptr %234, align 8, !tbaa !22
  %236 = getelementptr inbounds %"class.cascadb::Tree", ptr %235, i32 0, i32 1
  %237 = getelementptr inbounds %"class.cascadb::Options", ptr %236, i32 0, i32 7
  %238 = load i64, ptr %237, align 8, !tbaa !49
  %239 = icmp ugt i64 %232, %238
  br i1 %239, label %252, label %240

240:                                              ; preds = %233
  %241 = load ptr, ptr %27, align 8, !tbaa !28
  %242 = getelementptr inbounds ptr, ptr %241, i64 2
  %243 = load ptr, ptr %242, align 8
  %244 = invoke noundef i64 %243(ptr noundef nonnull align 8 dereferenceable(320) %27)
          to label %245 unwind label %96

245:                                              ; preds = %240
  %246 = getelementptr inbounds %"class.cascadb::DataNode", ptr %27, i32 0, i32 1
  %247 = load ptr, ptr %246, align 8, !tbaa !22
  %248 = getelementptr inbounds %"class.cascadb::Tree", ptr %247, i32 0, i32 1
  %249 = getelementptr inbounds %"class.cascadb::Options", ptr %248, i32 0, i32 4
  %250 = load i64, ptr %249, align 8, !tbaa !50
  %251 = icmp ugt i64 %244, %250
  br i1 %251, label %252, label %258

252:                                              ; preds = %245, %233
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !48
  %253 = getelementptr inbounds { ptr, i32 }, ptr %26, i32 0, i32 0
  %254 = load ptr, ptr %253, align 8
  %255 = getelementptr inbounds { ptr, i32 }, ptr %26, i32 0, i32 1
  %256 = load i32, ptr %255, align 8
  invoke void @_ZN7cascadb8LeafNode5splitENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320) %27, ptr %254, i32 %256)
          to label %257 unwind label %96

257:                                              ; preds = %252
  br label %260

258:                                              ; preds = %245, %228
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %27)
          to label %259 unwind label %96

259:                                              ; preds = %258
  br label %260

260:                                              ; preds = %259, %257
  br label %261

261:                                              ; preds = %260, %224
  invoke void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %9)
          to label %262 unwind label %96

262:                                              ; preds = %261
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @_ZN7cascadb13RecordBucketsD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  ret i1 true

263:                                              ; preds = %165, %104, %100, %96
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  br label %264

264:                                              ; preds = %263, %92
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @_ZN7cascadb13RecordBucketsD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %265

265:                                              ; preds = %264
  %266 = load ptr, ptr %14, align 8
  %267 = load i32, ptr %15, align 4
  %268 = insertvalue { ptr, i32 } poison, ptr %266, 0
  %269 = insertvalue { ptr, i32 } %268, i32 %267, 1
  resume { ptr, i32 } %269
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode16load_all_bucketsEv(ptr noundef nonnull align 8 dereferenceable(320)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb13RecordBuckets12get_iteratorEv(ptr dead_on_unwind noalias writable sret(%"class.cascadb::RecordBuckets::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

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

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

declare void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef byval(%"class.cascadb::Record") align 8) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode9to_recordERKNS_3MsgE(ptr dead_on_unwind noalias writable sret(%"class.cascadb::Record") align 8, ptr noundef nonnull align 8 dereferenceable(320), ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

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

declare void @_ZN7cascadb3Msg7destroyEv(ptr noundef nonnull align 8 dereferenceable(40)) #4

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

declare void @_ZN7cascadb13RecordBuckets4swapERS0_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56)) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode5mergeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320), ptr, i32) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode5splitENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320), ptr, i32) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 "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 = { inlinehint 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 #7 = { 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, !20, i64 208}
!10 = !{!"_ZTSN7cascadb8DataNodeE", !11, i64 0, !6, i64 200, !20, i64 208}
!11 = !{!"_ZTSN7cascadb4NodeE", !12, i64 8, !14, i64 40, !15, i64 48, !16, i64 96, !16, i64 97, !16, i64 98, !17, i64 104, !17, i64 120, !18, i64 136, !18, i64 140, !19, i64 144}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !13, i64 0, !14, i64 8, !7, i64 16}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN7cascadb5MutexE", !16, i64 0, !7, i64 8}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTS7timeval", !14, i64 0, !14, i64 8}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!20 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!21 = !{!14, !14, i64 0}
!22 = !{!10, !6, i64 200}
!23 = !{!24, !14, i64 72}
!24 = !{!"_ZTSN7cascadb4TreeE", !12, i64 0, !25, i64 32, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!25 = !{!"_ZTSN7cascadb7OptionsE", !6, i64 0, !6, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !18, i64 72, !18, i64 76, !18, i64 80, !18, i64 84, !18, i64 88, !18, i64 92, !26, i64 96, !16, i64 100}
!26 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!27 = !{!24, !6, i64 40}
!28 = !{!29, !29, i64 0}
!29 = !{!"vtable pointer", !8, i64 0}
!30 = !{!18, !18, i64 0}
!31 = !{!32, !33, i64 0}
!32 = !{!"_ZTSN7cascadb3MsgE", !33, i64 0, !34, i64 8, !34, i64 24}
!33 = !{!"_ZTSN7cascadb7MsgTypeE", !7, i64 0}
!34 = !{!"_ZTSN7cascadb5SliceE", !6, i64 0, !18, i64 8}
!35 = !{i64 0, i64 8, !5, i64 8, i64 4, !30, i64 16, i64 8, !5, i64 24, i64 4, !30}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}
!39 = distinct !{!39, !37}
!40 = !{!41, !14, i64 296}
!41 = !{!"_ZTSN7cascadb9InnerNodeE", !10, i64 0, !16, i64 212, !14, i64 216, !6, i64 224, !34, i64 232, !18, i64 248, !18, i64 252, !18, i64 256, !42, i64 260, !43, i64 264, !14, i64 288, !14, i64 296, !14, i64 304}
!42 = !{!"short", !7, i64 0}
!43 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !44, i64 0}
!44 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!47 = !{!41, !14, i64 304}
!48 = !{i64 0, i64 8, !5, i64 8, i64 4, !30}
!49 = !{!24, !14, i64 88}
!50 = !{!24, !14, i64 64}


; 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::FastVector<cascadb::Msg>::Iterator" = type { ptr, i64, i64 }
%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.cascadb::RecordBuckets" = type { i64, %"class.std::vector.13", i64, i64, i64 }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::RecordBuckets::Iterator" = type { ptr, i64, i64 }
%"class.cascadb::Record" = type { %"class.cascadb::Slice", %"class.cascadb::Slice" }

; 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6MsgBuf5beginEv(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(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(24) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorppEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #2 align 2

declare void @_ZN7cascadb6MsgBuf5clearEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode7cascadeEPNS_6MsgBufEPNS_9InnerNodeE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef %1, ptr noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.cascadb::Slice", align 8
  %5 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %6 = alloca %"class.cascadb::RecordBuckets", align 8
  %7 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %8 = alloca %"class.cascadb::RecordBuckets::Iterator", align 8
  %9 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %10 = alloca %"class.cascadb::Record", align 8
  %11 = alloca %"class.cascadb::Record", align 8
  %12 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %13 = alloca %"class.cascadb::Record", align 8
  tail call void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  %14 = getelementptr inbounds i8, ptr %0, i64 208
  %15 = load i32, ptr %14, align 8, !tbaa !5
  %16 = icmp eq i32 %15, 2
  br i1 %16, label %17, label %19

17:                                               ; preds = %3
  %18 = tail call noundef zeroext i1 @_ZN7cascadb8LeafNode16load_all_bucketsEv(ptr noundef nonnull align 8 dereferenceable(320) %0)
  br label %19

19:                                               ; preds = %17, %3
  tail call void @_ZN7cascadb6MsgBuf10write_lockEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
  %20 = tail call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
  %21 = tail call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZN7cascadb6MsgBuf5beginEv(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(104) %1)
  %22 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = call { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12) %23)
  %.fca.0.extract = extractvalue { ptr, i32 } %24, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %24, 1
  store ptr %.fca.0.extract, ptr %4, align 8
  %.sroa.27.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.27.0..sroa_idx, align 8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %6) #6
  %25 = getelementptr inbounds i8, ptr %0, i64 200
  %26 = load ptr, ptr %25, align 8, !tbaa !20
  %27 = getelementptr inbounds i8, ptr %26, i64 72
  %28 = load i64, ptr %27, align 8, !tbaa !21
  call void @_ZN7cascadb13RecordBucketsC2Em(ptr noundef nonnull align 8 dereferenceable(56) %6, i64 noundef %28)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  invoke void @_ZN7cascadb6MsgBuf5beginEv(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %29 unwind label %55

29:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  %30 = getelementptr inbounds i8, ptr %0, i64 264
  invoke void @_ZN7cascadb13RecordBuckets12get_iteratorEv(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::RecordBuckets::Iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(56) %30)
          to label %.preheader36 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader36:                                     ; preds = %29, %.preheader36.backedge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  invoke void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %31 unwind label %57

31:                                               ; preds = %.preheader36
  %32 = invoke noundef zeroext i1 @_ZNK7cascadb10FastVectorINS_3MsgELi32EE8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %33 unwind label %57

33:                                               ; preds = %31
  br i1 %32, label %34, label %.critedge

34:                                               ; preds = %33
  %35 = call noundef zeroext i1 @_ZN7cascadb13RecordBuckets8Iterator5validEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br i1 %35, label %36, label %.loopexit37.preheader

36:                                               ; preds = %34
  %37 = load ptr, ptr %25, align 8, !tbaa !20
  %38 = getelementptr inbounds i8, ptr %37, i64 40
  %39 = load ptr, ptr %38, align 8, !tbaa !25
  %40 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %43 = load ptr, ptr %39, align 8, !tbaa !26
  %44 = load ptr, ptr %43, align 8
  %45 = invoke noundef i32 %44(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(12) %41, ptr noundef nonnull align 8 dereferenceable(12) %42)
          to label %46 unwind label %59

46:                                               ; preds = %36
  %47 = icmp slt i32 %45, 0
  br i1 %47, label %48, label %65

48:                                               ; preds = %46
  %49 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %50 = load i32, ptr %49, align 8, !tbaa !28
  %51 = icmp eq i32 %50, 1
  br i1 %51, label %52, label %61

52:                                               ; preds = %48
  %53 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  invoke void @_ZN7cascadb8LeafNode9to_recordERKNS_3MsgE(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::Record") align 8 %10, ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef nonnull align 8 dereferenceable(40) %53)
          to label %54 unwind label %59

54:                                               ; preds = %52
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull byval(%"class.cascadb::Record") align 8 %10)
          to label %63 unwind label %59

55:                                               ; preds = %19
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %144

.loopexit:                                        ; preds = %.lr.ph
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %93, %91
  %lpad.loopexit33 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %142, %141, %140, %130, %120, %116, %108, %104, %103, %102, %101, %._crit_edge, %29
  %lpad.loopexit.split-lp34 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

57:                                               ; preds = %31, %.preheader36
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %.loopexit.split-lp

59:                                               ; preds = %79, %76, %75, %73, %66, %61, %54, %52, %36
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

61:                                               ; preds = %48
  %62 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  invoke void @_ZN7cascadb3Msg7destroyEv(ptr noundef nonnull align 8 dereferenceable(40) %62)
          to label %63 unwind label %59

63:                                               ; preds = %61, %54
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorppEi(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 0)
  br label %.preheader36.backedge

65:                                               ; preds = %46
  %.not = icmp eq i32 %45, 0
  br i1 %.not, label %69, label %66

66:                                               ; preds = %65
  %67 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull byval(%"class.cascadb::Record") align 8 %67)
          to label %68 unwind label %59

68:                                               ; preds = %66
  call void @_ZN7cascadb13RecordBuckets8Iterator4nextEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  br label %.preheader36.backedge

.preheader36.backedge:                            ; preds = %68, %82, %63
  br label %.preheader36, !llvm.loop !32

69:                                               ; preds = %65
  %70 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %71 = load i32, ptr %70, align 8, !tbaa !28
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %73, label %76

73:                                               ; preds = %69
  %74 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  invoke void @_ZN7cascadb8LeafNode9to_recordERKNS_3MsgE(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::Record") align 8 %11, ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef nonnull align 8 dereferenceable(40) %74)
          to label %75 unwind label %59

75:                                               ; preds = %73
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull byval(%"class.cascadb::Record") align 8 %11)
          to label %76 unwind label %59

76:                                               ; preds = %75, %69
  %77 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorppEi(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 0)
  %78 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  invoke void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %78)
          to label %79 unwind label %59

79:                                               ; preds = %76
  %80 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  invoke void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %81)
          to label %82 unwind label %59

82:                                               ; preds = %79
  call void @_ZN7cascadb13RecordBuckets8Iterator4nextEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  br label %.preheader36.backedge

.critedge:                                        ; preds = %33
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %.loopexit37.preheader

.loopexit37.preheader:                            ; preds = %34, %.critedge
  br label %.loopexit37

.loopexit37:                                      ; preds = %.loopexit37.preheader, %96
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #6
  invoke void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %12, ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %83 unwind label %94

83:                                               ; preds = %.loopexit37
  %84 = invoke noundef zeroext i1 @_ZNK7cascadb10FastVectorINS_3MsgELi32EE8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %85 unwind label %94

85:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #6
  br i1 %84, label %87, label %.preheader

.preheader:                                       ; preds = %85
  %86 = call noundef zeroext i1 @_ZN7cascadb13RecordBuckets8Iterator5validEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  br i1 %86, label %.lr.ph, label %._crit_edge

87:                                               ; preds = %85
  %88 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %89 = load i32, ptr %88, align 8, !tbaa !28
  %90 = icmp eq i32 %89, 1
  br i1 %90, label %91, label %96

91:                                               ; preds = %87
  %92 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  invoke void @_ZN7cascadb8LeafNode9to_recordERKNS_3MsgE(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::Record") align 8 %13, ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef nonnull align 8 dereferenceable(40) %92)
          to label %93 unwind label %.loopexit.split-lp.loopexit

93:                                               ; preds = %91
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull byval(%"class.cascadb::Record") align 8 %13)
          to label %96 unwind label %.loopexit.split-lp.loopexit

94:                                               ; preds = %83, %.loopexit37
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #6
  br label %.loopexit.split-lp

96:                                               ; preds = %87, %93
  %97 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorppEi(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 0)
  br label %.loopexit37, !llvm.loop !34

.lr.ph:                                           ; preds = %.preheader, %99
  %98 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7cascadb13RecordBuckets8Iterator6recordEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  invoke void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull byval(%"class.cascadb::Record") align 8 %98)
          to label %99 unwind label %.loopexit

99:                                               ; preds = %.lr.ph
  call void @_ZN7cascadb13RecordBuckets8Iterator4nextEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %100 = call noundef zeroext i1 @_ZN7cascadb13RecordBuckets8Iterator5validEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  br i1 %100, label %.lr.ph, label %._crit_edge, !llvm.loop !35

._crit_edge:                                      ; preds = %99, %.preheader
  invoke void @_ZN7cascadb13RecordBuckets4swapERS0_(ptr noundef nonnull align 8 dereferenceable(56) %30, ptr noundef nonnull align 8 dereferenceable(56) %6)
          to label %101 unwind label %.loopexit.split-lp.loopexit.split-lp

101:                                              ; preds = %._crit_edge
  invoke void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320) %0)
          to label %102 unwind label %.loopexit.split-lp.loopexit.split-lp

102:                                              ; preds = %101
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %0, i1 noundef zeroext true)
          to label %103 unwind label %.loopexit.split-lp.loopexit.split-lp

103:                                              ; preds = %102
  invoke void @_ZN7cascadb6MsgBuf5clearEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %104 unwind label %.loopexit.split-lp.loopexit.split-lp

104:                                              ; preds = %103
  %105 = getelementptr inbounds i8, ptr %2, i64 296
  %106 = load i64, ptr %105, align 8, !tbaa !36
  %107 = invoke noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %108 unwind label %.loopexit.split-lp.loopexit.split-lp

108:                                              ; preds = %104
  %109 = sub i64 %106, %20
  %110 = add i64 %109, %107
  store i64 %110, ptr %105, align 8, !tbaa !36
  %111 = getelementptr inbounds i8, ptr %2, i64 304
  %112 = load i64, ptr %111, align 8, !tbaa !43
  %113 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
  %114 = sub i64 %112, %21
  %115 = add i64 %114, %113
  store i64 %115, ptr %111, align 8, !tbaa !43
  invoke void @_ZN7cascadb6MsgBuf6unlockEv(ptr noundef nonnull align 8 dereferenceable(104) %1)
          to label %116 unwind label %.loopexit.split-lp.loopexit.split-lp

116:                                              ; preds = %108
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %2)
          to label %117 unwind label %.loopexit.split-lp.loopexit.split-lp

117:                                              ; preds = %116
  %118 = call noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %30)
  %119 = icmp eq i64 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %117
  invoke void @_ZN7cascadb8LeafNode5mergeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr %.fca.0.extract, i32 %.fca.1.extract)
          to label %142 unwind label %.loopexit.split-lp.loopexit.split-lp

121:                                              ; preds = %117
  %122 = call noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %30)
  %123 = icmp ugt i64 %122, 1
  br i1 %123, label %124, label %141

124:                                              ; preds = %121
  %125 = call noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %30)
  %126 = load ptr, ptr %25, align 8, !tbaa !20
  %127 = getelementptr inbounds i8, ptr %126, i64 88
  %128 = load i64, ptr %127, align 8, !tbaa !44
  %129 = icmp ugt i64 %125, %128
  br i1 %129, label %140, label %130

130:                                              ; preds = %124
  %131 = load ptr, ptr %0, align 8, !tbaa !26
  %132 = getelementptr inbounds i8, ptr %131, i64 16
  %133 = load ptr, ptr %132, align 8
  %134 = invoke noundef i64 %133(ptr noundef nonnull align 8 dereferenceable(320) %0)
          to label %135 unwind label %.loopexit.split-lp.loopexit.split-lp

135:                                              ; preds = %130
  %136 = load ptr, ptr %25, align 8, !tbaa !20
  %137 = getelementptr inbounds i8, ptr %136, i64 64
  %138 = load i64, ptr %137, align 8, !tbaa !45
  %139 = icmp ugt i64 %134, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %135, %124
  invoke void @_ZN7cascadb8LeafNode5splitENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr %.fca.0.extract, i32 %.fca.1.extract)
          to label %142 unwind label %.loopexit.split-lp.loopexit.split-lp

141:                                              ; preds = %135, %121
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
          to label %142 unwind label %.loopexit.split-lp.loopexit.split-lp

142:                                              ; preds = %140, %141, %120
  invoke void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
          to label %143 unwind label %.loopexit.split-lp.loopexit.split-lp

143:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @_ZN7cascadb13RecordBucketsD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  ret i1 true

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %94, %59, %57
  %.pn = phi { ptr, i32 } [ %60, %59 ], [ %95, %94 ], [ %58, %57 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit33, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp34, %.loopexit.split-lp.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %144

144:                                              ; preds = %.loopexit.split-lp, %55
  %.pn.pn = phi { ptr, i32 } [ %.pn, %.loopexit.split-lp ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @_ZN7cascadb13RecordBucketsD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode16load_all_bucketsEv(ptr noundef nonnull align 8 dereferenceable(320)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb13RecordBuckets12get_iteratorEv(ptr dead_on_unwind noalias writable sret(%"class.cascadb::RecordBuckets::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

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

declare void @_ZN7cascadb13RecordBuckets9push_backENS_6RecordE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef byval(%"class.cascadb::Record") align 8) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode9to_recordERKNS_3MsgE(ptr dead_on_unwind noalias writable sret(%"class.cascadb::Record") align 8, ptr noundef nonnull align 8 dereferenceable(320), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

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

declare void @_ZN7cascadb3Msg7destroyEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

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

declare void @_ZN7cascadb13RecordBuckets4swapERS0_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode5mergeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320), ptr, i32) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode5splitENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320), ptr, i32) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint 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 #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, !19, i64 208}
!6 = !{!"_ZTSN7cascadb8DataNodeE", !7, i64 0, !10, i64 200, !19, i64 208}
!7 = !{!"_ZTSN7cascadb4NodeE", !8, i64 8, !13, i64 40, !14, i64 48, !15, i64 96, !15, i64 97, !15, i64 98, !16, i64 104, !16, i64 120, !17, i64 136, !17, i64 140, !18, i64 144}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !9, i64 0, !13, i64 8, !11, i64 16}
!9 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !10, i64 0}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"long", !11, i64 0}
!14 = !{!"_ZTSN7cascadb5MutexE", !15, i64 0, !11, i64 8}
!15 = !{!"bool", !11, i64 0}
!16 = !{!"_ZTS7timeval", !13, i64 0, !13, i64 8}
!17 = !{!"int", !11, i64 0}
!18 = !{!"_ZTSN7cascadb6RWLockE", !11, i64 0}
!19 = !{!"_ZTSN7cascadb10NodeStatusE", !11, i64 0}
!20 = !{!6, !10, i64 200}
!21 = !{!22, !13, i64 72}
!22 = !{!"_ZTSN7cascadb4TreeE", !8, i64 0, !23, i64 32, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176}
!23 = !{!"_ZTSN7cascadb7OptionsE", !10, i64 0, !10, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !17, i64 72, !17, i64 76, !17, i64 80, !17, i64 84, !17, i64 88, !17, i64 92, !24, i64 96, !15, i64 100}
!24 = !{!"_ZTSN7cascadb8CompressE", !11, i64 0}
!25 = !{!22, !10, i64 40}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !12, i64 0}
!28 = !{!29, !30, i64 0}
!29 = !{!"_ZTSN7cascadb3MsgE", !30, i64 0, !31, i64 8, !31, i64 24}
!30 = !{!"_ZTSN7cascadb7MsgTypeE", !11, i64 0}
!31 = !{!"_ZTSN7cascadb5SliceE", !10, i64 0, !17, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}
!35 = distinct !{!35, !33}
!36 = !{!37, !13, i64 296}
!37 = !{!"_ZTSN7cascadb9InnerNodeE", !6, i64 0, !15, i64 212, !13, i64 216, !10, i64 224, !31, i64 232, !17, i64 248, !17, i64 252, !17, i64 256, !38, i64 260, !39, i64 264, !13, i64 288, !13, i64 296, !13, i64 304}
!38 = !{!"short", !11, i64 0}
!39 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!43 = !{!37, !13, i64 304}
!44 = !{!22, !13, i64 88}
!45 = !{!22, !13, i64 64}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass