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

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

%"class.cascadb::LeafNode" = type { %"class.cascadb::DataNode.base", i8, i64, i64, i64, %"class.std::vector.8", %"class.cascadb::RecordBuckets" }
%"class.cascadb::DataNode.base" = type <{ %"class.cascadb::Node", ptr, i32 }>
%"class.cascadb::Node" = type { ptr, %"class.std::__cxx11::basic_string", i64, %"class.cascadb::Mutex", i8, i8, i8, %struct.timeval, %struct.timeval, i32, i32, %"class.cascadb::RWLock" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.cascadb::Mutex" = type { i8, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.timeval = type { i64, i64 }
%"class.cascadb::RWLock" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::RecordBuckets" = type { i64, %"class.std::vector.13", i64, i64, i64 }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.cascadb::LeafNode::BucketInfo" = type <{ %"class.cascadb::Slice", %"class.cascadb::Slice", i32, i32, i32, i16, [2 x i8] }>
%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.cascadb::DataNode" = type <{ %"class.cascadb::Node", ptr, i32, [4 x i8] }>

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode17read_buckets_infoERNS_11BlockReaderE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #2 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef %6)
  br i1 %11, label %13, label %12

12:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %88

13:                                               ; preds = %2
  %14 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 5
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = zext i32 %15 to i64
  call void @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %16)
  %17 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 4
  store i64 4, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !32
  br label %18

18:                                               ; preds = %78, %13
  %19 = load i64, ptr %8, align 8, !tbaa !32
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = zext i32 %20 to i64
  %22 = icmp ult i64 %19, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %18
  store i32 2, ptr %7, align 4
  br label %81

24:                                               ; preds = %18
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 5
  %27 = load i64, ptr %8, align 8, !tbaa !32
  %28 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %27) #4
  %29 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %28, i32 0, i32 0
  %30 = call noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(12) %29)
  br i1 %30, label %32, label %31

31:                                               ; preds = %24
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %81

32:                                               ; preds = %24
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 5
  %35 = load i64, ptr %8, align 8, !tbaa !32
  %36 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35) #4
  %37 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %36, i32 0, i32 2
  %38 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef %37)
  br i1 %38, label %40, label %39

39:                                               ; preds = %32
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %81

40:                                               ; preds = %32
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 5
  %43 = load i64, ptr %8, align 8, !tbaa !32
  %44 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %43) #4
  %45 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %44, i32 0, i32 3
  %46 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef %45)
  br i1 %46, label %48, label %47

47:                                               ; preds = %40
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %81

48:                                               ; preds = %40
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 5
  %51 = load i64, ptr %8, align 8, !tbaa !32
  %52 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %51) #4
  %53 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %52, i32 0, i32 4
  %54 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef %53)
  br i1 %54, label %56, label %55

55:                                               ; preds = %48
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %81

56:                                               ; preds = %48
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 5
  %59 = load i64, ptr %8, align 8, !tbaa !32
  %60 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %59) #4
  %61 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %60, i32 0, i32 5
  %62 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt16EPt(ptr noundef nonnull align 8 dereferenceable(16) %57, ptr noundef %61)
  br i1 %62, label %64, label %63

63:                                               ; preds = %56
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %81

64:                                               ; preds = %56
  %65 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 5
  %66 = load i64, ptr %8, align 8, !tbaa !32
  %67 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %66) #4
  %68 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %67, i32 0, i32 0
  %69 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %68)
  %70 = add i64 4, %69
  %71 = add i64 %70, 4
  %72 = add i64 %71, 4
  %73 = add i64 %72, 4
  %74 = add i64 %73, 2
  %75 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 4
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = add i64 %76, %74
  store i64 %77, ptr %75, align 8, !tbaa !11
  br label %78

78:                                               ; preds = %64
  %79 = load i64, ptr %8, align 8, !tbaa !32
  %80 = add i64 %79, 1
  store i64 %80, ptr %8, align 8, !tbaa !32
  br label %18, !llvm.loop !33

81:                                               ; preds = %63, %55, %47, %39, %31, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %82 = load i32, ptr %7, align 4
  switch i32 %82, label %88 [
    i32 2, label %83
  ]

83:                                               ; preds = %81
  %84 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %9, i32 0, i32 6
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = zext i32 %85 to i64
  call void @_ZN7cascadb13RecordBuckets18set_buckets_numberEm(ptr noundef nonnull align 8 dereferenceable(56) %84, i64 noundef %86)
  %87 = getelementptr inbounds %"class.cascadb::DataNode", ptr %9, i32 0, i32 2
  store i32 2, ptr %87, align 8, !tbaa !35
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %88

88:                                               ; preds = %83, %81, %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %89 = load i1, ptr %3, align 1
  ret i1 %89
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !17, i64 232}
!12 = !{!"_ZTSN7cascadb8LeafNodeE", !13, i64 0, !19, i64 212, !17, i64 216, !17, i64 224, !17, i64 232, !23, i64 240, !27, i64 264}
!13 = !{!"_ZTSN7cascadb8DataNodeE", !14, i64 0, !6, i64 200, !22, i64 208}
!14 = !{!"_ZTSN7cascadb4NodeE", !15, i64 8, !17, i64 40, !18, i64 48, !19, i64 96, !19, i64 97, !19, i64 98, !20, i64 104, !20, i64 120, !10, i64 136, !10, i64 140, !21, i64 144}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN7cascadb5MutexE", !19, i64 0, !7, i64 8}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTS7timeval", !17, i64 0, !17, i64 8}
!21 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!22 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!23 = !{!"_ZTSSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSN7cascadb13RecordBucketsE", !17, i64 0, !28, i64 8, !17, i64 32, !17, i64 40, !17, i64 48}
!28 = !{!"_ZTSSt6vectorIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!17, !17, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!13, !22, i64 208}


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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode17read_buckets_infoERNS_11BlockReaderE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #2 align 2 {
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %4 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %3)
  br i1 %4, label %5, label %.loopexit

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 240
  %7 = load i32, ptr %3, align 4, !tbaa !5
  %8 = zext i32 %7 to i64
  call void @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %8)
  %9 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 4, ptr %9, align 8, !tbaa !9
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %.not18.not = icmp eq i32 %10, 0
  br i1 %.not18.not, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %5, %29
  %.019 = phi i64 [ %35, %29 ], [ 0, %5 ]
  %11 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.019) #4
  %12 = call noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(12) %11)
  br i1 %12, label %13, label %.loopexit

13:                                               ; preds = %.lr.ph
  %14 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.019) #4
  %15 = getelementptr inbounds i8, ptr %14, i64 32
  %16 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %15)
  br i1 %16, label %17, label %.loopexit

17:                                               ; preds = %13
  %18 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.019) #4
  %19 = getelementptr inbounds i8, ptr %18, i64 36
  %20 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %19)
  br i1 %20, label %21, label %.loopexit

21:                                               ; preds = %17
  %22 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.019) #4
  %23 = getelementptr inbounds i8, ptr %22, i64 40
  %24 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %23)
  br i1 %24, label %25, label %.loopexit

25:                                               ; preds = %21
  %26 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.019) #4
  %27 = getelementptr inbounds i8, ptr %26, i64 44
  %28 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt16EPt(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %27)
  br i1 %28, label %29, label %.loopexit

29:                                               ; preds = %25
  %30 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.019) #4
  %31 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %30)
  %32 = add i64 %31, 18
  %33 = load i64, ptr %9, align 8, !tbaa !9
  %34 = add i64 %32, %33
  store i64 %34, ptr %9, align 8, !tbaa !9
  %35 = add nuw nsw i64 %.019, 1
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = zext i32 %36 to i64
  %.not = icmp ult i64 %35, %37
  br i1 %.not, label %.lr.ph, label %.critedge.loopexit, !llvm.loop !31

.critedge.loopexit:                               ; preds = %29
  %38 = zext i32 %36 to i64
  br label %.critedge

.critedge:                                        ; preds = %5, %.critedge.loopexit
  %39 = phi i64 [ %38, %.critedge.loopexit ], [ 0, %5 ]
  %40 = getelementptr inbounds i8, ptr %0, i64 264
  call void @_ZN7cascadb13RecordBuckets18set_buckets_numberEm(ptr noundef nonnull align 8 dereferenceable(56) %40, i64 noundef %39)
  %41 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 2, ptr %41, align 8, !tbaa !33
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %13, %17, %21, %25, %2, %.critedge
  %.1 = phi i1 [ true, %.critedge ], [ false, %2 ], [ false, %25 ], [ false, %21 ], [ false, %17 ], [ false, %13 ], [ false, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  ret i1 %.1
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !16, i64 232}
!10 = !{!"_ZTSN7cascadb8LeafNodeE", !11, i64 0, !18, i64 212, !16, i64 216, !16, i64 224, !16, i64 232, !22, i64 240, !26, i64 264}
!11 = !{!"_ZTSN7cascadb8DataNodeE", !12, i64 0, !15, i64 200, !21, i64 208}
!12 = !{!"_ZTSN7cascadb4NodeE", !13, i64 8, !16, i64 40, !17, i64 48, !18, i64 96, !18, i64 97, !18, i64 98, !19, i64 104, !19, i64 120, !6, i64 136, !6, i64 140, !20, i64 144}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !16, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN7cascadb5MutexE", !18, i64 0, !7, i64 8}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS7timeval", !16, i64 0, !16, i64 8}
!20 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!21 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!22 = !{!"_ZTSSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!26 = !{!"_ZTSN7cascadb13RecordBucketsE", !16, i64 0, !27, i64 8, !16, i64 32, !16, i64 40, !16, 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", !15, i64 0, !15, i64 8, !15, i64 16}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!11, !21, i64 208}


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