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

; 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::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<cascadb::DataNode *, std::allocator<cascadb::DataNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::DataNode *, std::allocator<cascadb::DataNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::DataNode *, std::allocator<cascadb::DataNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::DataNode *, std::allocator<cascadb::DataNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.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.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::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::DataNode" = type <{ %"class.cascadb::Node", ptr, i32, [4 x i8] }>
%"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] }>

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE = external hidden unnamed_addr constant [37 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1

; 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200), i1 noundef zeroext) #2 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 @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200)) #2 align 2

declare noundef ptr @_ZN7cascadb4Tree13new_leaf_nodeEv(ptr noundef nonnull align 8 dereferenceable(184)) #4

declare noundef ptr @_ZN7cascadb4Tree9load_nodeEmb(ptr noundef nonnull align 8 dereferenceable(184), i64 noundef, i1 noundef zeroext) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb9InnerNode9add_pivotENS_5SliceEmRSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(312), ptr, i32, i64 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320)) #2 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
define dso_local void @_ZN7cascadb8LeafNode5splitENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr %1, i32 %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.cascadb::Slice", align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::vector.18", align 8
  %7 = alloca %"class.cascadb::Slice", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.cascadb::Slice", align 8
  %14 = alloca { ptr, i32 }, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.cascadb::Slice", align 8
  %17 = getelementptr inbounds { ptr, i32 }, ptr %4, i32 0, i32 0
  store ptr %1, ptr %17, align 8
  %18 = getelementptr inbounds { ptr, i32 }, ptr %4, i32 0, i32 1
  store i32 %2, ptr %18, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8
  %20 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 1
  %21 = load i8, ptr %20, align 4, !tbaa !9, !range !31, !noundef !32
  %22 = trunc i8 %21 to i1
  br i1 %22, label %23, label %24

23:                                               ; preds = %3
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %19)
  br label %191

24:                                               ; preds = %3
  %25 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 1
  store i8 1, ptr %25, align 4, !tbaa !9
  %26 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 6
  %27 = call noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %26)
  %28 = icmp ugt i64 %27, 1
  br i1 %28, label %29, label %30

29:                                               ; preds = %24
  br label %32

30:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.37, ptr noundef @.str.1, i32 noundef 1097, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #7
  unreachable

31:                                               ; No predecessors!
  br label %32

32:                                               ; preds = %31, %29
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #8
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %33 = getelementptr inbounds %"class.cascadb::DataNode", ptr %19, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !33
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %4, i64 16, i1 false), !tbaa.struct !34
  %35 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8
  %37 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 1
  %38 = load i32, ptr %37, align 8
  invoke void @_ZN7cascadb4Tree9lock_pathENS_5SliceERSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(184) %34, ptr %36, i32 %38, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %39 unwind label %45

39:                                               ; preds = %32
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = icmp eq ptr %41, %19
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  br label %50

44:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 1105, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #7
  unreachable

45:                                               ; preds = %86, %83, %66, %55, %50, %32
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %8, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %9, align 4
  br label %198

49:                                               ; No predecessors!
  br label %50

50:                                               ; preds = %49, %43
  %51 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 6
  %52 = invoke noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %51)
          to label %53 unwind label %45

53:                                               ; preds = %50
  %54 = icmp ule i64 %52, 1
  br i1 %54, label %79, label %55

55:                                               ; preds = %53
  %56 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 6
  %57 = invoke noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %56)
          to label %58 unwind label %45

58:                                               ; preds = %55
  %59 = getelementptr inbounds %"class.cascadb::DataNode", ptr %19, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !33
  %61 = getelementptr inbounds %"class.cascadb::Tree", ptr %60, i32 0, i32 1
  %62 = getelementptr inbounds %"class.cascadb::Options", ptr %61, i32 0, i32 7
  %63 = load i64, ptr %62, align 8, !tbaa !36
  %64 = udiv i64 %63, 2
  %65 = icmp ule i64 %57, %64
  br i1 %65, label %66, label %91

66:                                               ; preds = %58
  %67 = load ptr, ptr %19, align 8, !tbaa !40
  %68 = getelementptr inbounds ptr, ptr %67, i64 2
  %69 = load ptr, ptr %68, align 8
  %70 = invoke noundef i64 %69(ptr noundef nonnull align 8 dereferenceable(320) %19)
          to label %71 unwind label %45

71:                                               ; preds = %66
  %72 = getelementptr inbounds %"class.cascadb::DataNode", ptr %19, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !33
  %74 = getelementptr inbounds %"class.cascadb::Tree", ptr %73, i32 0, i32 1
  %75 = getelementptr inbounds %"class.cascadb::Options", ptr %74, i32 0, i32 4
  %76 = load i64, ptr %75, align 8, !tbaa !42
  %77 = udiv i64 %76, 2
  %78 = icmp ule i64 %70, %77
  br i1 %78, label %79, label %91

79:                                               ; preds = %71, %53
  br label %80

80:                                               ; preds = %89, %79
  %81 = call noundef i64 @_ZNKSt6vectorIPN7cascadb8DataNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %82 = icmp ne i64 %81, 0
  br i1 %82, label %83, label %90

83:                                               ; preds = %80
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %85)
          to label %86 unwind label %45

86:                                               ; preds = %83
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %88)
          to label %89 unwind label %45

89:                                               ; preds = %86
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  br label %80, !llvm.loop !43

90:                                               ; preds = %80
  store i32 1, ptr %10, align 4
  br label %189

91:                                               ; preds = %71, %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %92 = getelementptr inbounds %"class.cascadb::DataNode", ptr %19, i32 0, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !33
  %94 = invoke noundef ptr @_ZN7cascadb4Tree13new_leaf_nodeEv(ptr noundef nonnull align 8 dereferenceable(184) %93)
          to label %95 unwind label %100

95:                                               ; preds = %91
  store ptr %94, ptr %11, align 8, !tbaa !5
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %99

98:                                               ; preds = %95
  br label %105

99:                                               ; preds = %95
  call void @__assert_fail(ptr noundef @.str.38, ptr noundef @.str.1, i32 noundef 1121, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #7
  unreachable

100:                                              ; preds = %91
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %8, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %9, align 4
  br label %197

104:                                              ; No predecessors!
  br label %105

105:                                              ; preds = %104, %98
  %106 = getelementptr inbounds %"class.cascadb::Node", ptr %19, i32 0, i32 2
  %107 = load i64, ptr %106, align 8, !tbaa !45
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %108, i32 0, i32 2
  store i64 %107, ptr %109, align 8, !tbaa !46
  %110 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 3
  %111 = load i64, ptr %110, align 8, !tbaa !47
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %112, i32 0, i32 3
  store i64 %111, ptr %113, align 8, !tbaa !47
  %114 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 3
  %115 = load i64, ptr %114, align 8, !tbaa !47
  %116 = icmp uge i64 %115, 281474976710657
  br i1 %116, label %117, label %147

117:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %118 = getelementptr inbounds %"class.cascadb::DataNode", ptr %19, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !33
  %120 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 3
  %121 = load i64, ptr %120, align 8, !tbaa !47
  %122 = invoke noundef ptr @_ZN7cascadb4Tree9load_nodeEmb(ptr noundef nonnull align 8 dereferenceable(184) %119, i64 noundef %121, i1 noundef zeroext false)
          to label %123 unwind label %128

123:                                              ; preds = %117
  store ptr %122, ptr %12, align 8, !tbaa !5
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  %125 = icmp ne ptr %124, null
  br i1 %125, label %126, label %127

126:                                              ; preds = %123
  br label %133

127:                                              ; preds = %123
  call void @__assert_fail(ptr noundef @.str.39, ptr noundef @.str.1, i32 noundef 1128, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #7
  unreachable

128:                                              ; preds = %144, %142, %135, %133, %117
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %8, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %197

132:                                              ; No predecessors!
  br label %133

133:                                              ; preds = %132, %126
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %134)
          to label %135 unwind label %128

135:                                              ; preds = %133
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  %137 = getelementptr inbounds %"class.cascadb::Node", ptr %136, i32 0, i32 2
  %138 = load i64, ptr %137, align 8, !tbaa !45
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %139, i32 0, i32 2
  store i64 %138, ptr %140, align 8, !tbaa !46
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %141, i1 noundef zeroext true)
          to label %142 unwind label %128

142:                                              ; preds = %135
  %143 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %143)
          to label %144 unwind label %128

144:                                              ; preds = %142
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %145)
          to label %146 unwind label %128

146:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %147

147:                                              ; preds = %146, %105
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = getelementptr inbounds %"class.cascadb::Node", ptr %148, i32 0, i32 2
  %150 = load i64, ptr %149, align 8, !tbaa !45
  %151 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 3
  store i64 %150, ptr %151, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #8
  %152 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 6
  %153 = load ptr, ptr %11, align 8, !tbaa !5
  %154 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %153, i32 0, i32 6
  %155 = invoke { ptr, i32 } @_ZN7cascadb13RecordBuckets5splitERS0_(ptr noundef nonnull align 8 dereferenceable(56) %152, ptr noundef nonnull align 8 dereferenceable(56) %154)
          to label %156 unwind label %174

156:                                              ; preds = %147
  store { ptr, i32 } %155, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %14, i64 12, i1 false)
  invoke void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320) %19)
          to label %157 unwind label %174

157:                                              ; preds = %156
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320) %158)
          to label %159 unwind label %174

159:                                              ; preds = %157
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %19, i1 noundef zeroext true)
          to label %160 unwind label %174

160:                                              ; preds = %159
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %161, i1 noundef zeroext true)
          to label %162 unwind label %174

162:                                              ; preds = %160
  %163 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %163)
          to label %164 unwind label %174

164:                                              ; preds = %162
  %165 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %19, i32 0, i32 1
  store i8 0, ptr %165, align 4, !tbaa !9
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %19)
          to label %166 unwind label %174

166:                                              ; preds = %164
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %19)
          to label %167 unwind label %174

167:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  store ptr %169, ptr %15, align 8, !tbaa !5
  %170 = load ptr, ptr %15, align 8, !tbaa !5
  %171 = icmp ne ptr %170, null
  br i1 %171, label %172, label %173

172:                                              ; preds = %167
  br label %179

173:                                              ; preds = %167
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 1152, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #7
  unreachable

174:                                              ; preds = %166, %164, %162, %160, %159, %157, %156, %147
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %8, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %9, align 4
  br label %196

178:                                              ; No predecessors!
  br label %179

179:                                              ; preds = %178, %172
  %180 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %13, i64 16, i1 false), !tbaa.struct !34
  %181 = load ptr, ptr %11, align 8, !tbaa !5
  %182 = getelementptr inbounds %"class.cascadb::Node", ptr %181, i32 0, i32 2
  %183 = load i64, ptr %182, align 8, !tbaa !45
  %184 = getelementptr inbounds { ptr, i32 }, ptr %16, i32 0, i32 0
  %185 = load ptr, ptr %184, align 8
  %186 = getelementptr inbounds { ptr, i32 }, ptr %16, i32 0, i32 1
  %187 = load i32, ptr %186, align 8
  invoke void @_ZN7cascadb9InnerNode9add_pivotENS_5SliceEmRSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(312) %180, ptr %185, i32 %187, i64 noundef %183, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %188 unwind label %192

188:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  store i32 0, ptr %10, align 4
  br label %189

189:                                              ; preds = %188, %90
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  %190 = load i32, ptr %10, align 4
  switch i32 %190, label %204 [
    i32 0, label %191
    i32 1, label %191
  ]

191:                                              ; preds = %189, %189, %23
  ret void

192:                                              ; preds = %179
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %8, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %196

196:                                              ; preds = %192, %174
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  br label %197

197:                                              ; preds = %196, %128, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %198

198:                                              ; preds = %197, %45
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %8, align 8
  %201 = load i32, ptr %9, align 4
  %202 = insertvalue { ptr, i32 } poison, ptr %200, 0
  %203 = insertvalue { ptr, i32 } %202, i32 %201, 1
  resume { ptr, i32 } %203

204:                                              ; preds = %189
  unreachable
}

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

declare void @_ZN7cascadb4Tree9lock_pathENS_5SliceERSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(184), ptr, i32, ptr noundef nonnull align 8 dereferenceable(24)) #4

declare { ptr, i32 } @_ZN7cascadb13RecordBuckets5splitERS0_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #4

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<cascadb::DataNode *, std::allocator<cascadb::DataNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::DataNode *, std::allocator<cascadb::DataNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::DataNode *, std::allocator<cascadb::DataNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::DataNode *, std::allocator<cascadb::DataNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE = external hidden unnamed_addr constant [37 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare noundef ptr @_ZN7cascadb4Tree13new_leaf_nodeEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #3

declare noundef ptr @_ZN7cascadb4Tree9load_nodeEmb(ptr noundef nonnull align 8 dereferenceable(184), i64 noundef, i1 noundef zeroext) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb9InnerNode9add_pivotENS_5SliceEmRSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(312), ptr, i32, i64 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320)) local_unnamed_addr #2 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
define dso_local void @_ZN7cascadb8LeafNode5splitENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr %1, i32 %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector.18", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 212
  %6 = load i8, ptr %5, align 4, !tbaa !5, !range !30, !noundef !31
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %8, label %9

8:                                                ; preds = %3
  tail call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  br label %99

9:                                                ; preds = %3
  store i8 1, ptr %5, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 264
  %11 = tail call noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %10)
  %12 = icmp ugt i64 %11, 1
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.37, ptr noundef nonnull @.str.1, i32 noundef 1097, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #6
  unreachable

14:                                               ; preds = %9
  tail call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %15 = getelementptr inbounds i8, ptr %0, i64 200
  %16 = load ptr, ptr %15, align 8, !tbaa !32
  invoke void @_ZN7cascadb4Tree9lock_pathENS_5SliceERSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(184) %16, ptr %1, i32 %2, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %17 unwind label %.loopexit.split-lp

17:                                               ; preds = %14
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %19 = load ptr, ptr %18, align 8, !tbaa !33
  %20 = icmp eq ptr %19, %0
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 1105, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #6
  unreachable

.loopexit45:                                      ; preds = %.lr.ph, %45
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %102

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

22:                                               ; preds = %17
  %23 = call noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %10)
  %24 = icmp ult i64 %23, 2
  br i1 %24, label %41, label %25

25:                                               ; preds = %22
  %26 = call noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %10)
  %27 = load ptr, ptr %15, align 8, !tbaa !32
  %28 = getelementptr inbounds i8, ptr %27, i64 88
  %29 = load i64, ptr %28, align 8, !tbaa !34
  %30 = lshr i64 %29, 1
  %.not = icmp ugt i64 %26, %30
  br i1 %.not, label %50, label %31

31:                                               ; preds = %25
  %32 = load ptr, ptr %0, align 8, !tbaa !38
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %34 = load ptr, ptr %33, align 8
  %35 = invoke noundef i64 %34(ptr noundef nonnull align 8 dereferenceable(320) %0)
          to label %36 unwind label %.loopexit.split-lp

36:                                               ; preds = %31
  %37 = load ptr, ptr %15, align 8, !tbaa !32
  %38 = getelementptr inbounds i8, ptr %37, i64 64
  %39 = load i64, ptr %38, align 8, !tbaa !40
  %40 = lshr i64 %39, 1
  %.not36 = icmp ugt i64 %35, %40
  br i1 %.not36, label %50, label %41

41:                                               ; preds = %36, %22
  %42 = call noundef i64 @_ZNKSt6vectorIPN7cascadb8DataNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %.not4246 = icmp eq i64 %42, 0
  br i1 %.not4246, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %41, %48
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %44 = load ptr, ptr %43, align 8, !tbaa !33
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %44)
          to label %45 unwind label %.loopexit45

45:                                               ; preds = %.lr.ph
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %47 = load ptr, ptr %46, align 8, !tbaa !33
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %47)
          to label %48 unwind label %.loopexit45

48:                                               ; preds = %45
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %49 = call noundef i64 @_ZNKSt6vectorIPN7cascadb8DataNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %.not42 = icmp eq i64 %49, 0
  br i1 %.not42, label %.loopexit, label %.lr.ph, !llvm.loop !41

50:                                               ; preds = %36, %25
  %51 = phi ptr [ %37, %36 ], [ %27, %25 ]
  %52 = invoke noundef ptr @_ZN7cascadb4Tree13new_leaf_nodeEv(ptr noundef nonnull align 8 dereferenceable(184) %51)
          to label %53 unwind label %55

53:                                               ; preds = %50
  %.not37 = icmp eq ptr %52, null
  br i1 %.not37, label %54, label %57

54:                                               ; preds = %53
  call void @__assert_fail(ptr noundef nonnull @.str.38, ptr noundef nonnull @.str.1, i32 noundef 1121, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #6
  unreachable

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

57:                                               ; preds = %53
  %58 = getelementptr inbounds i8, ptr %0, i64 40
  %59 = load i64, ptr %58, align 8, !tbaa !43
  %60 = getelementptr inbounds i8, ptr %52, i64 216
  store i64 %59, ptr %60, align 8, !tbaa !44
  %61 = getelementptr inbounds i8, ptr %0, i64 224
  %62 = load i64, ptr %61, align 8, !tbaa !45
  %63 = getelementptr inbounds i8, ptr %52, i64 224
  store i64 %62, ptr %63, align 8, !tbaa !45
  %64 = icmp ugt i64 %62, 281474976710656
  br i1 %64, label %65, label %79

65:                                               ; preds = %57
  %66 = load ptr, ptr %15, align 8, !tbaa !32
  %67 = invoke noundef ptr @_ZN7cascadb4Tree9load_nodeEmb(ptr noundef nonnull align 8 dereferenceable(184) %66, i64 noundef %62, i1 noundef zeroext false)
          to label %68 unwind label %70

68:                                               ; preds = %65
  %.not38 = icmp eq ptr %67, null
  br i1 %.not38, label %69, label %72

69:                                               ; preds = %68
  call void @__assert_fail(ptr noundef nonnull @.str.39, ptr noundef nonnull @.str.1, i32 noundef 1128, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #6
  unreachable

70:                                               ; preds = %78, %77, %73, %72, %65
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %102

72:                                               ; preds = %68
  invoke void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %67)
          to label %73 unwind label %70

73:                                               ; preds = %72
  %74 = getelementptr inbounds i8, ptr %52, i64 40
  %75 = load i64, ptr %74, align 8, !tbaa !43
  %76 = getelementptr inbounds i8, ptr %67, i64 216
  store i64 %75, ptr %76, align 8, !tbaa !44
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %67, i1 noundef zeroext true)
          to label %77 unwind label %70

77:                                               ; preds = %73
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %67)
          to label %78 unwind label %70

78:                                               ; preds = %77
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %67)
          to label %79 unwind label %70

79:                                               ; preds = %78, %57
  %80 = getelementptr inbounds i8, ptr %52, i64 40
  %81 = load i64, ptr %80, align 8, !tbaa !43
  store i64 %81, ptr %61, align 8, !tbaa !45
  %82 = getelementptr inbounds i8, ptr %52, i64 264
  %83 = invoke { ptr, i32 } @_ZN7cascadb13RecordBuckets5splitERS0_(ptr noundef nonnull align 8 dereferenceable(56) %10, ptr noundef nonnull align 8 dereferenceable(56) %82)
          to label %84 unwind label %95

84:                                               ; preds = %79
  %.fca.0.extract = extractvalue { ptr, i32 } %83, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %83, 1
  invoke void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320) %0)
          to label %85 unwind label %95

85:                                               ; preds = %84
  invoke void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320) %52)
          to label %86 unwind label %95

86:                                               ; preds = %85
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %0, i1 noundef zeroext true)
          to label %87 unwind label %95

87:                                               ; preds = %86
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %52, i1 noundef zeroext true)
          to label %88 unwind label %95

88:                                               ; preds = %87
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %52)
          to label %89 unwind label %95

89:                                               ; preds = %88
  store i8 0, ptr %5, align 4, !tbaa !5
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
          to label %90 unwind label %95

90:                                               ; preds = %89
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
          to label %91 unwind label %95

91:                                               ; preds = %90
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %93 = load ptr, ptr %92, align 8, !tbaa !33
  %.not39 = icmp eq ptr %93, null
  br i1 %.not39, label %94, label %97

94:                                               ; preds = %91
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 1152, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5splitENS_5SliceE) #6
  unreachable

95:                                               ; preds = %90, %89, %88, %87, %86, %85, %84, %79
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %102

97:                                               ; preds = %91
  %98 = load i64, ptr %80, align 8, !tbaa !43
  invoke void @_ZN7cascadb9InnerNode9add_pivotENS_5SliceEmRSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(312) %93, ptr %.fca.0.extract, i32 %.fca.1.extract, i64 noundef %98, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %.loopexit unwind label %100

.loopexit:                                        ; preds = %48, %41, %97
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %99

99:                                               ; preds = %.loopexit, %8
  ret void

100:                                              ; preds = %97
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %102

102:                                              ; preds = %.loopexit45, %.loopexit.split-lp, %55, %70, %100, %95
  %.pn43 = phi { ptr, i32 } [ %71, %70 ], [ %56, %55 ], [ %101, %100 ], [ %96, %95 ], [ %lpad.loopexit, %.loopexit45 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn43
}

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

declare void @_ZN7cascadb4Tree9lock_pathENS_5SliceERSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(184), ptr, i32, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare { ptr, i32 } @_ZN7cascadb13RecordBuckets5splitERS0_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { noreturn nounwind }
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, !16, i64 212}
!6 = !{!"_ZTSN7cascadb8LeafNodeE", !7, i64 0, !16, i64 212, !14, i64 216, !14, i64 224, !14, i64 232, !21, i64 240, !25, i64 264}
!7 = !{!"_ZTSN7cascadb8DataNodeE", !8, i64 0, !11, i64 200, !20, i64 208}
!8 = !{!"_ZTSN7cascadb4NodeE", !9, 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}
!9 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !10, i64 0, !14, i64 8, !12, i64 16}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"_ZTSN7cascadb5MutexE", !16, i64 0, !12, i64 8}
!16 = !{!"bool", !12, i64 0}
!17 = !{!"_ZTS7timeval", !14, i64 0, !14, i64 8}
!18 = !{!"int", !12, i64 0}
!19 = !{!"_ZTSN7cascadb6RWLockE", !12, i64 0}
!20 = !{!"_ZTSN7cascadb10NodeStatusE", !12, i64 0}
!21 = !{!"_ZTSSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!25 = !{!"_ZTSN7cascadb13RecordBucketsE", !14, i64 0, !26, i64 8, !14, i64 32, !14, i64 40, !14, i64 48}
!26 = !{!"_ZTSSt6vectorIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!7, !11, i64 200}
!33 = !{!11, !11, i64 0}
!34 = !{!35, !14, i64 88}
!35 = !{!"_ZTSN7cascadb4TreeE", !9, i64 0, !36, i64 32, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176}
!36 = !{!"_ZTSN7cascadb7OptionsE", !11, i64 0, !11, 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, !37, i64 96, !16, i64 100}
!37 = !{!"_ZTSN7cascadb8CompressE", !12, i64 0}
!38 = !{!39, !39, i64 0}
!39 = !{!"vtable pointer", !13, i64 0}
!40 = !{!35, !14, i64 64}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!8, !14, i64 40}
!44 = !{!6, !14, i64 216}
!45 = !{!6, !14, i64 224}


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