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

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

%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.cascadb::Pivot" = type <{ %"class.cascadb::Slice", %"class.cascadb::Slice", i64, ptr, i32, i32, i32, i16, [2 x i8] }>
%"class.cascadb::InnerNode" = type { %"class.cascadb::DataNode.base", i8, i64, ptr, %"class.cascadb::Slice", i32, i32, i32, i16, %"class.std::vector", i64, i64, i64 }
%"class.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" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.10 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.cascadb::Slice", align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca %"class.cascadb::Slice", align 8
  %20 = alloca %"class.cascadb::Slice", align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca %"class.cascadb::Pivot", align 8
  %27 = alloca %"class.cascadb::Slice", align 8
  %28 = alloca { ptr, i32 }, align 8
  %29 = alloca %"class.cascadb::Slice", align 8
  %30 = alloca ptr, align 8
  %31 = alloca %"class.cascadb::Slice", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %32 = load ptr, ptr %3, align 8
  %33 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %34 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #9
  %35 = icmp ugt i64 %34, 1
  br i1 %35, label %36, label %37

36:                                               ; preds = %2
  br label %39

37:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 381, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE) #10
  unreachable

38:                                               ; No predecessors!
  br label %39

39:                                               ; preds = %38, %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %40 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %41 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #9
  %42 = udiv i64 %41, 2
  store i64 %42, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %43 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %44 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #9
  %45 = load i64, ptr %5, align 8, !tbaa !9
  %46 = sub i64 %44, %45
  %47 = sub i64 %46, 1
  store i64 %47, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #9
  %48 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %49 = load i64, ptr %5, align 8, !tbaa !9
  %50 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %49) #9
  %51 = getelementptr inbounds %"class.cascadb::Pivot", ptr %50, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %51, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %52 = getelementptr inbounds %"class.cascadb::DataNode", ptr %32, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  %54 = call noundef ptr @_ZN7cascadb4Tree14new_inner_nodeEv(ptr noundef nonnull align 8 dereferenceable(184) %53)
  store ptr %54, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %56 = load i64, ptr %5, align 8, !tbaa !9
  %57 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %56) #9
  %58 = getelementptr inbounds %"class.cascadb::Pivot", ptr %57, i32 0, i32 2
  %59 = load i64, ptr %58, align 8, !tbaa !24
  %60 = icmp uge i64 %59, 281474976710657
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %61, i32 0, i32 1
  %63 = zext i1 %60 to i8
  store i8 %63, ptr %62, align 4, !tbaa !28
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %67

66:                                               ; preds = %39
  br label %69

67:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 388, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE) #10
  unreachable

68:                                               ; No predecessors!
  br label %69

69:                                               ; preds = %68, %66
  %70 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %71 = load i64, ptr %5, align 8, !tbaa !9
  %72 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %71) #9
  %73 = getelementptr inbounds %"class.cascadb::Pivot", ptr %72, i32 0, i32 2
  %74 = load i64, ptr %73, align 8, !tbaa !24
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %75, i32 0, i32 2
  store i64 %74, ptr %76, align 8, !tbaa !34
  %77 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %78 = load i64, ptr %5, align 8, !tbaa !9
  %79 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef %78) #9
  %80 = getelementptr inbounds %"class.cascadb::Pivot", ptr %79, i32 0, i32 3
  %81 = load ptr, ptr %80, align 8, !tbaa !35
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %82, i32 0, i32 3
  store ptr %81, ptr %83, align 8, !tbaa !36
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %84, i32 0, i32 9
  %86 = load i64, ptr %6, align 8, !tbaa !9
  call void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %86)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %87 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %88 = call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %87) #9
  %89 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %88, ptr %89, align 8
  %90 = load i64, ptr %5, align 8, !tbaa !9
  %91 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef %90) #9
  %92 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %91, ptr %92, align 8
  %93 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 1) #9
  %94 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %93, ptr %94, align 8
  %95 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %96 = call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %95) #9
  %97 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %96, ptr %97, align 8
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %98, i32 0, i32 9
  %100 = call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #9
  %101 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %100, ptr %101, align 8
  %102 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8
  %104 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8
  %106 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8
  %108 = call ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS3_SaIS3_EEEES8_ET0_T_SA_S9_(ptr %103, ptr %105, ptr %107)
  %109 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  %110 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 9
  %111 = load i64, ptr %5, align 8, !tbaa !9
  call void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %110, i64 noundef %111)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  store i64 0, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  store i64 0, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  store i64 0, ptr %17, align 8, !tbaa !9
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %112, i32 0, i32 3
  %114 = load ptr, ptr %113, align 8, !tbaa !36
  %115 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %114)
  %116 = load i64, ptr %16, align 8, !tbaa !9
  %117 = add i64 %116, %115
  store i64 %117, ptr %16, align 8, !tbaa !9
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %118, i32 0, i32 3
  %120 = load ptr, ptr %119, align 8, !tbaa !36
  %121 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %120)
  %122 = load i64, ptr %17, align 8, !tbaa !9
  %123 = add i64 %122, %121
  store i64 %123, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %124

124:                                              ; preds = %162, %69
  %125 = load i64, ptr %18, align 8, !tbaa !9
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %126, i32 0, i32 9
  %128 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %127) #9
  %129 = icmp ult i64 %125, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  br label %165

131:                                              ; preds = %124
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %132, i32 0, i32 9
  %134 = load i64, ptr %18, align 8, !tbaa !9
  %135 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %133, i64 noundef %134) #9
  %136 = getelementptr inbounds %"class.cascadb::Pivot", ptr %135, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %136, i64 16, i1 false), !tbaa.struct !11
  %137 = getelementptr inbounds { ptr, i32 }, ptr %19, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8
  %139 = getelementptr inbounds { ptr, i32 }, ptr %19, i32 0, i32 1
  %140 = load i32, ptr %139, align 8
  %141 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %32, ptr %138, i32 %140)
  %142 = load i64, ptr %15, align 8, !tbaa !9
  %143 = add i64 %142, %141
  store i64 %143, ptr %15, align 8, !tbaa !9
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %144, i32 0, i32 9
  %146 = load i64, ptr %18, align 8, !tbaa !9
  %147 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %145, i64 noundef %146) #9
  %148 = getelementptr inbounds %"class.cascadb::Pivot", ptr %147, i32 0, i32 3
  %149 = load ptr, ptr %148, align 8, !tbaa !35
  %150 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %149)
  %151 = load i64, ptr %16, align 8, !tbaa !9
  %152 = add i64 %151, %150
  store i64 %152, ptr %16, align 8, !tbaa !9
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %153, i32 0, i32 9
  %155 = load i64, ptr %18, align 8, !tbaa !9
  %156 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %154, i64 noundef %155) #9
  %157 = getelementptr inbounds %"class.cascadb::Pivot", ptr %156, i32 0, i32 3
  %158 = load ptr, ptr %157, align 8, !tbaa !35
  %159 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %158)
  %160 = load i64, ptr %17, align 8, !tbaa !9
  %161 = add i64 %160, %159
  store i64 %161, ptr %17, align 8, !tbaa !9
  br label %162

162:                                              ; preds = %131
  %163 = load i64, ptr %18, align 8, !tbaa !9
  %164 = add i64 %163, 1
  store i64 %164, ptr %18, align 8, !tbaa !9
  br label %124, !llvm.loop !37

165:                                              ; preds = %130
  %166 = load i64, ptr %15, align 8, !tbaa !9
  %167 = load ptr, ptr %8, align 8, !tbaa !5
  %168 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %167, i32 0, i32 10
  store i64 %166, ptr %168, align 8, !tbaa !39
  %169 = load i64, ptr %16, align 8, !tbaa !9
  %170 = load ptr, ptr %8, align 8, !tbaa !5
  %171 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %170, i32 0, i32 11
  store i64 %169, ptr %171, align 8, !tbaa !40
  %172 = load i64, ptr %17, align 8, !tbaa !9
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %173, i32 0, i32 12
  store i64 %172, ptr %174, align 8, !tbaa !41
  %175 = load i64, ptr %15, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !11
  %176 = getelementptr inbounds { ptr, i32 }, ptr %20, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8
  %178 = getelementptr inbounds { ptr, i32 }, ptr %20, i32 0, i32 1
  %179 = load i32, ptr %178, align 8
  %180 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %32, ptr %177, i32 %179)
  %181 = add i64 %175, %180
  %182 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 10
  %183 = load i64, ptr %182, align 8, !tbaa !39
  %184 = sub i64 %183, %181
  store i64 %184, ptr %182, align 8, !tbaa !39
  %185 = load i64, ptr %16, align 8, !tbaa !9
  %186 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 11
  %187 = load i64, ptr %186, align 8, !tbaa !40
  %188 = sub i64 %187, %185
  store i64 %188, ptr %186, align 8, !tbaa !40
  %189 = load i64, ptr %17, align 8, !tbaa !9
  %190 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %32, i32 0, i32 12
  %191 = load i64, ptr %190, align 8, !tbaa !41
  %192 = sub i64 %191, %189
  store i64 %192, ptr %190, align 8, !tbaa !41
  %193 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %193, i1 noundef zeroext true)
  %194 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %194)
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %195) #9
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %32)
  call void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %32)
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = call noundef i64 @_ZNKSt6vectorIPN7cascadb8DataNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %196) #9
  %198 = icmp eq i64 %197, 0
  br i1 %198, label %199, label %280

199:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %200 = getelementptr inbounds %"class.cascadb::DataNode", ptr %32, i32 0, i32 1
  %201 = load ptr, ptr %200, align 8, !tbaa !14
  %202 = call noundef ptr @_ZN7cascadb4Tree14new_inner_nodeEv(ptr noundef nonnull align 8 dereferenceable(184) %201)
  store ptr %202, ptr %21, align 8, !tbaa !5
  %203 = load ptr, ptr %21, align 8, !tbaa !5
  %204 = icmp ne ptr %203, null
  br i1 %204, label %205, label %206

205:                                              ; preds = %199
  br label %208

206:                                              ; preds = %199
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 424, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE) #10
  unreachable

207:                                              ; No predecessors!
  br label %208

208:                                              ; preds = %207, %205
  %209 = load ptr, ptr %21, align 8, !tbaa !5
  %210 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %209, i32 0, i32 1
  store i8 0, ptr %210, align 4, !tbaa !28
  %211 = getelementptr inbounds %"class.cascadb::Node", ptr %32, i32 0, i32 2
  %212 = load i64, ptr %211, align 8, !tbaa !42
  %213 = load ptr, ptr %21, align 8, !tbaa !5
  %214 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %213, i32 0, i32 2
  store i64 %212, ptr %214, align 8, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %215 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #11
  %216 = getelementptr inbounds %"class.cascadb::DataNode", ptr %32, i32 0, i32 1
  %217 = load ptr, ptr %216, align 8, !tbaa !14
  %218 = getelementptr inbounds %"class.cascadb::Tree", ptr %217, i32 0, i32 1
  %219 = getelementptr inbounds %"class.cascadb::Options", ptr %218, i32 0, i32 1
  %220 = load ptr, ptr %219, align 8, !tbaa !43
  invoke void @_ZN7cascadb6MsgBufC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(104) %215, ptr noundef %220)
          to label %221 unwind label %271

221:                                              ; preds = %208
  store ptr %215, ptr %22, align 8, !tbaa !5
  %222 = load ptr, ptr %22, align 8, !tbaa !5
  %223 = load ptr, ptr %21, align 8, !tbaa !5
  %224 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %223, i32 0, i32 3
  store ptr %222, ptr %224, align 8, !tbaa !36
  %225 = load ptr, ptr %22, align 8, !tbaa !5
  %226 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %225)
  %227 = load ptr, ptr %21, align 8, !tbaa !5
  %228 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %227, i32 0, i32 12
  %229 = load i64, ptr %228, align 8, !tbaa !41
  %230 = add i64 %229, %226
  store i64 %230, ptr %228, align 8, !tbaa !41
  %231 = load ptr, ptr %21, align 8, !tbaa !5
  %232 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %231, i32 0, i32 9
  call void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %232, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %233 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #11
  %234 = getelementptr inbounds %"class.cascadb::DataNode", ptr %32, i32 0, i32 1
  %235 = load ptr, ptr %234, align 8, !tbaa !14
  %236 = getelementptr inbounds %"class.cascadb::Tree", ptr %235, i32 0, i32 1
  %237 = getelementptr inbounds %"class.cascadb::Options", ptr %236, i32 0, i32 1
  %238 = load ptr, ptr %237, align 8, !tbaa !43
  invoke void @_ZN7cascadb6MsgBufC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(104) %233, ptr noundef %238)
          to label %239 unwind label %275

239:                                              ; preds = %221
  store ptr %233, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %26) #9
  %240 = call { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12) %7)
  store { ptr, i32 } %240, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %28, i64 12, i1 false)
  %241 = load ptr, ptr %8, align 8, !tbaa !5
  %242 = getelementptr inbounds %"class.cascadb::Node", ptr %241, i32 0, i32 2
  %243 = load i64, ptr %242, align 8, !tbaa !42
  %244 = load ptr, ptr %25, align 8, !tbaa !5
  %245 = getelementptr inbounds { ptr, i32 }, ptr %27, i32 0, i32 0
  %246 = load ptr, ptr %245, align 8
  %247 = getelementptr inbounds { ptr, i32 }, ptr %27, i32 0, i32 1
  %248 = load i32, ptr %247, align 8
  call void @_ZN7cascadb5PivotC2ENS_5SliceEmPNS_6MsgBufE(ptr noundef nonnull align 8 dereferenceable(62) %26, ptr %246, i32 %248, i64 noundef %243, ptr noundef %244)
  %249 = load ptr, ptr %21, align 8, !tbaa !5
  %250 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %249, i32 0, i32 9
  %251 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %250, i64 noundef 0) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %251, ptr align 8 %26, i64 62, i1 false), !tbaa.struct !47
  call void @llvm.lifetime.end.p0(i64 64, ptr %26) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !11
  %252 = getelementptr inbounds { ptr, i32 }, ptr %29, i32 0, i32 0
  %253 = load ptr, ptr %252, align 8
  %254 = getelementptr inbounds { ptr, i32 }, ptr %29, i32 0, i32 1
  %255 = load i32, ptr %254, align 8
  %256 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %32, ptr %253, i32 %255)
  %257 = load ptr, ptr %21, align 8, !tbaa !5
  %258 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %257, i32 0, i32 10
  %259 = load i64, ptr %258, align 8, !tbaa !39
  %260 = add i64 %259, %256
  store i64 %260, ptr %258, align 8, !tbaa !39
  %261 = load ptr, ptr %25, align 8, !tbaa !5
  %262 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %261)
  %263 = load ptr, ptr %21, align 8, !tbaa !5
  %264 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %263, i32 0, i32 12
  %265 = load i64, ptr %264, align 8, !tbaa !41
  %266 = add i64 %265, %262
  store i64 %266, ptr %264, align 8, !tbaa !41
  %267 = load ptr, ptr %21, align 8, !tbaa !5
  call void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %267, i1 noundef zeroext true)
  %268 = getelementptr inbounds %"class.cascadb::DataNode", ptr %32, i32 0, i32 1
  %269 = load ptr, ptr %268, align 8, !tbaa !14
  %270 = load ptr, ptr %21, align 8, !tbaa !5
  call void @_ZN7cascadb4Tree6pileupEPNS_9InnerNodeE(ptr noundef nonnull align 8 dereferenceable(184) %269, ptr noundef %270)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %299

271:                                              ; preds = %208
  %272 = landingpad { ptr, i32 }
          cleanup
  %273 = extractvalue { ptr, i32 } %272, 0
  store ptr %273, ptr %23, align 8
  %274 = extractvalue { ptr, i32 } %272, 1
  store i32 %274, ptr %24, align 4
  call void @_ZdlPvm(ptr noundef %215, i64 noundef 104) #12
  br label %279

275:                                              ; preds = %221
  %276 = landingpad { ptr, i32 }
          cleanup
  %277 = extractvalue { ptr, i32 } %276, 0
  store ptr %277, ptr %23, align 8
  %278 = extractvalue { ptr, i32 } %276, 1
  store i32 %278, ptr %24, align 4
  call void @_ZdlPvm(ptr noundef %233, i64 noundef 104) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %279

279:                                              ; preds = %275, %271
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  br label %300

280:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %281 = load ptr, ptr %4, align 8, !tbaa !5
  %282 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %281) #9
  %283 = load ptr, ptr %282, align 8, !tbaa !5
  store ptr %283, ptr %30, align 8, !tbaa !5
  %284 = load ptr, ptr %30, align 8, !tbaa !5
  %285 = icmp ne ptr %284, null
  br i1 %285, label %286, label %287

286:                                              ; preds = %280
  br label %289

287:                                              ; preds = %280
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 443, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE) #10
  unreachable

288:                                              ; No predecessors!
  br label %289

289:                                              ; preds = %288, %286
  %290 = load ptr, ptr %30, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !11
  %291 = load ptr, ptr %8, align 8, !tbaa !5
  %292 = getelementptr inbounds %"class.cascadb::Node", ptr %291, i32 0, i32 2
  %293 = load i64, ptr %292, align 8, !tbaa !42
  %294 = load ptr, ptr %4, align 8, !tbaa !5
  %295 = getelementptr inbounds { ptr, i32 }, ptr %31, i32 0, i32 0
  %296 = load ptr, ptr %295, align 8
  %297 = getelementptr inbounds { ptr, i32 }, ptr %31, i32 0, i32 1
  %298 = load i32, ptr %297, align 8
  call void @_ZN7cascadb9InnerNode9add_pivotENS_5SliceEmRSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(312) %290, ptr %296, i32 %298, i64 noundef %293, ptr noundef nonnull align 8 dereferenceable(24) %294)
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  br label %299

299:                                              ; preds = %289, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  ret void

300:                                              ; preds = %279
  %301 = load ptr, ptr %23, align 8
  %302 = load i32, ptr %24, align 4
  %303 = insertvalue { ptr, i32 } poison, ptr %301, 0
  %304 = insertvalue { ptr, i32 } %303, i32 %302, 1
  resume { ptr, i32 } %304
}

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

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

declare noundef ptr @_ZN7cascadb4Tree14new_inner_nodeEv(ptr noundef nonnull align 8 dereferenceable(184)) #7

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS3_SaIS3_EEEES8_ET0_T_SA_S9_(ptr, ptr, ptr) #8

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

declare void @_ZN7cascadb4Tree6pileupEPNS_9InnerNodeE(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{i64 0, i64 8, !5, i64 8, i64 4, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 200}
!15 = !{!"_ZTSN7cascadb8DataNodeE", !16, i64 0, !6, i64 200, !23, i64 208}
!16 = !{!"_ZTSN7cascadb4NodeE", !17, i64 8, !10, i64 40, !19, i64 48, !20, i64 96, !20, i64 97, !20, i64 98, !21, i64 104, !21, i64 120, !13, i64 136, !13, i64 140, !22, i64 144}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !10, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!19 = !{!"_ZTSN7cascadb5MutexE", !20, i64 0, !7, i64 8}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTS7timeval", !10, i64 0, !10, i64 8}
!22 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!23 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!24 = !{!25, !10, i64 32}
!25 = !{!"_ZTSN7cascadb5PivotE", !26, i64 0, !26, i64 16, !10, i64 32, !6, i64 40, !13, i64 48, !13, i64 52, !13, i64 56, !27, i64 60}
!26 = !{!"_ZTSN7cascadb5SliceE", !6, i64 0, !13, i64 8}
!27 = !{!"short", !7, i64 0}
!28 = !{!29, !20, i64 212}
!29 = !{!"_ZTSN7cascadb9InnerNodeE", !15, i64 0, !20, i64 212, !10, i64 216, !6, i64 224, !26, i64 232, !13, i64 248, !13, i64 252, !13, i64 256, !27, i64 260, !30, i64 264, !10, i64 288, !10, i64 296, !10, i64 304}
!30 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!29, !10, i64 216}
!35 = !{!25, !6, i64 40}
!36 = !{!29, !6, i64 224}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!29, !10, i64 288}
!40 = !{!29, !10, i64 296}
!41 = !{!29, !10, i64 304}
!42 = !{!16, !10, i64 40}
!43 = !{!44, !6, i64 40}
!44 = !{!"_ZTSN7cascadb4TreeE", !17, i64 0, !45, i64 32, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!45 = !{!"_ZTSN7cascadb7OptionsE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !46, i64 96, !20, i64 100}
!46 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!47 = !{i64 0, i64 8, !5, i64 8, i64 4, !12, i64 16, i64 8, !5, i64 24, i64 4, !12, i64 32, i64 8, !9, i64 40, i64 8, !5, i64 48, i64 4, !12, i64 52, i64 4, !12, i64 56, i64 4, !12, i64 60, i64 2, !48}
!48 = !{!27, !27, i64 0}


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

%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.cascadb::Pivot" = type <{ %"class.cascadb::Slice", %"class.cascadb::Slice", i64, ptr, i32, i32, i32, i16, [2 x i8] }>

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE = external hidden unnamed_addr constant [58 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress 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) #6

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.cascadb::Slice", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.cascadb::Pivot", align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 264
  %8 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #9
  %9 = icmp ugt i64 %8, 1
  br i1 %9, label %11, label %10

10:                                               ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 381, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE) #10
  unreachable

11:                                               ; preds = %2
  %12 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #9
  %13 = lshr i64 %12, 1
  %14 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #9
  %15 = tail call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %13) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %15, i64 16, i1 false), !tbaa.struct !5
  %16 = getelementptr inbounds i8, ptr %0, i64 200
  %17 = load ptr, ptr %16, align 8, !tbaa !12
  %18 = tail call noundef ptr @_ZN7cascadb4Tree14new_inner_nodeEv(ptr noundef nonnull align 8 dereferenceable(184) %17)
  %19 = tail call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %13) #9
  %20 = getelementptr inbounds i8, ptr %19, i64 32
  %21 = load i64, ptr %20, align 8, !tbaa !23
  %22 = icmp ugt i64 %21, 281474976710656
  %23 = getelementptr inbounds i8, ptr %18, i64 212
  %24 = zext i1 %22 to i8
  store i8 %24, ptr %23, align 4, !tbaa !27
  %25 = xor i64 %13, -1
  %26 = add i64 %14, %25
  %27 = tail call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %13) #9
  %28 = getelementptr inbounds i8, ptr %27, i64 32
  %29 = load i64, ptr %28, align 8, !tbaa !23
  %30 = getelementptr inbounds i8, ptr %18, i64 216
  store i64 %29, ptr %30, align 8, !tbaa !33
  %31 = tail call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %13) #9
  %32 = getelementptr inbounds i8, ptr %31, i64 40
  %33 = load ptr, ptr %32, align 8, !tbaa !34
  %34 = getelementptr inbounds i8, ptr %18, i64 224
  store ptr %33, ptr %34, align 8, !tbaa !35
  %35 = getelementptr inbounds i8, ptr %18, i64 264
  tail call void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %26)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %36 = tail call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #9
  store ptr %36, ptr %5, align 8
  %37 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %13) #9
  store ptr %37, ptr %4, align 8
  %38 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 1) #9
  %39 = call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #9
  %40 = call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #9
  %41 = call ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS3_SaIS3_EEEES8_ET0_T_SA_S9_(ptr %38, ptr %39, ptr %40)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %13)
  %42 = load ptr, ptr %34, align 8, !tbaa !35
  %43 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %42)
  %44 = load ptr, ptr %34, align 8, !tbaa !35
  %45 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %44)
  %46 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #9
  %.not = icmp eq i64 %46, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %11
  %.084.lcssa = phi i64 [ %45, %11 ], [ %75, %.lr.ph ]
  %.083.lcssa = phi i64 [ %43, %11 ], [ %70, %.lr.ph ]
  %.0.lcssa = phi i64 [ 0, %11 ], [ %65, %.lr.ph ]
  %47 = getelementptr inbounds i8, ptr %18, i64 288
  store i64 %.0.lcssa, ptr %47, align 8, !tbaa !36
  %48 = getelementptr inbounds i8, ptr %18, i64 296
  store i64 %.083.lcssa, ptr %48, align 8, !tbaa !37
  %49 = getelementptr inbounds i8, ptr %18, i64 304
  store i64 %.084.lcssa, ptr %49, align 8, !tbaa !38
  %.sroa.025.0.copyload = load ptr, ptr %3, align 8, !tbaa !6
  %.sroa.226.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %.sroa.226.0.copyload = load i32, ptr %.sroa.226.0..sroa_idx, align 8, !tbaa !10
  %50 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr %.sroa.025.0.copyload, i32 %.sroa.226.0.copyload)
  %51 = getelementptr inbounds i8, ptr %0, i64 288
  %52 = load i64, ptr %51, align 8, !tbaa !36
  %53 = add i64 %50, %.0.lcssa
  %54 = sub i64 %52, %53
  store i64 %54, ptr %51, align 8, !tbaa !36
  %55 = getelementptr inbounds i8, ptr %0, i64 296
  %56 = load i64, ptr %55, align 8, !tbaa !37
  %57 = sub i64 %56, %.083.lcssa
  store i64 %57, ptr %55, align 8, !tbaa !37
  %58 = getelementptr inbounds i8, ptr %0, i64 304
  %59 = load i64, ptr %58, align 8, !tbaa !38
  %60 = sub i64 %59, %.084.lcssa
  store i64 %60, ptr %58, align 8, !tbaa !38
  call void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %18, i1 noundef zeroext true)
  call void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %18)
  call void @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  call void @_ZN7cascadb4Node7dec_refEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  %61 = call noundef i64 @_ZNKSt6vectorIPN7cascadb8DataNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %62 = icmp eq i64 %61, 0
  br i1 %62, label %79, label %121

.lr.ph:                                           ; preds = %11, %.lr.ph
  %.098 = phi i64 [ %65, %.lr.ph ], [ 0, %11 ]
  %.08397 = phi i64 [ %70, %.lr.ph ], [ %43, %11 ]
  %.08496 = phi i64 [ %75, %.lr.ph ], [ %45, %11 ]
  %.08595 = phi i64 [ %76, %.lr.ph ], [ 0, %11 ]
  %63 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %.08595) #9
  %.sroa.028.0.copyload = load ptr, ptr %63, align 8, !tbaa !6
  %.sroa.229.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 8
  %.sroa.229.0.copyload = load i32, ptr %.sroa.229.0..sroa_idx, align 8, !tbaa !10
  %64 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr %.sroa.028.0.copyload, i32 %.sroa.229.0.copyload)
  %65 = add i64 %64, %.098
  %66 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %.08595) #9
  %67 = getelementptr inbounds i8, ptr %66, i64 40
  %68 = load ptr, ptr %67, align 8, !tbaa !34
  %69 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %68)
  %70 = add i64 %69, %.08397
  %71 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %.08595) #9
  %72 = getelementptr inbounds i8, ptr %71, i64 40
  %73 = load ptr, ptr %72, align 8, !tbaa !34
  %74 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %73)
  %75 = add i64 %74, %.08496
  %76 = add nuw i64 %.08595, 1
  %77 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #9
  %78 = icmp ult i64 %76, %77
  br i1 %78, label %.lr.ph, label %._crit_edge, !llvm.loop !39

79:                                               ; preds = %._crit_edge
  %80 = load ptr, ptr %16, align 8, !tbaa !12
  %81 = call noundef ptr @_ZN7cascadb4Tree14new_inner_nodeEv(ptr noundef nonnull align 8 dereferenceable(184) %80)
  %.not92 = icmp eq ptr %81, null
  br i1 %.not92, label %82, label %83

82:                                               ; preds = %79
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 424, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE) #10
  unreachable

83:                                               ; preds = %79
  %84 = getelementptr inbounds i8, ptr %81, i64 212
  store i8 0, ptr %84, align 4, !tbaa !27
  %85 = getelementptr inbounds i8, ptr %0, i64 40
  %86 = load i64, ptr %85, align 8, !tbaa !41
  %87 = getelementptr inbounds i8, ptr %81, i64 216
  store i64 %86, ptr %87, align 8, !tbaa !33
  %88 = call noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #11
  %89 = load ptr, ptr %16, align 8, !tbaa !12
  %90 = getelementptr inbounds i8, ptr %89, i64 40
  %91 = load ptr, ptr %90, align 8, !tbaa !42
  invoke void @_ZN7cascadb6MsgBufC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(104) %88, ptr noundef %91)
          to label %92 unwind label %116

92:                                               ; preds = %83
  %93 = getelementptr inbounds i8, ptr %81, i64 224
  store ptr %88, ptr %93, align 8, !tbaa !35
  %94 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %88)
  %95 = getelementptr inbounds i8, ptr %81, i64 304
  %96 = load i64, ptr %95, align 8, !tbaa !38
  %97 = add i64 %96, %94
  store i64 %97, ptr %95, align 8, !tbaa !38
  %98 = getelementptr inbounds i8, ptr %81, i64 264
  call void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef 1)
  %99 = call noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #11
  %100 = load ptr, ptr %16, align 8, !tbaa !12
  %101 = getelementptr inbounds i8, ptr %100, i64 40
  %102 = load ptr, ptr %101, align 8, !tbaa !42
  invoke void @_ZN7cascadb6MsgBufC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(104) %99, ptr noundef %102)
          to label %103 unwind label %118

103:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #9
  %104 = call { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  %.fca.0.extract = extractvalue { ptr, i32 } %104, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %104, 1
  %105 = getelementptr inbounds i8, ptr %18, i64 40
  %106 = load i64, ptr %105, align 8, !tbaa !41
  call void @_ZN7cascadb5PivotC2ENS_5SliceEmPNS_6MsgBufE(ptr noundef nonnull align 8 dereferenceable(62) %6, ptr %.fca.0.extract, i32 %.fca.1.extract, i64 noundef %106, ptr noundef nonnull %99)
  %107 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef 0) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(62) %107, ptr noundef nonnull align 8 dereferenceable(62) %6, i64 62, i1 false), !tbaa.struct !46
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #9
  %.sroa.02.0.copyload = load ptr, ptr %3, align 8, !tbaa !6
  %.sroa.23.0.copyload = load i32, ptr %.sroa.226.0..sroa_idx, align 8, !tbaa !10
  %108 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr %.sroa.02.0.copyload, i32 %.sroa.23.0.copyload)
  %109 = getelementptr inbounds i8, ptr %81, i64 288
  %110 = load i64, ptr %109, align 8, !tbaa !36
  %111 = add i64 %110, %108
  store i64 %111, ptr %109, align 8, !tbaa !36
  %112 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %99)
  %113 = load i64, ptr %95, align 8, !tbaa !38
  %114 = add i64 %113, %112
  store i64 %114, ptr %95, align 8, !tbaa !38
  call void @_ZN7cascadb4Node9set_dirtyEb(ptr noundef nonnull align 8 dereferenceable(200) %81, i1 noundef zeroext true)
  %115 = load ptr, ptr %16, align 8, !tbaa !12
  call void @_ZN7cascadb4Tree6pileupEPNS_9InnerNodeE(ptr noundef nonnull align 8 dereferenceable(184) %115, ptr noundef nonnull %81)
  br label %128

116:                                              ; preds = %83
  %117 = landingpad { ptr, i32 }
          cleanup
  br label %120

118:                                              ; preds = %92
  %119 = landingpad { ptr, i32 }
          cleanup
  br label %120

120:                                              ; preds = %118, %116
  %.sink = phi ptr [ %99, %118 ], [ %88, %116 ]
  %.pn = phi { ptr, i32 } [ %119, %118 ], [ %117, %116 ]
  call void @_ZdlPvm(ptr noundef nonnull %.sink, i64 noundef 104) #12
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn

121:                                              ; preds = %._crit_edge
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7cascadb8DataNodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #9
  %123 = load ptr, ptr %122, align 8, !tbaa !6
  %.not91 = icmp eq ptr %123, null
  br i1 %.not91, label %124, label %125

124:                                              ; preds = %121
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 443, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb9InnerNode5splitERSt6vectorIPNS_8DataNodeESaIS3_EE) #10
  unreachable

125:                                              ; preds = %121
  %126 = getelementptr inbounds i8, ptr %18, i64 40
  %127 = load i64, ptr %126, align 8, !tbaa !41
  call void @_ZN7cascadb9InnerNode9add_pivotENS_5SliceEmRSt6vectorIPNS_8DataNodeESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(312) %123, ptr %.sroa.025.0.copyload, i32 %.sroa.226.0.copyload, i64 noundef %127, ptr noundef nonnull align 8 dereferenceable(24) %1)
  br label %128

128:                                              ; preds = %125, %103
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #9
  ret void
}

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

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

declare noundef ptr @_ZN7cascadb4Tree14new_inner_nodeEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #7

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS3_SaIS3_EEEES8_ET0_T_SA_S9_(ptr, ptr, ptr) local_unnamed_addr #8

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

declare void @_ZN7cascadb4Tree6pileupEPNS_9InnerNodeE(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) local_unnamed_addr #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 0, i64 8, !6, i64 8, i64 4, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!13, !7, i64 200}
!13 = !{!"_ZTSN7cascadb8DataNodeE", !14, i64 0, !7, i64 200, !22, i64 208}
!14 = !{!"_ZTSN7cascadb4NodeE", !15, i64 8, !17, i64 40, !18, i64 48, !19, i64 96, !19, i64 97, !19, i64 98, !20, i64 104, !20, i64 120, !11, i64 136, !11, i64 140, !21, i64 144}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !8, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = !{!"_ZTSN7cascadb5MutexE", !19, i64 0, !8, i64 8}
!19 = !{!"bool", !8, i64 0}
!20 = !{!"_ZTS7timeval", !17, i64 0, !17, i64 8}
!21 = !{!"_ZTSN7cascadb6RWLockE", !8, i64 0}
!22 = !{!"_ZTSN7cascadb10NodeStatusE", !8, i64 0}
!23 = !{!24, !17, i64 32}
!24 = !{!"_ZTSN7cascadb5PivotE", !25, i64 0, !25, i64 16, !17, i64 32, !7, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !26, i64 60}
!25 = !{!"_ZTSN7cascadb5SliceE", !7, i64 0, !11, i64 8}
!26 = !{!"short", !8, i64 0}
!27 = !{!28, !19, i64 212}
!28 = !{!"_ZTSN7cascadb9InnerNodeE", !13, i64 0, !19, i64 212, !17, i64 216, !7, i64 224, !25, i64 232, !11, i64 248, !11, i64 252, !11, i64 256, !26, i64 260, !29, i64 264, !17, i64 288, !17, i64 296, !17, i64 304}
!29 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!33 = !{!28, !17, i64 216}
!34 = !{!24, !7, i64 40}
!35 = !{!28, !7, i64 224}
!36 = !{!28, !17, i64 288}
!37 = !{!28, !17, i64 296}
!38 = !{!28, !17, i64 304}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!14, !17, i64 40}
!42 = !{!43, !7, i64 40}
!43 = !{!"_ZTSN7cascadb4TreeE", !15, i64 0, !44, i64 32, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!44 = !{!"_ZTSN7cascadb7OptionsE", !7, i64 0, !7, i64 8, !17, i64 16, !17, i64 24, !17, i64 32, !17, i64 40, !17, i64 48, !17, i64 56, !17, i64 64, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !45, i64 96, !19, i64 100}
!45 = !{!"_ZTSN7cascadb8CompressE", !8, i64 0}
!46 = !{i64 0, i64 8, !6, i64 8, i64 4, !10, i64 16, i64 8, !6, i64 24, i64 4, !10, i64 32, i64 8, !47, i64 40, i64 8, !6, i64 48, i64 4, !10, i64 52, i64 4, !10, i64 56, i64 4, !10, i64 60, i64 2, !48}
!47 = !{!17, !17, i64 0}
!48 = !{!26, !26, i64 0}


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