; LLVM IR from weicao/cascadb :: src/tree/node.ll (ZN7cascadb8LeafNode5mergeENS_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] }>

@.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.39 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE = external hidden unnamed_addr constant [37 x i8], align 1
@.str.41 = 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 @_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 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 @_ZN7cascadb9InnerNode8rm_pivotEmRSt6vectorIPNS_8DataNodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(312), i64 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200)) #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 @_ZN7cascadb8LeafNode5mergeENS_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 ptr, align 8
  %14 = getelementptr inbounds { ptr, i32 }, ptr %4, i32 0, i32 0
  store ptr %1, ptr %14, align 8
  %15 = getelementptr inbounds { ptr, i32 }, ptr %4, i32 0, i32 1
  store i32 %2, ptr %15, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8
  %17 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 1
  %18 = load i8, ptr %17, align 4, !tbaa !9, !range !31, !noundef !32
  %19 = trunc i8 %18 to i1
  br i1 %19, label %20, label %21

20:                                               ; preds = %3
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %16)
  br label %149

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

26:                                               ; preds = %21
  br label %29

27:                                               ; preds = %21
  call void @__assert_fail(ptr noundef @.str.40, ptr noundef @.str.1, i32 noundef 1163, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #7
  unreachable

28:                                               ; No predecessors!
  br label %29

29:                                               ; preds = %28, %26
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %16)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #8
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %30 = getelementptr inbounds %"class.cascadb::DataNode", ptr %16, i32 0, i32 1
  %31 = load ptr, ptr %30, 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
  %32 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8
  %34 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 1
  %35 = load i32, ptr %34, align 8
  invoke void @_ZN7cascadb4Tree9lock_pathENS_5SliceERSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(184) %31, ptr %33, i32 %35, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %36 unwind label %42

36:                                               ; preds = %29
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = icmp eq ptr %38, %16
  br i1 %39, label %40, label %41

40:                                               ; preds = %36
  br label %47

41:                                               ; preds = %36
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 1170, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #7
  unreachable

42:                                               ; preds = %133, %130, %59, %56, %47, %29
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %8, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %9, align 4
  br label %154

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %40
  %48 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 6
  %49 = invoke noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %48)
          to label %50 unwind label %42

50:                                               ; preds = %47
  %51 = icmp ugt i64 %49, 0
  br i1 %51, label %52, label %64

52:                                               ; preds = %50
  br label %53

53:                                               ; preds = %62, %52
  %54 = call noundef i64 @_ZNKSt6vectorIPN7cascadb8DataNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %55 = icmp ne i64 %54, 0
  br i1 %55, label %56, label %63

56:                                               ; preds = %53
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %58)
          to label %59 unwind label %42

59:                                               ; preds = %56
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %61)
          to label %62 unwind label %42

62:                                               ; preds = %59
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  br label %53, !llvm.loop !36

63:                                               ; preds = %53
  store i32 1, ptr %10, align 4
  br label %147

64:                                               ; preds = %50
  %65 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 2
  %66 = load i64, ptr %65, align 8, !tbaa !38
  %67 = icmp uge i64 %66, 281474976710657
  br i1 %67, label %68, label %97

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %69 = getelementptr inbounds %"class.cascadb::DataNode", ptr %16, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !33
  %71 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 2
  %72 = load i64, ptr %71, align 8, !tbaa !38
  %73 = invoke noundef ptr @_ZN7cascadb4Tree9load_nodeEmb(ptr noundef nonnull align 8 dereferenceable(184) %70, i64 noundef %72, i1 noundef zeroext false)
          to label %74 unwind label %79

74:                                               ; preds = %68
  store ptr %73, ptr %11, align 8, !tbaa !5
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %78

77:                                               ; preds = %74
  br label %84

78:                                               ; preds = %74
  call void @__assert_fail(ptr noundef @.str.41, ptr noundef @.str.1, i32 noundef 1184, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #7
  unreachable

79:                                               ; preds = %94, %92, %86, %84, %68
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %8, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %154

83:                                               ; No predecessors!
  br label %84

84:                                               ; preds = %83, %77
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %85)
          to label %86 unwind label %79

86:                                               ; preds = %84
  %87 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 3
  %88 = load i64, ptr %87, align 8, !tbaa !39
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %89, i32 0, i32 3
  store i64 %88, ptr %90, align 8, !tbaa !39
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %91, i1 noundef zeroext true)
          to label %92 unwind label %79

92:                                               ; preds = %86
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %93)
          to label %94 unwind label %79

94:                                               ; preds = %92
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %95)
          to label %96 unwind label %79

96:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %97

97:                                               ; preds = %96, %64
  %98 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 3
  %99 = load i64, ptr %98, align 8, !tbaa !39
  %100 = icmp uge i64 %99, 281474976710657
  br i1 %100, label %101, label %130

101:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %102 = getelementptr inbounds %"class.cascadb::DataNode", ptr %16, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !33
  %104 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 3
  %105 = load i64, ptr %104, align 8, !tbaa !39
  %106 = invoke noundef ptr @_ZN7cascadb4Tree9load_nodeEmb(ptr noundef nonnull align 8 dereferenceable(184) %103, i64 noundef %105, i1 noundef zeroext false)
          to label %107 unwind label %112

107:                                              ; preds = %101
  store ptr %106, ptr %12, align 8, !tbaa !5
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %111

110:                                              ; preds = %107
  br label %117

111:                                              ; preds = %107
  call void @__assert_fail(ptr noundef @.str.39, ptr noundef @.str.1, i32 noundef 1193, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #7
  unreachable

112:                                              ; preds = %127, %125, %119, %117, %101
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %8, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %154

116:                                              ; No predecessors!
  br label %117

117:                                              ; preds = %116, %110
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %118)
          to label %119 unwind label %112

119:                                              ; preds = %117
  %120 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 2
  %121 = load i64, ptr %120, align 8, !tbaa !38
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %122, i32 0, i32 2
  store i64 %121, ptr %123, align 8, !tbaa !38
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %124, i1 noundef zeroext true)
          to label %125 unwind label %112

125:                                              ; preds = %119
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %126)
          to label %127 unwind label %112

127:                                              ; preds = %125
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %128)
          to label %129 unwind label %112

129:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %130

130:                                              ; preds = %129, %97
  %131 = getelementptr inbounds %"class.cascadb::Node", ptr %16, i32 0, i32 5
  store i8 1, ptr %131, align 1, !tbaa !40
  %132 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %16, i32 0, i32 1
  store i8 0, ptr %132, 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) %16)
          to label %133 unwind label %42

133:                                              ; preds = %130
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %16)
          to label %134 unwind label %42

134:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %136 = load ptr, ptr %135, align 8, !tbaa !5
  store ptr %136, ptr %13, align 8, !tbaa !5
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  %138 = icmp ne ptr %137, null
  br i1 %138, label %139, label %140

139:                                              ; preds = %134
  br label %142

140:                                              ; preds = %134
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 1209, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #7
  unreachable

141:                                              ; No predecessors!
  br label %142

142:                                              ; preds = %141, %139
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %"class.cascadb::Node", ptr %16, i32 0, i32 2
  %145 = load i64, ptr %144, align 8, !tbaa !41
  invoke void @_ZN7cascadb9InnerNode8rm_pivotEmRSt6vectorIPNS_8DataNodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(312) %143, i64 noundef %145, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %146 unwind label %150

146:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  store i32 0, ptr %10, align 4
  br label %147

147:                                              ; preds = %146, %63
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  %148 = load i32, ptr %10, align 4
  switch i32 %148, label %160 [
    i32 0, label %149
    i32 1, label %149
  ]

149:                                              ; preds = %147, %147, %20
  ret void

150:                                              ; preds = %142
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %8, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %154

154:                                              ; preds = %150, %112, %79, %42
  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 %155

155:                                              ; preds = %154
  %156 = load ptr, ptr %8, align 8
  %157 = load i32, ptr %9, align 4
  %158 = insertvalue { ptr, i32 } poison, ptr %156, 0
  %159 = insertvalue { ptr, i32 } %158, i32 %157, 1
  resume { ptr, i32 } %159

160:                                              ; preds = %147
  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

; 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 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!10, !15, i64 216}
!39 = !{!10, !15, i64 224}
!40 = !{!12, !17, i64 97}
!41 = !{!12, !15, i64 40}


; 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.39 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE = external hidden unnamed_addr constant [37 x i8], align 1
@.str.41 = 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 @_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 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 @_ZN7cascadb9InnerNode8rm_pivotEmRSt6vectorIPNS_8DataNodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(312), i64 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 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: 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 @_ZN7cascadb8LeafNode5mergeENS_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 %77

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 eq i64 %11, 0
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.40, ptr noundef nonnull @.str.1, i32 noundef 1163, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_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 1170, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #6
  unreachable

.loopexit30:                                      ; preds = %.lr.ph, %27
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %80

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

22:                                               ; preds = %17
  %23 = call noundef i64 @_ZN7cascadb13RecordBuckets4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %10)
  %.not = icmp eq i64 %23, 0
  br i1 %.not, label %32, label %.preheader

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

.lr.ph:                                           ; preds = %.preheader, %30
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %26 = load ptr, ptr %25, align 8, !tbaa !33
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %26)
          to label %27 unwind label %.loopexit30

27:                                               ; preds = %.lr.ph
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %29 = load ptr, ptr %28, align 8, !tbaa !33
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %29)
          to label %30 unwind label %.loopexit30

30:                                               ; preds = %27
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %31 = call noundef i64 @_ZNKSt6vectorIPN7cascadb8DataNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %.not28 = icmp eq i64 %31, 0
  br i1 %.not28, label %.loopexit, label %.lr.ph, !llvm.loop !34

32:                                               ; preds = %22
  %33 = getelementptr inbounds i8, ptr %0, i64 216
  %34 = load i64, ptr %33, align 8, !tbaa !36
  %35 = icmp ugt i64 %34, 281474976710656
  br i1 %35, label %36, label %50

36:                                               ; preds = %32
  %37 = load ptr, ptr %15, align 8, !tbaa !32
  %38 = invoke noundef ptr @_ZN7cascadb4Tree9load_nodeEmb(ptr noundef nonnull align 8 dereferenceable(184) %37, i64 noundef %34, i1 noundef zeroext false)
          to label %39 unwind label %41

39:                                               ; preds = %36
  %.not25 = icmp eq ptr %38, null
  br i1 %.not25, label %40, label %43

40:                                               ; preds = %39
  call void @__assert_fail(ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.1, i32 noundef 1184, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #6
  unreachable

41:                                               ; preds = %49, %48, %44, %43, %36
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %80

43:                                               ; preds = %39
  invoke void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %38)
          to label %44 unwind label %41

44:                                               ; preds = %43
  %45 = getelementptr inbounds i8, ptr %0, i64 224
  %46 = load i64, ptr %45, align 8, !tbaa !37
  %47 = getelementptr inbounds i8, ptr %38, i64 224
  store i64 %46, ptr %47, align 8, !tbaa !37
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %38, i1 noundef zeroext true)
          to label %48 unwind label %41

48:                                               ; preds = %44
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %38)
          to label %49 unwind label %41

49:                                               ; preds = %48
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %38)
          to label %50 unwind label %41

50:                                               ; preds = %49, %32
  %51 = getelementptr inbounds i8, ptr %0, i64 224
  %52 = load i64, ptr %51, align 8, !tbaa !37
  %53 = icmp ugt i64 %52, 281474976710656
  br i1 %53, label %54, label %67

54:                                               ; preds = %50
  %55 = load ptr, ptr %15, align 8, !tbaa !32
  %56 = invoke noundef ptr @_ZN7cascadb4Tree9load_nodeEmb(ptr noundef nonnull align 8 dereferenceable(184) %55, i64 noundef %52, i1 noundef zeroext false)
          to label %57 unwind label %59

57:                                               ; preds = %54
  %.not26 = icmp eq ptr %56, null
  br i1 %.not26, label %58, label %61

58:                                               ; preds = %57
  call void @__assert_fail(ptr noundef nonnull @.str.39, ptr noundef nonnull @.str.1, i32 noundef 1193, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #6
  unreachable

59:                                               ; preds = %66, %65, %62, %61, %54
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %80

61:                                               ; preds = %57
  invoke void @_ZN7cascadb4Node10write_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %56)
          to label %62 unwind label %59

62:                                               ; preds = %61
  %63 = load i64, ptr %33, align 8, !tbaa !36
  %64 = getelementptr inbounds i8, ptr %56, i64 216
  store i64 %63, ptr %64, align 8, !tbaa !36
  invoke void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %56, i1 noundef zeroext true)
          to label %65 unwind label %59

65:                                               ; preds = %62
  invoke void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %56)
          to label %66 unwind label %59

66:                                               ; preds = %65
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %56)
          to label %67 unwind label %59

67:                                               ; preds = %66, %50
  %68 = getelementptr inbounds i8, ptr %0, i64 97
  store i8 1, ptr %68, align 1, !tbaa !38
  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 %69 unwind label %.loopexit.split-lp

69:                                               ; preds = %67
  invoke void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
          to label %70 unwind label %.loopexit.split-lp

70:                                               ; preds = %69
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %72 = load ptr, ptr %71, align 8, !tbaa !33
  %.not27 = icmp eq ptr %72, null
  br i1 %.not27, label %73, label %74

73:                                               ; preds = %70
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 1209, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode5mergeENS_5SliceE) #6
  unreachable

74:                                               ; preds = %70
  %75 = getelementptr inbounds i8, ptr %0, i64 40
  %76 = load i64, ptr %75, align 8, !tbaa !39
  invoke void @_ZN7cascadb9InnerNode8rm_pivotEmRSt6vectorIPNS_8DataNodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(312) %72, i64 noundef %76, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %.loopexit unwind label %78

.loopexit:                                        ; preds = %30, %.preheader, %74
  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 %77

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

78:                                               ; preds = %74
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %80

80:                                               ; preds = %.loopexit30, %.loopexit.split-lp, %78, %59, %41
  %.pn = phi { ptr, i32 } [ %79, %78 ], [ %60, %59 ], [ %42, %41 ], [ %lpad.loopexit, %.loopexit30 ], [ %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 } %.pn
}

; 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

; 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 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!6, !14, i64 216}
!37 = !{!6, !14, i64 224}
!38 = !{!8, !16, i64 97}
!39 = !{!8, !14, i64 40}


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