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

; 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 }
%"class.cascadb::SuperBlock" = type { i64, i8, i8, ptr, i64 }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb6LayoutD2Ev = external hidden unnamed_addr constant [27 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

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

; Function Attrs: nounwind
declare void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7cascadb6LayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(600) %0) unnamed_addr #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 %"struct.std::_Rb_tree_iterator", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  %8 = invoke noundef zeroext i1 @_ZN7cascadb6Layout5flushEv(ptr noundef nonnull align 8 dereferenceable(600) %7)
          to label %9 unwind label %57

9:                                                ; preds = %1
  br i1 %8, label %11, label %10

10:                                               ; preds = %9
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 42, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb6LayoutD2Ev) #7
  unreachable

11:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #8
  %12 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 6
  invoke void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef %12)
          to label %13 unwind label %57

13:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %14 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 7
  %15 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %14) #8
  %16 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %4, i32 0, i32 0
  store ptr %15, ptr %16, align 8
  br label %17

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

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

23:                                               ; preds = %17
  %24 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %25 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = icmp eq ptr %26, null
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  call void @_ZdlPvm(ptr noundef %26, i64 noundef 24) #9
  br label %29

29:                                               ; preds = %28, %23
  br label %30

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

33:                                               ; preds = %22
  %34 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 7
  call void @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %34) #8
  %35 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 8
  call void @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %35) #8
  invoke void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %36 unwind label %57

36:                                               ; preds = %33
  %37 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 5
  %38 = load ptr, ptr %37, align 8, !tbaa !14
  %39 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %38, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !34
  %41 = icmp eq ptr %40, null
  br i1 %41, label %43, label %42

42:                                               ; preds = %36
  call void @_ZdlPvm(ptr noundef %40, i64 noundef 24) #9
  br label %43

43:                                               ; preds = %42, %36
  %44 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 5
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  %46 = icmp eq ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  call void @_ZdlPvm(ptr noundef %45, i64 noundef 32) #9
  br label %48

48:                                               ; preds = %47, %43
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #8
  %49 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 12
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %49) #8
  %50 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 11
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %50) #8
  %51 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 10
  call void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %51) #8
  %52 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 9
  call void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %52) #8
  %53 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 8
  call void @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %53) #8
  %54 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 7
  call void @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %54) #8
  %55 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 6
  call void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %55) #8
  %56 = getelementptr inbounds %"class.cascadb::Layout", ptr %7, i32 0, i32 3
  call void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %56) #8
  ret void

57:                                               ; preds = %33, %11, %1
  %58 = landingpad { ptr, i32 }
          catch ptr null
  %59 = extractvalue { ptr, i32 } %58, 0
  call void @__clang_call_terminate(ptr %59) #7
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb6Layout5flushEv(ptr noundef nonnull align 8 dereferenceable(600)) #3 align 2

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #4

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { nobuiltin 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 #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 = { 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 = { 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 = { noinline noreturn nounwind uwtable "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 = { 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 #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { builtin 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 }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb6LayoutD2Ev = external hidden unnamed_addr constant [27 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind
declare void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7cascadb6LayoutD2Ev(ptr noundef nonnull align 8 dereferenceable(600) %0) 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
  %5 = invoke noundef zeroext i1 @_ZN7cascadb6Layout5flushEv(ptr noundef nonnull align 8 dereferenceable(600) %0)
          to label %6 unwind label %40

6:                                                ; preds = %1
  br i1 %5, label %8, label %7

7:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 42, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb6LayoutD2Ev) #7
  unreachable

8:                                                ; preds = %6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #8
  %9 = getelementptr inbounds i8, ptr %0, i64 184
  invoke void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull %9)
          to label %10 unwind label %40

10:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %11 = getelementptr inbounds i8, ptr %0, i64 232
  %12 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #8
  store ptr %12, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %13 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #8
  store ptr %13, ptr %4, align 8
  %14 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEES8_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %21, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #8
  %15 = getelementptr inbounds i8, ptr %0, i64 280
  call void @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #8
  invoke void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %25 unwind label %40

.lr.ph:                                           ; preds = %10, %21
  %16 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %21, label %20

20:                                               ; preds = %.lr.ph
  call void @_ZdlPvm(ptr noundef nonnull %18, i64 noundef 24) #9
  br label %21

21:                                               ; preds = %.lr.ph, %20
  %22 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %23 = call ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #8
  store ptr %23, ptr %4, align 8
  %24 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKmPN7cascadb9BlockMetaEEES8_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11

25:                                               ; preds = %._crit_edge
  %26 = getelementptr inbounds i8, ptr %0, i64 176
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %29 = load ptr, ptr %28, align 8, !tbaa !33
  %30 = icmp eq ptr %29, null
  br i1 %30, label %.thread, label %31

31:                                               ; preds = %25
  call void @_ZdlPvm(ptr noundef nonnull %29, i64 noundef 24) #9
  %.pr = load ptr, ptr %26, align 8, !tbaa !13
  %32 = icmp eq ptr %.pr, null
  br i1 %32, label %34, label %.thread

.thread:                                          ; preds = %25, %31
  %33 = phi ptr [ %.pr, %31 ], [ %27, %25 ]
  call void @_ZdlPvm(ptr noundef nonnull %33, i64 noundef 32) #9
  br label %34

34:                                               ; preds = %.thread, %31
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #8
  %35 = getelementptr inbounds i8, ptr %0, i64 504
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %35) #8
  %36 = getelementptr inbounds i8, ptr %0, i64 424
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %36) #8
  %37 = getelementptr inbounds i8, ptr %0, i64 376
  call void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %37) #8
  %38 = getelementptr inbounds i8, ptr %0, i64 328
  call void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %38) #8
  call void @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #8
  call void @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #8
  call void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #8
  %39 = getelementptr inbounds i8, ptr %0, i64 120
  call void @_ZN7cascadb5MutexD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %39) #8
  ret void

40:                                               ; preds = %._crit_edge, %8, %1
  %41 = landingpad { ptr, i32 }
          catch ptr null
  %42 = extractvalue { ptr, i32 } %41, 0
  call void @__clang_call_terminate(ptr %42) #7
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb6Layout5flushEv(ptr noundef nonnull align 8 dereferenceable(600)) local_unnamed_addr #3 align 2

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #4

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

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

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

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

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

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

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

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

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

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


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