; LLVM IR from weicao/cascadb :: src/tree/node.ll (ZN7cascadb8LeafNode8write_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.cascadb::LoggerFormat" = type { ptr, %"class.std::__cxx11::basic_ostringstream" }
%"class.std::__cxx11::basic_ostringstream" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"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.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::LeafNode" = type { %"class.cascadb::DataNode.base", i8, i64, i64, i64, %"class.std::vector.8", %"class.cascadb::RecordBuckets" }
%"class.cascadb::DataNode.base" = type <{ %"class.cascadb::Node", ptr, i32 }>
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::RecordBuckets" = type { i64, %"class.std::vector.13", i64, i64, i64 }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::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] }>
%"struct.cascadb::LeafNode::BucketInfo" = type <{ %"class.cascadb::Slice", %"class.cascadb::Slice", i32, i32, i32, i16, [2 x i8] }>

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@_ZN7cascadb14g_logger_levelE = external global i32, align 4
@_ZN7cascadb8g_loggerE = external global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [42 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode8write_toERNS_11BlockWriterERm = external hidden unnamed_addr constant [66 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [31 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #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 nounwind uwtable
declare dso_local noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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

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

; Function Attrs: nounwind willreturn memory(read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) #6

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #7

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode8write_toERNS_11BlockWriterERm(ptr noundef nonnull align 8 dereferenceable(320) %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 i32, align 4
  %10 = alloca %"class.cascadb::Slice", align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.cascadb::Slice", align 8
  %14 = alloca { ptr, i32 }, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.cascadb::Slice", align 8
  %19 = alloca i64, align 8
  %20 = alloca %"class.cascadb::LoggerFormat", align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  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
  %23 = load ptr, ptr %5, align 8
  %24 = getelementptr inbounds %"class.cascadb::DataNode", ptr %23, i32 0, i32 2
  %25 = load i32, ptr %24, align 8, !tbaa !9
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %31, label %27

27:                                               ; preds = %3
  %28 = getelementptr inbounds %"class.cascadb::DataNode", ptr %23, i32 0, i32 2
  %29 = load i32, ptr %28, align 8, !tbaa !9
  %30 = icmp eq i32 %29, 3
  br label %31

31:                                               ; preds = %27, %3
  %32 = phi i1 [ true, %3 ], [ %30, %27 ]
  br i1 %32, label %33, label %34

33:                                               ; preds = %31
  br label %36

34:                                               ; preds = %31
  call void @__assert_fail(ptr noundef @.str.47, ptr noundef @.str.1, i32 noundef 1298, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode8write_toERNS_11BlockWriterERm) #8
  unreachable

35:                                               ; No predecessors!
  br label %36

36:                                               ; preds = %35, %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %37)
  store i64 %38, ptr %8, align 8, !tbaa !21
  %39 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 4
  %40 = load i64, ptr %39, align 8, !tbaa !22
  %41 = add i64 16, %40
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %41, ptr %42, align 8, !tbaa !21
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = load i64, ptr %44, align 8, !tbaa !21
  %46 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter4skipEm(ptr noundef nonnull align 8 dereferenceable(16) %43, i64 noundef %45)
  br i1 %46, label %48, label %47

47:                                               ; preds = %36
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %225

48:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #9
  call void @_ZN7cascadb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %10)
  %49 = getelementptr inbounds %"class.cascadb::DataNode", ptr %23, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !33
  %51 = getelementptr inbounds %"class.cascadb::Tree", ptr %50, i32 0, i32 5
  %52 = load ptr, ptr %51, align 8, !tbaa !34
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %78

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  store i64 0, ptr %11, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  store i64 0, ptr %12, align 8, !tbaa !21
  br label %55

55:                                               ; preds = %72, %54
  %56 = load i64, ptr %12, align 8, !tbaa !21
  %57 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 6
  %58 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %57)
  %59 = icmp ult i64 %56, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %75

61:                                               ; preds = %55
  %62 = load i64, ptr %11, align 8, !tbaa !21
  %63 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 6
  %64 = load i64, ptr %12, align 8, !tbaa !21
  %65 = call noundef i64 @_ZN7cascadb13RecordBuckets13bucket_lengthEm(ptr noundef nonnull align 8 dereferenceable(56) %63, i64 noundef %64)
  %66 = icmp ult i64 %62, %65
  br i1 %66, label %67, label %71

67:                                               ; preds = %61
  %68 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 6
  %69 = load i64, ptr %12, align 8, !tbaa !21
  %70 = call noundef i64 @_ZN7cascadb13RecordBuckets13bucket_lengthEm(ptr noundef nonnull align 8 dereferenceable(56) %68, i64 noundef %69)
  store i64 %70, ptr %11, align 8, !tbaa !21
  br label %71

71:                                               ; preds = %67, %61
  br label %72

72:                                               ; preds = %71
  %73 = load i64, ptr %12, align 8, !tbaa !21
  %74 = add i64 %73, 1
  store i64 %74, ptr %12, align 8, !tbaa !21
  br label %55, !llvm.loop !38

75:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #9
  %76 = load i64, ptr %11, align 8, !tbaa !21
  %77 = call { ptr, i32 } @_ZN7cascadb5Slice5allocEm(i64 noundef %76)
  store { ptr, i32 } %77, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %14, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %13, i64 12, i1 false), !tbaa.struct !40
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %78

78:                                               ; preds = %75, %48
  %79 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 6
  %80 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %79)
  %81 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 5
  %82 = call noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #9
  %83 = icmp eq i64 %80, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %78
  br label %87

85:                                               ; preds = %78
  call void @__assert_fail(ptr noundef @.str.48, ptr noundef @.str.1, i32 noundef 1315, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode8write_toERNS_11BlockWriterERm) #8
  unreachable

86:                                               ; No predecessors!
  br label %87

87:                                               ; preds = %86, %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  store i64 0, ptr %15, align 8, !tbaa !21
  br label %88

88:                                               ; preds = %156, %87
  %89 = load i64, ptr %15, align 8, !tbaa !21
  %90 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 6
  %91 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %90)
  %92 = icmp ult i64 %89, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %88
  store i32 5, ptr %9, align 4
  br label %159

94:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %95 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 6
  %96 = load i64, ptr %15, align 8, !tbaa !21
  %97 = call noundef ptr @_ZN7cascadb13RecordBuckets6bucketEm(ptr noundef nonnull align 8 dereferenceable(56) %95, i64 noundef %96)
  store ptr %97, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = call noundef ptr @_ZN7cascadb11BlockWriter4addrEv(ptr noundef nonnull align 8 dereferenceable(16) %98)
  store ptr %99, ptr %17, align 8, !tbaa !5
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %100)
  %102 = trunc i64 %101 to i32
  %103 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 5
  %104 = load i64, ptr %15, align 8, !tbaa !21
  %105 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %103, i64 noundef %104) #9
  %106 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %105, i32 0, i32 2
  store i32 %102, ptr %106, align 8, !tbaa !42
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %10, i64 16, i1 false), !tbaa.struct !40
  %109 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8
  %111 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 1
  %112 = load i32, ptr %111, align 8
  %113 = call noundef zeroext i1 @_ZN7cascadb8LeafNode12write_bucketERNS_11BlockWriterEPSt6vectorINS_6RecordESaIS4_EENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320) %23, ptr noundef nonnull align 8 dereferenceable(16) %107, ptr noundef %108, ptr %110, i32 %112)
  br i1 %113, label %119, label %114

114:                                              ; preds = %94
  %115 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %10)
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %114
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %10)
  br label %118

118:                                              ; preds = %117, %114
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %153

119:                                              ; preds = %94
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %120)
  %122 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 5
  %123 = load i64, ptr %15, align 8, !tbaa !21
  %124 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %122, i64 noundef %123) #9
  %125 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %124, i32 0, i32 2
  %126 = load i32, ptr %125, align 8, !tbaa !42
  %127 = zext i32 %126 to i64
  %128 = sub i64 %121, %127
  %129 = trunc i64 %128 to i32
  %130 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 5
  %131 = load i64, ptr %15, align 8, !tbaa !21
  %132 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %130, i64 noundef %131) #9
  %133 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %132, i32 0, i32 3
  store i32 %129, ptr %133, align 4, !tbaa !46
  %134 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 6
  %135 = load i64, ptr %15, align 8, !tbaa !21
  %136 = call noundef i64 @_ZN7cascadb13RecordBuckets13bucket_lengthEm(ptr noundef nonnull align 8 dereferenceable(56) %134, i64 noundef %135)
  %137 = trunc i64 %136 to i32
  %138 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 5
  %139 = load i64, ptr %15, align 8, !tbaa !21
  %140 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %138, i64 noundef %139) #9
  %141 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %140, i32 0, i32 4
  store i32 %137, ptr %141, align 8, !tbaa !47
  %142 = load ptr, ptr %17, align 8, !tbaa !5
  %143 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 5
  %144 = load i64, ptr %15, align 8, !tbaa !21
  %145 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %143, i64 noundef %144) #9
  %146 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %145, i32 0, i32 3
  %147 = load i32, ptr %146, align 4, !tbaa !46
  %148 = call noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef %142, i32 noundef %147)
  %149 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 5
  %150 = load i64, ptr %15, align 8, !tbaa !21
  %151 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %149, i64 noundef %150) #9
  %152 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %151, i32 0, i32 5
  store i16 %148, ptr %152, align 4, !tbaa !48
  store i32 0, ptr %9, align 4
  br label %153

153:                                              ; preds = %119, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  %154 = load i32, ptr %9, align 4
  switch i32 %154, label %159 [
    i32 0, label %155
  ]

155:                                              ; preds = %153
  br label %156

156:                                              ; preds = %155
  %157 = load i64, ptr %15, align 8, !tbaa !21
  %158 = add i64 %157, 1
  store i64 %158, ptr %15, align 8, !tbaa !21
  br label %88, !llvm.loop !49

159:                                              ; preds = %153, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  %160 = load i32, ptr %9, align 4
  switch i32 %160, label %224 [
    i32 5, label %161
  ]

161:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %162)
  store i64 %163, ptr %19, align 8, !tbaa !21
  %164 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %10)
  %165 = icmp ne i64 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %161
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %10)
  br label %167

167:                                              ; preds = %166, %161
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = load i64, ptr %8, align 8, !tbaa !21
  call void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %168, i64 noundef %169)
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 2
  %172 = load i64, ptr %171, align 8, !tbaa !50
  %173 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16) %170, i64 noundef %172)
  br i1 %173, label %175, label %174

174:                                              ; preds = %167
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %223

175:                                              ; preds = %167
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %23, i32 0, i32 3
  %178 = load i64, ptr %177, align 8, !tbaa !51
  %179 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16) %176, i64 noundef %178)
  br i1 %179, label %181, label %180

180:                                              ; preds = %175
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %223

181:                                              ; preds = %175
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = call noundef zeroext i1 @_ZN7cascadb8LeafNode18write_buckets_infoERNS_11BlockWriterE(ptr noundef nonnull align 8 dereferenceable(320) %23, ptr noundef nonnull align 8 dereferenceable(16) %182)
  br i1 %183, label %220, label %184

184:                                              ; preds = %181
  %185 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !52
  %186 = icmp sge i32 3, %185
  br i1 %186, label %187, label %219

187:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 384, ptr %20) #9
  %188 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %20, ptr noundef %188)
  %189 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %20, i32 noundef 3)
          to label %190 unwind label %215

190:                                              ; preds = %187
  %191 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %189, ptr noundef @.str.19)
          to label %192 unwind label %215

192:                                              ; preds = %190
  %193 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #10
  %194 = icmp ne ptr %193, null
  br i1 %194, label %195, label %198

195:                                              ; preds = %192
  %196 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #10
  %197 = getelementptr inbounds i8, ptr %196, i64 1
  br label %199

198:                                              ; preds = %192
  br label %199

199:                                              ; preds = %198, %195
  %200 = phi ptr [ %197, %195 ], [ @.str.1, %198 ]
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %191, ptr noundef %200)
          to label %202 unwind label %215

202:                                              ; preds = %199
  %203 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %201, ptr noundef @.str.20)
          to label %204 unwind label %215

204:                                              ; preds = %202
  %205 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %203, i32 noundef 1342)
          to label %206 unwind label %215

206:                                              ; preds = %204
  %207 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %205, ptr noundef @.str.19)
          to label %208 unwind label %215

208:                                              ; preds = %206
  %209 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %207, ptr noundef @.str.49)
          to label %210 unwind label %215

210:                                              ; preds = %208
  %211 = getelementptr inbounds %"class.cascadb::Node", ptr %23, i32 0, i32 2
  %212 = load i64, ptr %211, align 8, !tbaa !54
  %213 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %209, i64 noundef %212)
          to label %214 unwind label %215

214:                                              ; preds = %210
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %20) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr %20) #9
  br label %219

215:                                              ; preds = %210, %208, %206, %204, %202, %199, %190, %187
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %21, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %22, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %20) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  br label %227

219:                                              ; preds = %214, %184
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %223

220:                                              ; preds = %181
  %221 = load ptr, ptr %6, align 8, !tbaa !5
  %222 = load i64, ptr %19, align 8, !tbaa !21
  call void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %221, i64 noundef %222)
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %223

223:                                              ; preds = %220, %219, %180, %174
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br label %224

224:                                              ; preds = %223, %159
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #9
  br label %225

225:                                              ; preds = %224, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  %226 = load i1, ptr %4, align 1
  ret i1 %226

227:                                              ; preds = %215
  %228 = load ptr, ptr %21, align 8
  %229 = load i32, ptr %22, align 4
  %230 = insertvalue { ptr, i32 } poison, ptr %228, 0
  %231 = insertvalue { ptr, i32 } %230, i32 %229, 1
  resume { ptr, i32 } %231
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode18write_buckets_infoERNS_11BlockWriterE(ptr noundef nonnull align 8 dereferenceable(320), ptr noundef nonnull align 8 dereferenceable(16)) #0 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }

!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, !20, i64 208}
!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 = !{!14, !14, i64 0}
!22 = !{!23, !14, i64 232}
!23 = !{!"_ZTSN7cascadb8LeafNodeE", !10, i64 0, !16, i64 212, !14, i64 216, !14, i64 224, !14, i64 232, !24, i64 240, !28, i64 264}
!24 = !{!"_ZTSSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"_ZTSN7cascadb13RecordBucketsE", !14, i64 0, !29, i64 8, !14, i64 32, !14, i64 40, !14, i64 48}
!29 = !{!"_ZTSSt6vectorIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!10, !6, i64 200}
!34 = !{!35, !6, i64 160}
!35 = !{!"_ZTSN7cascadb4TreeE", !12, i64 0, !36, i64 32, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!36 = !{!"_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, !37, i64 96, !16, i64 100}
!37 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = !{i64 0, i64 8, !5, i64 8, i64 4, !41}
!41 = !{!18, !18, i64 0}
!42 = !{!43, !18, i64 32}
!43 = !{!"_ZTSN7cascadb8LeafNode10BucketInfoE", !44, i64 0, !44, i64 16, !18, i64 32, !18, i64 36, !18, i64 40, !45, i64 44}
!44 = !{!"_ZTSN7cascadb5SliceE", !6, i64 0, !18, i64 8}
!45 = !{!"short", !7, i64 0}
!46 = !{!43, !18, i64 36}
!47 = !{!43, !18, i64 40}
!48 = !{!43, !45, i64 44}
!49 = distinct !{!49, !39}
!50 = !{!23, !14, i64 216}
!51 = !{!23, !14, i64 224}
!52 = !{!53, !53, i64 0}
!53 = !{!"_ZTSN7cascadb11LoggerLevelE", !7, i64 0}
!54 = !{!11, !14, i64 40}


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

%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.cascadb::LoggerFormat" = type { ptr, %"class.std::__cxx11::basic_ostringstream" }
%"class.std::__cxx11::basic_ostringstream" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@_ZN7cascadb14g_logger_levelE = external local_unnamed_addr global i32, align 4
@_ZN7cascadb8g_loggerE = external local_unnamed_addr global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [42 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode8write_toERNS_11BlockWriterERm = external hidden unnamed_addr constant [66 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [31 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #6

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 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 nounwind uwtable
declare dso_local void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode8write_toERNS_11BlockWriterERm(ptr noundef nonnull align 8 dereferenceable(320) %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.cascadb::LoggerFormat", align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 208
  %7 = load i32, ptr %6, align 8, !tbaa !5
  switch i32 %7, label %8 [
    i32 0, label %.critedge
    i32 3, label %.critedge
  ]

8:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.47, ptr noundef nonnull @.str.1, i32 noundef 1298, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode8write_toERNS_11BlockWriterERm) #7
  unreachable

.critedge:                                        ; preds = %3, %3
  %9 = tail call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %10 = getelementptr inbounds i8, ptr %0, i64 232
  %11 = load i64, ptr %10, align 8, !tbaa !20
  %12 = add i64 %11, 16
  store i64 %12, ptr %2, align 8, !tbaa !31
  %13 = tail call noundef zeroext i1 @_ZN7cascadb11BlockWriter4skipEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %12)
  br i1 %13, label %14, label %112

14:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  call void @_ZN7cascadb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %15 = getelementptr inbounds i8, ptr %0, i64 200
  %16 = load ptr, ptr %15, align 8, !tbaa !32
  %17 = getelementptr inbounds i8, ptr %16, i64 160
  %18 = load ptr, ptr %17, align 8, !tbaa !33
  %.not = icmp eq ptr %18, null
  br i1 %.not, label %30, label %.preheader57

.preheader57:                                     ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 264
  %20 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
  %.not63 = icmp eq i64 %20, 0
  br i1 %.not63, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %26, %.preheader57
  %.045.lcssa = phi i64 [ 0, %.preheader57 ], [ %.146, %26 ]
  %21 = call { ptr, i32 } @_ZN7cascadb5Slice5allocEm(i64 noundef %.045.lcssa)
  %.fca.0.extract = extractvalue { ptr, i32 } %21, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %21, 1
  store ptr %.fca.0.extract, ptr %4, align 8, !tbaa !37
  %.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 !38
  br label %30

.lr.ph:                                           ; preds = %.preheader57, %26
  %.04559 = phi i64 [ %.146, %26 ], [ 0, %.preheader57 ]
  %.04758 = phi i64 [ %27, %26 ], [ 0, %.preheader57 ]
  %22 = call noundef i64 @_ZN7cascadb13RecordBuckets13bucket_lengthEm(ptr noundef nonnull align 8 dereferenceable(56) %19, i64 noundef %.04758)
  %23 = icmp ult i64 %.04559, %22
  br i1 %23, label %24, label %26

24:                                               ; preds = %.lr.ph
  %25 = call noundef i64 @_ZN7cascadb13RecordBuckets13bucket_lengthEm(ptr noundef nonnull align 8 dereferenceable(56) %19, i64 noundef %.04758)
  br label %26

26:                                               ; preds = %.lr.ph, %24
  %.146 = phi i64 [ %25, %24 ], [ %.04559, %.lr.ph ]
  %27 = add nuw i64 %.04758, 1
  %28 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
  %29 = icmp ult i64 %27, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !39

30:                                               ; preds = %._crit_edge, %14
  %31 = getelementptr inbounds i8, ptr %0, i64 264
  %32 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %31)
  %33 = getelementptr inbounds i8, ptr %0, i64 240
  %34 = call noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #8
  %35 = icmp eq i64 %32, %34
  br i1 %35, label %.preheader, label %37

.preheader:                                       ; preds = %30
  %36 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %31)
  %.not5260.not = icmp eq i64 %36, 0
  br i1 %.not5260.not, label %.critedge56, label %.lr.ph62

.lr.ph62:                                         ; preds = %.preheader
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %38

37:                                               ; preds = %30
  call void @__assert_fail(ptr noundef nonnull @.str.48, ptr noundef nonnull @.str.1, i32 noundef 1315, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode8write_toERNS_11BlockWriterERm) #7
  unreachable

38:                                               ; preds = %.lr.ph62, %49
  %.04861 = phi i64 [ 0, %.lr.ph62 ], [ %68, %49 ]
  %39 = call noundef ptr @_ZN7cascadb13RecordBuckets6bucketEm(ptr noundef nonnull align 8 dereferenceable(56) %31, i64 noundef %.04861)
  %40 = call noundef ptr @_ZN7cascadb11BlockWriter4addrEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %41 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %42 = trunc i64 %41 to i32
  %43 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %.04861) #8
  %44 = getelementptr inbounds i8, ptr %43, i64 32
  store i32 %42, ptr %44, align 8, !tbaa !41
  %.sroa.0.0.copyload = load ptr, ptr %4, align 8, !tbaa !37
  %.sroa.2.0.copyload = load i32, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !38
  %45 = call noundef zeroext i1 @_ZN7cascadb8LeafNode12write_bucketERNS_11BlockWriterEPSt6vectorINS_6RecordESaIS4_EENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %39, ptr %.sroa.0.0.copyload, i32 %.sroa.2.0.copyload)
  br i1 %45, label %49, label %46

46:                                               ; preds = %38
  %47 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %.not51 = icmp eq i64 %47, 0
  br i1 %.not51, label %111, label %48

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

49:                                               ; preds = %38
  %50 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %51 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %.04861) #8
  %52 = getelementptr inbounds i8, ptr %51, i64 32
  %53 = load i32, ptr %52, align 8, !tbaa !41
  %54 = trunc i64 %50 to i32
  %55 = sub i32 %54, %53
  %56 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %.04861) #8
  %57 = getelementptr inbounds i8, ptr %56, i64 36
  store i32 %55, ptr %57, align 4, !tbaa !45
  %58 = call noundef i64 @_ZN7cascadb13RecordBuckets13bucket_lengthEm(ptr noundef nonnull align 8 dereferenceable(56) %31, i64 noundef %.04861)
  %59 = trunc i64 %58 to i32
  %60 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %.04861) #8
  %61 = getelementptr inbounds i8, ptr %60, i64 40
  store i32 %59, ptr %61, align 8, !tbaa !46
  %62 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %.04861) #8
  %63 = getelementptr inbounds i8, ptr %62, i64 36
  %64 = load i32, ptr %63, align 4, !tbaa !45
  %65 = call noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef %40, i32 noundef %64)
  %66 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %.04861) #8
  %67 = getelementptr inbounds i8, ptr %66, i64 44
  store i16 %65, ptr %67, align 4, !tbaa !47
  %68 = add nuw i64 %.04861, 1
  %69 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %31)
  %.not52 = icmp ult i64 %68, %69
  br i1 %.not52, label %38, label %.critedge56, !llvm.loop !48

.critedge56:                                      ; preds = %49, %.preheader
  %70 = call noundef i64 @_ZN7cascadb11BlockWriter3posEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %71 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %.not53 = icmp eq i64 %71, 0
  br i1 %.not53, label %73, label %72

72:                                               ; preds = %.critedge56
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  br label %73

73:                                               ; preds = %72, %.critedge56
  call void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %9)
  %74 = getelementptr inbounds i8, ptr %0, i64 216
  %75 = load i64, ptr %74, align 8, !tbaa !49
  %76 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %75)
  br i1 %76, label %77, label %111

77:                                               ; preds = %73
  %78 = getelementptr inbounds i8, ptr %0, i64 224
  %79 = load i64, ptr %78, align 8, !tbaa !50
  %80 = call noundef zeroext i1 @_ZN7cascadb11BlockWriter11writeUInt64Em(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %79)
  br i1 %80, label %81, label %111

81:                                               ; preds = %77
  %82 = call noundef zeroext i1 @_ZN7cascadb8LeafNode18write_buckets_infoERNS_11BlockWriterE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef nonnull align 8 dereferenceable(16) %1)
  br i1 %82, label %110, label %83

83:                                               ; preds = %81
  %84 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !51
  %85 = icmp slt i32 %84, 4
  br i1 %85, label %86, label %111

86:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %5) #8
  %87 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !37
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %5, ptr noundef %87)
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %5, i32 noundef 3)
          to label %89 unwind label %108

89:                                               ; preds = %86
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull @.str.19)
          to label %91 unwind label %108

91:                                               ; preds = %89
  %92 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #9
  %.not54 = icmp eq ptr %92, null
  %93 = getelementptr inbounds i8, ptr %92, i64 1
  %spec.select = select i1 %.not54, ptr @.str.1, ptr %93
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull %spec.select)
          to label %95 unwind label %108

95:                                               ; preds = %91
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef nonnull @.str.20)
          to label %97 unwind label %108

97:                                               ; preds = %95
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %96, i32 noundef 1342)
          to label %99 unwind label %108

99:                                               ; preds = %97
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @.str.19)
          to label %101 unwind label %108

101:                                              ; preds = %99
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef nonnull @.str.49)
          to label %103 unwind label %108

103:                                              ; preds = %101
  %104 = getelementptr inbounds i8, ptr %0, i64 40
  %105 = load i64, ptr %104, align 8, !tbaa !53
  %106 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %102, i64 noundef %105)
          to label %107 unwind label %108

107:                                              ; preds = %103
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %5) #8
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %5) #8
  br label %111

108:                                              ; preds = %103, %101, %99, %97, %95, %91, %89, %86
  %109 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %5) #8
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  resume { ptr, i32 } %109

110:                                              ; preds = %81
  call void @_ZN7cascadb11BlockWriter4seekEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %70)
  br label %111

111:                                              ; preds = %48, %46, %110, %73, %77, %107, %83
  %.4 = phi i1 [ true, %110 ], [ false, %73 ], [ false, %77 ], [ false, %107 ], [ false, %83 ], [ false, %46 ], [ false, %48 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  br label %112

112:                                              ; preds = %.critedge, %111
  %.5 = phi i1 [ %.4, %111 ], [ false, %.critedge ]
  ret i1 %.5
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode18write_buckets_infoERNS_11BlockWriterE(ptr noundef nonnull align 8 dereferenceable(320), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }

!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, !19, i64 208}
!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, !13, i64 232}
!21 = !{!"_ZTSN7cascadb8LeafNodeE", !6, i64 0, !15, i64 212, !13, i64 216, !13, i64 224, !13, i64 232, !22, i64 240, !26, i64 264}
!22 = !{!"_ZTSSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!26 = !{!"_ZTSN7cascadb13RecordBucketsE", !13, i64 0, !27, i64 8, !13, i64 32, !13, i64 40, !13, i64 48}
!27 = !{!"_ZTSSt6vectorIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!31 = !{!13, !13, i64 0}
!32 = !{!6, !10, i64 200}
!33 = !{!34, !10, i64 160}
!34 = !{!"_ZTSN7cascadb4TreeE", !8, i64 0, !35, i64 32, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176}
!35 = !{!"_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, !36, i64 96, !15, i64 100}
!36 = !{!"_ZTSN7cascadb8CompressE", !11, i64 0}
!37 = !{!10, !10, i64 0}
!38 = !{!17, !17, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!42, !17, i64 32}
!42 = !{!"_ZTSN7cascadb8LeafNode10BucketInfoE", !43, i64 0, !43, i64 16, !17, i64 32, !17, i64 36, !17, i64 40, !44, i64 44}
!43 = !{!"_ZTSN7cascadb5SliceE", !10, i64 0, !17, i64 8}
!44 = !{!"short", !11, i64 0}
!45 = !{!42, !17, i64 36}
!46 = !{!42, !17, i64 40}
!47 = !{!42, !44, i64 44}
!48 = distinct !{!48, !40}
!49 = !{!21, !13, i64 216}
!50 = !{!21, !13, i64 224}
!51 = !{!52, !52, i64 0}
!52 = !{!"_ZTSN7cascadb11LoggerLevelE", !11, i64 0}
!53 = !{!7, !13, i64 40}


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