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

; 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.cascadb::DataNode" = type <{ %"class.cascadb::Node", ptr, i32, [4 x i8] }>
%"class.cascadb::Node" = type { ptr, %"class.std::__cxx11::basic_string", i64, %"class.cascadb::Mutex", i8, i8, i8, %struct.timeval, %struct.timeval, i32, i32, %"class.cascadb::RWLock" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.cascadb::Mutex" = type { i8, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.timeval = type { i64, i64 }
%"class.cascadb::RWLock" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%"class.cascadb::Tree" = type { %"class.std::__cxx11::basic_string", %"class.cascadb::Options", ptr, ptr, ptr, ptr, ptr, ptr }
%"class.cascadb::Options" = type <{ ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"class.cascadb::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.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::Pivot" = type <{ %"class.cascadb::Slice", %"class.cascadb::Slice", i64, ptr, i32, i32, i32, i16, [2 x i8] }>

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode15load_all_msgbufERNS_11BlockReaderE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.cascadb::Slice", align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.cascadb::Slice", align 8
  %10 = alloca { ptr, i32 }, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.cascadb::Slice", align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca %"class.cascadb::Slice", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  call void @_ZN7cascadb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %6)
  %18 = getelementptr inbounds %"class.cascadb::DataNode", ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds %"class.cascadb::Tree", ptr %19, i32 0, i32 5
  %21 = load ptr, ptr %20, align 8, !tbaa !21
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %56

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %24 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 7
  %25 = load i32, ptr %24, align 8, !tbaa !25
  %26 = zext i32 %25 to i64
  store i64 %26, ptr %7, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !33
  br label %27

27:                                               ; preds = %50, %23
  %28 = load i64, ptr %8, align 8, !tbaa !33
  %29 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %30 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #6
  %31 = icmp ult i64 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %53

33:                                               ; preds = %27
  %34 = load i64, ptr %7, align 8, !tbaa !33
  %35 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %36 = load i64, ptr %8, align 8, !tbaa !33
  %37 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %36) #6
  %38 = getelementptr inbounds %"class.cascadb::Pivot", ptr %37, i32 0, i32 6
  %39 = load i32, ptr %38, align 8, !tbaa !34
  %40 = zext i32 %39 to i64
  %41 = icmp ult i64 %34, %40
  br i1 %41, label %42, label %49

42:                                               ; preds = %33
  %43 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %44 = load i64, ptr %8, align 8, !tbaa !33
  %45 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %44) #6
  %46 = getelementptr inbounds %"class.cascadb::Pivot", ptr %45, i32 0, i32 6
  %47 = load i32, ptr %46, align 8, !tbaa !34
  %48 = zext i32 %47 to i64
  store i64 %48, ptr %7, align 8, !tbaa !33
  br label %49

49:                                               ; preds = %42, %33
  br label %50

50:                                               ; preds = %49
  %51 = load i64, ptr %8, align 8, !tbaa !33
  %52 = add i64 %51, 1
  store i64 %52, ptr %8, align 8, !tbaa !33
  br label %27, !llvm.loop !36

53:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %54 = load i64, ptr %7, align 8, !tbaa !33
  %55 = call { ptr, i32 } @_ZN7cascadb5Slice5allocEm(i64 noundef %54)
  store { ptr, i32 } %55, ptr %10, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %10, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %9, i64 12, i1 false), !tbaa.struct !38
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %56

56:                                               ; preds = %53, %2
  %57 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 3
  %58 = load ptr, ptr %57, align 8, !tbaa !40
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %105

60:                                               ; preds = %56
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 5
  %63 = load i32, ptr %62, align 8, !tbaa !41
  %64 = zext i32 %63 to i64
  call void @_ZN7cascadb11BlockReader4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %61, i64 noundef %64)
  %65 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #7
  %66 = getelementptr inbounds %"class.cascadb::DataNode", ptr %17, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds %"class.cascadb::Tree", ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds %"class.cascadb::Options", ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !42
  invoke void @_ZN7cascadb6MsgBufC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(104) %65, ptr noundef %70)
          to label %71 unwind label %87

71:                                               ; preds = %60
  %72 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 3
  store ptr %65, ptr %72, align 8, !tbaa !40
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 6
  %75 = load i32, ptr %74, align 4, !tbaa !43
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 7
  %78 = load i32, ptr %77, align 8, !tbaa !25
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 3
  %81 = load ptr, ptr %80, align 8, !tbaa !40
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !38
  %82 = call noundef zeroext i1 @_ZN7cascadb9InnerNode11read_msgbufERNS_11BlockReaderEmmPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %17, ptr noundef nonnull align 8 dereferenceable(16) %73, i64 noundef %76, i64 noundef %79, ptr noundef %81, ptr noundef byval(%"class.cascadb::Slice") align 8 %13)
  br i1 %82, label %92, label %83

83:                                               ; preds = %71
  %84 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
  %85 = icmp ne i64 %84, 0
  br i1 %85, label %86, label %91

86:                                               ; preds = %83
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
  br label %91

87:                                               ; preds = %60
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %11, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %65, i64 noundef 104) #8
  br label %199

91:                                               ; preds = %86, %83
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %197

92:                                               ; preds = %71
  %93 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 3
  %94 = load ptr, ptr %93, align 8, !tbaa !40
  %95 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %94)
  %96 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 11
  %97 = load i64, ptr %96, align 8, !tbaa !44
  %98 = add i64 %97, %95
  store i64 %98, ptr %96, align 8, !tbaa !44
  %99 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 3
  %100 = load ptr, ptr %99, align 8, !tbaa !40
  %101 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %100)
  %102 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 12
  %103 = load i64, ptr %102, align 8, !tbaa !45
  %104 = add i64 %103, %101
  store i64 %104, ptr %102, align 8, !tbaa !45
  br label %105

105:                                              ; preds = %92, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !33
  br label %106

106:                                              ; preds = %186, %105
  %107 = load i64, ptr %15, align 8, !tbaa !33
  %108 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %109 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #6
  %110 = icmp ult i64 %107, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %106
  store i32 5, ptr %14, align 4
  br label %189

112:                                              ; preds = %106
  %113 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %114 = load i64, ptr %15, align 8, !tbaa !33
  %115 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %113, i64 noundef %114) #6
  %116 = getelementptr inbounds %"class.cascadb::Pivot", ptr %115, i32 0, i32 3
  %117 = load ptr, ptr %116, align 8, !tbaa !46
  %118 = icmp eq ptr %117, null
  br i1 %118, label %119, label %185

119:                                              ; preds = %112
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %122 = load i64, ptr %15, align 8, !tbaa !33
  %123 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %122) #6
  %124 = getelementptr inbounds %"class.cascadb::Pivot", ptr %123, i32 0, i32 4
  %125 = load i32, ptr %124, align 8, !tbaa !47
  %126 = zext i32 %125 to i64
  call void @_ZN7cascadb11BlockReader4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %120, i64 noundef %126)
  %127 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #7
  %128 = getelementptr inbounds %"class.cascadb::DataNode", ptr %17, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !9
  %130 = getelementptr inbounds %"class.cascadb::Tree", ptr %129, i32 0, i32 1
  %131 = getelementptr inbounds %"class.cascadb::Options", ptr %130, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !42
  invoke void @_ZN7cascadb6MsgBufC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(104) %127, ptr noundef %132)
          to label %133 unwind label %161

133:                                              ; preds = %119
  %134 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %135 = load i64, ptr %15, align 8, !tbaa !33
  %136 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %134, i64 noundef %135) #6
  %137 = getelementptr inbounds %"class.cascadb::Pivot", ptr %136, i32 0, i32 3
  store ptr %127, ptr %137, align 8, !tbaa !46
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %140 = load i64, ptr %15, align 8, !tbaa !33
  %141 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %139, i64 noundef %140) #6
  %142 = getelementptr inbounds %"class.cascadb::Pivot", ptr %141, i32 0, i32 5
  %143 = load i32, ptr %142, align 4, !tbaa !48
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %146 = load i64, ptr %15, align 8, !tbaa !33
  %147 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %145, i64 noundef %146) #6
  %148 = getelementptr inbounds %"class.cascadb::Pivot", ptr %147, i32 0, i32 6
  %149 = load i32, ptr %148, align 8, !tbaa !34
  %150 = zext i32 %149 to i64
  %151 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %152 = load i64, ptr %15, align 8, !tbaa !33
  %153 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %151, i64 noundef %152) #6
  %154 = getelementptr inbounds %"class.cascadb::Pivot", ptr %153, i32 0, i32 3
  %155 = load ptr, ptr %154, align 8, !tbaa !46
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !38
  %156 = call noundef zeroext i1 @_ZN7cascadb9InnerNode11read_msgbufERNS_11BlockReaderEmmPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %17, ptr noundef nonnull align 8 dereferenceable(16) %138, i64 noundef %144, i64 noundef %150, ptr noundef %155, ptr noundef byval(%"class.cascadb::Slice") align 8 %16)
  br i1 %156, label %166, label %157

157:                                              ; preds = %133
  %158 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
  %159 = icmp ne i64 %158, 0
  br i1 %159, label %160, label %165

160:                                              ; preds = %157
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
  br label %165

161:                                              ; preds = %119
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %11, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %127, i64 noundef 104) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %199

165:                                              ; preds = %160, %157
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %189

166:                                              ; preds = %133
  %167 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %168 = load i64, ptr %15, align 8, !tbaa !33
  %169 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %167, i64 noundef %168) #6
  %170 = getelementptr inbounds %"class.cascadb::Pivot", ptr %169, i32 0, i32 3
  %171 = load ptr, ptr %170, align 8, !tbaa !46
  %172 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %171)
  %173 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 11
  %174 = load i64, ptr %173, align 8, !tbaa !44
  %175 = add i64 %174, %172
  store i64 %175, ptr %173, align 8, !tbaa !44
  %176 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 9
  %177 = load i64, ptr %15, align 8, !tbaa !33
  %178 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %176, i64 noundef %177) #6
  %179 = getelementptr inbounds %"class.cascadb::Pivot", ptr %178, i32 0, i32 3
  %180 = load ptr, ptr %179, align 8, !tbaa !46
  %181 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %180)
  %182 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %17, i32 0, i32 12
  %183 = load i64, ptr %182, align 8, !tbaa !45
  %184 = add i64 %183, %181
  store i64 %184, ptr %182, align 8, !tbaa !45
  br label %185

185:                                              ; preds = %166, %112
  br label %186

186:                                              ; preds = %185
  %187 = load i64, ptr %15, align 8, !tbaa !33
  %188 = add i64 %187, 1
  store i64 %188, ptr %15, align 8, !tbaa !33
  br label %106, !llvm.loop !49

189:                                              ; preds = %165, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %190 = load i32, ptr %14, align 4
  switch i32 %190, label %197 [
    i32 5, label %191
  ]

191:                                              ; preds = %189
  %192 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
  %193 = icmp ne i64 %192, 0
  br i1 %193, label %194, label %195

194:                                              ; preds = %191
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
  br label %195

195:                                              ; preds = %194, %191
  %196 = getelementptr inbounds %"class.cascadb::DataNode", ptr %17, i32 0, i32 2
  store i32 3, ptr %196, align 8, !tbaa !50
  store i1 true, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %197

197:                                              ; preds = %195, %189, %91
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  %198 = load i1, ptr %3, align 1
  ret i1 %198

199:                                              ; preds = %161, %87
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  br label %200

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i32 } @_ZN7cascadb5Slice5allocEm(i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode11read_msgbufERNS_11BlockReaderEmmPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef, ptr noundef, ptr noundef byval(%"class.cascadb::Slice") align 8) #2 align 2

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

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


; 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] }>

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode15load_all_msgbufERNS_11BlockReaderE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.cascadb::Slice", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @_ZN7cascadb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 200
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 160
  %7 = load ptr, ptr %6, align 8, !tbaa !20
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %29, label %8

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 256
  %10 = load i32, ptr %9, align 8, !tbaa !24
  %11 = zext i32 %10 to i64
  %12 = getelementptr inbounds i8, ptr %0, i64 264
  %13 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %.not44 = icmp eq i64 %13, 0
  br i1 %.not44, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %25, %8
  %.029.lcssa = phi i64 [ %11, %8 ], [ %.130, %25 ]
  %14 = call { ptr, i32 } @_ZN7cascadb5Slice5allocEm(i64 noundef %.029.lcssa)
  %.fca.0.extract = extractvalue { ptr, i32 } %14, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %14, 1
  store ptr %.fca.0.extract, ptr %3, align 8, !tbaa !32
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !33
  br label %29

.lr.ph:                                           ; preds = %8, %25
  %.02939 = phi i64 [ %.130, %25 ], [ %11, %8 ]
  %.03138 = phi i64 [ %26, %25 ], [ 0, %8 ]
  %15 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %.03138) #5
  %16 = getelementptr inbounds i8, ptr %15, i64 56
  %17 = load i32, ptr %16, align 8, !tbaa !34
  %18 = zext i32 %17 to i64
  %19 = icmp ult i64 %.02939, %18
  br i1 %19, label %20, label %25

20:                                               ; preds = %.lr.ph
  %21 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %.03138) #5
  %22 = getelementptr inbounds i8, ptr %21, i64 56
  %23 = load i32, ptr %22, align 8, !tbaa !34
  %24 = zext i32 %23 to i64
  br label %25

25:                                               ; preds = %.lr.ph, %20
  %.130 = phi i64 [ %24, %20 ], [ %.02939, %.lr.ph ]
  %26 = add nuw i64 %.03138, 1
  %27 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %28 = icmp ult i64 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !36

29:                                               ; preds = %._crit_edge, %2
  %30 = getelementptr inbounds i8, ptr %0, i64 224
  %31 = load ptr, ptr %30, align 8, !tbaa !38
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %65

33:                                               ; preds = %29
  %34 = getelementptr inbounds i8, ptr %0, i64 248
  %35 = load i32, ptr %34, align 8, !tbaa !39
  %36 = zext i32 %35 to i64
  call void @_ZN7cascadb11BlockReader4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %36)
  %37 = call noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #6
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 40
  %40 = load ptr, ptr %39, align 8, !tbaa !40
  invoke void @_ZN7cascadb6MsgBufC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(104) %37, ptr noundef %40)
          to label %41 unwind label %52

41:                                               ; preds = %33
  store ptr %37, ptr %30, align 8, !tbaa !38
  %42 = getelementptr inbounds i8, ptr %0, i64 252
  %43 = load i32, ptr %42, align 4, !tbaa !41
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds i8, ptr %0, i64 256
  %46 = load i32, ptr %45, align 8, !tbaa !24
  %47 = zext i32 %46 to i64
  %48 = call noundef zeroext i1 @_ZN7cascadb9InnerNode11read_msgbufERNS_11BlockReaderEmmPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %44, i64 noundef %47, ptr noundef nonnull %37, ptr noundef nonnull byval(%"class.cascadb::Slice") align 8 %3)
  br i1 %48, label %54, label %49

49:                                               ; preds = %41
  %50 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  %.not32 = icmp eq i64 %50, 0
  br i1 %.not32, label %124, label %51

51:                                               ; preds = %49
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  br label %124

52:                                               ; preds = %33
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %125

54:                                               ; preds = %41
  %55 = load ptr, ptr %30, align 8, !tbaa !38
  %56 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %55)
  %57 = getelementptr inbounds i8, ptr %0, i64 296
  %58 = load i64, ptr %57, align 8, !tbaa !42
  %59 = add i64 %58, %56
  store i64 %59, ptr %57, align 8, !tbaa !42
  %60 = load ptr, ptr %30, align 8, !tbaa !38
  %61 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %60)
  %62 = getelementptr inbounds i8, ptr %0, i64 304
  %63 = load i64, ptr %62, align 8, !tbaa !43
  %64 = add i64 %63, %61
  store i64 %64, ptr %62, align 8, !tbaa !43
  br label %65

65:                                               ; preds = %54, %29
  %66 = getelementptr inbounds i8, ptr %0, i64 264
  %67 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %66) #5
  %.not3540.not = icmp eq i64 %67, 0
  br i1 %.not3540.not, label %.critedge, label %.lr.ph43

.lr.ph43:                                         ; preds = %65
  %68 = getelementptr inbounds i8, ptr %0, i64 296
  %69 = getelementptr inbounds i8, ptr %0, i64 304
  br label %70

70:                                               ; preds = %.lr.ph43, %117
  %.041 = phi i64 [ 0, %.lr.ph43 ], [ %118, %117 ]
  %71 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.041) #5
  %72 = getelementptr inbounds i8, ptr %71, i64 40
  %73 = load ptr, ptr %72, align 8, !tbaa !44
  %74 = icmp eq ptr %73, null
  br i1 %74, label %75, label %117

75:                                               ; preds = %70
  %76 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.041) #5
  %77 = getelementptr inbounds i8, ptr %76, i64 48
  %78 = load i32, ptr %77, align 8, !tbaa !45
  %79 = zext i32 %78 to i64
  call void @_ZN7cascadb11BlockReader4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %79)
  %80 = call noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #6
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 40
  %83 = load ptr, ptr %82, align 8, !tbaa !40
  invoke void @_ZN7cascadb6MsgBufC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(104) %80, ptr noundef %83)
          to label %84 unwind label %102

84:                                               ; preds = %75
  %85 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.041) #5
  %86 = getelementptr inbounds i8, ptr %85, i64 40
  store ptr %80, ptr %86, align 8, !tbaa !44
  %87 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.041) #5
  %88 = getelementptr inbounds i8, ptr %87, i64 52
  %89 = load i32, ptr %88, align 4, !tbaa !46
  %90 = zext i32 %89 to i64
  %91 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.041) #5
  %92 = getelementptr inbounds i8, ptr %91, i64 56
  %93 = load i32, ptr %92, align 8, !tbaa !34
  %94 = zext i32 %93 to i64
  %95 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.041) #5
  %96 = getelementptr inbounds i8, ptr %95, i64 40
  %97 = load ptr, ptr %96, align 8, !tbaa !44
  %98 = call noundef zeroext i1 @_ZN7cascadb9InnerNode11read_msgbufERNS_11BlockReaderEmmPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %90, i64 noundef %94, ptr noundef %97, ptr noundef nonnull byval(%"class.cascadb::Slice") align 8 %3)
  br i1 %98, label %104, label %99

99:                                               ; preds = %84
  %100 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  %.not34 = icmp eq i64 %100, 0
  br i1 %.not34, label %124, label %101

101:                                              ; preds = %99
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  br label %124

102:                                              ; preds = %75
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %125

104:                                              ; preds = %84
  %105 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.041) #5
  %106 = getelementptr inbounds i8, ptr %105, i64 40
  %107 = load ptr, ptr %106, align 8, !tbaa !44
  %108 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %107)
  %109 = load i64, ptr %68, align 8, !tbaa !42
  %110 = add i64 %109, %108
  store i64 %110, ptr %68, align 8, !tbaa !42
  %111 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.041) #5
  %112 = getelementptr inbounds i8, ptr %111, i64 40
  %113 = load ptr, ptr %112, align 8, !tbaa !44
  %114 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %113)
  %115 = load i64, ptr %69, align 8, !tbaa !43
  %116 = add i64 %115, %114
  store i64 %116, ptr %69, align 8, !tbaa !43
  br label %117

117:                                              ; preds = %70, %104
  %118 = add nuw i64 %.041, 1
  %119 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %66) #5
  %.not35 = icmp ult i64 %118, %119
  br i1 %.not35, label %70, label %.critedge, !llvm.loop !47

.critedge:                                        ; preds = %117, %65
  %120 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  %.not36 = icmp eq i64 %120, 0
  br i1 %.not36, label %122, label %121

121:                                              ; preds = %.critedge
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  br label %122

122:                                              ; preds = %121, %.critedge
  %123 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 3, ptr %123, align 8, !tbaa !48
  br label %124

124:                                              ; preds = %101, %99, %49, %51, %122
  %.1 = phi i1 [ true, %122 ], [ false, %51 ], [ false, %49 ], [ false, %99 ], [ false, %101 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  ret i1 %.1

125:                                              ; preds = %102, %52
  %.lcssa.sink = phi ptr [ %80, %102 ], [ %37, %52 ]
  %.pn = phi { ptr, i32 } [ %103, %102 ], [ %53, %52 ]
  call void @_ZdlPvm(ptr noundef nonnull %.lcssa.sink, i64 noundef 104) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i32 } @_ZN7cascadb5Slice5allocEm(i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode11read_msgbufERNS_11BlockReaderEmmPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef, ptr noundef, ptr noundef byval(%"class.cascadb::Slice") align 8) local_unnamed_addr #2 align 2

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

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


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