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

; 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"

%"struct.cascadb::AIOStatus" = type { i8, i64 }
%"class.cascadb::ScopedMutex" = type { i8, ptr }
%"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::Slice" = type <{ ptr, i32, [4 x i8] }>
%"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.cascadb::Layout::AsyncReadReq" = type { i64, ptr, ptr, %"struct.cascadb::BlockMeta", %"class.cascadb::Slice" }
%"struct.cascadb::BlockMeta" = type { i64, i32, i32, i16, i16 }

@.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.23 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [7 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3hexRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3decRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #6

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

declare noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef, i32 noundef) #8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7cascadb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(12)) #5 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 void @_ZN7cascadb8Callback4execIbEEvT_(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb6Layout17handle_async_readEPNS0_12AsyncReadReqENS_9AIOStatusE(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr noundef %1, i8 %2, i64 %3) #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"struct.cascadb::AIOStatus", align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.cascadb::ScopedMutex", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.cascadb::LoggerFormat", align 8
  %12 = alloca i16, align 2
  %13 = alloca %"class.cascadb::Slice", align 8
  %14 = alloca %"class.cascadb::LoggerFormat", align 8
  %15 = alloca %"class.cascadb::Slice", align 8
  %16 = alloca %"class.cascadb::LoggerFormat", align 8
  %17 = alloca %"class.cascadb::Slice", align 8
  %18 = getelementptr inbounds { i8, i64 }, ptr %5, i32 0, i32 0
  store i8 %2, ptr %18, align 8
  %19 = getelementptr inbounds { i8, i64 }, ptr %5, i32 0, i32 1
  store i64 %3, ptr %19, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #9
  %21 = getelementptr inbounds %"class.cascadb::Layout", ptr %20, i32 0, i32 3
  call void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %21)
  %22 = getelementptr inbounds %"class.cascadb::Layout", ptr %20, i32 0, i32 14
  %23 = load i64, ptr %22, align 8, !tbaa !9
  %24 = add i64 %23, -1
  store i64 %24, ptr %22, align 8, !tbaa !9
  invoke void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %25 unwind label %76

25:                                               ; preds = %4
  %26 = getelementptr inbounds %"struct.cascadb::AIOStatus", ptr %5, i32 0, i32 0
  %27 = load i8, ptr %26, align 8, !tbaa !30, !range !32, !noundef !33
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %207

29:                                               ; preds = %25
  %30 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !34
  %31 = icmp sge i32 0, %30
  br i1 %31, label %32, label %89

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 384, ptr %11) #9
  %33 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  invoke void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %11, ptr noundef %33)
          to label %34 unwind label %80

34:                                               ; preds = %32
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %11, i32 noundef 0)
          to label %36 unwind label %84

36:                                               ; preds = %34
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef @.str.2)
          to label %38 unwind label %84

38:                                               ; preds = %36
  %39 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #10
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %44

41:                                               ; preds = %38
  %42 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #10
  %43 = getelementptr inbounds i8, ptr %42, i64 1
  br label %45

44:                                               ; preds = %38
  br label %45

45:                                               ; preds = %44, %41
  %46 = phi ptr [ %43, %41 ], [ @.str.1, %44 ]
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef %46)
          to label %48 unwind label %84

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

50:                                               ; preds = %48
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %49, i32 noundef 218)
          to label %52 unwind label %84

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

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

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef @_ZSt3hexRSt8ios_base)
          to label %58 unwind label %84

58:                                               ; preds = %56
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %59, i32 0, i32 0
  %61 = load i64, ptr %60, align 8, !tbaa !36
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %57, i64 noundef %61)
          to label %63 unwind label %84

63:                                               ; preds = %58
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef @_ZSt3decRSt8ios_base)
          to label %65 unwind label %84

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 @.str.24)
          to label %67 unwind label %84

67:                                               ; preds = %65
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %68, i32 0, i32 3
  %70 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %69, i32 0, i32 0
  %71 = load i64, ptr %70, align 8, !tbaa !41
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %66, i64 noundef %71)
          to label %73 unwind label %84

73:                                               ; preds = %67
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef @.str.25)
          to label %75 unwind label %84

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

76:                                               ; preds = %268, %261, %4
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %9, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %10, align 4
  br label %284

80:                                               ; preds = %32
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %9, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %10, align 4
  br label %88

84:                                               ; preds = %73, %67, %65, %63, %58, %56, %54, %52, %50, %48, %45, %36, %34
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %9, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %10, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %11) #9
  br label %88

88:                                               ; preds = %84, %80
  call void @llvm.lifetime.end.p0(i64 384, ptr %11) #9
  br label %284

89:                                               ; preds = %75, %29
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #9
  %90 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #11
          to label %91 unwind label %131

91:                                               ; preds = %89
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %92, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %93, i64 16, i1 false), !tbaa.struct !42
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %94, i32 0, i32 3
  %96 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %95, i32 0, i32 2
  %97 = load i32, ptr %96, align 4, !tbaa !44
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds { ptr, i32 }, ptr %13, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8
  %101 = getelementptr inbounds { ptr, i32 }, ptr %13, i32 0, i32 1
  %102 = load i32, ptr %101, align 8
  invoke void @_ZN7cascadb5BlockC2ENS_5SliceEmm(ptr noundef nonnull align 8 dereferenceable(32) %90, ptr %100, i32 %102, i64 noundef 0, i64 noundef %98)
          to label %103 unwind label %135

103:                                              ; preds = %91
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %104, i32 0, i32 2
  %106 = load ptr, ptr %105, align 8, !tbaa !45
  store ptr %90, ptr %106, align 8, !tbaa !5
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %107, i32 0, i32 4
  %109 = invoke noundef ptr @_ZNK7cascadb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(12) %108)
          to label %110 unwind label %131

110:                                              ; preds = %103
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %111, i32 0, i32 4
  %113 = invoke noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %112)
          to label %114 unwind label %131

114:                                              ; preds = %110
  %115 = trunc i64 %113 to i32
  %116 = invoke noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef %109, i32 noundef %115)
          to label %117 unwind label %131

117:                                              ; preds = %114
  store i16 %116, ptr %12, align 2, !tbaa !46
  %118 = load i16, ptr %12, align 2, !tbaa !46
  %119 = zext i16 %118 to i32
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %120, i32 0, i32 3
  %122 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %121, i32 0, i32 3
  %123 = load i16, ptr %122, align 8, !tbaa !47
  %124 = zext i16 %123 to i32
  %125 = icmp eq i32 %119, %124
  br i1 %125, label %126, label %139

126:                                              ; preds = %117
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !48
  invoke void @_ZN7cascadb8Callback4execIbEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %129, i1 noundef zeroext true)
          to label %130 unwind label %131

130:                                              ; preds = %126
  br label %205

131:                                              ; preds = %200, %193, %126, %114, %110, %103, %89
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %9, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %10, align 4
  br label %206

135:                                              ; preds = %91
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %9, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %90, i64 noundef 32) #12
  br label %206

139:                                              ; preds = %117
  %140 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !34
  %141 = icmp sge i32 3, %140
  br i1 %141, label %142, label %193

142:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 384, ptr %14) #9
  %143 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  invoke void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %14, ptr noundef %143)
          to label %144 unwind label %184

144:                                              ; preds = %142
  %145 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %14, i32 noundef 3)
          to label %146 unwind label %188

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

148:                                              ; preds = %146
  %149 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #10
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %154

151:                                              ; preds = %148
  %152 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #10
  %153 = getelementptr inbounds i8, ptr %152, i64 1
  br label %155

154:                                              ; preds = %148
  br label %155

155:                                              ; preds = %154, %151
  %156 = phi ptr [ %153, %151 ], [ @.str.1, %154 ]
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef %156)
          to label %158 unwind label %188

158:                                              ; preds = %155
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %157, ptr noundef @.str.3)
          to label %160 unwind label %188

160:                                              ; preds = %158
  %161 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %159, i32 noundef 228)
          to label %162 unwind label %188

162:                                              ; preds = %160
  %163 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %161, ptr noundef @.str.2)
          to label %164 unwind label %188

164:                                              ; preds = %162
  %165 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %163, ptr noundef @.str.26)
          to label %166 unwind label %188

166:                                              ; preds = %164
  %167 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %165, ptr noundef @_ZSt3hexRSt8ios_base)
          to label %168 unwind label %188

168:                                              ; preds = %166
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %169, i32 0, i32 0
  %171 = load i64, ptr %170, align 8, !tbaa !36
  %172 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %167, i64 noundef %171)
          to label %173 unwind label %188

173:                                              ; preds = %168
  %174 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %172, ptr noundef @_ZSt3decRSt8ios_base)
          to label %175 unwind label %188

175:                                              ; preds = %173
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %176, i32 0, i32 3
  %178 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %177, i32 0, i32 3
  %179 = load i16, ptr %178, align 8, !tbaa !47
  %180 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEt(ptr noundef nonnull align 8 dereferenceable(8) %174, i16 noundef zeroext %179)
          to label %181 unwind label %188

181:                                              ; preds = %175
  %182 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %180, ptr noundef @.str.27)
          to label %183 unwind label %188

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

184:                                              ; preds = %142
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %9, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %10, align 4
  br label %192

188:                                              ; preds = %181, %175, %173, %168, %166, %164, %162, %160, %158, %155, %146, %144
  %189 = landingpad { ptr, i32 }
          cleanup
  %190 = extractvalue { ptr, i32 } %189, 0
  store ptr %190, ptr %9, align 8
  %191 = extractvalue { ptr, i32 } %189, 1
  store i32 %191, ptr %10, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %14) #9
  br label %192

192:                                              ; preds = %188, %184
  call void @llvm.lifetime.end.p0(i64 384, ptr %14) #9
  br label %206

193:                                              ; preds = %183, %139
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %194, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %195, i64 16, i1 false), !tbaa.struct !42
  %196 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 0
  %197 = load ptr, ptr %196, align 8
  %198 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 1
  %199 = load i32, ptr %198, align 8
  invoke void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %20, ptr %197, i32 %199)
          to label %200 unwind label %131

200:                                              ; preds = %193
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %201, i32 0, i32 1
  %203 = load ptr, ptr %202, align 8, !tbaa !48
  invoke void @_ZN7cascadb8Callback4execIbEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %203, i1 noundef zeroext false)
          to label %204 unwind label %131

204:                                              ; preds = %200
  br label %205

205:                                              ; preds = %204, %130
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #9
  br label %273

206:                                              ; preds = %192, %135, %131
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #9
  br label %284

207:                                              ; preds = %25
  %208 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !34
  %209 = icmp sge i32 3, %208
  br i1 %209, label %210, label %261

210:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 384, ptr %16) #9
  %211 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  invoke void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %16, ptr noundef %211)
          to label %212 unwind label %252

212:                                              ; preds = %210
  %213 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %16, i32 noundef 3)
          to label %214 unwind label %256

214:                                              ; preds = %212
  %215 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %213, ptr noundef @.str.2)
          to label %216 unwind label %256

216:                                              ; preds = %214
  %217 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #10
  %218 = icmp ne ptr %217, null
  br i1 %218, label %219, label %222

219:                                              ; preds = %216
  %220 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #10
  %221 = getelementptr inbounds i8, ptr %220, i64 1
  br label %223

222:                                              ; preds = %216
  br label %223

223:                                              ; preds = %222, %219
  %224 = phi ptr [ %221, %219 ], [ @.str.1, %222 ]
  %225 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %215, ptr noundef %224)
          to label %226 unwind label %256

226:                                              ; preds = %223
  %227 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %225, ptr noundef @.str.3)
          to label %228 unwind label %256

228:                                              ; preds = %226
  %229 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %227, i32 noundef 233)
          to label %230 unwind label %256

230:                                              ; preds = %228
  %231 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %229, ptr noundef @.str.2)
          to label %232 unwind label %256

232:                                              ; preds = %230
  %233 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %231, ptr noundef @.str.23)
          to label %234 unwind label %256

234:                                              ; preds = %232
  %235 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %233, ptr noundef @_ZSt3hexRSt8ios_base)
          to label %236 unwind label %256

236:                                              ; preds = %234
  %237 = load ptr, ptr %7, align 8, !tbaa !5
  %238 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %237, i32 0, i32 0
  %239 = load i64, ptr %238, align 8, !tbaa !36
  %240 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %235, i64 noundef %239)
          to label %241 unwind label %256

241:                                              ; preds = %236
  %242 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %240, ptr noundef @_ZSt3decRSt8ios_base)
          to label %243 unwind label %256

243:                                              ; preds = %241
  %244 = load ptr, ptr %7, align 8, !tbaa !5
  %245 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %244, i32 0, i32 3
  %246 = getelementptr inbounds %"struct.cascadb::BlockMeta", ptr %245, i32 0, i32 3
  %247 = load i16, ptr %246, align 8, !tbaa !47
  %248 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEt(ptr noundef nonnull align 8 dereferenceable(8) %242, i16 noundef zeroext %247)
          to label %249 unwind label %256

249:                                              ; preds = %243
  %250 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %248, ptr noundef @.str.27)
          to label %251 unwind label %256

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

252:                                              ; preds = %210
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %9, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %10, align 4
  br label %260

256:                                              ; preds = %249, %243, %241, %236, %234, %232, %230, %228, %226, %223, %214, %212
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %9, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %10, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %16) #9
  br label %260

260:                                              ; preds = %256, %252
  call void @llvm.lifetime.end.p0(i64 384, ptr %16) #9
  br label %284

261:                                              ; preds = %251, %207
  %262 = load ptr, ptr %7, align 8, !tbaa !5
  %263 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %262, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %263, i64 16, i1 false), !tbaa.struct !42
  %264 = getelementptr inbounds { ptr, i32 }, ptr %17, i32 0, i32 0
  %265 = load ptr, ptr %264, align 8
  %266 = getelementptr inbounds { ptr, i32 }, ptr %17, i32 0, i32 1
  %267 = load i32, ptr %266, align 8
  invoke void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %20, ptr %265, i32 %267)
          to label %268 unwind label %76

268:                                              ; preds = %261
  %269 = load ptr, ptr %7, align 8, !tbaa !5
  %270 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %269, i32 0, i32 1
  %271 = load ptr, ptr %270, align 8, !tbaa !48
  invoke void @_ZN7cascadb8Callback4execIbEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %271, i1 noundef zeroext false)
          to label %272 unwind label %76

272:                                              ; preds = %268
  br label %273

273:                                              ; preds = %272, %205
  %274 = load ptr, ptr %7, align 8, !tbaa !5
  %275 = getelementptr inbounds %"struct.cascadb::Layout::AsyncReadReq", ptr %274, i32 0, i32 1
  %276 = load ptr, ptr %275, align 8, !tbaa !48
  %277 = icmp eq ptr %276, null
  br i1 %277, label %279, label %278

278:                                              ; preds = %273
  call void @_ZN7cascadb8CallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %276) #9
  call void @_ZdlPvm(ptr noundef %276, i64 noundef 8) #12
  br label %279

279:                                              ; preds = %278, %273
  %280 = load ptr, ptr %7, align 8, !tbaa !5
  %281 = icmp eq ptr %280, null
  br i1 %281, label %283, label %282

282:                                              ; preds = %279
  call void @_ZdlPvm(ptr noundef %280, i64 noundef 64) #12
  br label %283

283:                                              ; preds = %282, %279
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #9
  ret void

284:                                              ; preds = %260, %206, %88, %76
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #9
  br label %285

285:                                              ; preds = %284
  %286 = load ptr, ptr %9, align 8
  %287 = load i32, ptr %10, align 4
  %288 = insertvalue { ptr, i32 } poison, ptr %286, 0
  %289 = insertvalue { ptr, i32 } %288, i32 %287, 1
  resume { ptr, i32 } %289
}

; 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 void @_ZN7cascadb8CallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 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 = { 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 #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 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { 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, !11, i64 592}
!10 = !{!"_ZTSN7cascadb6LayoutE", !6, i64 0, !11, i64 8, !12, i64 16, !16, i64 120, !11, i64 168, !6, i64 176, !16, i64 184, !17, i64 232, !17, i64 280, !16, i64 328, !16, i64 376, !25, i64 424, !25, i64 504, !11, i64 584, !11, i64 592}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_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, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !14, i64 96, !15, i64 100}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN7cascadb5MutexE", !15, i64 0, !7, i64 8}
!17 = !{!"_ZTSSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE", !18, i64 0}
!18 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE", !19, i64 0}
!19 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !20, i64 0, !22, i64 8}
!20 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !21, i64 0}
!21 = !{!"_ZTSSt4lessImE"}
!22 = !{!"_ZTSSt15_Rb_tree_header", !23, i64 0, !11, i64 32}
!23 = !{!"_ZTSSt18_Rb_tree_node_base", !24, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!24 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!25 = !{!"_ZTSSt5dequeIN7cascadb6Layout4HoleESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE11_Deque_implE", !28, i64 0}
!28 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !11, i64 8, !29, i64 16, !29, i64 48}
!29 = !{!"_ZTSSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!30 = !{!31, !15, i64 0}
!31 = !{!"_ZTSN7cascadb9AIOStatusE", !15, i64 0, !11, i64 8}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!35, !35, i64 0}
!35 = !{!"_ZTSN7cascadb11LoggerLevelE", !7, i64 0}
!36 = !{!37, !11, i64 0}
!37 = !{!"_ZTSN7cascadb6Layout12AsyncReadReqE", !11, i64 0, !6, i64 8, !6, i64 16, !38, i64 24, !40, i64 48}
!38 = !{!"_ZTSN7cascadb9BlockMetaE", !11, i64 0, !13, i64 8, !13, i64 12, !39, i64 16, !39, i64 18}
!39 = !{!"short", !7, i64 0}
!40 = !{!"_ZTSN7cascadb5SliceE", !6, i64 0, !13, i64 8}
!41 = !{!37, !11, i64 24}
!42 = !{i64 0, i64 8, !5, i64 8, i64 4, !43}
!43 = !{!13, !13, i64 0}
!44 = !{!37, !13, i64 36}
!45 = !{!37, !6, i64 16}
!46 = !{!39, !39, i64 0}
!47 = !{!37, !39, i64 40}
!48 = !{!37, !6, i64 8}


; 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 }
%"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 }

@.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.23 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [7 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3hexRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt3decRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #5

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

declare noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7cascadb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4 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 void @_ZN7cascadb8Callback4execIbEEvT_(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7cascadb6Layout17handle_async_readEPNS0_12AsyncReadReqENS_9AIOStatusE(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr noundef %1, i8 %2, i64 %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.cascadb::ScopedMutex", align 8
  %6 = alloca %"class.cascadb::LoggerFormat", align 8
  %7 = alloca %"class.cascadb::LoggerFormat", align 8
  %8 = alloca %"class.cascadb::LoggerFormat", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %9 = getelementptr inbounds i8, ptr %0, i64 120
  call void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 592
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = add i64 %11, -1
  store i64 %12, ptr %10, align 8, !tbaa !5
  invoke void @_ZN7cascadb11ScopedMutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %13 unwind label %52

13:                                               ; preds = %4
  %14 = trunc i8 %2 to i1
  %15 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !29
  br i1 %14, label %16, label %120

16:                                               ; preds = %13
  %17 = icmp slt i32 %15, 1
  br i1 %17, label %18, label %59

18:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %6) #8
  %19 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !31
  invoke void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %6, ptr noundef %19)
          to label %20 unwind label %54

20:                                               ; preds = %18
  %21 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %6, i32 noundef 0)
          to label %22 unwind label %56

22:                                               ; preds = %20
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @.str.2)
          to label %24 unwind label %56

24:                                               ; preds = %22
  %25 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #9
  %.not41 = icmp eq ptr %25, null
  %26 = getelementptr inbounds i8, ptr %25, i64 1
  %spec.select = select i1 %.not41, ptr @.str.1, ptr %26
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull %spec.select)
          to label %28 unwind label %56

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

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %29, i32 noundef 218)
          to label %32 unwind label %56

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

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

36:                                               ; preds = %34
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @_ZSt3hexRSt8ios_base)
          to label %38 unwind label %56

38:                                               ; preds = %36
  %39 = load i64, ptr %1, align 8, !tbaa !32
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %37, i64 noundef %39)
          to label %41 unwind label %56

41:                                               ; preds = %38
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @_ZSt3decRSt8ios_base)
          to label %43 unwind label %56

43:                                               ; preds = %41
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @.str.24)
          to label %45 unwind label %56

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %1, i64 24
  %47 = load i64, ptr %46, align 8, !tbaa !37
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %44, i64 noundef %47)
          to label %49 unwind label %56

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

51:                                               ; preds = %49
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %6) #8
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %6) #8
  br label %59

52:                                               ; preds = %161, %159, %4
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %170

54:                                               ; preds = %18
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %58

56:                                               ; preds = %49, %45, %43, %41, %38, %36, %34, %32, %30, %28, %24, %22, %20
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %6) #8
  br label %58

58:                                               ; preds = %56, %54
  %.pn42 = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %6) #8
  br label %170

59:                                               ; preds = %51, %16
  %60 = invoke noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #10
          to label %61 unwind label %76

61:                                               ; preds = %59
  %62 = getelementptr inbounds i8, ptr %1, i64 48
  %.sroa.04.0.copyload = load ptr, ptr %62, align 8, !tbaa !31
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 56
  %.sroa.25.0.copyload = load i32, ptr %.sroa.25.0..sroa_idx, align 8, !tbaa !38
  %63 = getelementptr inbounds i8, ptr %1, i64 36
  %64 = load i32, ptr %63, align 4, !tbaa !39
  %65 = zext i32 %64 to i64
  call void @_ZN7cascadb5BlockC2ENS_5SliceEmm(ptr noundef nonnull align 8 dereferenceable(32) %60, ptr %.sroa.04.0.copyload, i32 %.sroa.25.0.copyload, i64 noundef 0, i64 noundef %65)
  %66 = getelementptr inbounds i8, ptr %1, i64 16
  %67 = load ptr, ptr %66, align 8, !tbaa !40
  store ptr %60, ptr %67, align 8, !tbaa !31
  %68 = call noundef ptr @_ZNK7cascadb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(12) %62)
  %69 = call noundef i64 @_ZNK7cascadb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(12) %62)
  %70 = trunc i64 %69 to i32
  %71 = invoke noundef zeroext i16 @_ZN7cascadb5crc16EPKcj(ptr noundef %68, i32 noundef %70)
          to label %72 unwind label %76

72:                                               ; preds = %61
  %73 = getelementptr inbounds i8, ptr %1, i64 40
  %74 = load i16, ptr %73, align 8, !tbaa !41
  %75 = icmp eq i16 %71, %74
  br i1 %75, label %.invoke, label %78

76:                                               ; preds = %.invoke, %117, %61, %59
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %170

78:                                               ; preds = %72
  %79 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !29
  %80 = icmp slt i32 %79, 4
  br i1 %80, label %81, label %117

81:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %7) #8
  %82 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !31
  invoke void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %7, ptr noundef %82)
          to label %83 unwind label %112

83:                                               ; preds = %81
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %7, i32 noundef 3)
          to label %85 unwind label %114

85:                                               ; preds = %83
  %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.2)
          to label %87 unwind label %114

87:                                               ; preds = %85
  %88 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #9
  %.not44 = icmp eq ptr %88, null
  %89 = getelementptr inbounds i8, ptr %88, i64 1
  %spec.select50 = select i1 %.not44, ptr @.str.1, ptr %89
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull %spec.select50)
          to label %91 unwind label %114

91:                                               ; preds = %87
  %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.3)
          to label %93 unwind label %114

93:                                               ; preds = %91
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %92, i32 noundef 228)
          to label %95 unwind label %114

95:                                               ; preds = %93
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef nonnull @.str.2)
          to label %97 unwind label %114

97:                                               ; preds = %95
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull @.str.26)
          to label %99 unwind label %114

99:                                               ; preds = %97
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @_ZSt3hexRSt8ios_base)
          to label %101 unwind label %114

101:                                              ; preds = %99
  %102 = load i64, ptr %1, align 8, !tbaa !32
  %103 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %100, i64 noundef %102)
          to label %104 unwind label %114

104:                                              ; preds = %101
  %105 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef nonnull @_ZSt3decRSt8ios_base)
          to label %106 unwind label %114

106:                                              ; preds = %104
  %107 = load i16, ptr %73, align 8, !tbaa !41
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEt(ptr noundef nonnull align 8 dereferenceable(8) %105, i16 noundef zeroext %107)
          to label %109 unwind label %114

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

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

112:                                              ; preds = %81
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %116

114:                                              ; preds = %109, %106, %104, %101, %99, %97, %95, %93, %91, %87, %85, %83
  %115 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %7) #8
  br label %116

116:                                              ; preds = %114, %112
  %.pn45 = phi { ptr, i32 } [ %115, %114 ], [ %113, %112 ]
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %7) #8
  br label %170

117:                                              ; preds = %111, %78
  %.sroa.01.0.copyload = load ptr, ptr %62, align 8, !tbaa !31
  %.sroa.22.0.copyload = load i32, ptr %.sroa.25.0..sroa_idx, align 8, !tbaa !38
  invoke void @_ZN7cascadb6Layout11free_bufferENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload)
          to label %.invoke unwind label %76

.invoke:                                          ; preds = %117, %72
  %118 = getelementptr inbounds i8, ptr %1, i64 8
  %119 = load ptr, ptr %118, align 8, !tbaa !42
  invoke void @_ZN7cascadb8Callback4execIbEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %119, i1 noundef zeroext %75)
          to label %164 unwind label %76

120:                                              ; preds = %13
  %121 = icmp slt i32 %15, 4
  br i1 %121, label %122, label %159

122:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %8) #8
  %123 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !31
  invoke void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %8, ptr noundef %123)
          to label %124 unwind label %154

124:                                              ; preds = %122
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %8, i32 noundef 3)
          to label %126 unwind label %156

126:                                              ; preds = %124
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %125, ptr noundef nonnull @.str.2)
          to label %128 unwind label %156

128:                                              ; preds = %126
  %129 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #9
  %.not = icmp eq ptr %129, null
  %130 = getelementptr inbounds i8, ptr %129, i64 1
  %spec.select51 = select i1 %.not, ptr @.str.1, ptr %130
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef nonnull %spec.select51)
          to label %132 unwind label %156

132:                                              ; preds = %128
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef nonnull @.str.3)
          to label %134 unwind label %156

134:                                              ; preds = %132
  %135 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %133, i32 noundef 233)
          to label %136 unwind label %156

136:                                              ; preds = %134
  %137 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %135, ptr noundef nonnull @.str.2)
          to label %138 unwind label %156

138:                                              ; preds = %136
  %139 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull @.str.23)
          to label %140 unwind label %156

140:                                              ; preds = %138
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef nonnull @_ZSt3hexRSt8ios_base)
          to label %142 unwind label %156

142:                                              ; preds = %140
  %143 = load i64, ptr %1, align 8, !tbaa !32
  %144 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %141, i64 noundef %143)
          to label %145 unwind label %156

145:                                              ; preds = %142
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %144, ptr noundef nonnull @_ZSt3decRSt8ios_base)
          to label %147 unwind label %156

147:                                              ; preds = %145
  %148 = getelementptr inbounds i8, ptr %1, i64 40
  %149 = load i16, ptr %148, align 8, !tbaa !41
  %150 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEt(ptr noundef nonnull align 8 dereferenceable(8) %146, i16 noundef zeroext %149)
          to label %151 unwind label %156

151:                                              ; preds = %147
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %150, ptr noundef nonnull @.str.27)
          to label %153 unwind label %156

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

154:                                              ; preds = %122
  %155 = landingpad { ptr, i32 }
          cleanup
  br label %158

156:                                              ; preds = %151, %147, %145, %142, %140, %138, %136, %134, %132, %128, %126, %124
  %157 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %8) #8
  br label %158

158:                                              ; preds = %156, %154
  %.pn = phi { ptr, i32 } [ %157, %156 ], [ %155, %154 ]
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %8) #8
  br label %170

159:                                              ; preds = %153, %120
  %160 = getelementptr inbounds i8, ptr %1, i64 48
  %.sroa.0.0.copyload = load ptr, ptr %160, align 8, !tbaa !31
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 56
  %.sroa.2.0.copyload = load i32, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !38
  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 %161 unwind label %52

161:                                              ; preds = %159
  %162 = getelementptr inbounds i8, ptr %1, i64 8
  %163 = load ptr, ptr %162, align 8, !tbaa !42
  invoke void @_ZN7cascadb8Callback4execIbEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %163, i1 noundef zeroext false)
          to label %164 unwind label %52

164:                                              ; preds = %.invoke, %161
  %165 = getelementptr inbounds i8, ptr %1, i64 8
  %166 = load ptr, ptr %165, align 8, !tbaa !42
  %167 = icmp eq ptr %166, null
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  call void @_ZN7cascadb8CallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %166) #8
  call void @_ZdlPvm(ptr noundef nonnull %166, i64 noundef 8) #11
  br label %169

169:                                              ; preds = %168, %164
  call void @_ZdlPvm(ptr noundef nonnull %1, i64 noundef 64) #11
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  ret void

170:                                              ; preds = %76, %116, %158, %58, %52
  %.pn47.pn = phi { ptr, i32 } [ %.pn42, %58 ], [ %53, %52 ], [ %.pn, %158 ], [ %77, %76 ], [ %.pn45, %116 ]
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  resume { ptr, i32 } %.pn47.pn
}

; 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 void @_ZN7cascadb8CallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 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 = { 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 #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 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { 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 592}
!6 = !{!"_ZTSN7cascadb6LayoutE", !7, i64 0, !10, i64 8, !11, i64 16, !15, i64 120, !10, i64 168, !7, i64 176, !15, i64 184, !16, i64 232, !16, i64 280, !15, i64 328, !15, i64 376, !24, i64 424, !24, i64 504, !10, i64 584, !10, i64 592}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSN7cascadb7OptionsE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !13, i64 96, !14, i64 100}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSN7cascadb8CompressE", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!"_ZTSN7cascadb5MutexE", !14, i64 0, !8, i64 8}
!16 = !{!"_ZTSSt3mapImPN7cascadb9BlockMetaESt4lessImESaISt4pairIKmS2_EEE", !17, i64 0}
!17 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE", !18, i64 0}
!18 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmPN7cascadb9BlockMetaEESt10_Select1stIS5_ESt4lessImESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !19, i64 0, !21, i64 8}
!19 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !20, i64 0}
!20 = !{!"_ZTSSt4lessImE"}
!21 = !{!"_ZTSSt15_Rb_tree_header", !22, i64 0, !10, i64 32}
!22 = !{!"_ZTSSt18_Rb_tree_node_base", !23, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!23 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!24 = !{!"_ZTSSt5dequeIN7cascadb6Layout4HoleESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE11_Deque_implE", !27, i64 0}
!27 = !{!"_ZTSNSt11_Deque_baseIN7cascadb6Layout4HoleESaIS2_EE16_Deque_impl_dataE", !7, i64 0, !10, i64 8, !28, i64 16, !28, i64 48}
!28 = !{!"_ZTSSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_E", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!29 = !{!30, !30, i64 0}
!30 = !{!"_ZTSN7cascadb11LoggerLevelE", !8, i64 0}
!31 = !{!7, !7, i64 0}
!32 = !{!33, !10, i64 0}
!33 = !{!"_ZTSN7cascadb6Layout12AsyncReadReqE", !10, i64 0, !7, i64 8, !7, i64 16, !34, i64 24, !36, i64 48}
!34 = !{!"_ZTSN7cascadb9BlockMetaE", !10, i64 0, !12, i64 8, !12, i64 12, !35, i64 16, !35, i64 18}
!35 = !{!"short", !8, i64 0}
!36 = !{!"_ZTSN7cascadb5SliceE", !7, i64 0, !12, i64 8}
!37 = !{!33, !10, i64 24}
!38 = !{!12, !12, i64 0}
!39 = !{!33, !12, i64 36}
!40 = !{!33, !7, i64 16}
!41 = !{!33, !35, i64 40}
!42 = !{!33, !7, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass