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

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

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

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

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

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

; 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 ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7cascadb9InnerNode17find_msgbuf_maxszEv(ptr noundef nonnull align 8 dereferenceable(312) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %10 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %9, i32 0, i32 3
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %11)
  store i64 %12, ptr %5, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %13 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %9, i32 0, i32 9
  %14 = call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  %15 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %14, ptr %15, align 8
  br label %16

16:                                               ; preds = %44, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %17 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %9, i32 0, i32 9
  %18 = call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  %19 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %18, ptr %19, align 8
  %20 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %47

22:                                               ; preds = %16
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %3, align 4, !tbaa !9
  %25 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %26 = getelementptr inbounds %"class.cascadb::Pivot", ptr %25, i32 0, i32 3
  %27 = load ptr, ptr %26, align 8, !tbaa !30
  %28 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %27)
  %29 = load i64, ptr %5, align 8, !tbaa !29
  %30 = icmp ugt i64 %28, %29
  br i1 %30, label %31, label %43

31:                                               ; preds = %22
  %32 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %33 = getelementptr inbounds %"class.cascadb::Pivot", ptr %32, i32 0, i32 3
  %34 = load ptr, ptr %33, align 8, !tbaa !30
  call void @_ZN7cascadb6MsgBuf9read_lockEv(ptr noundef nonnull align 8 dereferenceable(104) %34)
  %35 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %36 = getelementptr inbounds %"class.cascadb::Pivot", ptr %35, i32 0, i32 3
  %37 = load ptr, ptr %36, align 8, !tbaa !30
  %38 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %37)
  store i64 %38, ptr %5, align 8, !tbaa !29
  %39 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %40 = getelementptr inbounds %"class.cascadb::Pivot", ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !30
  call void @_ZN7cascadb6MsgBuf6unlockEv(ptr noundef nonnull align 8 dereferenceable(104) %41)
  %42 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %42, ptr %4, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %31, %22
  br label %44

44:                                               ; preds = %43
  %45 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #4
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  br label %16, !llvm.loop !32

47:                                               ; preds = %21
  %48 = load i32, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret i32 %48
}

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { 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, !6, i64 224}
!12 = !{!"_ZTSN7cascadb9InnerNodeE", !13, i64 0, !19, i64 212, !17, i64 216, !6, i64 224, !23, i64 232, !10, i64 248, !10, i64 252, !10, i64 256, !24, i64 260, !25, i64 264, !17, i64 288, !17, i64 296, !17, i64 304}
!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 = !{!"_ZTSN7cascadb5SliceE", !6, i64 0, !10, i64 8}
!24 = !{!"short", !7, i64 0}
!25 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!17, !17, i64 0}
!30 = !{!31, !6, i64 40}
!31 = !{!"_ZTSN7cascadb5PivotE", !23, i64 0, !23, i64 16, !17, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !24, i64 60}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; 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.__gnu_cxx::__normal_iterator" = type { ptr }

; 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; 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 ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7cascadb9InnerNode17find_msgbuf_maxszEv(ptr noundef nonnull align 8 dereferenceable(312) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 224
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = tail call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 264
  %8 = tail call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %8, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %9 = tail call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %9, ptr %3, align 8
  %10 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %28, %1
  %.05.lcssa = phi i32 [ 0, %1 ], [ %.16, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret i32 %.05.lcssa

.lr.ph:                                           ; preds = %1, %28
  %.09 = phi i32 [ %11, %28 ], [ 0, %1 ]
  %.048 = phi i64 [ %.1, %28 ], [ %6, %1 ]
  %.057 = phi i32 [ %.16, %28 ], [ 0, %1 ]
  %11 = add nuw nsw i32 %.09, 1
  %12 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %13 = getelementptr inbounds i8, ptr %12, i64 40
  %14 = load ptr, ptr %13, align 8, !tbaa !27
  %15 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %14)
  %16 = icmp ugt i64 %15, %.048
  br i1 %16, label %17, label %28

17:                                               ; preds = %.lr.ph
  %18 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %19 = getelementptr inbounds i8, ptr %18, i64 40
  %20 = load ptr, ptr %19, align 8, !tbaa !27
  call void @_ZN7cascadb6MsgBuf9read_lockEv(ptr noundef nonnull align 8 dereferenceable(104) %20)
  %21 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %22 = getelementptr inbounds i8, ptr %21, i64 40
  %23 = load ptr, ptr %22, align 8, !tbaa !27
  %24 = call noundef i64 @_ZNK7cascadb6MsgBuf4sizeEv(ptr noundef nonnull align 8 dereferenceable(104) %23)
  %25 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %26 = getelementptr inbounds i8, ptr %25, i64 40
  %27 = load ptr, ptr %26, align 8, !tbaa !27
  call void @_ZN7cascadb6MsgBuf6unlockEv(ptr noundef nonnull align 8 dereferenceable(104) %27)
  br label %28

28:                                               ; preds = %.lr.ph, %17
  %.16 = phi i32 [ %11, %17 ], [ %.057, %.lr.ph ]
  %.1 = phi i64 [ %24, %17 ], [ %.048, %.lr.ph ]
  %29 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef 0) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %30 = call ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %30, ptr %3, align 8
  %31 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN7cascadb5PivotESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !29
}

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 224}
!6 = !{!"_ZTSN7cascadb9InnerNodeE", !7, i64 0, !16, i64 212, !14, i64 216, !11, i64 224, !21, i64 232, !18, i64 248, !18, i64 252, !18, i64 256, !22, i64 260, !23, i64 264, !14, i64 288, !14, i64 296, !14, i64 304}
!7 = !{!"_ZTSN7cascadb8DataNodeE", !8, i64 0, !11, i64 200, !20, i64 208}
!8 = !{!"_ZTSN7cascadb4NodeE", !9, i64 8, !14, i64 40, !15, i64 48, !16, i64 96, !16, i64 97, !16, i64 98, !17, i64 104, !17, i64 120, !18, i64 136, !18, i64 140, !19, i64 144}
!9 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !10, i64 0, !14, i64 8, !12, i64 16}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"_ZTSN7cascadb5MutexE", !16, i64 0, !12, i64 8}
!16 = !{!"bool", !12, i64 0}
!17 = !{!"_ZTS7timeval", !14, i64 0, !14, i64 8}
!18 = !{!"int", !12, i64 0}
!19 = !{!"_ZTSN7cascadb6RWLockE", !12, i64 0}
!20 = !{!"_ZTSN7cascadb10NodeStatusE", !12, i64 0}
!21 = !{!"_ZTSN7cascadb5SliceE", !11, i64 0, !18, i64 8}
!22 = !{!"short", !12, i64 0}
!23 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!27 = !{!28, !11, i64 40}
!28 = !{!"_ZTSN7cascadb5PivotE", !21, i64 0, !21, i64 16, !14, i64 32, !11, i64 40, !18, i64 48, !18, i64 52, !18, i64 56, !22, i64 60}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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