; LLVM IR from weicao/cascadb :: src/tree/msg.ll (ZN7cascadb6MsgBuf5writeERKNS_3MsgE)

; 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::FastVector<cascadb::Msg>::Iterator" = type { ptr, i64, i64 }
%"class.cascadb::KeyComp" = type { ptr }
%"class.cascadb::MsgBuf" = type { ptr, %"class.cascadb::RWLock", %"class.cascadb::FastVector", 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::FastVector" = type { %"class.std::vector", i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<cascadb::Msg> *, std::allocator<std::vector<cascadb::Msg> *>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<cascadb::Msg> *, std::allocator<std::vector<cascadb::Msg> *>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<cascadb::Msg> *, std::allocator<std::vector<cascadb::Msg> *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<cascadb::Msg> *, std::allocator<std::vector<cascadb::Msg> *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::Msg" = type { i32, [4 x i8], %"class.cascadb::Slice", %"class.cascadb::Slice" }
%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK7cascadb3Msg4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) #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 @_ZN7cascadb3Msg7destroyEv(ptr noundef nonnull align 8 dereferenceable(40)) #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb6MsgBuf5writeERKNS_3MsgE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %6 = alloca %"class.cascadb::KeyComp", align 8
  %7 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %8 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %9 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  %11 = getelementptr inbounds %"class.cascadb::MsgBuf", ptr %10, i32 0, i32 2
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %"class.cascadb::MsgBuf", ptr %10, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  call void @_ZN7cascadb7KeyCompC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %14)
  %15 = getelementptr inbounds %"class.cascadb::KeyComp", ptr %6, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8
  call void @_ZN7cascadb10FastVectorINS_3MsgELi32EE11lower_boundIS1_NS_7KeyCompEEENS2_8IteratorERKT_T0_(ptr dead_on_unwind writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(40) %12, ptr %16)
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  call void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(104) %10)
  %17 = call noundef zeroext i1 @_ZNK7cascadb10FastVectorINS_3MsgELi32EE8IteratoreqERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %7)
  br i1 %17, label %24, label %18

18:                                               ; preds = %2
  %19 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %20 = getelementptr inbounds %"class.cascadb::Msg", ptr %19, i32 0, i32 2
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.cascadb::Msg", ptr %21, i32 0, i32 2
  %23 = call noundef zeroext i1 @_ZN7cascadbneERKNS_5SliceES2_(ptr noundef nonnull align 8 dereferenceable(12) %20, ptr noundef nonnull align 8 dereferenceable(12) %22)
  br label %24

24:                                               ; preds = %18, %2
  %25 = phi i1 [ true, %2 ], [ %23, %18 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br i1 %25, label %26, label %34

26:                                               ; preds = %24
  %27 = getelementptr inbounds %"class.cascadb::MsgBuf", ptr %10, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %5, i64 24, i1 false), !tbaa.struct !18
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  call void @_ZN7cascadb10FastVectorINS_3MsgELi32EE6insertENS2_8IteratorERKS1_(ptr dead_on_unwind writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef byval(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(40) %28)
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = call noundef i64 @_ZNK7cascadb3Msg4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %29)
  %31 = getelementptr inbounds %"class.cascadb::MsgBuf", ptr %10, i32 0, i32 3
  %32 = load i64, ptr %31, align 8, !tbaa !20
  %33 = add i64 %32, %30
  store i64 %33, ptr %31, align 8, !tbaa !20
  br label %48

34:                                               ; preds = %24
  %35 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %36 = call noundef i64 @_ZNK7cascadb3Msg4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %35)
  %37 = getelementptr inbounds %"class.cascadb::MsgBuf", ptr %10, i32 0, i32 3
  %38 = load i64, ptr %37, align 8, !tbaa !20
  %39 = sub i64 %38, %36
  store i64 %39, ptr %37, align 8, !tbaa !20
  %40 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @_ZN7cascadb3Msg7destroyEv(ptr noundef nonnull align 8 dereferenceable(40) %40)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %42, ptr align 8 %41, i64 40, i1 false), !tbaa.struct !21
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = call noundef i64 @_ZNK7cascadb3Msg4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %43)
  %45 = getelementptr inbounds %"class.cascadb::MsgBuf", ptr %10, i32 0, i32 3
  %46 = load i64, ptr %45, align 8, !tbaa !20
  %47 = add i64 %46, %44
  store i64 %47, ptr %45, align 8, !tbaa !20
  br label %48

48:                                               ; preds = %34, %26
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb10FastVectorINS_3MsgELi32EE11lower_boundIS1_NS_7KeyCompEEENS2_8IteratorERKT_T0_(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40), ptr) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadbneERKNS_5SliceES2_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb10FastVectorINS_3MsgELi32EE6insertENS2_8IteratorERKS1_(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(40)) #0 align 2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN7cascadb6MsgBufE", !6, i64 0, !11, i64 8, !12, i64 64, !17, i64 96}
!11 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!12 = !{!"_ZTSN7cascadb10FastVectorINS_3MsgELi32EEE", !13, i64 0, !17, i64 24}
!13 = !{!"_ZTSSt6vectorIPS_IN7cascadb3MsgESaIS1_EESaIS4_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIPSt6vectorIN7cascadb3MsgESaIS2_EESaIS5_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPSt6vectorIN7cascadb3MsgESaIS2_EESaIS5_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPSt6vectorIN7cascadb3MsgESaIS2_EESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{i64 0, i64 8, !5, i64 8, i64 8, !19, i64 16, i64 8, !19}
!19 = !{!17, !17, i64 0}
!20 = !{!10, !17, i64 96}
!21 = !{i64 0, i64 4, !22, i64 8, i64 8, !5, i64 16, i64 4, !24, i64 24, i64 8, !5, i64 32, i64 4, !24}
!22 = !{!23, !23, i64 0}
!23 = !{!"_ZTSN7cascadb7MsgTypeE", !7, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !7, i64 0}


; 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::FastVector<cascadb::Msg>::Iterator" = type { ptr, i64, i64 }
%"class.cascadb::KeyComp" = type { ptr }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb6MsgBuf5writeERKNS_3MsgE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(40) %1) local_unnamed_addr #0 align 2 {
  %3 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %4 = alloca %"class.cascadb::KeyComp", align 8
  %5 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  %6 = alloca %"class.cascadb::FastVector<cascadb::Msg>::Iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  call void @_ZN7cascadb7KeyCompC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %8)
  %9 = load ptr, ptr %4, align 8
  call void @_ZN7cascadb10FastVectorINS_3MsgELi32EE11lower_boundIS1_NS_7KeyCompEEENS2_8IteratorERKT_T0_(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr %9)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(104) %0)
  %10 = call noundef zeroext i1 @_ZNK7cascadb10FastVectorINS_3MsgELi32EE8IteratoreqERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %5)
  br i1 %10, label %.critedge, label %11

11:                                               ; preds = %2
  %12 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = call noundef zeroext i1 @_ZN7cascadbneERKNS_5SliceES2_(ptr noundef nonnull align 8 dereferenceable(12) %13, ptr noundef nonnull align 8 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br i1 %15, label %16, label %19

.critedge:                                        ; preds = %2
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %16

16:                                               ; preds = %.critedge, %11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN7cascadb10FastVectorINS_3MsgELi32EE6insertENS2_8IteratorERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull byval(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(40) %1)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %17 = call noundef i64 @_ZNK7cascadb3Msg4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  %18 = getelementptr inbounds i8, ptr %0, i64 96
  br label %28

19:                                               ; preds = %11
  %20 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %21 = call noundef i64 @_ZNK7cascadb3Msg4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %20)
  %22 = getelementptr inbounds i8, ptr %0, i64 96
  %23 = load i64, ptr %22, align 8, !tbaa !17
  %24 = sub i64 %23, %21
  store i64 %24, ptr %22, align 8, !tbaa !17
  %25 = call noundef ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratorptEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @_ZN7cascadb3Msg7destroyEv(ptr noundef nonnull align 8 dereferenceable(40) %25)
  %26 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN7cascadb10FastVectorINS_3MsgELi32EE8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %26, ptr noundef nonnull align 8 dereferenceable(40) %1, i64 40, i1 false), !tbaa.struct !18
  %27 = call noundef i64 @_ZNK7cascadb3Msg4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  br label %28

28:                                               ; preds = %19, %16
  %.sink = phi ptr [ %22, %19 ], [ %18, %16 ]
  %.sink9 = phi i64 [ %27, %19 ], [ %17, %16 ]
  %29 = load i64, ptr %.sink, align 8, !tbaa !17
  %30 = add i64 %29, %.sink9
  store i64 %30, ptr %.sink, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb10FastVectorINS_3MsgELi32EE11lower_boundIS1_NS_7KeyCompEEENS2_8IteratorERKT_T0_(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40), ptr) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6MsgBuf3endEv(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadbneERKNS_5SliceES2_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb10FastVectorINS_3MsgELi32EE6insertENS2_8IteratorERKS1_(ptr dead_on_unwind noalias writable sret(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%"class.cascadb::FastVector<cascadb::Msg>::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN7cascadb6MsgBufE", !7, i64 0, !10, i64 8, !11, i64 64, !16, i64 96}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN7cascadb6RWLockE", !8, i64 0}
!11 = !{!"_ZTSN7cascadb10FastVectorINS_3MsgELi32EEE", !12, i64 0, !16, i64 24}
!12 = !{!"_ZTSSt6vectorIPS_IN7cascadb3MsgESaIS1_EESaIS4_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIPSt6vectorIN7cascadb3MsgESaIS2_EESaIS5_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPSt6vectorIN7cascadb3MsgESaIS2_EESaIS5_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPSt6vectorIN7cascadb3MsgESaIS2_EESaIS5_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!16 = !{!"long", !8, i64 0}
!17 = !{!6, !16, i64 96}
!18 = !{i64 0, i64 4, !19, i64 8, i64 8, !21, i64 16, i64 4, !22, i64 24, i64 8, !21, i64 32, i64 4, !22}
!19 = !{!20, !20, i64 0}
!20 = !{!"_ZTSN7cascadb7MsgTypeE", !8, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"int", !8, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass