; LLVM IR from weicao/cascadb :: src/tree/node.ll (ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE)

; 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.__gnu_cxx::__normal_iterator.30" = type { ptr }
%"class.cascadb::KeyComp" = type { ptr }
%"class.cascadb::LeafNode" = type { %"class.cascadb::DataNode.base", i8, i64, i64, i64, %"class.std::vector.8", %"class.cascadb::RecordBuckets" }
%"class.cascadb::DataNode.base" = type <{ %"class.cascadb::Node", ptr, i32 }>
%"class.cascadb::Node" = type { ptr, %"class.std::__cxx11::basic_string", i64, %"class.cascadb::Mutex", i8, i8, i8, %struct.timeval, %struct.timeval, i32, i32, %"class.cascadb::RWLock" }
%"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 }
%struct.timeval = type { i64, i64 }
%"class.cascadb::RWLock" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::LeafNode::BucketInfo, std::allocator<cascadb::LeafNode::BucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::RecordBuckets" = type { i64, %"class.std::vector.13", i64, i64, i64 }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::RecordBuckets::RecordBucketInfo, std::allocator<cascadb::RecordBuckets::RecordBucketInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::DataNode" = type <{ %"class.cascadb::Node", ptr, i32, [4 x i8] }>
%"class.cascadb::Tree" = type { %"class.std::__cxx11::basic_string", %"class.cascadb::Options", ptr, ptr, ptr, ptr, ptr, ptr }
%"class.cascadb::Options" = type <{ ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"struct.cascadb::LeafNode::BucketInfo" = type <{ %"class.cascadb::Slice", %"class.cascadb::Slice", i32, i32, i32, i16, [2 x i8] }>
%"class.cascadb::Record" = type { %"class.cascadb::Slice", %"class.cascadb::Slice" }

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@_ZN7cascadb14g_logger_levelE = external global i32, align 4
@_ZN7cascadb8g_loggerE = external global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE = external hidden unnamed_addr constant [66 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef) unnamed_addr #2 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) #2 align 2

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

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

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

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr %1, i32 %2, ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef %4) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i1, align 1
  %7 = alloca %"class.cascadb::Slice", align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.cascadb::LoggerFormat", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %21 = alloca %"class.cascadb::KeyComp", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %23 = alloca %"class.cascadb::Slice", align 8
  %24 = alloca { ptr, i32 }, align 8
  %25 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 0
  store ptr %1, ptr %25, align 8
  %26 = getelementptr inbounds { ptr, i32 }, ptr %7, i32 0, i32 1
  store i32 %2, ptr %26, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %8, align 8
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %5
  br label %33

31:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 1215, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE) #9
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  call void @_ZN7cascadb4Node9read_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %27)
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %34)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %35

35:                                               ; preds = %57, %33
  %36 = load i64, ptr %11, align 8, !tbaa !9
  %37 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 5
  %38 = call noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #10
  %39 = icmp ult i64 %36, %38
  br i1 %39, label %40, label %60

40:                                               ; preds = %35
  %41 = getelementptr inbounds %"class.cascadb::DataNode", ptr %27, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds %"class.cascadb::Tree", ptr %42, i32 0, i32 1
  %44 = getelementptr inbounds %"class.cascadb::Options", ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !22
  %46 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 5
  %47 = load i64, ptr %11, align 8, !tbaa !9
  %48 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %47) #10
  %49 = getelementptr inbounds %"struct.cascadb::LeafNode::BucketInfo", ptr %48, i32 0, i32 0
  %50 = load ptr, ptr %45, align 8, !tbaa !26
  %51 = getelementptr inbounds ptr, ptr %50, i64 0
  %52 = load ptr, ptr %51, align 8
  %53 = call noundef i32 %52(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(12) %49)
  %54 = icmp slt i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %40
  br label %60

56:                                               ; preds = %40
  br label %57

57:                                               ; preds = %56
  %58 = load i64, ptr %11, align 8, !tbaa !9
  %59 = add i64 %58, 1
  store i64 %59, ptr %11, align 8, !tbaa !9
  br label %35, !llvm.loop !28

60:                                               ; preds = %55, %35
  %61 = load i64, ptr %11, align 8, !tbaa !9
  %62 = icmp eq i64 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %27)
  store i1 false, ptr %6, align 1
  store i32 1, ptr %12, align 4
  br label %167

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  %65 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 6
  %66 = load i64, ptr %11, align 8, !tbaa !9
  %67 = sub i64 %66, 1
  %68 = call noundef ptr @_ZN7cascadb13RecordBuckets6bucketEm(ptr noundef nonnull align 8 dereferenceable(56) %65, i64 noundef %67)
  store ptr %68, ptr %13, align 8, !tbaa !5
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %128

71:                                               ; preds = %64
  %72 = load i64, ptr %11, align 8, !tbaa !9
  %73 = sub i64 %72, 1
  %74 = call noundef zeroext i1 @_ZN7cascadb8LeafNode11load_bucketEm(ptr noundef nonnull align 8 dereferenceable(320) %27, i64 noundef %73)
  br i1 %74, label %117, label %75

75:                                               ; preds = %71
  %76 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !30
  %77 = icmp sge i32 3, %76
  br i1 %77, label %78, label %116

78:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 384, ptr %14) #10
  %79 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !5
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %14, ptr noundef %79)
  %80 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %14, i32 noundef 3)
          to label %81 unwind label %112

81:                                               ; preds = %78
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef @.str.19)
          to label %83 unwind label %112

83:                                               ; preds = %81
  %84 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #11
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %89

86:                                               ; preds = %83
  %87 = call noundef ptr @strrchr(ptr noundef @.str.1, i32 noundef 47) #11
  %88 = getelementptr inbounds i8, ptr %87, i64 1
  br label %90

89:                                               ; preds = %83
  br label %90

90:                                               ; preds = %89, %86
  %91 = phi ptr [ %88, %86 ], [ @.str.1, %89 ]
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef %91)
          to label %93 unwind label %112

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

95:                                               ; preds = %93
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %94, i32 noundef 1235)
          to label %97 unwind label %112

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 @.str.19)
          to label %99 unwind label %112

99:                                               ; preds = %97
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef @.str.42)
          to label %101 unwind label %112

101:                                              ; preds = %99
  %102 = getelementptr inbounds %"class.cascadb::Node", ptr %27, i32 0, i32 2
  %103 = load i64, ptr %102, align 8, !tbaa !32
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %100, i64 noundef %103)
          to label %105 unwind label %112

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

107:                                              ; preds = %105
  %108 = load i64, ptr %11, align 8, !tbaa !9
  %109 = sub i64 %108, 1
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %106, i64 noundef %109)
          to label %111 unwind label %112

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

112:                                              ; preds = %107, %105, %101, %99, %97, %95, %93, %90, %81, %78
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %15, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %16, align 4
  call void @_ZN7cascadb12LoggerFormatD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %14) #10
  call void @llvm.lifetime.end.p0(i64 384, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  br label %169

116:                                              ; preds = %111, %75
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %27)
  store i1 false, ptr %6, align 1
  store i32 1, ptr %12, align 4
  br label %166

117:                                              ; preds = %71
  %118 = getelementptr inbounds %"class.cascadb::LeafNode", ptr %27, i32 0, i32 6
  %119 = load i64, ptr %11, align 8, !tbaa !9
  %120 = sub i64 %119, 1
  %121 = call noundef ptr @_ZN7cascadb13RecordBuckets6bucketEm(ptr noundef nonnull align 8 dereferenceable(56) %118, i64 noundef %120)
  store ptr %121, ptr %13, align 8, !tbaa !5
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %125

124:                                              ; preds = %117
  br label %127

125:                                              ; preds = %117
  call void @__assert_fail(ptr noundef @.str.44, ptr noundef @.str.1, i32 noundef 1240, ptr noundef @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE) #9
  unreachable

126:                                              ; No predecessors!
  br label %127

127:                                              ; preds = %126, %124
  br label %128

128:                                              ; preds = %127, %64
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #10
  store i8 0, ptr %17, align 1, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #10
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = call ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #10
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %19, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = call ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #10
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %20, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  %135 = getelementptr inbounds %"class.cascadb::DataNode", ptr %27, i32 0, i32 1
  %136 = load ptr, ptr %135, align 8, !tbaa !11
  %137 = getelementptr inbounds %"class.cascadb::Tree", ptr %136, i32 0, i32 1
  %138 = getelementptr inbounds %"class.cascadb::Options", ptr %137, i32 0, i32 1
  %139 = load ptr, ptr %138, align 8, !tbaa !22
  call void @_ZN7cascadb7KeyCompC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef %139)
  %140 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %19, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8
  %142 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %20, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8
  %144 = getelementptr inbounds %"class.cascadb::KeyComp", ptr %21, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8
  %146 = call ptr @_ZSt11lower_boundIN9__gnu_cxx17__normal_iteratorIPN7cascadb6RecordESt6vectorIS3_SaIS3_EEEENS2_5SliceENS2_7KeyCompEET_SB_SB_RKT0_T1_(ptr %141, ptr %143, ptr noundef nonnull align 8 dereferenceable(12) %7, ptr %145)
  %147 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %18, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %148 = load ptr, ptr %13, align 8, !tbaa !5
  %149 = call ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %148) #10
  %150 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.30", ptr %22, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  %151 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN7cascadb6RecordESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %22) #10
  br i1 %151, label %152, label %156

152:                                              ; preds = %128
  %153 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb6RecordESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #10
  %154 = getelementptr inbounds %"class.cascadb::Record", ptr %153, i32 0, i32 0
  %155 = call noundef zeroext i1 @_ZN7cascadbeqERKNS_5SliceES2_(ptr noundef nonnull align 8 dereferenceable(12) %154, ptr noundef nonnull align 8 dereferenceable(12) %7)
  br label %156

156:                                              ; preds = %152, %128
  %157 = phi i1 [ false, %128 ], [ %155, %152 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br i1 %157, label %158, label %163

158:                                              ; preds = %156
  store i8 1, ptr %17, align 1, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #10
  %159 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb6RecordESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #10
  %160 = getelementptr inbounds %"class.cascadb::Record", ptr %159, i32 0, i32 1
  %161 = call { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12) %160)
  store { ptr, i32 } %161, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %24, i64 12, i1 false)
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %162, ptr align 8 %23, i64 12, i1 false), !tbaa.struct !34
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #10
  br label %163

163:                                              ; preds = %158, %156
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %27)
  %164 = load i8, ptr %17, align 1, !tbaa !33, !range !36, !noundef !37
  %165 = trunc i8 %164 to i1
  store i1 %165, ptr %6, align 1
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #10
  br label %166

166:                                              ; preds = %163, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  br label %167

167:                                              ; preds = %166, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  %168 = load i1, ptr %6, align 1
  ret i1 %168

169:                                              ; preds = %112
  %170 = load ptr, ptr %15, align 8
  %171 = load i32, ptr %16, align 4
  %172 = insertvalue { ptr, i32 } poison, ptr %170, 0
  %173 = insertvalue { ptr, i32 } %172, i32 %171, 1
  resume { ptr, i32 } %173
}

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

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

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

!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, !6, i64 200}
!12 = !{!"_ZTSN7cascadb8DataNodeE", !13, i64 0, !6, i64 200, !21, i64 208}
!13 = !{!"_ZTSN7cascadb4NodeE", !14, i64 8, !10, i64 40, !16, i64 48, !17, i64 96, !17, i64 97, !17, i64 98, !18, i64 104, !18, i64 120, !19, i64 136, !19, i64 140, !20, i64 144}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !10, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!16 = !{!"_ZTSN7cascadb5MutexE", !17, i64 0, !7, i64 8}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTS7timeval", !10, i64 0, !10, i64 8}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!21 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!22 = !{!23, !6, i64 40}
!23 = !{!"_ZTSN7cascadb4TreeE", !14, i64 0, !24, i64 32, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!24 = !{!"_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, !19, i64 72, !19, i64 76, !19, i64 80, !19, i64 84, !19, i64 88, !19, i64 92, !25, i64 96, !17, i64 100}
!25 = !{!"_ZTSN7cascadb8CompressE", !7, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !8, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !31, i64 0}
!31 = !{!"_ZTSN7cascadb11LoggerLevelE", !7, i64 0}
!32 = !{!13, !10, i64 40}
!33 = !{!17, !17, i64 0}
!34 = !{i64 0, i64 8, !5, i64 8, i64 4, !35}
!35 = !{!19, !19, i64 0}
!36 = !{i8 0, i8 2}
!37 = !{}


; 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.__gnu_cxx::__normal_iterator.30" = type { ptr }
%"class.cascadb::KeyComp" = type { ptr }

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 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.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE = external hidden unnamed_addr constant [66 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 uwtable
declare dso_local void @_ZN7cascadb4Node9read_lockEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #2 align 2

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

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

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

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

; 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 #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef) unnamed_addr #2 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 #2 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPN7cascadb6RecordESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #7

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr %1, i32 %2, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(12) %3, ptr noundef %4) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.cascadb::Slice", align 8
  %7 = alloca %"class.cascadb::LoggerFormat", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  %9 = alloca %"class.cascadb::KeyComp", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.30", align 8
  store ptr %1, ptr %6, align 8
  %11 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %2, ptr %11, align 8
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %12, label %13

12:                                               ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 1215, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE) #8
  unreachable

13:                                               ; preds = %5
  tail call void @_ZN7cascadb4Node9read_lockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  tail call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %4)
  %14 = getelementptr inbounds i8, ptr %0, i64 200
  %15 = getelementptr inbounds i8, ptr %0, i64 240
  %16 = tail call noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #9
  %.not35 = icmp eq i64 %16, 0
  br i1 %.not35, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %13, %25
  %.02332 = phi i64 [ %26, %25 ], [ 0, %13 ]
  %17 = load ptr, ptr %14, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 40
  %19 = load ptr, ptr %18, align 8, !tbaa !20
  %20 = call noundef nonnull align 8 dereferenceable(46) ptr @_ZNSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %.02332) #9
  %21 = load ptr, ptr %19, align 8, !tbaa !24
  %22 = load ptr, ptr %21, align 8
  %23 = call noundef i32 %22(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 8 dereferenceable(12) %20)
  %24 = icmp slt i32 %23, 0
  br i1 %24, label %._crit_edge, label %25

25:                                               ; preds = %.lr.ph
  %26 = add nuw i64 %.02332, 1
  %27 = call noundef i64 @_ZNKSt6vectorIN7cascadb8LeafNode10BucketInfoESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #9
  %28 = icmp ult i64 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge.thread37, !llvm.loop !26

._crit_edge:                                      ; preds = %.lr.ph
  %29 = icmp eq i64 %.02332, 0
  br i1 %29, label %._crit_edge.thread, label %._crit_edge.thread37

._crit_edge.thread:                               ; preds = %13, %._crit_edge
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  br label %89

._crit_edge.thread37:                             ; preds = %25, %._crit_edge
  %.023.lcssa39 = phi i64 [ %.02332, %._crit_edge ], [ %26, %25 ]
  %30 = getelementptr inbounds i8, ptr %0, i64 264
  %31 = add i64 %.023.lcssa39, -1
  %32 = call noundef ptr @_ZN7cascadb13RecordBuckets6bucketEm(ptr noundef nonnull align 8 dereferenceable(56) %30, i64 noundef %31)
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %71

34:                                               ; preds = %._crit_edge.thread37
  %35 = call noundef zeroext i1 @_ZN7cascadb8LeafNode11load_bucketEm(ptr noundef nonnull align 8 dereferenceable(320) %0, i64 noundef %31)
  br i1 %35, label %68, label %36

36:                                               ; preds = %34
  %37 = load i32, ptr @_ZN7cascadb14g_logger_levelE, align 4, !tbaa !28
  %38 = icmp slt i32 %37, 4
  br i1 %38, label %39, label %67

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %7) #9
  %40 = load ptr, ptr @_ZN7cascadb8g_loggerE, align 8, !tbaa !30
  call void @_ZN7cascadb12LoggerFormatC2EPNS_6LoggerE(ptr noundef nonnull align 8 dereferenceable(384) %7, ptr noundef %40)
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7cascadb12LoggerFormat3getENS_11LoggerLevelE(ptr noundef nonnull align 8 dereferenceable(384) %7, i32 noundef 3)
          to label %42 unwind label %65

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

44:                                               ; preds = %42
  %45 = call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 47) #10
  %.not30 = icmp eq ptr %45, null
  %46 = getelementptr inbounds i8, ptr %45, i64 1
  %spec.select = select i1 %.not30, ptr @.str.1, ptr %46
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull %spec.select)
          to label %48 unwind label %65

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

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

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 nonnull @.str.19)
          to label %54 unwind label %65

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 nonnull @.str.42)
          to label %56 unwind label %65

56:                                               ; preds = %54
  %57 = getelementptr inbounds i8, ptr %0, i64 40
  %58 = load i64, ptr %57, align 8, !tbaa !31
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %55, i64 noundef %58)
          to label %60 unwind label %65

60:                                               ; preds = %56
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @.str.43)
          to label %62 unwind label %65

62:                                               ; preds = %60
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %61, i64 noundef %31)
          to label %64 unwind label %65

64:                                               ; preds = %62
  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 %67

65:                                               ; preds = %62, %60, %56, %54, %52, %50, %48, %44, %42, %39
  %66 = 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
  resume { ptr, i32 } %66

67:                                               ; preds = %64, %36
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  br label %89

68:                                               ; preds = %34
  %69 = call noundef ptr @_ZN7cascadb13RecordBuckets6bucketEm(ptr noundef nonnull align 8 dereferenceable(56) %30, i64 noundef %31)
  %.not31 = icmp eq ptr %69, null
  br i1 %.not31, label %70, label %71

70:                                               ; preds = %68
  call void @__assert_fail(ptr noundef nonnull @.str.44, ptr noundef nonnull @.str.1, i32 noundef 1240, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7cascadb8LeafNode4findENS_5SliceERS1_PNS_9InnerNodeE) #8
  unreachable

71:                                               ; preds = %68, %._crit_edge.thread37
  %.024 = phi ptr [ %69, %68 ], [ %32, %._crit_edge.thread37 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  %72 = call ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %.024) #9
  %73 = call ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %.024) #9
  %74 = load ptr, ptr %14, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 40
  %76 = load ptr, ptr %75, align 8, !tbaa !20
  call void @_ZN7cascadb7KeyCompC2EPNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %76)
  %77 = load ptr, ptr %9, align 8
  %78 = call ptr @_ZSt11lower_boundIN9__gnu_cxx17__normal_iteratorIPN7cascadb6RecordESt6vectorIS3_SaIS3_EEEENS2_5SliceENS2_7KeyCompEET_SB_SB_RKT0_T1_(ptr %72, ptr %73, ptr noundef nonnull align 8 dereferenceable(12) %6, ptr %77)
  store ptr %78, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %79 = call ptr @_ZNSt6vectorIN7cascadb6RecordESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %.024) #9
  store ptr %79, ptr %10, align 8
  %80 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN7cascadb6RecordESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  br i1 %80, label %81, label %.critedge

81:                                               ; preds = %71
  %82 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb6RecordESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  %83 = call noundef zeroext i1 @_ZN7cascadbeqERKNS_5SliceES2_(ptr noundef nonnull align 8 dereferenceable(12) %82, ptr noundef nonnull align 8 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br i1 %83, label %84, label %88

84:                                               ; preds = %81
  %85 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN7cascadb6RecordESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  %86 = getelementptr inbounds i8, ptr %85, i64 16
  %87 = call { ptr, i32 } @_ZNK7cascadb5Slice5cloneEv(ptr noundef nonnull align 8 dereferenceable(12) %86)
  %.fca.0.extract = extractvalue { ptr, i32 } %87, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %87, 1
  store ptr %.fca.0.extract, ptr %3, align 8, !tbaa !30
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !32
  br label %88

.critedge:                                        ; preds = %71
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br label %88

88:                                               ; preds = %.critedge, %84, %81
  %.025 = phi i1 [ true, %84 ], [ false, %81 ], [ false, %.critedge ]
  call void @_ZN7cascadb4Node6unlockEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  br label %89

89:                                               ; preds = %67, %88, %._crit_edge.thread
  %.1 = phi i1 [ false, %._crit_edge.thread ], [ %.025, %88 ], [ false, %67 ]
  ret i1 %.1
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11lower_boundIN9__gnu_cxx17__normal_iteratorIPN7cascadb6RecordESt6vectorIS3_SaIS3_EEEENS2_5SliceENS2_7KeyCompEET_SB_SB_RKT0_T1_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(12), ptr) local_unnamed_addr #4

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

!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 200}
!6 = !{!"_ZTSN7cascadb8DataNodeE", !7, i64 0, !10, i64 200, !19, i64 208}
!7 = !{!"_ZTSN7cascadb4NodeE", !8, i64 8, !13, i64 40, !14, i64 48, !15, i64 96, !15, i64 97, !15, i64 98, !16, i64 104, !16, i64 120, !17, i64 136, !17, i64 140, !18, i64 144}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !9, i64 0, !13, i64 8, !11, i64 16}
!9 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !10, i64 0}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"long", !11, i64 0}
!14 = !{!"_ZTSN7cascadb5MutexE", !15, i64 0, !11, i64 8}
!15 = !{!"bool", !11, i64 0}
!16 = !{!"_ZTS7timeval", !13, i64 0, !13, i64 8}
!17 = !{!"int", !11, i64 0}
!18 = !{!"_ZTSN7cascadb6RWLockE", !11, i64 0}
!19 = !{!"_ZTSN7cascadb10NodeStatusE", !11, i64 0}
!20 = !{!21, !10, i64 40}
!21 = !{!"_ZTSN7cascadb4TreeE", !8, i64 0, !22, i64 32, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176}
!22 = !{!"_ZTSN7cascadb7OptionsE", !10, i64 0, !10, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !17, i64 72, !17, i64 76, !17, i64 80, !17, i64 84, !17, i64 88, !17, i64 92, !23, i64 96, !15, i64 100}
!23 = !{!"_ZTSN7cascadb8CompressE", !11, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !12, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!29, !29, i64 0}
!29 = !{!"_ZTSN7cascadb11LoggerLevelE", !11, i64 0}
!30 = !{!10, !10, i64 0}
!31 = !{!7, !13, i64 40}
!32 = !{!17, !17, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass