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

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

%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.std::__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::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.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::Pivot" = type <{ %"class.cascadb::Slice", %"class.cascadb::Slice", i64, ptr, i32, i32, i32, i16, [2 x i8] }>
%"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] }>

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #0 align 2

; 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)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104)) #0 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 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 noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312), ptr, i32) #0 align 2

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

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

declare noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef, i32 noundef) #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode8write_toERNS_11BlockWriterERm(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.cascadb::Slice", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.cascadb::Slice", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"class.cascadb::Slice", align 8
  %17 = alloca { ptr, i32 }, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"class.cascadb::Slice", align 8
  %20 = alloca i64, align 8
  %21 = alloca %"class.cascadb::Slice", align 8
  %22 = alloca i64, align 8
  %23 = alloca %"class.std::__cxx11::basic_string", align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca %"class.cascadb::Slice", align 8
  %27 = alloca i64, align 8
  %28 = alloca %"class.cascadb::Slice", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
  store i64 %31, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %32 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 3
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %33)
  %35 = trunc i64 %34 to i32
  %36 = call noundef i64 @_ZN7cascadb9InnerNode10bloom_sizeEi(ptr noundef nonnull align 8 dereferenceable(312) %29, i32 noundef %35)
  %37 = add i64 27, %36
  store i64 %37, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %66, %3
  %39 = load i64, ptr %10, align 8, !tbaa !9
  %40 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %41 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #5
  %42 = icmp ult i64 %39, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %69

44:                                               ; preds = %38
  %45 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %46 = load i64, ptr %10, align 8, !tbaa !9
  %47 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %46) #5
  %48 = getelementptr inbounds %"class.cascadb::Pivot", ptr %47, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %48, i64 16, i1 false), !tbaa.struct !29
  %49 = getelementptr inbounds { ptr, i32 }, ptr %11, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8
  %51 = getelementptr inbounds { ptr, i32 }, ptr %11, i32 0, i32 1
  %52 = load i32, ptr %51, align 8
  %53 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %29, ptr %50, i32 %52)
  %54 = load i64, ptr %9, align 8, !tbaa !9
  %55 = add i64 %54, %53
  store i64 %55, ptr %9, align 8, !tbaa !9
  %56 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %57 = load i64, ptr %10, align 8, !tbaa !9
  %58 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %57) #5
  %59 = getelementptr inbounds %"class.cascadb::Pivot", ptr %58, i32 0, i32 3
  %60 = load ptr, ptr %59, align 8, !tbaa !31
  %61 = call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %60)
  %62 = trunc i64 %61 to i32
  %63 = call noundef i64 @_ZN7cascadb9InnerNode10bloom_sizeEi(ptr noundef nonnull align 8 dereferenceable(312) %29, i32 noundef %62)
  %64 = load i64, ptr %9, align 8, !tbaa !9
  %65 = add i64 %64, %63
  store i64 %65, ptr %9, align 8, !tbaa !9
  br label %66

66:                                               ; preds = %44
  %67 = load i64, ptr %10, align 8, !tbaa !9
  %68 = add i64 %67, 1
  store i64 %68, ptr %10, align 8, !tbaa !9
  br label %38, !llvm.loop !33

69:                                               ; preds = %43
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load i64, ptr %9, align 8, !tbaa !9
  %72 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter4skipEm(ptr noundef nonnull align 8 dereferenceable(16) %70, i64 noundef %71)
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %393

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  call void @_ZN7cascadb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %13)
  %75 = getelementptr inbounds %"class.cascadb::DataNode", ptr %29, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !35
  %77 = getelementptr inbounds %"class.cascadb::Tree", ptr %76, i32 0, i32 5
  %78 = load ptr, ptr %77, align 8, !tbaa !36
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %113

80:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %81 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 3
  %82 = load ptr, ptr %81, align 8, !tbaa !11
  %83 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %82)
  store i64 %83, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %107, %80
  %85 = load i64, ptr %15, align 8, !tbaa !9
  %86 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %87 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #5
  %88 = icmp ult i64 %85, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %84
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %110

90:                                               ; preds = %84
  %91 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %92 = load i64, ptr %15, align 8, !tbaa !9
  %93 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %91, i64 noundef %92) #5
  %94 = getelementptr inbounds %"class.cascadb::Pivot", ptr %93, i32 0, i32 3
  %95 = load ptr, ptr %94, align 8, !tbaa !31
  %96 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %95)
  %97 = load i64, ptr %14, align 8, !tbaa !9
  %98 = icmp ugt i64 %96, %97
  br i1 %98, label %99, label %106

99:                                               ; preds = %90
  %100 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %101 = load i64, ptr %15, align 8, !tbaa !9
  %102 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %101) #5
  %103 = getelementptr inbounds %"class.cascadb::Pivot", ptr %102, i32 0, i32 3
  %104 = load ptr, ptr %103, align 8, !tbaa !31
  %105 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %104)
  store i64 %105, ptr %14, align 8, !tbaa !9
  br label %106

106:                                              ; preds = %99, %90
  br label %107

107:                                              ; preds = %106
  %108 = load i64, ptr %15, align 8, !tbaa !9
  %109 = add i64 %108, 1
  store i64 %109, ptr %15, align 8, !tbaa !9
  br label %84, !llvm.loop !40

110:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %111 = load i64, ptr %14, align 8, !tbaa !9
  %112 = call { ptr, i32 } @_ZN7cascadb5Slice5allocEm(i64 noundef %111)
  store { ptr, i32 } %112, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %17, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %16, i64 12, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %113

113:                                              ; preds = %110, %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = call noundef ptr @_ZN7cascadb11BlockWriter4addrEv(ptr noundef nonnull align 8 dereferenceable(16) %114)
  store ptr %115, ptr %18, align 8, !tbaa !5
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %116)
  %118 = trunc i64 %117 to i32
  %119 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 5
  store i32 %118, ptr %119, align 8, !tbaa !41
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %13, i64 16, i1 false), !tbaa.struct !29
  %123 = getelementptr inbounds { ptr, i32 }, ptr %19, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8
  %125 = getelementptr inbounds { ptr, i32 }, ptr %19, i32 0, i32 1
  %126 = load i32, ptr %125, align 8
  %127 = call noundef zeroext i1 @_ZN7cascadb9InnerNode12write_msgbufERNS_11BlockWriterEPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %29, ptr noundef nonnull align 8 dereferenceable(16) %120, ptr noundef %122, ptr %124, i32 %126)
  br i1 %127, label %129, label %128

128:                                              ; preds = %113
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %392

129:                                              ; preds = %113
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %130)
  %132 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 5
  %133 = load i32, ptr %132, align 8, !tbaa !41
  %134 = zext i32 %133 to i64
  %135 = sub i64 %131, %134
  %136 = trunc i64 %135 to i32
  %137 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 6
  store i32 %136, ptr %137, align 4, !tbaa !42
  %138 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 3
  %139 = load ptr, ptr %138, align 8, !tbaa !11
  %140 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %139)
  %141 = trunc i64 %140 to i32
  %142 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 7
  store i32 %141, ptr %142, align 8, !tbaa !43
  %143 = load ptr, ptr %18, align 8, !tbaa !5
  %144 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 6
  %145 = load i32, ptr %144, align 4, !tbaa !42
  %146 = call noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef %143, i32 noundef %145)
  %147 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 8
  store i16 %146, ptr %147, align 4, !tbaa !44
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store i64 0, ptr %20, align 8, !tbaa !9
  br label %148

148:                                              ; preds = %213, %129
  %149 = load i64, ptr %20, align 8, !tbaa !9
  %150 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %151 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %150) #5
  %152 = icmp ult i64 %149, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %148
  store i32 8, ptr %12, align 4
  br label %216

154:                                              ; preds = %148
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = call noundef ptr @_ZN7cascadb11BlockWriter4addrEv(ptr noundef nonnull align 8 dereferenceable(16) %155)
  store ptr %156, ptr %18, align 8, !tbaa !5
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %157)
  %159 = trunc i64 %158 to i32
  %160 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %161 = load i64, ptr %20, align 8, !tbaa !9
  %162 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %160, i64 noundef %161) #5
  %163 = getelementptr inbounds %"class.cascadb::Pivot", ptr %162, i32 0, i32 4
  store i32 %159, ptr %163, align 8, !tbaa !45
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %166 = load i64, ptr %20, align 8, !tbaa !9
  %167 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %165, i64 noundef %166) #5
  %168 = getelementptr inbounds %"class.cascadb::Pivot", ptr %167, i32 0, i32 3
  %169 = load ptr, ptr %168, align 8, !tbaa !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %13, i64 16, i1 false), !tbaa.struct !29
  %170 = getelementptr inbounds { ptr, i32 }, ptr %21, i32 0, i32 0
  %171 = load ptr, ptr %170, align 8
  %172 = getelementptr inbounds { ptr, i32 }, ptr %21, i32 0, i32 1
  %173 = load i32, ptr %172, align 8
  %174 = call noundef zeroext i1 @_ZN7cascadb9InnerNode12write_msgbufERNS_11BlockWriterEPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %29, ptr noundef nonnull align 8 dereferenceable(16) %164, ptr noundef %169, ptr %171, i32 %173)
  br i1 %174, label %176, label %175

175:                                              ; preds = %154
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %216

176:                                              ; preds = %154
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %177)
  %179 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %180 = load i64, ptr %20, align 8, !tbaa !9
  %181 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %179, i64 noundef %180) #5
  %182 = getelementptr inbounds %"class.cascadb::Pivot", ptr %181, i32 0, i32 4
  %183 = load i32, ptr %182, align 8, !tbaa !45
  %184 = zext i32 %183 to i64
  %185 = sub i64 %178, %184
  %186 = trunc i64 %185 to i32
  %187 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %188 = load i64, ptr %20, align 8, !tbaa !9
  %189 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %187, i64 noundef %188) #5
  %190 = getelementptr inbounds %"class.cascadb::Pivot", ptr %189, i32 0, i32 5
  store i32 %186, ptr %190, align 4, !tbaa !46
  %191 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %192 = load i64, ptr %20, align 8, !tbaa !9
  %193 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %191, i64 noundef %192) #5
  %194 = getelementptr inbounds %"class.cascadb::Pivot", ptr %193, i32 0, i32 3
  %195 = load ptr, ptr %194, align 8, !tbaa !31
  %196 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %195)
  %197 = trunc i64 %196 to i32
  %198 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %199 = load i64, ptr %20, align 8, !tbaa !9
  %200 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %198, i64 noundef %199) #5
  %201 = getelementptr inbounds %"class.cascadb::Pivot", ptr %200, i32 0, i32 6
  store i32 %197, ptr %201, align 8, !tbaa !47
  %202 = load ptr, ptr %18, align 8, !tbaa !5
  %203 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %204 = load i64, ptr %20, align 8, !tbaa !9
  %205 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %203, i64 noundef %204) #5
  %206 = getelementptr inbounds %"class.cascadb::Pivot", ptr %205, i32 0, i32 5
  %207 = load i32, ptr %206, align 4, !tbaa !46
  %208 = call noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef %202, i32 noundef %207)
  %209 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %210 = load i64, ptr %20, align 8, !tbaa !9
  %211 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %209, i64 noundef %210) #5
  %212 = getelementptr inbounds %"class.cascadb::Pivot", ptr %211, i32 0, i32 7
  store i16 %208, ptr %212, align 4, !tbaa !48
  br label %213

213:                                              ; preds = %176
  %214 = load i64, ptr %20, align 8, !tbaa !9
  %215 = add i64 %214, 1
  store i64 %215, ptr %20, align 8, !tbaa !9
  br label %148, !llvm.loop !49

216:                                              ; preds = %175, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  %217 = load i32, ptr %12, align 4
  switch i32 %217, label %392 [
    i32 8, label %218
  ]

218:                                              ; preds = %216
  %219 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %13)
  %220 = icmp ne i64 %219, 0
  br i1 %220, label %221, label %222

221:                                              ; preds = %218
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %13)
  br label %222

222:                                              ; preds = %221, %218
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %223 = load ptr, ptr %6, align 8, !tbaa !5
  %224 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %223)
  store i64 %224, ptr %22, align 8, !tbaa !9
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = load i64, ptr %8, align 8, !tbaa !9
  call void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %225, i64 noundef %226)
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 1
  %229 = load i8, ptr %228, align 4, !tbaa !50, !range !51, !noundef !52
  %230 = trunc i8 %229 to i1
  %231 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter9writeBoolEb(ptr noundef nonnull align 8 dereferenceable(16) %227, i1 noundef zeroext %230)
  br i1 %231, label %233, label %232

232:                                              ; preds = %222
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %391

233:                                              ; preds = %222
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %236 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %235) #5
  %237 = trunc i64 %236 to i32
  %238 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %234, i32 noundef %237)
  br i1 %238, label %240, label %239

239:                                              ; preds = %233
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %391

240:                                              ; preds = %233
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  %242 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 2
  %243 = load i64, ptr %242, align 8, !tbaa !53
  %244 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16) %241, i64 noundef %243)
  br i1 %244, label %246, label %245

245:                                              ; preds = %240
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %391

246:                                              ; preds = %240
  %247 = load ptr, ptr %6, align 8, !tbaa !5
  %248 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 5
  %249 = load i32, ptr %248, align 8, !tbaa !41
  %250 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %247, i32 noundef %249)
  br i1 %250, label %252, label %251

251:                                              ; preds = %246
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %391

252:                                              ; preds = %246
  %253 = load ptr, ptr %6, align 8, !tbaa !5
  %254 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 6
  %255 = load i32, ptr %254, align 4, !tbaa !42
  %256 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %253, i32 noundef %255)
  br i1 %256, label %258, label %257

257:                                              ; preds = %252
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %391

258:                                              ; preds = %252
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 7
  %261 = load i32, ptr %260, align 8, !tbaa !43
  %262 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %259, i32 noundef %261)
  br i1 %262, label %264, label %263

263:                                              ; preds = %258
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %391

264:                                              ; preds = %258
  %265 = load ptr, ptr %6, align 8, !tbaa !5
  %266 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 8
  %267 = load i16, ptr %266, align 4, !tbaa !44
  %268 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt16Et(ptr noundef nonnull align 8 dereferenceable(16) %265, i16 noundef zeroext %267)
  br i1 %268, label %270, label %269

269:                                              ; preds = %264
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %391

270:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #5
  %271 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 3
  %272 = load ptr, ptr %271, align 8, !tbaa !11
  invoke void @_ZN7cascadb6MsgBuf10get_filterEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(104) %272, ptr noundef %23)
          to label %273 unwind label %281

273:                                              ; preds = %270
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #5
  invoke void @_ZN7cascadb5SliceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(12) %26, ptr noundef nonnull align 8 dereferenceable(32) %23)
          to label %274 unwind label %285

274:                                              ; preds = %273
  %275 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %275, ptr align 8 %26, i64 12, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  %276 = load ptr, ptr %6, align 8, !tbaa !5
  %277 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 4
  %278 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter10writeSliceERKNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %276, ptr noundef nonnull align 8 dereferenceable(12) %277)
          to label %279 unwind label %281

279:                                              ; preds = %274
  br i1 %278, label %289, label %280

280:                                              ; preds = %279
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %389

281:                                              ; preds = %383, %274, %270
  %282 = landingpad { ptr, i32 }
          cleanup
  %283 = extractvalue { ptr, i32 } %282, 0
  store ptr %283, ptr %24, align 8
  %284 = extractvalue { ptr, i32 } %282, 1
  store i32 %284, ptr %25, align 4
  br label %390

285:                                              ; preds = %273
  %286 = landingpad { ptr, i32 }
          cleanup
  %287 = extractvalue { ptr, i32 } %286, 0
  store ptr %287, ptr %24, align 8
  %288 = extractvalue { ptr, i32 } %286, 1
  store i32 %288, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  br label %390

289:                                              ; preds = %279
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  store i64 0, ptr %27, align 8, !tbaa !9
  br label %290

290:                                              ; preds = %377, %289
  %291 = load i64, ptr %27, align 8, !tbaa !9
  %292 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %293 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %292) #5
  %294 = icmp ult i64 %291, %293
  br i1 %294, label %296, label %295

295:                                              ; preds = %290
  store i32 11, ptr %12, align 4
  br label %380

296:                                              ; preds = %290
  %297 = load ptr, ptr %6, align 8, !tbaa !5
  %298 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %299 = load i64, ptr %27, align 8, !tbaa !9
  %300 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %298, i64 noundef %299) #5
  %301 = getelementptr inbounds %"class.cascadb::Pivot", ptr %300, i32 0, i32 0
  %302 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter10writeSliceERKNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %297, ptr noundef nonnull align 8 dereferenceable(12) %301)
          to label %303 unwind label %305

303:                                              ; preds = %296
  br i1 %302, label %309, label %304

304:                                              ; preds = %303
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %380

305:                                              ; preds = %359, %349, %339, %329, %319, %309, %296
  %306 = landingpad { ptr, i32 }
          cleanup
  %307 = extractvalue { ptr, i32 } %306, 0
  store ptr %307, ptr %24, align 8
  %308 = extractvalue { ptr, i32 } %306, 1
  store i32 %308, ptr %25, align 4
  br label %382

309:                                              ; preds = %303
  %310 = load ptr, ptr %6, align 8, !tbaa !5
  %311 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %312 = load i64, ptr %27, align 8, !tbaa !9
  %313 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %311, i64 noundef %312) #5
  %314 = getelementptr inbounds %"class.cascadb::Pivot", ptr %313, i32 0, i32 2
  %315 = load i64, ptr %314, align 8, !tbaa !54
  %316 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16) %310, i64 noundef %315)
          to label %317 unwind label %305

317:                                              ; preds = %309
  br i1 %316, label %319, label %318

318:                                              ; preds = %317
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %380

319:                                              ; preds = %317
  %320 = load ptr, ptr %6, align 8, !tbaa !5
  %321 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %322 = load i64, ptr %27, align 8, !tbaa !9
  %323 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %321, i64 noundef %322) #5
  %324 = getelementptr inbounds %"class.cascadb::Pivot", ptr %323, i32 0, i32 4
  %325 = load i32, ptr %324, align 8, !tbaa !45
  %326 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %320, i32 noundef %325)
          to label %327 unwind label %305

327:                                              ; preds = %319
  br i1 %326, label %329, label %328

328:                                              ; preds = %327
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %380

329:                                              ; preds = %327
  %330 = load ptr, ptr %6, align 8, !tbaa !5
  %331 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %332 = load i64, ptr %27, align 8, !tbaa !9
  %333 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %331, i64 noundef %332) #5
  %334 = getelementptr inbounds %"class.cascadb::Pivot", ptr %333, i32 0, i32 5
  %335 = load i32, ptr %334, align 4, !tbaa !46
  %336 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %330, i32 noundef %335)
          to label %337 unwind label %305

337:                                              ; preds = %329
  br i1 %336, label %339, label %338

338:                                              ; preds = %337
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %380

339:                                              ; preds = %337
  %340 = load ptr, ptr %6, align 8, !tbaa !5
  %341 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %342 = load i64, ptr %27, align 8, !tbaa !9
  %343 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %341, i64 noundef %342) #5
  %344 = getelementptr inbounds %"class.cascadb::Pivot", ptr %343, i32 0, i32 6
  %345 = load i32, ptr %344, align 8, !tbaa !47
  %346 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %340, i32 noundef %345)
          to label %347 unwind label %305

347:                                              ; preds = %339
  br i1 %346, label %349, label %348

348:                                              ; preds = %347
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %380

349:                                              ; preds = %347
  %350 = load ptr, ptr %6, align 8, !tbaa !5
  %351 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %352 = load i64, ptr %27, align 8, !tbaa !9
  %353 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %351, i64 noundef %352) #5
  %354 = getelementptr inbounds %"class.cascadb::Pivot", ptr %353, i32 0, i32 7
  %355 = load i16, ptr %354, align 4, !tbaa !48
  %356 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt16Et(ptr noundef nonnull align 8 dereferenceable(16) %350, i16 noundef zeroext %355)
          to label %357 unwind label %305

357:                                              ; preds = %349
  br i1 %356, label %359, label %358

358:                                              ; preds = %357
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %380

359:                                              ; preds = %357
  %360 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %29, i32 0, i32 9
  %361 = load i64, ptr %27, align 8, !tbaa !9
  %362 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %360, i64 noundef %361) #5
  %363 = getelementptr inbounds %"class.cascadb::Pivot", ptr %362, i32 0, i32 3
  %364 = load ptr, ptr %363, align 8, !tbaa !31
  invoke void @_ZN7cascadb6MsgBuf10get_filterEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(104) %364, ptr noundef %23)
          to label %365 unwind label %305

365:                                              ; preds = %359
  %366 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #5
  invoke void @_ZN7cascadb5SliceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(12) %28, ptr noundef nonnull align 8 dereferenceable(32) %23)
          to label %367 unwind label %372

367:                                              ; preds = %365
  %368 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter10writeSliceERKNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %366, ptr noundef nonnull align 8 dereferenceable(12) %28)
          to label %369 unwind label %372

369:                                              ; preds = %367
  %370 = xor i1 %368, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #5
  br i1 %370, label %371, label %376

371:                                              ; preds = %369
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %380

372:                                              ; preds = %367, %365
  %373 = landingpad { ptr, i32 }
          cleanup
  %374 = extractvalue { ptr, i32 } %373, 0
  store ptr %374, ptr %24, align 8
  %375 = extractvalue { ptr, i32 } %373, 1
  store i32 %375, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #5
  br label %382

376:                                              ; preds = %369
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %23) #5
  br label %377

377:                                              ; preds = %376
  %378 = load i64, ptr %27, align 8, !tbaa !9
  %379 = add i64 %378, 1
  store i64 %379, ptr %27, align 8, !tbaa !9
  br label %290, !llvm.loop !55

380:                                              ; preds = %371, %358, %348, %338, %328, %318, %304, %295
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  %381 = load i32, ptr %12, align 4
  switch i32 %381, label %389 [
    i32 11, label %383
  ]

382:                                              ; preds = %372, %305
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %390

383:                                              ; preds = %380
  %384 = load ptr, ptr %6, align 8, !tbaa !5
  %385 = load i64, ptr %22, align 8, !tbaa !9
  invoke void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %384, i64 noundef %385)
          to label %386 unwind label %281

386:                                              ; preds = %383
  %387 = load i64, ptr %9, align 8, !tbaa !9
  %388 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %387, ptr %388, align 8, !tbaa !9
  store i1 true, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %389

389:                                              ; preds = %386, %380, %280
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #5
  br label %391

390:                                              ; preds = %382, %285, %281
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %395

391:                                              ; preds = %389, %269, %263, %257, %251, %245, %239, %232
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %392

392:                                              ; preds = %391, %216, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  br label %393

393:                                              ; preds = %392, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %394 = load i1, ptr %4, align 1
  ret i1 %394

395:                                              ; preds = %390
  %396 = load ptr, ptr %24, align 8
  %397 = load i32, ptr %25, align 4
  %398 = insertvalue { ptr, i32 } poison, ptr %396, 0
  %399 = insertvalue { ptr, i32 } %398, i32 %397, 1
  resume { ptr, i32 } %399
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter4skipEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7cascadb11BlockWriter4addrEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode12write_msgbufERNS_11BlockWriterEPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr, i32) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter9writeBoolEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt16Et(ptr noundef nonnull align 8 dereferenceable(16), i16 noundef zeroext) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

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

declare noundef zeroext i1 @_ZN7cascadb11BlockWriter10writeSliceERKNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(12)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!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 = !{!12, !6, i64 224}
!12 = !{!"_ZTSN7cascadb9InnerNodeE", !13, i64 0, !18, i64 212, !10, i64 216, !6, i64 224, !23, i64 232, !20, i64 248, !20, i64 252, !20, i64 256, !24, i64 260, !25, i64 264, !10, i64 288, !10, i64 296, !10, i64 304}
!13 = !{!"_ZTSN7cascadb8DataNodeE", !14, i64 0, !6, i64 200, !22, i64 208}
!14 = !{!"_ZTSN7cascadb4NodeE", !15, i64 8, !10, i64 40, !17, i64 48, !18, i64 96, !18, i64 97, !18, i64 98, !19, i64 104, !19, i64 120, !20, i64 136, !20, i64 140, !21, i64 144}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !10, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"_ZTSN7cascadb5MutexE", !18, i64 0, !7, i64 8}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS7timeval", !10, i64 0, !10, i64 8}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!22 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!23 = !{!"_ZTSN7cascadb5SliceE", !6, i64 0, !20, i64 8}
!24 = !{!"short", !7, i64 0}
!25 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{i64 0, i64 8, !5, i64 8, i64 4, !30}
!30 = !{!20, !20, i64 0}
!31 = !{!32, !6, i64 40}
!32 = !{!"_ZTSN7cascadb5PivotE", !23, i64 0, !23, i64 16, !10, i64 32, !6, i64 40, !20, i64 48, !20, i64 52, !20, i64 56, !24, i64 60}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!13, !6, i64 200}
!36 = !{!37, !6, i64 160}
!37 = !{!"_ZTSN7cascadb4TreeE", !15, i64 0, !38, i64 32, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!38 = !{!"_ZTSN7cascadb7OptionsE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !20, i64 72, !20, i64 76, !20, i64 80, !20, i64 84, !20, i64 88, !20, i64 92, !39, i64 96, !18, i64 100}
!39 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!40 = distinct !{!40, !34}
!41 = !{!12, !20, i64 248}
!42 = !{!12, !20, i64 252}
!43 = !{!12, !20, i64 256}
!44 = !{!12, !24, i64 260}
!45 = !{!32, !20, i64 48}
!46 = !{!32, !20, i64 52}
!47 = !{!32, !20, i64 56}
!48 = !{!32, !24, i64 60}
!49 = distinct !{!49, !34}
!50 = !{!12, !18, i64 212}
!51 = !{i8 0, i8 2}
!52 = !{}
!53 = !{!12, !10, i64 216}
!54 = !{!32, !10, i64 32}
!55 = distinct !{!55, !34}


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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #0 align 2

; 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 #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #0 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 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 noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312), ptr, i32) local_unnamed_addr #0 align 2

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

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

declare noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode8write_toERNS_11BlockWriterERm(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.cascadb::Slice", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.cascadb::Slice", align 8
  %7 = alloca %"class.cascadb::Slice", align 8
  %8 = tail call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %9 = getelementptr inbounds i8, ptr %0, i64 224
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = tail call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %10)
  %12 = trunc i64 %11 to i32
  %13 = tail call noundef i64 @_ZN7cascadb9InnerNode10bloom_sizeEi(ptr noundef nonnull align 8 dereferenceable(312) %0, i32 noundef %12)
  %14 = add i64 %13, 27
  %15 = getelementptr inbounds i8, ptr %0, i64 264
  %16 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %.not119 = icmp eq i64 %16, 0
  br i1 %.not119, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %3
  %.086.lcssa = phi i64 [ %14, %3 ], [ %27, %.lr.ph ]
  %17 = tail call noundef zeroext i1 @_ZN7cascadb11BlockWriter4skipEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %.086.lcssa)
  br i1 %17, label %31, label %195

.lr.ph:                                           ; preds = %3, %.lr.ph
  %.086103 = phi i64 [ %27, %.lr.ph ], [ %14, %3 ]
  %.087102 = phi i64 [ %28, %.lr.ph ], [ 0, %3 ]
  %18 = tail call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.087102) #5
  %.sroa.038.0.copyload = load ptr, ptr %18, align 8, !tbaa !27
  %.sroa.239.0..sroa_idx = getelementptr inbounds i8, ptr %18, i64 8
  %.sroa.239.0.copyload = load i32, ptr %.sroa.239.0..sroa_idx, align 8, !tbaa !28
  %19 = tail call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr %.sroa.038.0.copyload, i32 %.sroa.239.0.copyload)
  %20 = add i64 %19, %.086103
  %21 = tail call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.087102) #5
  %22 = getelementptr inbounds i8, ptr %21, i64 40
  %23 = load ptr, ptr %22, align 8, !tbaa !29
  %24 = tail call noundef i64 @_ZNK7cascadb6MsgBuf5countEv(ptr noundef nonnull align 8 dereferenceable(104) %23)
  %25 = trunc i64 %24 to i32
  %26 = tail call noundef i64 @_ZN7cascadb9InnerNode10bloom_sizeEi(ptr noundef nonnull align 8 dereferenceable(312) %0, i32 noundef %25)
  %27 = add i64 %20, %26
  %28 = add nuw i64 %.087102, 1
  %29 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %30 = icmp ult i64 %28, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !31

31:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @_ZN7cascadb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %32 = getelementptr inbounds i8, ptr %0, i64 200
  %33 = load ptr, ptr %32, align 8, !tbaa !33
  %34 = getelementptr inbounds i8, ptr %33, i64 160
  %35 = load ptr, ptr %34, align 8, !tbaa !34
  %.not = icmp eq ptr %35, null
  br i1 %.not, label %55, label %36

36:                                               ; preds = %31
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %37)
  %39 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %.not120 = icmp eq i64 %39, 0
  br i1 %.not120, label %._crit_edge109, label %.lr.ph108

._crit_edge109:                                   ; preds = %51, %36
  %.091.lcssa = phi i64 [ %38, %36 ], [ %.192, %51 ]
  %40 = call { ptr, i32 } @_ZN7cascadb5Slice5allocEm(i64 noundef %.091.lcssa)
  %.fca.0.extract = extractvalue { ptr, i32 } %40, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %40, 1
  store ptr %.fca.0.extract, ptr %4, align 8, !tbaa !27
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !28
  br label %55

.lr.ph108:                                        ; preds = %36, %51
  %.091106 = phi i64 [ %.192, %51 ], [ %38, %36 ]
  %.093105 = phi i64 [ %52, %51 ], [ 0, %36 ]
  %41 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.093105) #5
  %42 = getelementptr inbounds i8, ptr %41, i64 40
  %43 = load ptr, ptr %42, align 8, !tbaa !29
  %44 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %43)
  %45 = icmp ugt i64 %44, %.091106
  br i1 %45, label %46, label %51

46:                                               ; preds = %.lr.ph108
  %47 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.093105) #5
  %48 = getelementptr inbounds i8, ptr %47, i64 40
  %49 = load ptr, ptr %48, align 8, !tbaa !29
  %50 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %49)
  br label %51

51:                                               ; preds = %.lr.ph108, %46
  %.192 = phi i64 [ %50, %46 ], [ %.091106, %.lr.ph108 ]
  %52 = add nuw i64 %.093105, 1
  %53 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %54 = icmp ult i64 %52, %53
  br i1 %54, label %.lr.ph108, label %._crit_edge109, !llvm.loop !38

55:                                               ; preds = %._crit_edge109, %31
  %56 = call noundef ptr @_ZN7cascadb11BlockWriter4addrEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %57 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %58 = trunc i64 %57 to i32
  %59 = getelementptr inbounds i8, ptr %0, i64 248
  store i32 %58, ptr %59, align 8, !tbaa !39
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %.sroa.022.0.copyload = load ptr, ptr %4, align 8, !tbaa !27
  %.sroa.223.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.223.0.copyload = load i32, ptr %.sroa.223.0..sroa_idx, align 8, !tbaa !28
  %61 = call noundef zeroext i1 @_ZN7cascadb9InnerNode12write_msgbufERNS_11BlockWriterEPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %60, ptr %.sroa.022.0.copyload, i32 %.sroa.223.0.copyload)
  br i1 %61, label %62, label %.loopexit101

62:                                               ; preds = %55
  %63 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %64 = load i32, ptr %59, align 8, !tbaa !39
  %65 = trunc i64 %63 to i32
  %66 = sub i32 %65, %64
  %67 = getelementptr inbounds i8, ptr %0, i64 252
  store i32 %66, ptr %67, align 4, !tbaa !40
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %68)
  %70 = trunc i64 %69 to i32
  %71 = getelementptr inbounds i8, ptr %0, i64 256
  store i32 %70, ptr %71, align 8, !tbaa !41
  %72 = load i32, ptr %67, align 4, !tbaa !40
  %73 = call noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef %56, i32 noundef %72)
  %74 = getelementptr inbounds i8, ptr %0, i64 260
  store i16 %73, ptr %74, align 4, !tbaa !42
  %75 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %.not94111.not = icmp eq i64 %75, 0
  br i1 %.not94111.not, label %.critedge, label %.lr.ph114

.lr.ph114:                                        ; preds = %62, %85
  %.090112 = phi i64 [ %107, %85 ], [ 0, %62 ]
  %76 = call noundef ptr @_ZN7cascadb11BlockWriter4addrEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %77 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %78 = trunc i64 %77 to i32
  %79 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.090112) #5
  %80 = getelementptr inbounds i8, ptr %79, i64 48
  store i32 %78, ptr %80, align 8, !tbaa !43
  %81 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.090112) #5
  %82 = getelementptr inbounds i8, ptr %81, i64 40
  %83 = load ptr, ptr %82, align 8, !tbaa !29
  %.sroa.0.0.copyload = load ptr, ptr %4, align 8, !tbaa !27
  %.sroa.2.0.copyload = load i32, ptr %.sroa.223.0..sroa_idx, align 8, !tbaa !28
  %84 = call noundef zeroext i1 @_ZN7cascadb9InnerNode12write_msgbufERNS_11BlockWriterEPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %83, ptr %.sroa.0.0.copyload, i32 %.sroa.2.0.copyload)
  br i1 %84, label %85, label %.loopexit101

85:                                               ; preds = %.lr.ph114
  %86 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %87 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.090112) #5
  %88 = getelementptr inbounds i8, ptr %87, i64 48
  %89 = load i32, ptr %88, align 8, !tbaa !43
  %90 = trunc i64 %86 to i32
  %91 = sub i32 %90, %89
  %92 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.090112) #5
  %93 = getelementptr inbounds i8, ptr %92, i64 52
  store i32 %91, ptr %93, align 4, !tbaa !44
  %94 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.090112) #5
  %95 = getelementptr inbounds i8, ptr %94, i64 40
  %96 = load ptr, ptr %95, align 8, !tbaa !29
  %97 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %96)
  %98 = trunc i64 %97 to i32
  %99 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.090112) #5
  %100 = getelementptr inbounds i8, ptr %99, i64 56
  store i32 %98, ptr %100, align 8, !tbaa !45
  %101 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.090112) #5
  %102 = getelementptr inbounds i8, ptr %101, i64 52
  %103 = load i32, ptr %102, align 4, !tbaa !44
  %104 = call noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef %76, i32 noundef %103)
  %105 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.090112) #5
  %106 = getelementptr inbounds i8, ptr %105, i64 60
  store i16 %104, ptr %106, align 4, !tbaa !46
  %107 = add nuw i64 %.090112, 1
  %108 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %.not94 = icmp ult i64 %107, %108
  br i1 %.not94, label %.lr.ph114, label %.critedge, !llvm.loop !47

.critedge:                                        ; preds = %85, %62
  %109 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %.not95 = icmp eq i64 %109, 0
  br i1 %.not95, label %111, label %110

110:                                              ; preds = %.critedge
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  br label %111

111:                                              ; preds = %110, %.critedge
  %112 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %8)
  %113 = getelementptr inbounds i8, ptr %0, i64 212
  %114 = load i8, ptr %113, align 4, !tbaa !48, !range !49, !noundef !50
  %115 = trunc nuw i8 %114 to i1
  %116 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter9writeBoolEb(ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext %115)
  br i1 %116, label %117, label %.loopexit101

117:                                              ; preds = %111
  %118 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %119 = trunc i64 %118 to i32
  %120 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %119)
  br i1 %120, label %121, label %.loopexit101

121:                                              ; preds = %117
  %122 = getelementptr inbounds i8, ptr %0, i64 216
  %123 = load i64, ptr %122, align 8, !tbaa !51
  %124 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %123)
  br i1 %124, label %125, label %.loopexit101

125:                                              ; preds = %121
  %126 = load i32, ptr %59, align 8, !tbaa !39
  %127 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %126)
  br i1 %127, label %128, label %.loopexit101

128:                                              ; preds = %125
  %129 = load i32, ptr %67, align 4, !tbaa !40
  %130 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %129)
  br i1 %130, label %131, label %.loopexit101

131:                                              ; preds = %128
  %132 = load i32, ptr %71, align 8, !tbaa !41
  %133 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %132)
  br i1 %133, label %134, label %.loopexit101

134:                                              ; preds = %131
  %135 = load i16, ptr %74, align 4, !tbaa !42
  %136 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt16Et(ptr noundef nonnull align 8 dereferenceable(16) %1, i16 noundef zeroext %135)
  br i1 %136, label %137, label %.loopexit101

137:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN7cascadb6MsgBuf10get_filterEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(104) %138, ptr noundef nonnull %5)
          to label %139 unwind label %143

139:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void @_ZN7cascadb5SliceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 8 dereferenceable(32) %5)
  %140 = getelementptr inbounds i8, ptr %0, i64 232
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %140, ptr noundef nonnull align 8 dereferenceable(12) %6, i64 12, i1 false), !tbaa.struct !52
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  %141 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter10writeSliceERKNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(12) %140)
          to label %142 unwind label %143

142:                                              ; preds = %139
  br i1 %141, label %145, label %.loopexit

143:                                              ; preds = %139, %137
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %194

145:                                              ; preds = %142
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  %146 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %.not98115.not = icmp eq i64 %146, 0
  br i1 %.not98115.not, label %.critedge100, label %.lr.ph118

.lr.ph118:                                        ; preds = %145, %191
  %.0116 = phi i64 [ %192, %191 ], [ 0, %145 ]
  %147 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.0116) #5
  %148 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter10writeSliceERKNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(12) %147)
          to label %149 unwind label %150

149:                                              ; preds = %.lr.ph118
  br i1 %148, label %152, label %.loopexit

150:                                              ; preds = %182, %176, %170, %164, %158, %152, %.lr.ph118
  %151 = landingpad { ptr, i32 }
          cleanup
  br label %194

152:                                              ; preds = %149
  %153 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.0116) #5
  %154 = getelementptr inbounds i8, ptr %153, i64 32
  %155 = load i64, ptr %154, align 8, !tbaa !53
  %156 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %155)
          to label %157 unwind label %150

157:                                              ; preds = %152
  br i1 %156, label %158, label %.loopexit

158:                                              ; preds = %157
  %159 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.0116) #5
  %160 = getelementptr inbounds i8, ptr %159, i64 48
  %161 = load i32, ptr %160, align 8, !tbaa !43
  %162 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %161)
          to label %163 unwind label %150

163:                                              ; preds = %158
  br i1 %162, label %164, label %.loopexit

164:                                              ; preds = %163
  %165 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.0116) #5
  %166 = getelementptr inbounds i8, ptr %165, i64 52
  %167 = load i32, ptr %166, align 4, !tbaa !44
  %168 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %167)
          to label %169 unwind label %150

169:                                              ; preds = %164
  br i1 %168, label %170, label %.loopexit

170:                                              ; preds = %169
  %171 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.0116) #5
  %172 = getelementptr inbounds i8, ptr %171, i64 56
  %173 = load i32, ptr %172, align 8, !tbaa !45
  %174 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %173)
          to label %175 unwind label %150

175:                                              ; preds = %170
  br i1 %174, label %176, label %.loopexit

176:                                              ; preds = %175
  %177 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.0116) #5
  %178 = getelementptr inbounds i8, ptr %177, i64 60
  %179 = load i16, ptr %178, align 4, !tbaa !46
  %180 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt16Et(ptr noundef nonnull align 8 dereferenceable(16) %1, i16 noundef zeroext %179)
          to label %181 unwind label %150

181:                                              ; preds = %176
  br i1 %180, label %182, label %.loopexit

182:                                              ; preds = %181
  %183 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.0116) #5
  %184 = getelementptr inbounds i8, ptr %183, i64 40
  %185 = load ptr, ptr %184, align 8, !tbaa !29
  invoke void @_ZN7cascadb6MsgBuf10get_filterEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(104) %185, ptr noundef nonnull %5)
          to label %186 unwind label %150

186:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  call void @_ZN7cascadb5SliceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(32) %5)
  %187 = invoke noundef zeroext i1 @_ZN7cascadb11BlockWriter10writeSliceERKNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(12) %7)
          to label %188 unwind label %189

188:                                              ; preds = %186
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br i1 %187, label %191, label %.loopexit

189:                                              ; preds = %186
  %190 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %194

191:                                              ; preds = %188
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  %192 = add nuw i64 %.0116, 1
  %193 = call noundef i64 @_ZNKSt6vectorIN7cascadb5PivotESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %.not98 = icmp ult i64 %192, %193
  br i1 %.not98, label %.lr.ph118, label %.critedge100, !llvm.loop !54

.critedge100:                                     ; preds = %191, %145
  call void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %112)
  store i64 %.086.lcssa, ptr %2, align 8, !tbaa !55
  br label %.loopexit

.loopexit:                                        ; preds = %149, %157, %163, %169, %175, %181, %188, %142, %.critedge100
  %.2 = phi i1 [ true, %.critedge100 ], [ false, %142 ], [ false, %188 ], [ false, %181 ], [ false, %175 ], [ false, %169 ], [ false, %163 ], [ false, %157 ], [ false, %149 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %.loopexit101

194:                                              ; preds = %150, %189, %143
  %.pn.pn = phi { ptr, i32 } [ %144, %143 ], [ %190, %189 ], [ %151, %150 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn

.loopexit101:                                     ; preds = %.lr.ph114, %.loopexit, %111, %117, %121, %125, %128, %131, %134, %55
  %.4 = phi i1 [ false, %55 ], [ %.2, %.loopexit ], [ false, %111 ], [ false, %117 ], [ false, %121 ], [ false, %125 ], [ false, %128 ], [ false, %131 ], [ false, %134 ], [ false, %.lr.ph114 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %195

195:                                              ; preds = %._crit_edge, %.loopexit101
  %.5 = phi i1 [ %.4, %.loopexit101 ], [ false, %._crit_edge ]
  ret i1 %.5
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter4skipEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7cascadb11BlockWriter4addrEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode12write_msgbufERNS_11BlockWriterEPNS_6MsgBufENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr, i32) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter9writeBoolEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt32Ej(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt16Et(ptr noundef nonnull align 8 dereferenceable(16), i16 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare void @_ZN7cascadb6MsgBuf10get_filterEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) local_unnamed_addr #4

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

declare noundef zeroext i1 @_ZN7cascadb11BlockWriter10writeSliceERKNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!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, !11, i64 224}
!6 = !{!"_ZTSN7cascadb9InnerNodeE", !7, i64 0, !16, i64 212, !14, i64 216, !11, i64 224, !21, i64 232, !18, i64 248, !18, i64 252, !18, i64 256, !22, i64 260, !23, i64 264, !14, i64 288, !14, i64 296, !14, i64 304}
!7 = !{!"_ZTSN7cascadb8DataNodeE", !8, i64 0, !11, i64 200, !20, i64 208}
!8 = !{!"_ZTSN7cascadb4NodeE", !9, i64 8, !14, i64 40, !15, i64 48, !16, i64 96, !16, i64 97, !16, i64 98, !17, i64 104, !17, i64 120, !18, i64 136, !18, i64 140, !19, i64 144}
!9 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !10, i64 0, !14, i64 8, !12, i64 16}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"_ZTSN7cascadb5MutexE", !16, i64 0, !12, i64 8}
!16 = !{!"bool", !12, i64 0}
!17 = !{!"_ZTS7timeval", !14, i64 0, !14, i64 8}
!18 = !{!"int", !12, i64 0}
!19 = !{!"_ZTSN7cascadb6RWLockE", !12, i64 0}
!20 = !{!"_ZTSN7cascadb10NodeStatusE", !12, i64 0}
!21 = !{!"_ZTSN7cascadb5SliceE", !11, i64 0, !18, i64 8}
!22 = !{!"short", !12, i64 0}
!23 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!27 = !{!11, !11, i64 0}
!28 = !{!18, !18, i64 0}
!29 = !{!30, !11, i64 40}
!30 = !{!"_ZTSN7cascadb5PivotE", !21, i64 0, !21, i64 16, !14, i64 32, !11, i64 40, !18, i64 48, !18, i64 52, !18, i64 56, !22, i64 60}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!7, !11, i64 200}
!34 = !{!35, !11, i64 160}
!35 = !{!"_ZTSN7cascadb4TreeE", !9, i64 0, !36, i64 32, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176}
!36 = !{!"_ZTSN7cascadb7OptionsE", !11, i64 0, !11, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !18, i64 72, !18, i64 76, !18, i64 80, !18, i64 84, !18, i64 88, !18, i64 92, !37, i64 96, !16, i64 100}
!37 = !{!"_ZTSN7cascadb8CompressE", !12, i64 0}
!38 = distinct !{!38, !32}
!39 = !{!6, !18, i64 248}
!40 = !{!6, !18, i64 252}
!41 = !{!6, !18, i64 256}
!42 = !{!6, !22, i64 260}
!43 = !{!30, !18, i64 48}
!44 = !{!30, !18, i64 52}
!45 = !{!30, !18, i64 56}
!46 = !{!30, !22, i64 60}
!47 = distinct !{!47, !32}
!48 = !{!6, !16, i64 212}
!49 = !{i8 0, i8 2}
!50 = !{}
!51 = !{!6, !14, i64 216}
!52 = !{i64 0, i64 8, !27, i64 8, i64 4, !28}
!53 = !{!30, !14, i64 32}
!54 = distinct !{!54, !32}
!55 = !{!14, !14, i64 0}


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