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

; 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::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::Record" = type { %"class.cascadb::Slice", %"class.cascadb::Slice" }

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode20refresh_buckets_infoEv = external hidden unnamed_addr constant [47 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [15 x i8], align 1

; 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 uwtable
declare dso_local void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12)) #1 align 2

; 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 uwtable
declare dso_local { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12)) #1 align 2

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

; Function Attrs: mustprogress 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 uwtable
define dso_local void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.cascadb::Slice", align 8
  %7 = alloca { ptr, i32 }, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %9

9:                                                ; preds = %20, %1
  %10 = load i64, ptr %3, align 8, !tbaa !9
  %11 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %12 = call noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %13 = icmp ult i64 %10, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %23

15:                                               ; preds = %9
  %16 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %17 = load i64, ptr %3, align 8, !tbaa !9
  %18 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %17) #5
  %19 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %18, i32 0, i32 0
  call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %19)
  br label %20

20:                                               ; preds = %15
  %21 = load i64, ptr %3, align 8, !tbaa !9
  %22 = add i64 %21, 1
  store i64 %22, ptr %3, align 8, !tbaa !9
  br label %9, !llvm.loop !11

23:                                               ; preds = %14
  %24 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 4
  store i64 4, ptr %24, align 8, !tbaa !13
  %25 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %26 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 6
  %27 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %26)
  call void @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %27)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %88, %23
  %29 = load i64, ptr %4, align 8, !tbaa !9
  %30 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 6
  %31 = call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %30)
  %32 = icmp ult i64 %29, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %91

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %35 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 6
  %36 = load i64, ptr %4, align 8, !tbaa !9
  %37 = call noundef ptr @_ZN7cascadb13RecordBuckets6bucketEm(ptr noundef nonnull align 8 dereferenceable(56) %35, i64 noundef %36)
  store ptr %37, ptr %5, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %34
  br label %43

41:                                               ; preds = %34
  call void @__assert_fail(ptr noundef @.str.44, ptr noundef @.str.1, i32 noundef 1397, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode20refresh_buckets_infoEv) #6
  unreachable

42:                                               ; No predecessors!
  br label %43

43:                                               ; preds = %42, %40
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call noundef i64 @_ZNKSt6vectorIN7cascadb6RecordESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #5
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  br label %50

48:                                               ; preds = %43
  call void @__assert_fail(ptr noundef @.str.50, ptr noundef @.str.1, i32 noundef 1398, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode20refresh_buckets_infoEv) #6
  unreachable

49:                                               ; No predecessors!
  br label %50

50:                                               ; preds = %49, %47
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #5
  %53 = getelementptr inbounds %"class.cascadb::Record", ptr %52, i32 0, i32 0
  %54 = call { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12) %53)
  store { ptr, i32 } %54, ptr %7, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %7, i64 12, i1 false)
  %55 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %56 = load i64, ptr %4, align 8, !tbaa !9
  %57 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %56) #5
  %58 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %57, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %58, ptr align 8 %6, i64 12, i1 false), !tbaa.struct !34
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  %59 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %60 = load i64, ptr %4, align 8, !tbaa !9
  %61 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %60) #5
  %62 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %61, i32 0, i32 2
  store i32 0, ptr %62, align 8, !tbaa !36
  %63 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %64 = load i64, ptr %4, align 8, !tbaa !9
  %65 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %64) #5
  %66 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %65, i32 0, i32 3
  store i32 0, ptr %66, align 4, !tbaa !40
  %67 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %68 = load i64, ptr %4, align 8, !tbaa !9
  %69 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %68) #5
  %70 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %69, i32 0, i32 4
  store i32 0, ptr %70, align 8, !tbaa !41
  %71 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %72 = load i64, ptr %4, align 8, !tbaa !9
  %73 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %72) #5
  %74 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %73, i32 0, i32 5
  store i16 0, ptr %74, align 4, !tbaa !42
  %75 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 5
  %76 = load i64, ptr %4, align 8, !tbaa !9
  %77 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %76) #5
  %78 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %77, i32 0, i32 0
  %79 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %78)
  %80 = add i64 4, %79
  %81 = add i64 %80, 4
  %82 = add i64 %81, 4
  %83 = add i64 %82, 4
  %84 = add i64 %83, 2
  %85 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %8, i32 0, i32 4
  %86 = load i64, ptr %85, align 8, !tbaa !13
  %87 = add i64 %86, %84
  store i64 %87, ptr %85, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %88

88:                                               ; preds = %50
  %89 = load i64, ptr %4, align 8, !tbaa !9
  %90 = add i64 %89, 1
  store i64 %90, ptr %4, align 8, !tbaa !9
  br label %28, !llvm.loop !43

91:                                               ; preds = %33
  ret void
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nounwind }
attributes #6 = { noreturn 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 232}
!14 = !{!"_ZTSN7cascadb8LeafNodeE", !15, i64 0, !20, i64 212, !10, i64 216, !10, i64 224, !10, i64 232, !25, i64 240, !29, i64 264}
!15 = !{!"_ZTSN7cascadb8DataNodeE", !16, i64 0, !6, i64 200, !24, i64 208}
!16 = !{!"_ZTSN7cascadb4NodeE", !17, i64 8, !10, i64 40, !19, i64 48, !20, i64 96, !20, i64 97, !20, i64 98, !21, i64 104, !21, i64 120, !22, i64 136, !22, i64 140, !23, i64 144}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !10, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!19 = !{!"_ZTSN7cascadb5MutexE", !20, i64 0, !7, i64 8}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTS7timeval", !10, i64 0, !10, i64 8}
!22 = !{!"int", !7, i64 0}
!23 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!24 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!25 = !{!"_ZTSSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSN7cascadb13RecordBucketsE", !10, i64 0, !30, i64 8, !10, i64 32, !10, i64 40, !10, i64 48}
!30 = !{!"_ZTSSt6vectorIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{i64 0, i64 8, !5, i64 8, i64 4, !35}
!35 = !{!22, !22, i64 0}
!36 = !{!37, !22, i64 32}
!37 = !{!"_ZTSN7cascadb8LeafNode10BucketInfoE", !38, i64 0, !38, i64 16, !22, i64 32, !22, i64 36, !22, i64 40, !39, i64 44}
!38 = !{!"_ZTSN7cascadb5SliceE", !6, i64 0, !22, i64 8}
!39 = !{!"short", !7, i64 0}
!40 = !{!37, !22, i64 36}
!41 = !{!37, !22, i64 40}
!42 = !{!37, !39, i64 44}
!43 = distinct !{!43, !12}


; 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"

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode20refresh_buckets_infoEv = external hidden unnamed_addr constant [47 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [15 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12)) 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_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(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb8LeafNode20refresh_buckets_infoEv(ptr noundef nonnull align 8 dereferenceable(320) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 240
  %3 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %.not24 = icmp eq i64 %3, 0
  br i1 %.not24, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %1
  %4 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 4, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 264
  %6 = tail call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %5)
  tail call void @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %6)
  %7 = tail call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %5)
  %.not25 = icmp eq i64 %7, 0
  br i1 %.not25, label %._crit_edge23, label %.lr.ph22

.lr.ph:                                           ; preds = %1, %.lr.ph
  %.019 = phi i64 [ %9, %.lr.ph ], [ 0, %1 ]
  %8 = tail call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.019) #3
  tail call void @_ZN7cascadb5Slice7destroyEv(ptr noundef nonnull align 8 dereferenceable(12) %8)
  %9 = add nuw i64 %.019, 1
  %10 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %11 = icmp ult i64 %9, %10
  br i1 %11, label %.lr.ph, label %._crit_edge, !llvm.loop !30

._crit_edge23:                                    ; preds = %17, %._crit_edge
  ret void

.lr.ph22:                                         ; preds = %._crit_edge, %17
  %.01620 = phi i64 [ %34, %17 ], [ 0, %._crit_edge ]
  %12 = tail call noundef ptr @_ZN7cascadb13RecordBuckets6bucketEm(ptr noundef nonnull align 8 dereferenceable(56) %5, i64 noundef %.01620)
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %13, label %14

13:                                               ; preds = %.lr.ph22
  tail call void @__assert_fail(ptr noundef nonnull @.str.44, ptr noundef nonnull @.str.1, i32 noundef 1397, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode20refresh_buckets_infoEv) #4
  unreachable

14:                                               ; preds = %.lr.ph22
  %15 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb6RecordESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  %.not18 = icmp eq i64 %15, 0
  br i1 %.not18, label %16, label %17

16:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.50, ptr noundef nonnull @.str.1, i32 noundef 1398, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode20refresh_buckets_infoEv) #4
  unreachable

17:                                               ; preds = %14
  %18 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  %19 = tail call { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12) %18)
  %.fca.0.extract = extractvalue { ptr, i32 } %19, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %19, 1
  %20 = tail call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01620) #3
  store ptr %.fca.0.extract, ptr %20, align 8, !tbaa !32
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %20, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !33
  %21 = tail call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01620) #3
  %22 = getelementptr inbounds i8, ptr %21, i64 32
  store i32 0, ptr %22, align 8, !tbaa !34
  %23 = tail call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01620) #3
  %24 = getelementptr inbounds i8, ptr %23, i64 36
  store i32 0, ptr %24, align 4, !tbaa !38
  %25 = tail call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01620) #3
  %26 = getelementptr inbounds i8, ptr %25, i64 40
  store i32 0, ptr %26, align 8, !tbaa !39
  %27 = tail call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01620) #3
  %28 = getelementptr inbounds i8, ptr %27, i64 44
  store i16 0, ptr %28, align 4, !tbaa !40
  %29 = tail call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01620) #3
  %30 = tail call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %29)
  %31 = add i64 %30, 18
  %32 = load i64, ptr %4, align 8, !tbaa !5
  %33 = add i64 %31, %32
  store i64 %33, ptr %4, align 8, !tbaa !5
  %34 = add nuw i64 %.01620, 1
  %35 = tail call noundef i64 @_ZN7cascadb13RecordBuckets14buckets_numberEv(ptr noundef nonnull align 8 dereferenceable(56) %5)
  %36 = icmp ult i64 %34, %35
  br i1 %36, label %.lr.ph22, label %._crit_edge23, !llvm.loop !41
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) local_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 = { 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 #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 = { nounwind }
attributes #4 = { noreturn 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, !14, i64 232}
!6 = !{!"_ZTSN7cascadb8LeafNodeE", !7, i64 0, !16, i64 212, !14, i64 216, !14, i64 224, !14, i64 232, !21, i64 240, !25, i64 264}
!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 = !{!"_ZTSSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN7cascadb8LeafNode10BucketInfoESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!25 = !{!"_ZTSN7cascadb13RecordBucketsE", !14, i64 0, !26, i64 8, !14, i64 32, !14, i64 40, !14, i64 48}
!26 = !{!"_ZTSSt6vectorIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN7cascadb13RecordBuckets16RecordBucketInfoESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!11, !11, i64 0}
!33 = !{!18, !18, i64 0}
!34 = !{!35, !18, i64 32}
!35 = !{!"_ZTSN7cascadb8LeafNode10BucketInfoE", !36, i64 0, !36, i64 16, !18, i64 32, !18, i64 36, !18, i64 40, !37, i64 44}
!36 = !{!"_ZTSN7cascadb5SliceE", !11, i64 0, !18, i64 8}
!37 = !{!"short", !12, i64 0}
!38 = !{!35, !18, i64 36}
!39 = !{!35, !18, i64 40}
!40 = !{!35, !37, i64 44}
!41 = distinct !{!41, !31}


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