; LLVM IR from weicao/cascadb :: src/serialize/layout.ll (ZN7cascadb6Layout11flush_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::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.cascadb::LoggerFormat" = type { ptr, %"class.std::__cxx11::basic_ostringstream" }
%"class.std::__cxx11::basic_ostringstream" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.cascadb::Block" = type { %"class.cascadb::Slice", i64, i64 }
%"class.cascadb::BlockWriter" = type { ptr, i64 }
%"class.cascadb::ScopedMutex" = type { i8, 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 }
%"class.cascadb::SuperBlock" = type { i64, i8, i8, ptr, i64 }
%"struct.cascadb::BlockMeta" = type { i64, i32, i32, i16, i16 }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@_ZN7cascadb14g_logger_levelE = external global i32, align 4
@_ZN7cascadb8g_loggerE = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [33 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb6Layout11flush_indexEv = external hidden unnamed_addr constant [36 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [21 x i8], align 1

; 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) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6

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

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

; Function Attrs: nounwind willreturn memory(read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) #7

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #8

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i32 } @_ZN7cascadb6Layout20alloc_aligned_bufferEm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef) #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7cascadb5BlockC2ENS_5SliceEmm(ptr noundef nonnull align 8 dereferenceable(32), ptr, i32, i64 noundef, i64 noundef) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600), ptr, i32) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN7cascadb5Block4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7cascadb6Layout10get_offsetEm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6Layout8add_holeEmm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef, i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb6Layout11flush_indexEv(ptr noundef nonnull align 8 dereferenceable(600) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.cascadb::Slice", align 8
  %6 = alloca { ptr, i32 }, align 8
  %7 = alloca %"class.cascadb::LoggerFormat", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.cascadb::Block", align 8
  %12 = alloca %"class.cascadb::Slice", align 8
  %13 = alloca %"class.cascadb::BlockWriter", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.cascadb::Slice", align 8
  %16 = alloca %"class.cascadb::LoggerFormat", align 8
  %17 = alloca %"class.cascadb::Slice", align 8
  %18 = alloca %"class.cascadb::LoggerFormat", align 8
  %19 = alloca %"class.cascadb::ScopedMutex", align 8
  %20 = alloca %"class.cascadb::Slice", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #10
  %22 = call noundef i64 @_ZN7cascadb6Layout14get_index_sizeEv(ptr noundef nonnull align 8 dereferenceable(600) %21)
  store i64 %22, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #10
  %23 = load i64, ptr %4, align 8, !tbaa !9
  %24 = call { ptr, i32 } @_ZN7cascadb6Layout20alloc_aligned_bufferEm(ptr noundef nonnull align 8 dereferenceable(600) %21, i64 noundef %23)
  store { ptr, i32 } %24, ptr %6, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %6, i64 12, i1 false)
  %25 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %5)
  %26 = icmp ne i64 %25, 0
  br i1 %26, label %62, label %27

27:                                               ; preds = %1
  %28 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !11
  %29 = icmp sge i32 3, %28
  br i1 %29, label %30, label %61

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 384, ptr %7) #10
  %31 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %7, ptr noundef %31)
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %7, i32 noundef 3)
          to label %33 unwind label %57

33:                                               ; preds = %30
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef @.str.2)
          to label %35 unwind label %57

35:                                               ; preds = %33
  %36 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #11
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %41

38:                                               ; preds = %35
  %39 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #11
  %40 = getelementptr inbounds i8, ptr %39, i64 1
  br label %42

41:                                               ; preds = %35
  br label %42

42:                                               ; preds = %41, %38
  %43 = phi ptr [ %40, %38 ], [ @.str.1, %41 ]
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef %43)
          to label %45 unwind label %57

45:                                               ; preds = %42
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef @.str.3)
          to label %47 unwind label %57

47:                                               ; preds = %45
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %46, i32 noundef 473)
          to label %49 unwind label %57

49:                                               ; preds = %47
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef @.str.2)
          to label %51 unwind label %57

51:                                               ; preds = %49
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef @.str.22)
          to label %53 unwind label %57

53:                                               ; preds = %51
  %54 = load i64, ptr %4, align 8, !tbaa !9
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %52, i64 noundef %54)
          to label %56 unwind label %57

56:                                               ; preds = %53
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %7) #10
  call void @llvm.lifetime.end.p0(i64 384, ptr %7) #10
  br label %61

57:                                               ; preds = %53, %51, %49, %47, %45, %42, %33, %30
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %8, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %9, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %7) #10
  call void @llvm.lifetime.end.p0(i64 384, ptr %7) #10
  br label %233

61:                                               ; preds = %56, %27
  store i1 false, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %231

62:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %5, i64 16, i1 false), !tbaa.struct !13
  %63 = getelementptr inbounds { ptr, i32 }, ptr %12, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8
  %65 = getelementptr inbounds { ptr, i32 }, ptr %12, i32 0, i32 1
  %66 = load i32, ptr %65, align 8
  call void @_ZN7cascadb5BlockC2ENS_5SliceEmm(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr %64, i32 %66, i64 noundef 0, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #10
  call void @_ZN7cascadb11BlockWriterC2EPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef %11)
  %67 = call noundef zeroext i1 @_ZN7cascadb6Layout11write_indexERNS_11BlockWriterE(ptr noundef nonnull align 8 dereferenceable(600) %21, ptr noundef nonnull align 8 dereferenceable(16) %13)
  br i1 %67, label %69, label %68

68:                                               ; preds = %62
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 480, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb6Layout11flush_indexEv) #12
  unreachable

69:                                               ; preds = %62
  %70 = call noundef i64 @_ZN7cascadb5Block4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  %71 = load i64, ptr %4, align 8, !tbaa !9
  %72 = icmp eq i64 %70, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %69
  br label %76

74:                                               ; preds = %69
  call void @__assert_fail(ptr noundef @.str.49, ptr noundef @.str.1, i32 noundef 482, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb6Layout11flush_indexEv) #12
  unreachable

75:                                               ; No predecessors!
  br label %76

76:                                               ; preds = %75, %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  %77 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %5)
  %78 = call noundef i64 @_ZN7cascadb6Layout10get_offsetEm(ptr noundef nonnull align 8 dereferenceable(600) %21, i64 noundef %77)
  store i64 %78, ptr %14, align 8, !tbaa !9
  %79 = load i64, ptr %14, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %5, i64 16, i1 false), !tbaa.struct !13
  %80 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  %82 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 1
  %83 = load i32, ptr %82, align 8
  %84 = call noundef zeroext i1 @_ZN7cascadb6Layout10write_dataEmNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %21, i64 noundef %79, ptr %81, i32 %83)
  br i1 %84, label %123, label %85

85:                                               ; preds = %76
  %86 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !11
  %87 = icmp sge i32 3, %86
  br i1 %87, label %88, label %116

88:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 384, ptr %16) #10
  %89 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %16, ptr noundef %89)
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %16, i32 noundef 3)
          to label %91 unwind label %112

91:                                               ; preds = %88
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef @.str.2)
          to label %93 unwind label %112

93:                                               ; preds = %91
  %94 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #11
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %99

96:                                               ; preds = %93
  %97 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #11
  %98 = getelementptr inbounds i8, ptr %97, i64 1
  br label %100

99:                                               ; preds = %93
  br label %100

100:                                              ; preds = %99, %96
  %101 = phi ptr [ %98, %96 ], [ @.str.1, %99 ]
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef %101)
          to label %103 unwind label %112

103:                                              ; preds = %100
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @.str.3)
          to label %105 unwind label %112

105:                                              ; preds = %103
  %106 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %104, i32 noundef 486)
          to label %107 unwind label %112

107:                                              ; preds = %105
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef @.str.2)
          to label %109 unwind label %112

109:                                              ; preds = %107
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %108, ptr noundef @.str.50)
          to label %111 unwind label %112

111:                                              ; preds = %109
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %16) #10
  call void @llvm.lifetime.end.p0(i64 384, ptr %16) #10
  br label %116

112:                                              ; preds = %109, %107, %105, %103, %100, %91, %88
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %8, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %9, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %16) #10
  call void @llvm.lifetime.end.p0(i64 384, ptr %16) #10
  br label %230

116:                                              ; preds = %111, %85
  %117 = load i64, ptr %14, align 8, !tbaa !9
  %118 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %5)
  call void @_ZN7cascadb6Layout8add_holeEmm(ptr noundef nonnull align 8 dereferenceable(600) %21, i64 noundef %117, i64 noundef %118)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %5, i64 16, i1 false), !tbaa.struct !13
  %119 = getelementptr inbounds { ptr, i32 }, ptr %17, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8
  %121 = getelementptr inbounds { ptr, i32 }, ptr %17, i32 0, i32 1
  %122 = load i32, ptr %121, align 8
  call void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %21, ptr %120, i32 %122)
  store i1 false, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %229

123:                                              ; preds = %76
  %124 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !11
  %125 = icmp sge i32 0, %124
  br i1 %125, label %126, label %154

126:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 384, ptr %18) #10
  %127 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %18, ptr noundef %127)
  %128 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %18, i32 noundef 0)
          to label %129 unwind label %150

129:                                              ; preds = %126
  %130 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef @.str.2)
          to label %131 unwind label %150

131:                                              ; preds = %129
  %132 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #11
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %137

134:                                              ; preds = %131
  %135 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #11
  %136 = getelementptr inbounds i8, ptr %135, i64 1
  br label %138

137:                                              ; preds = %131
  br label %138

138:                                              ; preds = %137, %134
  %139 = phi ptr [ %136, %134 ], [ @.str.1, %137 ]
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %130, ptr noundef %139)
          to label %141 unwind label %150

141:                                              ; preds = %138
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @.str.3)
          to label %143 unwind label %150

143:                                              ; preds = %141
  %144 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %142, i32 noundef 492)
          to label %145 unwind label %150

145:                                              ; preds = %143
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %144, ptr noundef @.str.2)
          to label %147 unwind label %150

147:                                              ; preds = %145
  %148 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef @.str.51)
          to label %149 unwind label %150

149:                                              ; preds = %147
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %18) #10
  call void @llvm.lifetime.end.p0(i64 384, ptr %18) #10
  br label %154

150:                                              ; preds = %147, %145, %143, %141, %138, %129, %126
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %8, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %9, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %18) #10
  call void @llvm.lifetime.end.p0(i64 384, ptr %18) #10
  br label %230

154:                                              ; preds = %149, %123
  %155 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %156 = load ptr, ptr %155, align 8, !tbaa !16
  %157 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %156, i32 0, i32 3
  %158 = load ptr, ptr %157, align 8, !tbaa !35
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %177

160:                                              ; preds = %154
  %161 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %162 = load ptr, ptr %161, align 8, !tbaa !16
  %163 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %162, i32 0, i32 3
  %164 = load ptr, ptr %163, align 8, !tbaa !35
  %165 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %164, i32 0, i32 0
  %166 = load i64, ptr %165, align 8, !tbaa !37
  %167 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %168 = load ptr, ptr %167, align 8, !tbaa !16
  %169 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %168, i32 0, i32 3
  %170 = load ptr, ptr %169, align 8, !tbaa !35
  %171 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %170, i32 0, i32 2
  %172 = load i32, ptr %171, align 4, !tbaa !40
  %173 = add i32 %172, 4096
  %174 = sub i32 %173, 1
  %175 = and i32 %174, -4096
  %176 = zext i32 %175 to i64
  call void @_ZN7cascadb6Layout12add_fly_holeEmm(ptr noundef nonnull align 8 dereferenceable(600) %21, i64 noundef %166, i64 noundef %176)
  br label %182

177:                                              ; preds = %154
  %178 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #13
  call void @llvm.memset.p0.i64(ptr align 16 %178, i8 0, i64 24, i1 false)
  %179 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %180 = load ptr, ptr %179, align 8, !tbaa !16
  %181 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %180, i32 0, i32 3
  store ptr %178, ptr %181, align 8, !tbaa !35
  br label %182

182:                                              ; preds = %177, %160
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #10
  %183 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 6
  call void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef %183)
  %184 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %185 = load ptr, ptr %184, align 8, !tbaa !16
  %186 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %185, i32 0, i32 3
  %187 = load ptr, ptr %186, align 8, !tbaa !35
  %188 = icmp ne ptr %187, null
  br i1 %188, label %189, label %202

189:                                              ; preds = %182
  %190 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 8
  %191 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %192 = load ptr, ptr %191, align 8, !tbaa !16
  %193 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %192, i32 0, i32 3
  %194 = load ptr, ptr %193, align 8, !tbaa !35
  %195 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %194, i32 0, i32 0
  %196 = invoke noundef i64 @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(48) %190, ptr noundef nonnull align 8 dereferenceable(8) %195)
          to label %197 unwind label %198

197:                                              ; preds = %189
  br label %202

198:                                              ; preds = %210, %209, %202, %189
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %8, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %9, align 4
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #10
  br label %230

202:                                              ; preds = %197, %182
  %203 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %204 = load ptr, ptr %203, align 8, !tbaa !16
  %205 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %204, i32 0, i32 3
  %206 = load ptr, ptr %205, align 8, !tbaa !35
  %207 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 8
  %208 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %207, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %209 unwind label %198

209:                                              ; preds = %202
  store ptr %206, ptr %208, align 8, !tbaa !5
  invoke void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %210 unwind label %198

210:                                              ; preds = %209
  %211 = load i64, ptr %14, align 8, !tbaa !9
  %212 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %213 = load ptr, ptr %212, align 8, !tbaa !16
  %214 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %213, i32 0, i32 3
  %215 = load ptr, ptr %214, align 8, !tbaa !35
  %216 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %215, i32 0, i32 0
  store i64 %211, ptr %216, align 8, !tbaa !37
  %217 = load i64, ptr %4, align 8, !tbaa !9
  %218 = trunc i64 %217 to i32
  %219 = getelementptr inbounds %"class.cascadb::Layout", ptr %21, i32 0, i32 5
  %220 = load ptr, ptr %219, align 8, !tbaa !16
  %221 = getelementptr inbounds %"class.cascadb::SuperBlock", ptr %220, i32 0, i32 3
  %222 = load ptr, ptr %221, align 8, !tbaa !35
  %223 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %222, i32 0, i32 2
  store i32 %218, ptr %223, align 4, !tbaa !40
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %5, i64 16, i1 false), !tbaa.struct !13
  %224 = getelementptr inbounds { ptr, i32 }, ptr %20, i32 0, i32 0
  %225 = load ptr, ptr %224, align 8
  %226 = getelementptr inbounds { ptr, i32 }, ptr %20, i32 0, i32 1
  %227 = load i32, ptr %226, align 8
  invoke void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %21, ptr %225, i32 %227)
          to label %228 unwind label %198

228:                                              ; preds = %210
  store i1 true, ptr %2, align 1
  store i32 1, ptr %10, align 4
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #10
  br label %229

229:                                              ; preds = %228, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #10
  br label %231

230:                                              ; preds = %198, %150, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #10
  br label %233

231:                                              ; preds = %229, %61
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #10
  %232 = load i1, ptr %2, align 1
  ret i1 %232

233:                                              ; preds = %230, %57
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #10
  br label %234

234:                                              ; preds = %233
  %235 = load ptr, ptr %8, align 8
  %236 = load i32, ptr %9, align 4
  %237 = insertvalue { ptr, i32 } poison, ptr %235, 0
  %238 = insertvalue { ptr, i32 } %237, i32 %236, 1
  resume { ptr, i32 } %238
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb6Layout10write_dataEmNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef, ptr, i32) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb6Layout11write_indexERNS_11BlockWriterE(ptr noundef nonnull align 8 dereferenceable(600), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6Layout12add_fly_holeEmm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef, i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; 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)) #4 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nounwind willreturn memory(read) "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 #8 = { "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 #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { noreturn nounwind }
attributes #13 = { builtin allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN7cascadb11LoggerLevelE", !7, i64 0}
!13 = !{i64 0, i64 8, !5, i64 8, i64 4, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !6, i64 176}
!17 = !{!"_ZTSN7cascadb6LayoutE", !6, i64 0, !10, i64 8, !18, i64 16, !21, i64 120, !10, i64 168, !6, i64 176, !21, i64 184, !22, i64 232, !22, i64 280, !21, i64 328, !21, i64 376, !30, i64 424, !30, i64 504, !10, i64 584, !10, i64 592}
!18 = !{!"_ZTSN7cascadb7OptionsE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !15, i64 72, !15, i64 76, !15, i64 80, !15, i64 84, !15, i64 88, !15, i64 92, !19, i64 96, !20, i64 100}
!19 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSN7cascadb5MutexE", !20, i64 0, !7, i64 8}
!22 = !{!"_ZTSSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !25, i64 0, !27, i64 8}
!25 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !26, i64 0}
!26 = !{!"_ZTSSt4lessImE"}
!27 = !{!"_ZTSSt15_Rb_tree_header", !28, i64 0, !10, i64 32}
!28 = !{!"_ZTSSt18_Rb_tree_node_base", !29, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!29 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!30 = !{!"_ZTSSt5dequeIN7cascadb6Layout4HoleESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE11_Deque_implE", !33, i64 0}
!33 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !10, i64 8, !34, i64 16, !34, i64 48}
!34 = !{!"_ZTSSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!35 = !{!36, !6, i64 16}
!36 = !{!"_ZTSN7cascadb10SuperBlockE", !10, i64 0, !7, i64 8, !7, i64 9, !6, i64 16, !10, i64 24}
!37 = !{!38, !10, i64 0}
!38 = !{!"_ZTSN7cascadb9BlockMetaE", !10, i64 0, !15, i64 8, !15, i64 12, !39, i64 16, !39, i64 18}
!39 = !{!"short", !7, i64 0}
!40 = !{!38, !15, i64 12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.cascadb::LoggerFormat" = type { ptr, %"class.std::__cxx11::basic_ostringstream" }
%"class.std::__cxx11::basic_ostringstream" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.cascadb::Block" = type { %"class.cascadb::Slice", i64, i64 }
%"class.cascadb::BlockWriter" = type { ptr, i64 }
%"class.cascadb::ScopedMutex" = type { i8, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@_ZN7cascadb14g_logger_levelE = external local_unnamed_addr global i32, align 4
@_ZN7cascadb8g_loggerE = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [33 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb6Layout11flush_indexEv = external hidden unnamed_addr constant [36 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #6

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #7

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i32 } @_ZN7cascadb6Layout20alloc_aligned_bufferEm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7cascadb5BlockC2ENS_5SliceEmm(ptr noundef nonnull align 8 dereferenceable(32), ptr, i32, i64 noundef, i64 noundef) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600), ptr, i32) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7cascadb6Layout10get_offsetEm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6Layout8add_holeEmm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb6Layout11flush_indexEv(ptr noundef nonnull align 8 dereferenceable(600) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.cascadb::Slice", align 8
  %3 = alloca %"class.cascadb::LoggerFormat", align 8
  %4 = alloca %"class.cascadb::Block", align 8
  %5 = alloca %"class.cascadb::BlockWriter", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.cascadb::LoggerFormat", align 8
  %8 = alloca %"class.cascadb::LoggerFormat", align 8
  %9 = alloca %"class.cascadb::ScopedMutex", align 8
  %10 = tail call noundef i64 @_ZN7cascadb6Layout14get_index_sizeEv(ptr noundef nonnull align 8 dereferenceable(600) %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #9
  %11 = tail call { ptr, i32 } @_ZN7cascadb6Layout20alloc_aligned_bufferEm(ptr noundef nonnull align 8 dereferenceable(600) %0, i64 noundef %10)
  %.fca.0.extract = extractvalue { ptr, i32 } %11, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %11, 1
  store ptr %.fca.0.extract, ptr %2, align 8
  %.sroa.211.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.211.0..sroa_idx, align 8
  %12 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %2)
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %13, label %38

13:                                               ; preds = %1
  %14 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 4
  br i1 %15, label %16, label %135

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %3) #9
  %17 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !9
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %3, ptr noundef %17)
  %18 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %3, i32 noundef 3)
          to label %19 unwind label %36

19:                                               ; preds = %16
  %20 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @.str.2)
          to label %21 unwind label %36

21:                                               ; preds = %19
  %22 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #10
  %.not28 = icmp eq ptr %22, null
  %23 = getelementptr inbounds i8, ptr %22, i64 1
  %spec.select = select i1 %.not28, ptr @.str.1, ptr %23
  %24 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull %spec.select)
          to label %25 unwind label %36

25:                                               ; preds = %21
  %26 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull @.str.3)
          to label %27 unwind label %36

27:                                               ; preds = %25
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef 473)
          to label %29 unwind label %36

29:                                               ; preds = %27
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @.str.2)
          to label %31 unwind label %36

31:                                               ; preds = %29
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @.str.22)
          to label %33 unwind label %36

33:                                               ; preds = %31
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %32, i64 noundef %10)
          to label %35 unwind label %36

35:                                               ; preds = %33
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %3) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %3) #9
  br label %135

36:                                               ; preds = %33, %31, %29, %27, %25, %21, %19, %16
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %3) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %3) #9
  br label %136

38:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #9
  %.sroa.07.0.copyload = load ptr, ptr %2, align 8, !tbaa !9
  %.sroa.28.0.copyload = load i32, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !11
  call void @_ZN7cascadb5BlockC2ENS_5SliceEmm(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr %.sroa.07.0.copyload, i32 %.sroa.28.0.copyload, i64 noundef 0, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #9
  call void @_ZN7cascadb11BlockWriterC2EPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull %4)
  %39 = call noundef zeroext i1 @_ZN7cascadb6Layout11write_indexERNS_11BlockWriterE(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr noundef nonnull align 8 dereferenceable(16) %5)
  br i1 %39, label %41, label %40

40:                                               ; preds = %38
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 480, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb6Layout11flush_indexEv) #11
  unreachable

41:                                               ; preds = %38
  %42 = call noundef i64 @_ZN7cascadb5Block4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %43 = icmp eq i64 %42, %10
  br i1 %43, label %45, label %44

44:                                               ; preds = %41
  call void @__assert_fail(ptr noundef nonnull @.str.49, ptr noundef nonnull @.str.1, i32 noundef 482, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb6Layout11flush_indexEv) #11
  unreachable

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %46 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %2)
  %47 = call noundef i64 @_ZN7cascadb6Layout10get_offsetEm(ptr noundef nonnull align 8 dereferenceable(600) %0, i64 noundef %46)
  store i64 %47, ptr %6, align 8, !tbaa !13
  %.sroa.04.0.copyload = load ptr, ptr %2, align 8, !tbaa !9
  %.sroa.25.0.copyload = load i32, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !11
  %48 = call noundef zeroext i1 @_ZN7cascadb6Layout10write_dataEmNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %0, i64 noundef %47, ptr %.sroa.04.0.copyload, i32 %.sroa.25.0.copyload)
  %49 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !5
  br i1 %48, label %74, label %50

50:                                               ; preds = %45
  %51 = icmp slt i32 %49, 4
  br i1 %51, label %52, label %72

52:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %7) #9
  %53 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !9
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %7, ptr noundef %53)
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %7, i32 noundef 3)
          to label %55 unwind label %70

55:                                               ; preds = %52
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull @.str.2)
          to label %57 unwind label %70

57:                                               ; preds = %55
  %58 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #10
  %.not29 = icmp eq ptr %58, null
  %59 = getelementptr inbounds i8, ptr %58, i64 1
  %spec.select35 = select i1 %.not29, ptr @.str.1, ptr %59
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull %spec.select35)
          to label %61 unwind label %70

61:                                               ; preds = %57
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull @.str.3)
          to label %63 unwind label %70

63:                                               ; preds = %61
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %62, i32 noundef 486)
          to label %65 unwind label %70

65:                                               ; preds = %63
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @.str.2)
          to label %67 unwind label %70

67:                                               ; preds = %65
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @.str.50)
          to label %69 unwind label %70

69:                                               ; preds = %67
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %7) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %7) #9
  br label %72

70:                                               ; preds = %67, %65, %63, %61, %57, %55, %52
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %7) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %7) #9
  br label %134

72:                                               ; preds = %69, %50
  %73 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %2)
  call void @_ZN7cascadb6Layout8add_holeEmm(ptr noundef nonnull align 8 dereferenceable(600) %0, i64 noundef %47, i64 noundef %73)
  %.sroa.01.0.copyload = load ptr, ptr %2, align 8, !tbaa !9
  %.sroa.22.0.copyload = load i32, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !11
  call void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload)
  br label %133

74:                                               ; preds = %45
  %75 = icmp slt i32 %49, 1
  br i1 %75, label %76, label %96

76:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %8) #9
  %77 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !9
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %8, ptr noundef %77)
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %8, i32 noundef 0)
          to label %79 unwind label %94

79:                                               ; preds = %76
  %80 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %78, ptr noundef nonnull @.str.2)
          to label %81 unwind label %94

81:                                               ; preds = %79
  %82 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #10
  %.not30 = icmp eq ptr %82, null
  %83 = getelementptr inbounds i8, ptr %82, i64 1
  %spec.select36 = select i1 %.not30, ptr @.str.1, ptr %83
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull %spec.select36)
          to label %85 unwind label %94

85:                                               ; preds = %81
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @.str.3)
          to label %87 unwind label %94

87:                                               ; preds = %85
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %86, i32 noundef 492)
          to label %89 unwind label %94

89:                                               ; preds = %87
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull @.str.2)
          to label %91 unwind label %94

91:                                               ; preds = %89
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull @.str.51)
          to label %93 unwind label %94

93:                                               ; preds = %91
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %8) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %8) #9
  br label %96

94:                                               ; preds = %91, %89, %87, %85, %81, %79, %76
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %8) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %8) #9
  br label %134

96:                                               ; preds = %93, %74
  %97 = getelementptr inbounds i8, ptr %0, i64 176
  %98 = load ptr, ptr %97, align 8, !tbaa !15
  %99 = getelementptr inbounds i8, ptr %98, i64 16
  %100 = load ptr, ptr %99, align 8, !tbaa !34
  %.not31 = icmp eq ptr %100, null
  br i1 %.not31, label %108, label %101

101:                                              ; preds = %96
  %102 = load i64, ptr %100, align 8, !tbaa !36
  %103 = getelementptr inbounds i8, ptr %100, i64 12
  %104 = load i32, ptr %103, align 4, !tbaa !39
  %105 = add i32 %104, 4095
  %106 = and i32 %105, -4096
  %107 = zext i32 %106 to i64
  call void @_ZN7cascadb6Layout12add_fly_holeEmm(ptr noundef nonnull align 8 dereferenceable(600) %0, i64 noundef %102, i64 noundef %107)
  br label %110

108:                                              ; preds = %96
  %109 = call noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #12
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %109, i8 0, i64 24, i1 false)
  store ptr %109, ptr %99, align 8, !tbaa !34
  br label %110

110:                                              ; preds = %108, %101
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #9
  %111 = getelementptr inbounds i8, ptr %0, i64 184
  call void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull %111)
  %112 = load ptr, ptr %97, align 8, !tbaa !15
  %113 = getelementptr inbounds i8, ptr %112, i64 16
  %114 = load ptr, ptr %113, align 8, !tbaa !34
  %.not32 = icmp eq ptr %114, null
  br i1 %.not32, label %120, label %115

115:                                              ; preds = %110
  %116 = getelementptr inbounds i8, ptr %0, i64 280
  %117 = invoke noundef i64 @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(48) %116, ptr noundef nonnull align 8 dereferenceable(8) %114)
          to label %._crit_edge unwind label %118

._crit_edge:                                      ; preds = %115
  %.pre = load ptr, ptr %97, align 8, !tbaa !15
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 16
  %.pre37 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !34
  br label %120

118:                                              ; preds = %125, %124, %120, %115
  %119 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #9
  br label %134

120:                                              ; preds = %._crit_edge, %110
  %121 = phi ptr [ %.pre37, %._crit_edge ], [ null, %110 ]
  %122 = getelementptr inbounds i8, ptr %0, i64 280
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %122, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %124 unwind label %118

124:                                              ; preds = %120
  store ptr %121, ptr %123, align 8, !tbaa !9
  invoke void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %125 unwind label %118

125:                                              ; preds = %124
  %126 = load i64, ptr %6, align 8, !tbaa !13
  %127 = load ptr, ptr %97, align 8, !tbaa !15
  %128 = getelementptr inbounds i8, ptr %127, i64 16
  %129 = load ptr, ptr %128, align 8, !tbaa !34
  store i64 %126, ptr %129, align 8, !tbaa !36
  %130 = trunc i64 %10 to i32
  %131 = getelementptr inbounds i8, ptr %129, i64 12
  store i32 %130, ptr %131, align 4, !tbaa !39
  %.sroa.0.0.copyload = load ptr, ptr %2, align 8, !tbaa !9
  %.sroa.2.0.copyload = load i32, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !11
  invoke void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr %.sroa.0.0.copyload, i32 %.sroa.2.0.copyload)
          to label %132 unwind label %118

132:                                              ; preds = %125
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #9
  br label %133

133:                                              ; preds = %132, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %135

134:                                              ; preds = %118, %94, %70
  %.pn = phi { ptr, i32 } [ %119, %118 ], [ %95, %94 ], [ %71, %70 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %136

135:                                              ; preds = %13, %35, %133
  %.1 = phi i1 [ %48, %133 ], [ false, %35 ], [ false, %13 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #9
  ret i1 %.1

136:                                              ; preds = %134, %36
  %.pn.pn = phi { ptr, i32 } [ %.pn, %134 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #9
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb6Layout12add_fly_holeEmm(ptr noundef nonnull align 8 dereferenceable(600), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

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

; 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 #3 align 2

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

!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 = !{!"_ZTSN7cascadb11LoggerLevelE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 176}
!16 = !{!"_ZTSN7cascadb6LayoutE", !10, i64 0, !14, i64 8, !17, i64 16, !20, i64 120, !14, i64 168, !10, i64 176, !20, i64 184, !21, i64 232, !21, i64 280, !20, i64 328, !20, i64 376, !29, i64 424, !29, i64 504, !14, i64 584, !14, i64 592}
!17 = !{!"_ZTSN7cascadb7OptionsE", !10, i64 0, !10, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !18, i64 96, !19, i64 100}
!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, !14, i64 32}
!27 = !{!"_ZTSSt18_Rb_tree_node_base", !28, i64 0, !10, i64 8, !10, i64 16, !10, 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", !10, i64 0, !14, i64 8, !33, i64 16, !33, i64 48}
!33 = !{!"_ZTSSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_E", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!34 = !{!35, !10, i64 16}
!35 = !{!"_ZTSN7cascadb10SuperBlockE", !14, i64 0, !7, i64 8, !7, i64 9, !10, i64 16, !14, i64 24}
!36 = !{!37, !14, i64 0}
!37 = !{!"_ZTSN7cascadb9BlockMetaE", !14, i64 0, !12, i64 8, !12, i64 12, !38, i64 16, !38, i64 18}
!38 = !{!"short", !7, i64 0}
!39 = !{!37, !12, i64 12}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass