; LLVM IR from weicao/cascadb :: src/serialize/layout.ll (ZN7cascadb6Layout23init_block_offset_indexEv)

; 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::ScopedMutex" = type { i8, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.cascadb::Layout" = type { ptr, i64, %"class.cascadb::Options", %"class.cascadb::Mutex", i64, ptr, %"class.cascadb::Mutex", %"class.std::map", %"class.std::map", %"class.cascadb::Mutex", %"class.cascadb::Mutex", %"class.std::deque", %"class.std::deque", i64, i64 }
%"class.cascadb::Options" = type <{ ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, cascadb::BlockMeta *>, std::_Select1st<std::pair<const unsigned long, cascadb::BlockMeta *>>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, cascadb::BlockMeta *>, std::_Select1st<std::pair<const unsigned long, cascadb::BlockMeta *>>, std::less<unsigned long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<cascadb::Layout::Hole, std::allocator<cascadb::Layout::Hole>>::_Deque_impl" }
%"struct.std::_Deque_base<cascadb::Layout::Hole, std::allocator<cascadb::Layout::Hole>>::_Deque_impl" = type { %"struct.std::_Deque_base<cascadb::Layout::Hole, std::allocator<cascadb::Layout::Hole>>::_Deque_impl_data" }
%"struct.std::_Deque_base<cascadb::Layout::Hole, std::allocator<cascadb::Layout::Hole>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i64, ptr }
%"struct.cascadb::BlockMeta" = type { i64, i32, i32, i16, i16 }
%"class.cascadb::SuperBlock" = type { i64, i8, i8, ptr, i64 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb6Layout23init_block_offset_indexEv(ptr noundef nonnull align 8 dereferenceable(600) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.cascadb::ScopedMutex", align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_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 16, ptr %3) #3
  %10 = getelementptr inbounds %"class.cascadb::Layout", ptr %9, i32 0, i32 6
  call void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %11 = getelementptr inbounds %"class.cascadb::Layout", ptr %9, i32 0, i32 7
  %12 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #3
  %13 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %4, i32 0, i32 0
  store ptr %12, ptr %13, align 8
  br label %14

14:                                               ; preds = %31, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %15 = getelementptr inbounds %"class.cascadb::Layout", ptr %9, i32 0, i32 7
  %16 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #3
  %17 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %5, i32 0, i32 0
  store ptr %16, ptr %17, align 8
  %18 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEES8_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %14
  %21 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %22 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds %"class.cascadb::Layout", ptr %9, i32 0, i32 8
  %25 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %26 = getelementptr inbounds %"struct.std::pair", ptr %25, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %27, i32 0, i32 0
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %24, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %30 unwind label %34

30:                                               ; preds = %20
  store ptr %23, ptr %29, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %30
  %32 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #3
  %33 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %8, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  br label %14, !llvm.loop !12

34:                                               ; preds = %20
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %6, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  br label %62

38:                                               ; preds = %19
  %39 = getelementptr inbounds %"class.cascadb::Layout", ptr %9, i32 0, i32 5
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %40, i32 0, i32 3
  %42 = load ptr, ptr %41, align 8, !tbaa !34
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %61

44:                                               ; preds = %38
  %45 = getelementptr inbounds %"class.cascadb::Layout", ptr %9, i32 0, i32 5
  %46 = load ptr, ptr %45, align 8, !tbaa !14
  %47 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !34
  %49 = getelementptr inbounds %"class.cascadb::Layout", ptr %9, i32 0, i32 8
  %50 = getelementptr inbounds %"class.cascadb::Layout", ptr %9, i32 0, i32 5
  %51 = load ptr, ptr %50, align 8, !tbaa !14
  %52 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %51, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !34
  %54 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %53, i32 0, i32 0
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %49, ptr noundef nonnull align 8 dereferenceable(8) %54)
          to label %56 unwind label %57

56:                                               ; preds = %44
  store ptr %48, ptr %55, align 8, !tbaa !5
  br label %61

57:                                               ; preds = %44
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %6, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %7, align 4
  br label %62

61:                                               ; preds = %56, %38
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #3
  ret void

62:                                               ; preds = %57, %34
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #3
  br label %63

63:                                               ; preds = %62
  %64 = load ptr, ptr %6, align 8
  %65 = load i32, ptr %7, align 4
  %66 = insertvalue { ptr, i32 } poison, ptr %64, 0
  %67 = insertvalue { ptr, i32 } %66, i32 %65, 1
  resume { ptr, i32 } %67
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #1 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 = { 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 }

!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 8}
!10 = !{!"_ZTSSt4pairIKmPN7cascadb9BlockMetaEE", !11, i64 0, !6, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !6, i64 176}
!15 = !{!"_ZTSN7cascadb6LayoutE", !6, i64 0, !11, i64 8, !16, i64 16, !20, i64 120, !11, i64 168, !6, i64 176, !20, i64 184, !21, i64 232, !21, i64 280, !20, i64 328, !20, i64 376, !29, i64 424, !29, i64 504, !11, i64 584, !11, i64 592}
!16 = !{!"_ZTSN7cascadb7OptionsE", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !17, i64 72, !17, i64 76, !17, i64 80, !17, i64 84, !17, i64 88, !17, i64 92, !18, i64 96, !19, i64 100}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSN7cascadb5MutexE", !19, i64 0, !7, i64 8}
!21 = !{!"_ZTSSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE", !22, i64 0}
!22 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE", !23, i64 0}
!23 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !24, i64 0, !26, i64 8}
!24 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !25, i64 0}
!25 = !{!"_ZTSSt4lessImE"}
!26 = !{!"_ZTSSt15_Rb_tree_header", !27, i64 0, !11, i64 32}
!27 = !{!"_ZTSSt18_Rb_tree_node_base", !28, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!28 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!29 = !{!"_ZTSSt5dequeIN7cascadb6Layout4HoleESaIS2_EE", !30, i64 0}
!30 = !{!"_ZTSSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE11_Deque_implE", !32, i64 0}
!32 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !11, i64 8, !33, i64 16, !33, i64 48}
!33 = !{!"_ZTSSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!35, !6, i64 16}
!35 = !{!"_ZTSN7cascadb10SuperBlockE", !11, i64 0, !7, i64 8, !7, i64 9, !6, i64 16, !11, i64 24}


; 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::ScopedMutex" = type { i8, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEES8_(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 @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 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 @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb6Layout23init_block_offset_indexEv(ptr noundef nonnull align 8 dereferenceable(600) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.cascadb::ScopedMutex", align 8
  %3 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 184
  call void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 232
  %7 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #3
  store ptr %7, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %8 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #3
  store ptr %8, ptr %4, align 8
  %9 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEES8_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 280
  br label %15

._crit_edge:                                      ; preds = %23, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  %11 = getelementptr inbounds i8, ptr %0, i64 176
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !29
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %35, label %29

15:                                               ; preds = %.lr.ph, %23
  %16 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !31
  %19 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !31
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %23 unwind label %27

23:                                               ; preds = %15
  store ptr %18, ptr %22, align 8, !tbaa !33
  %24 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %25 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #3
  store ptr %25, ptr %4, align 8
  %26 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEES8_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br i1 %26, label %15, label %._crit_edge, !llvm.loop !34

27:                                               ; preds = %15
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %36

29:                                               ; preds = %._crit_edge
  %30 = getelementptr inbounds i8, ptr %0, i64 280
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %30, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %32 unwind label %33

32:                                               ; preds = %29
  store ptr %14, ptr %31, align 8, !tbaa !33
  br label %35

33:                                               ; preds = %29
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %36

35:                                               ; preds = %32, %._crit_edge
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #3
  ret void

36:                                               ; preds = %33, %27
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %34, %33 ]
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #3
  resume { ptr, i32 } %.pn
}

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

attributes #0 = { mustprogress 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 = { 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 }

!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 176}
!6 = !{!"_ZTSN7cascadb6LayoutE", !7, i64 0, !10, i64 8, !11, i64 16, !15, i64 120, !10, i64 168, !7, i64 176, !15, i64 184, !16, i64 232, !16, i64 280, !15, i64 328, !15, i64 376, !24, i64 424, !24, i64 504, !10, i64 584, !10, i64 592}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSN7cascadb7OptionsE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !13, i64 96, !14, i64 100}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSN7cascadb8CompressE", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!"_ZTSN7cascadb5MutexE", !14, i64 0, !8, i64 8}
!16 = !{!"_ZTSSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE", !17, i64 0}
!17 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE", !18, i64 0}
!18 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !19, i64 0, !21, i64 8}
!19 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !20, i64 0}
!20 = !{!"_ZTSSt4lessImE"}
!21 = !{!"_ZTSSt15_Rb_tree_header", !22, i64 0, !10, i64 32}
!22 = !{!"_ZTSSt18_Rb_tree_node_base", !23, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!23 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!24 = !{!"_ZTSSt5dequeIN7cascadb6Layout4HoleESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE11_Deque_implE", !27, i64 0}
!27 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE16_Deque_impl_dataE", !7, i64 0, !10, i64 8, !28, i64 16, !28, i64 48}
!28 = !{!"_ZTSSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_E", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!29 = !{!30, !7, i64 16}
!30 = !{!"_ZTSN7cascadb10SuperBlockE", !10, i64 0, !8, i64 8, !8, i64 9, !7, i64 16, !10, i64 24}
!31 = !{!32, !7, i64 8}
!32 = !{!"_ZTSSt4pairIKmPN7cascadb9BlockMetaEE", !10, i64 0, !7, i64 8}
!33 = !{!7, !7, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}


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