; LLVM IR from KoishiDB/Koishi-DB :: src (db_impl)

; 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.std::shared_lock" = type <{ ptr, i8, [7 x i8] }>
%"class.koishidb::Slice" = type { ptr, i64 }
%"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.koishidb::RandomAccessFile" = type { i32, %"class.std::__cxx11::basic_string", %"class.koishidb::Status" }
%"class.koishidb::Status" = type { ptr }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [7 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<koishidb::SSTable *>::_Storage", i8 }>
%"union.std::_Optional_payload_base<koishidb::SSTable *>::_Storage" = type { ptr }
%"class.std::optional.8" = type { %"struct.std::_Optional_base.9" }
%"struct.std::_Optional_base.9" = type { %"struct.std::_Optional_payload.11" }
%"struct.std::_Optional_payload.11" = type { %"struct.std::_Optional_payload.base.15", [7 x i8] }
%"struct.std::_Optional_payload.base.15" = type { %"struct.std::_Optional_payload_base.base.14" }
%"struct.std::_Optional_payload_base.base.14" = type <{ %"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage" = type { %"class.std::__cxx11::basic_string" }
%"class.koishidb::DBimpl" = type { %"class.koishidb::DB", %"class.std::deque", %"class.std::shared_mutex", %"class.std::mutex", ptr, ptr, %"class.std::condition_variable", i8, i64, %"struct.std::atomic", %"class.std::vector", i64, ptr }
%"class.koishidb::DB" = type { ptr }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<koishidb::DBimpl::Writer *, std::allocator<koishidb::DBimpl::Writer *>>::_Deque_impl" }
%"struct.std::_Deque_base<koishidb::DBimpl::Writer *, std::allocator<koishidb::DBimpl::Writer *>>::_Deque_impl" = type { %"struct.std::_Deque_base<koishidb::DBimpl::Writer *, std::allocator<koishidb::DBimpl::Writer *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<koishidb::DBimpl::Writer *, std::allocator<koishidb::DBimpl::Writer *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::shared_mutex" = type { %"class.std::__shared_mutex_pthread" }
%"class.std::__shared_mutex_pthread" = 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::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %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::condition_variable" = type { %"class.std::__condvar" }
%"class.std::__condvar" = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<koishidb::FileMeta *, std::allocator<koishidb::FileMeta *>>::_Vector_impl" }
%"struct.std::_Vector_base<koishidb::FileMeta *, std::allocator<koishidb::FileMeta *>>::_Vector_impl" = type { %"struct.std::_Vector_base<koishidb::FileMeta *, std::allocator<koishidb::FileMeta *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<koishidb::FileMeta *, std::allocator<koishidb::FileMeta *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.koishidb::FileMeta" = type { i64, i64, %"class.koishidb::InternalKey", %"class.koishidb::InternalKey" }
%"class.koishidb::InternalKey" = type { %"class.std::__cxx11::basic_string" }

@.str.2 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN8koishidb6DBimpl3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE = external hidden unnamed_addr constant [65 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

declare void @_ZN8koishidb5SliceC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8koishidb6DBimpl3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %2) unnamed_addr #7 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::shared_lock", align 8
  %9 = alloca %"class.koishidb::Slice", align 8
  %10 = alloca %"class.koishidb::Slice", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.koishidb::Slice", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca %"class.koishidb::Slice", align 8
  %21 = alloca %"class.koishidb::Slice", align 8
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.std::__cxx11::basic_string", align 8
  %24 = alloca %"class.koishidb::RandomAccessFile", align 8
  %25 = alloca %"class.std::__cxx11::basic_string", align 8
  %26 = alloca %"class.std::optional", align 8
  %27 = alloca %"class.std::optional.8", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %28 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #11
  %29 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 2
  call void @_ZNSt11shared_lockISt12shared_mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %8, ptr noundef nonnull align 8 dereferenceable(56) %29)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #11
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #11
  invoke void @_ZN8koishidb5SliceC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef @.str.6)
          to label %31 unwind label %46

31:                                               ; preds = %3
  %32 = invoke { ptr, i64 } @_ZN8koishidb17CreateMemtableKeyERKNS_5SliceEmS2_NS_7KeyTypeE(ptr noundef nonnull align 8 dereferenceable(16) %30, i64 noundef -1, ptr noundef nonnull align 8 dereferenceable(16) %10, i8 noundef zeroext 1)
          to label %33 unwind label %46

33:                                               ; preds = %31
  %34 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %35 = extractvalue { ptr, i64 } %32, 0
  store ptr %35, ptr %34, align 8
  %36 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %37 = extractvalue { ptr, i64 } %32, 1
  store i64 %37, ptr %36, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #11
  %38 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  store ptr %39, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #11
  store ptr null, ptr %14, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 5
  %41 = load ptr, ptr %40, align 8, !tbaa !31
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %50

43:                                               ; preds = %33
  %44 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 5
  %45 = load ptr, ptr %44, align 8, !tbaa !31
  store ptr %45, ptr %14, align 8, !tbaa !5
  br label %50

46:                                               ; preds = %31, %3
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %11, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #11
  br label %264

50:                                               ; preds = %43, %33
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = invoke noundef zeroext i1 @_ZN8koishidb8Memtable3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80) %51, ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef %52)
          to label %54 unwind label %61

54:                                               ; preds = %50
  br i1 %53, label %55, label %65

55:                                               ; preds = %54
  %56 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %57 unwind label %61

57:                                               ; preds = %55
  %58 = icmp eq ptr %56, null
  br i1 %58, label %60, label %59

59:                                               ; preds = %57
  call void @_ZdlPvm(ptr noundef %56, i64 noundef 1) #12
  br label %60

60:                                               ; preds = %59, %57
  store i1 true, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %261

61:                                               ; preds = %81, %74, %69, %55, %50
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %11, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %12, align 4
  br label %263

65:                                               ; preds = %54
  %66 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 5
  %67 = load ptr, ptr %66, align 8, !tbaa !31
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %80

69:                                               ; preds = %65
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = invoke noundef zeroext i1 @_ZN8koishidb8Memtable3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80) %70, ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef %71)
          to label %73 unwind label %61

73:                                               ; preds = %69
  br i1 %72, label %74, label %80

74:                                               ; preds = %73
  %75 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %76 unwind label %61

76:                                               ; preds = %74
  %77 = icmp eq ptr %75, null
  br i1 %77, label %79, label %78

78:                                               ; preds = %76
  call void @_ZdlPvm(ptr noundef %75, i64 noundef 1) #12
  br label %79

79:                                               ; preds = %78, %76
  store i1 true, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %261

80:                                               ; preds = %73, %65
  br label %81

81:                                               ; preds = %80
  %82 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %83 unwind label %61

83:                                               ; preds = %81
  %84 = icmp eq ptr %82, null
  br i1 %84, label %86, label %85

85:                                               ; preds = %83
  call void @_ZdlPvm(ptr noundef %82, i64 noundef 1) #12
  br label %86

86:                                               ; preds = %85, %83
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #11
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = invoke { ptr, i64 } @_ZN8koishidb17CreateInternalKeyERKNS_5SliceEmNS_7KeyTypeE(ptr noundef nonnull align 8 dereferenceable(16) %87, i64 noundef -1, i8 noundef zeroext 1)
          to label %89 unwind label %106

89:                                               ; preds = %86
  %90 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 0
  %91 = extractvalue { ptr, i64 } %88, 0
  store ptr %91, ptr %90, align 8
  %92 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 1
  %93 = extractvalue { ptr, i64 } %88, 1
  store i64 %93, ptr %92, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #11
  %94 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #13
          to label %95 unwind label %110

95:                                               ; preds = %89
  %96 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #13
          to label %97 unwind label %114

97:                                               ; preds = %95
  call void @llvm.memset.p0.i64(ptr align 8 %96, i8 0, i64 8, i1 false)
  call void @_ZN8koishidb21InternalKeyComparatorC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %96) #11
  invoke void @_ZN8koishidb6OptionC1EPKNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef %96)
          to label %98 unwind label %114

98:                                               ; preds = %97
  store ptr %94, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #11
  store i32 0, ptr %18, align 4, !tbaa !32
  br label %99

99:                                               ; preds = %246, %98
  %100 = load i32, ptr %18, align 4, !tbaa !32
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 10
  %103 = call noundef i64 @_ZNKSt6vectorIPN8koishidb8FileMetaESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %102) #11
  %104 = icmp ult i64 %101, %103
  br i1 %104, label %118, label %105

105:                                              ; preds = %99
  store i32 2, ptr %15, align 4
  br label %250

106:                                              ; preds = %86
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %11, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %12, align 4
  br label %260

110:                                              ; preds = %252, %89
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %11, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %12, align 4
  br label %259

114:                                              ; preds = %97, %95
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %11, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %94, i64 noundef 8) #12
  br label %259

118:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #11
  %119 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 10
  %120 = load i32, ptr %18, align 4, !tbaa !32
  %121 = sext i32 %120 to i64
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN8koishidb8FileMetaESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %119, i64 noundef %121) #11
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  store ptr %123, ptr %19, align 8, !tbaa !5
  %124 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 12
  %125 = load ptr, ptr %124, align 8, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #11
  %126 = load ptr, ptr %19, align 8, !tbaa !5
  %127 = getelementptr inbounds %"struct.koishidb::FileMeta", ptr %126, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #11
  %128 = invoke { ptr, i64 } @_ZNK8koishidb11InternalKey7ToSliceEv(ptr noundef nonnull align 8 dereferenceable(32) %127)
          to label %129 unwind label %182

129:                                              ; preds = %118
  %130 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 0
  %131 = extractvalue { ptr, i64 } %128, 0
  store ptr %131, ptr %130, align 8
  %132 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 1
  %133 = extractvalue { ptr, i64 } %128, 1
  store i64 %133, ptr %132, align 8
  %134 = load ptr, ptr %125, align 8, !tbaa !35
  %135 = getelementptr inbounds ptr, ptr %134, i64 2
  %136 = load ptr, ptr %135, align 8
  %137 = invoke noundef i32 %136(ptr noundef nonnull align 8 dereferenceable(8) %125, ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %138 unwind label %182

138:                                              ; preds = %129
  %139 = icmp eq i32 %137, -1
  br i1 %139, label %140, label %157

140:                                              ; preds = %138
  %141 = getelementptr inbounds %"class.koishidb::DBimpl", ptr %28, i32 0, i32 12
  %142 = load ptr, ptr %141, align 8, !tbaa !34
  %143 = load ptr, ptr %19, align 8, !tbaa !5
  %144 = getelementptr inbounds %"struct.koishidb::FileMeta", ptr %143, i32 0, i32 3
  %145 = invoke { ptr, i64 } @_ZNK8koishidb11InternalKey7ToSliceEv(ptr noundef nonnull align 8 dereferenceable(32) %144)
          to label %146 unwind label %186

146:                                              ; preds = %140
  %147 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %148 = extractvalue { ptr, i64 } %145, 0
  store ptr %148, ptr %147, align 8
  %149 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %150 = extractvalue { ptr, i64 } %145, 1
  store i64 %150, ptr %149, align 8
  %151 = load ptr, ptr %142, align 8, !tbaa !35
  %152 = getelementptr inbounds ptr, ptr %151, i64 2
  %153 = load ptr, ptr %152, align 8
  %154 = invoke noundef i32 %153(ptr noundef nonnull align 8 dereferenceable(8) %142, ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %155 unwind label %186

155:                                              ; preds = %146
  %156 = icmp eq i32 %154, 1
  br label %157

157:                                              ; preds = %155, %138
  %158 = phi i1 [ false, %138 ], [ %156, %155 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #11
  br i1 %158, label %159, label %242

159:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #11
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.koishidb::FileMeta", ptr %160, i32 0, i32 1
  %162 = load i64, ptr %161, align 8, !tbaa !37
  invoke void @_ZNSt7__cxx119to_stringEm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %23, i64 noundef %162)
          to label %163 unwind label %191

163:                                              ; preds = %159
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %22, ptr noundef @.str.7, ptr noundef nonnull align 8 dereferenceable(32) %23)
          to label %164 unwind label %195

164:                                              ; preds = %163
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #11
  call void @llvm.lifetime.start.p0(i64 48, ptr %24) #11
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %165 unwind label %200

165:                                              ; preds = %164
  invoke void @_ZN8koishidb16RandomAccessFileC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48) %24, ptr noundef %25)
          to label %166 unwind label %204

166:                                              ; preds = %165
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #11
  %167 = load ptr, ptr %17, align 8, !tbaa !5
  %168 = load ptr, ptr %19, align 8, !tbaa !5
  %169 = getelementptr inbounds %"struct.koishidb::FileMeta", ptr %168, i32 0, i32 0
  %170 = load i64, ptr %169, align 8, !tbaa !42
  %171 = invoke { ptr, i8 } @_ZN8koishidb7SSTable4OpenEPKNS_6OptionEPNS_16RandomAccessFileEm(ptr noundef %167, ptr noundef %24, i64 noundef %170)
          to label %172 unwind label %208

172:                                              ; preds = %166
  %173 = getelementptr inbounds %"class.std::optional", ptr %26, i32 0, i32 0
  %174 = getelementptr inbounds %"struct.std::_Optional_base", ptr %173, i32 0, i32 0
  %175 = getelementptr inbounds { ptr, i8 }, ptr %174, i32 0, i32 0
  %176 = extractvalue { ptr, i8 } %171, 0
  store ptr %176, ptr %175, align 8
  %177 = getelementptr inbounds { ptr, i8 }, ptr %174, i32 0, i32 1
  %178 = extractvalue { ptr, i8 } %171, 1
  store i8 %178, ptr %177, align 8
  %179 = call noundef zeroext i1 @_ZNKSt8optionalIPN8koishidb7SSTableEE9has_valueEv(ptr noundef nonnull align 8 dereferenceable(16) %26) #11
  br i1 %179, label %180, label %181

180:                                              ; preds = %172
  br label %213

181:                                              ; preds = %172
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 201, ptr noundef @__PRETTY_FUNCTION__._ZN8koishidb6DBimpl3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE) #14
  unreachable

182:                                              ; preds = %129, %118
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %11, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %12, align 4
  br label %190

186:                                              ; preds = %146, %140
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %11, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #11
  br label %190

190:                                              ; preds = %186, %182
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #11
  br label %249

191:                                              ; preds = %159
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %11, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %12, align 4
  br label %199

195:                                              ; preds = %163
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %11, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #11
  br label %199

199:                                              ; preds = %195, %191
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #11
  br label %241

200:                                              ; preds = %164
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %11, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %12, align 4
  br label %240

204:                                              ; preds = %165
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %11, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #11
  br label %240

208:                                              ; preds = %166
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %11, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %12, align 4
  br label %239

212:                                              ; No predecessors!
  br label %213

213:                                              ; preds = %212, %180
  call void @llvm.lifetime.start.p0(i64 40, ptr %27) #11
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNRSt8optionalIPN8koishidb7SSTableEEdeEv(ptr noundef nonnull align 8 dereferenceable(16) %26) #11
  %215 = load ptr, ptr %214, align 8, !tbaa !5
  invoke void @_ZN8koishidb7SSTable11InternalGetB5cxx11ERKNS_5SliceE(ptr dead_on_unwind writable sret(%"class.std::optional.8") align 8 %27, ptr noundef nonnull align 8 dereferenceable(24) %215, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %216 unwind label %219

216:                                              ; preds = %213
  %217 = call noundef zeroext i1 @_ZNKSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv(ptr noundef nonnull align 8 dereferenceable(40) %27) #11
  br i1 %217, label %223, label %218

218:                                              ; preds = %216
  store i32 4, ptr %15, align 4
  br label %237

219:                                              ; preds = %213
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %11, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %12, align 4
  br label %238

223:                                              ; preds = %216
  %224 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNRSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(40) %27) #11
  %225 = load ptr, ptr %7, align 8, !tbaa !5
  %226 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %225, ptr noundef nonnull align 8 dereferenceable(32) %224)
          to label %227 unwind label %233

227:                                              ; preds = %223
  %228 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %229 unwind label %233

229:                                              ; preds = %227
  %230 = icmp eq ptr %228, null
  br i1 %230, label %232, label %231

231:                                              ; preds = %229
  call void @_ZdlPvm(ptr noundef %228, i64 noundef 1) #12
  br label %232

232:                                              ; preds = %231, %229
  store i1 true, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %237

233:                                              ; preds = %227, %223
  %234 = landingpad { ptr, i32 }
          cleanup
  %235 = extractvalue { ptr, i32 } %234, 0
  store ptr %235, ptr %11, align 8
  %236 = extractvalue { ptr, i32 } %234, 1
  store i32 %236, ptr %12, align 4
  call void @_ZNSt14_Optional_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #11
  br label %238

237:                                              ; preds = %232, %218
  call void @_ZNSt14_Optional_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #11
  call void @llvm.lifetime.end.p0(i64 40, ptr %27) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #11
  call void @_ZN8koishidb16RandomAccessFileD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %24) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #11
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #11
  br label %243

238:                                              ; preds = %233, %219
  call void @llvm.lifetime.end.p0(i64 40, ptr %27) #11
  br label %239

239:                                              ; preds = %238, %208
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #11
  call void @_ZN8koishidb16RandomAccessFileD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %24) #11
  br label %240

240:                                              ; preds = %239, %204, %200
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #11
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #11
  br label %241

241:                                              ; preds = %240, %199
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #11
  br label %249

242:                                              ; preds = %157
  store i32 0, ptr %15, align 4
  br label %243

243:                                              ; preds = %242, %237
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #11
  %244 = load i32, ptr %15, align 4
  switch i32 %244, label %250 [
    i32 0, label %245
    i32 4, label %246
  ]

245:                                              ; preds = %243
  br label %246

246:                                              ; preds = %245, %243
  %247 = load i32, ptr %18, align 4, !tbaa !32
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %18, align 4, !tbaa !32
  br label %99, !llvm.loop !43

249:                                              ; preds = %241, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #11
  br label %259

250:                                              ; preds = %243, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #11
  %251 = load i32, ptr %15, align 4
  switch i32 %251, label %258 [
    i32 2, label %252
  ]

252:                                              ; preds = %250
  %253 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %254 unwind label %110

254:                                              ; preds = %252
  %255 = icmp eq ptr %253, null
  br i1 %255, label %257, label %256

256:                                              ; preds = %254
  call void @_ZdlPvm(ptr noundef %253, i64 noundef 1) #12
  br label %257

257:                                              ; preds = %256, %254
  store i1 false, ptr %4, align 1
  store i32 1, ptr %15, align 4
  br label %258

258:                                              ; preds = %257, %250
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #11
  br label %261

259:                                              ; preds = %249, %114, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #11
  br label %260

260:                                              ; preds = %259, %106
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #11
  br label %263

261:                                              ; preds = %258, %79, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #11
  call void @_ZNSt11shared_lockISt12shared_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %8) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #11
  %262 = load i1, ptr %4, align 1
  ret i1 %262

263:                                              ; preds = %260, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  br label %264

264:                                              ; preds = %263, %46
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #11
  call void @_ZNSt11shared_lockISt12shared_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %8) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #11
  br label %265

265:                                              ; preds = %264
  %266 = load ptr, ptr %11, align 8
  %267 = load i32, ptr %12, align 4
  %268 = insertvalue { ptr, i32 } poison, ptr %266, 0
  %269 = insertvalue { ptr, i32 } %268, i32 %267, 1
  resume { ptr, i32 } %269
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt11shared_lockISt12shared_mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #7 align 2

declare { ptr, i64 } @_ZN8koishidb17CreateMemtableKeyERKNS_5SliceEmS2_NS_7KeyTypeE(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, ptr noundef nonnull align 8 dereferenceable(16), i8 noundef zeroext) #6

declare noundef zeroext i1 @_ZN8koishidb8Memtable3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #6

declare noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16)) #6

declare { ptr, i64 } @_ZN8koishidb17CreateInternalKeyERKNS_5SliceEmNS_7KeyTypeE(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i8 noundef zeroext) #6

declare void @_ZN8koishidb6OptionC1EPKNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #6

declare { ptr, i64 } @_ZNK8koishidb11InternalKey7ToSliceEv(ptr noundef nonnull align 8 dereferenceable(32)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #8

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt7__cxx119to_stringEm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) #8

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #7 align 2

declare void @_ZN8koishidb16RandomAccessFileC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) unnamed_addr #6

declare { ptr, i8 } @_ZN8koishidb7SSTable4OpenEPKNS_6OptionEPNS_16RandomAccessFileEm(ptr noundef, ptr noundef, i64 noundef) #6

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

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

declare void @_ZN8koishidb7SSTable11InternalGetB5cxx11ERKNS_5SliceE(ptr dead_on_unwind writable sret(%"class.std::optional.8") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #6

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Optional_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #9 align 2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 184}
!10 = !{!"_ZTSN8koishidb6DBimplE", !11, i64 0, !12, i64 8, !18, i64 88, !20, i64 144, !6, i64 184, !6, i64 192, !22, i64 200, !24, i64 248, !16, i64 256, !25, i64 264, !27, i64 272, !16, i64 296, !6, i64 304}
!11 = !{!"_ZTSN8koishidb2DBE"}
!12 = !{!"_ZTSSt5dequeIPN8koishidb6DBimpl6WriterESaIS3_EE", !13, i64 0}
!13 = !{!"_ZTSSt11_Deque_baseIPN8koishidb6DBimpl6WriterESaIS3_EE", !14, i64 0}
!14 = !{!"_ZTSNSt11_Deque_baseIPN8koishidb6DBimpl6WriterESaIS3_EE11_Deque_implE", !15, i64 0}
!15 = !{!"_ZTSNSt11_Deque_baseIPN8koishidb6DBimpl6WriterESaIS3_EE16_Deque_impl_dataE", !6, i64 0, !16, i64 8, !17, i64 16, !17, i64 48}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSSt15_Deque_iteratorIPN8koishidb6DBimpl6WriterERS3_PS3_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!"_ZTSSt12shared_mutex", !19, i64 0}
!19 = !{!"_ZTSSt22__shared_mutex_pthread", !7, i64 0}
!20 = !{!"_ZTSSt5mutex", !21, i64 0}
!21 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!22 = !{!"_ZTSSt18condition_variable", !23, i64 0}
!23 = !{!"_ZTSSt9__condvar", !7, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSSt6atomicIbE", !26, i64 0}
!26 = !{!"_ZTSSt13__atomic_baseIbE", !24, i64 0}
!27 = !{!"_ZTSSt6vectorIPN8koishidb8FileMetaESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIPN8koishidb8FileMetaESaIS2_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIPN8koishidb8FileMetaESaIS2_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIPN8koishidb8FileMetaESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!10, !6, i64 192}
!32 = !{!33, !33, i64 0}
!33 = !{!"int", !7, i64 0}
!34 = !{!10, !6, i64 304}
!35 = !{!36, !36, i64 0}
!36 = !{!"vtable pointer", !8, i64 0}
!37 = !{!38, !16, i64 8}
!38 = !{!"_ZTSN8koishidb8FileMetaE", !16, i64 0, !16, i64 8, !39, i64 16, !39, i64 48}
!39 = !{!"_ZTSN8koishidb11InternalKeyE", !40, i64 0}
!40 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !41, i64 0, !16, i64 8, !7, i64 16}
!41 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!42 = !{!38, !16, i64 0}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}


; 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.std::shared_lock" = type <{ ptr, i8, [7 x i8] }>
%"class.koishidb::Slice" = type { ptr, i64 }
%"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.koishidb::RandomAccessFile" = type { i32, %"class.std::__cxx11::basic_string", %"class.koishidb::Status" }
%"class.koishidb::Status" = type { ptr }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [7 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<koishidb::SSTable *>::_Storage", i8 }>
%"union.std::_Optional_payload_base<koishidb::SSTable *>::_Storage" = type { ptr }
%"class.std::optional.8" = type { %"struct.std::_Optional_base.9" }
%"struct.std::_Optional_base.9" = type { %"struct.std::_Optional_payload.11" }
%"struct.std::_Optional_payload.11" = type { %"struct.std::_Optional_payload.base.15", [7 x i8] }
%"struct.std::_Optional_payload.base.15" = type { %"struct.std::_Optional_payload_base.base.14" }
%"struct.std::_Optional_payload_base.base.14" = type <{ %"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage" = type { %"class.std::__cxx11::basic_string" }

@.str.2 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN8koishidb6DBimpl3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE = external hidden unnamed_addr constant [65 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 nounwind uwtable
declare dso_local void @_ZN8koishidb21InternalKeyComparatorC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

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

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

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

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

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

declare void @_ZN8koishidb5SliceC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8koishidb6DBimpl3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %2) unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::shared_lock", align 8
  %5 = alloca %"class.koishidb::Slice", align 8
  %6 = alloca %"class.koishidb::Slice", align 8
  %7 = alloca %"class.koishidb::Slice", align 8
  %8 = alloca %"class.koishidb::Slice", align 8
  %9 = alloca %"class.koishidb::Slice", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.koishidb::RandomAccessFile", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::optional", align 8
  %15 = alloca %"class.std::optional.8", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #10
  %16 = getelementptr inbounds i8, ptr %0, i64 88
  call void @_ZNSt11shared_lockISt12shared_mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %4, ptr noundef nonnull align 8 dereferenceable(56) %16)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #10
  invoke void @_ZN8koishidb5SliceC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull @.str.6)
          to label %17 unwind label %28

17:                                               ; preds = %3
  %18 = invoke { ptr, i64 } @_ZN8koishidb17CreateMemtableKeyERKNS_5SliceEmS2_NS_7KeyTypeE(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef -1, ptr noundef nonnull align 8 dereferenceable(16) %6, i8 noundef zeroext 1)
          to label %19 unwind label %28

19:                                               ; preds = %17
  %20 = extractvalue { ptr, i64 } %18, 0
  store ptr %20, ptr %5, align 8
  %21 = getelementptr inbounds i8, ptr %5, i64 8
  %22 = extractvalue { ptr, i64 } %18, 1
  store i64 %22, ptr %21, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #10
  %23 = getelementptr inbounds i8, ptr %0, i64 184
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 192
  %26 = load ptr, ptr %25, align 8, !tbaa !30
  %27 = invoke noundef zeroext i1 @_ZN8koishidb8Memtable3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80) %24, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef %2)
          to label %30 unwind label %36

28:                                               ; preds = %17, %3
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #10
  br label %164

30:                                               ; preds = %19
  br i1 %27, label %31, label %38

31:                                               ; preds = %30
  %32 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %33 unwind label %36

33:                                               ; preds = %31
  %34 = icmp eq ptr %32, null
  br i1 %34, label %163, label %35

35:                                               ; preds = %33
  call void @_ZdlPvm(ptr noundef nonnull %32, i64 noundef 1) #11
  br label %163

36:                                               ; preds = %48, %43, %40, %31, %19
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %164

38:                                               ; preds = %30
  %39 = load ptr, ptr %25, align 8, !tbaa !30
  %.not49 = icmp eq ptr %39, null
  br i1 %.not49, label %48, label %40

40:                                               ; preds = %38
  %41 = invoke noundef zeroext i1 @_ZN8koishidb8Memtable3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80) %26, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef %2)
          to label %42 unwind label %36

42:                                               ; preds = %40
  br i1 %41, label %43, label %48

43:                                               ; preds = %42
  %44 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %45 unwind label %36

45:                                               ; preds = %43
  %46 = icmp eq ptr %44, null
  br i1 %46, label %163, label %47

47:                                               ; preds = %45
  call void @_ZdlPvm(ptr noundef nonnull %44, i64 noundef 1) #11
  br label %163

48:                                               ; preds = %38, %42
  %49 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %50 unwind label %36

50:                                               ; preds = %48
  %51 = icmp eq ptr %49, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %50
  call void @_ZdlPvm(ptr noundef nonnull %49, i64 noundef 1) #11
  br label %53

53:                                               ; preds = %52, %50
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #10
  %54 = invoke { ptr, i64 } @_ZN8koishidb17CreateInternalKeyERKNS_5SliceEmNS_7KeyTypeE(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef -1, i8 noundef zeroext 1)
          to label %55 unwind label %69

55:                                               ; preds = %53
  %56 = extractvalue { ptr, i64 } %54, 0
  store ptr %56, ptr %7, align 8
  %57 = getelementptr inbounds i8, ptr %7, i64 8
  %58 = extractvalue { ptr, i64 } %54, 1
  store i64 %58, ptr %57, align 8
  %59 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #12
          to label %60 unwind label %71

60:                                               ; preds = %55
  %61 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #12
          to label %62 unwind label %73

62:                                               ; preds = %60
  store i64 0, ptr %61, align 8
  call void @_ZN8koishidb21InternalKeyComparatorC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %61) #10
  invoke void @_ZN8koishidb6OptionC1EPKNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull %61)
          to label %.preheader unwind label %73

.preheader:                                       ; preds = %62
  %63 = getelementptr inbounds i8, ptr %0, i64 272
  %64 = call noundef i64 @_ZNKSt6vectorIPN8koishidb8FileMetaESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #10
  %.not5983.not = icmp eq i64 %64, 0
  br i1 %.not5983.not, label %.critedge67, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %65 = getelementptr inbounds i8, ptr %0, i64 304
  %66 = getelementptr inbounds i8, ptr %8, i64 8
  %67 = getelementptr inbounds i8, ptr %9, i64 8
  %68 = getelementptr inbounds i8, ptr %14, i64 8
  br label %75

69:                                               ; preds = %53
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %162

71:                                               ; preds = %.critedge67, %55
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %162

73:                                               ; preds = %62, %60
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %59, i64 noundef 8) #11
  br label %162

75:                                               ; preds = %.lr.ph, %.thread
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.thread ]
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN8koishidb8FileMetaESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %indvars.iv) #10
  %77 = load ptr, ptr %76, align 8, !tbaa !31
  %78 = load ptr, ptr %65, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #10
  %79 = getelementptr inbounds i8, ptr %77, i64 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #10
  %80 = invoke { ptr, i64 } @_ZNK8koishidb11InternalKey7ToSliceEv(ptr noundef nonnull align 8 dereferenceable(32) %79)
          to label %81 unwind label %117

81:                                               ; preds = %75
  %82 = extractvalue { ptr, i64 } %80, 0
  store ptr %82, ptr %8, align 8
  %83 = extractvalue { ptr, i64 } %80, 1
  store i64 %83, ptr %66, align 8
  %84 = load ptr, ptr %78, align 8, !tbaa !33
  %85 = getelementptr inbounds i8, ptr %84, i64 16
  %86 = load ptr, ptr %85, align 8
  %87 = invoke noundef i32 %86(ptr noundef nonnull align 8 dereferenceable(8) %78, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %88 unwind label %117

88:                                               ; preds = %81
  %89 = icmp eq i32 %87, -1
  br i1 %89, label %90, label %.critedge

90:                                               ; preds = %88
  %91 = load ptr, ptr %65, align 8, !tbaa !32
  %92 = getelementptr inbounds i8, ptr %77, i64 48
  %93 = invoke { ptr, i64 } @_ZNK8koishidb11InternalKey7ToSliceEv(ptr noundef nonnull align 8 dereferenceable(32) %92)
          to label %94 unwind label %119

94:                                               ; preds = %90
  %95 = extractvalue { ptr, i64 } %93, 0
  store ptr %95, ptr %9, align 8
  %96 = extractvalue { ptr, i64 } %93, 1
  store i64 %96, ptr %67, align 8
  %97 = load ptr, ptr %91, align 8, !tbaa !33
  %98 = getelementptr inbounds i8, ptr %97, i64 16
  %99 = load ptr, ptr %98, align 8
  %100 = invoke noundef i32 %99(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %101 unwind label %119

101:                                              ; preds = %94
  %102 = icmp eq i32 %100, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #10
  br i1 %102, label %103, label %.thread

103:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #10
  %104 = getelementptr inbounds i8, ptr %77, i64 8
  %105 = load i64, ptr %104, align 8, !tbaa !35
  invoke void @_ZNSt7__cxx119to_stringEm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %11, i64 noundef %105)
          to label %106 unwind label %122

106:                                              ; preds = %103
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef nonnull @.str.7, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %107 unwind label %124

107:                                              ; preds = %106
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #10
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %12) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %108 unwind label %127

108:                                              ; preds = %107
  invoke void @_ZN8koishidb16RandomAccessFileC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull %13)
          to label %109 unwind label %129

109:                                              ; preds = %108
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #10
  %110 = load i64, ptr %77, align 8, !tbaa !40
  %111 = invoke { ptr, i8 } @_ZN8koishidb7SSTable4OpenEPKNS_6OptionEPNS_16RandomAccessFileEm(ptr noundef nonnull %59, ptr noundef nonnull %12, i64 noundef %110)
          to label %112 unwind label %131

112:                                              ; preds = %109
  %113 = extractvalue { ptr, i8 } %111, 0
  store ptr %113, ptr %14, align 8
  %114 = extractvalue { ptr, i8 } %111, 1
  store i8 %114, ptr %68, align 8
  %115 = call noundef zeroext i1 @_ZNKSt8optionalIPN8koishidb7SSTableEE9has_valueEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #10
  br i1 %115, label %133, label %116

116:                                              ; preds = %112
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 201, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8koishidb6DBimpl3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE) #13
  unreachable

117:                                              ; preds = %81, %75
  %118 = landingpad { ptr, i32 }
          cleanup
  br label %121

119:                                              ; preds = %94, %90
  %120 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #10
  br label %121

121:                                              ; preds = %119, %117
  %.pn = phi { ptr, i32 } [ %120, %119 ], [ %118, %117 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #10
  br label %162

122:                                              ; preds = %103
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %126

124:                                              ; preds = %106
  %125 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #10
  br label %126

126:                                              ; preds = %124, %122
  %.pn51 = phi { ptr, i32 } [ %125, %124 ], [ %123, %122 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #10
  br label %153

127:                                              ; preds = %107
  %128 = landingpad { ptr, i32 }
          cleanup
  br label %152

129:                                              ; preds = %108
  %130 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #10
  br label %152

131:                                              ; preds = %109
  %132 = landingpad { ptr, i32 }
          cleanup
  br label %151

133:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %15) #10
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNRSt8optionalIPN8koishidb7SSTableEEdeEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #10
  %135 = load ptr, ptr %134, align 8, !tbaa !31
  invoke void @_ZN8koishidb7SSTable11InternalGetB5cxx11ERKNS_5SliceE(ptr dead_on_unwind nonnull writable sret(%"class.std::optional.8") align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %135, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %136 unwind label %138

136:                                              ; preds = %133
  %137 = call noundef zeroext i1 @_ZNKSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv(ptr noundef nonnull align 8 dereferenceable(40) %15) #10
  br i1 %137, label %140, label %154

138:                                              ; preds = %133
  %139 = landingpad { ptr, i32 }
          cleanup
  br label %150

140:                                              ; preds = %136
  %141 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNRSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(40) %15) #10
  %142 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %141)
          to label %143 unwind label %148

143:                                              ; preds = %140
  %144 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %145 unwind label %148

145:                                              ; preds = %143
  %146 = icmp eq ptr %144, null
  br i1 %146, label %156, label %147

147:                                              ; preds = %145
  call void @_ZdlPvm(ptr noundef nonnull %144, i64 noundef 1) #11
  br label %156

148:                                              ; preds = %143, %140
  %149 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Optional_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #10
  br label %150

150:                                              ; preds = %148, %138
  %.pn53 = phi { ptr, i32 } [ %149, %148 ], [ %139, %138 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #10
  br label %151

151:                                              ; preds = %150, %131
  %.pn53.pn = phi { ptr, i32 } [ %.pn53, %150 ], [ %132, %131 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #10
  call void @_ZN8koishidb16RandomAccessFileD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #10
  br label %152

152:                                              ; preds = %151, %129, %127
  %.pn53.pn.pn = phi { ptr, i32 } [ %.pn53.pn, %151 ], [ %130, %129 ], [ %128, %127 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #10
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #10
  br label %153

153:                                              ; preds = %152, %126
  %.pn53.pn.pn.pn = phi { ptr, i32 } [ %.pn53.pn.pn, %152 ], [ %.pn51, %126 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #10
  br label %162

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

154:                                              ; preds = %136
  call void @_ZNSt14_Optional_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #10
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #10
  call void @_ZN8koishidb16RandomAccessFileD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #10
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #10
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #10
  br label %.thread

.thread:                                          ; preds = %101, %.critedge, %154
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %155 = call noundef i64 @_ZNKSt6vectorIPN8koishidb8FileMetaESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #10
  %.not59 = icmp ugt i64 %155, %indvars.iv.next
  br i1 %.not59, label %75, label %.critedge67, !llvm.loop !41

156:                                              ; preds = %147, %145
  call void @_ZNSt14_Optional_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb0ELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #10
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #10
  call void @_ZN8koishidb16RandomAccessFileD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #10
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #10
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #10
  br label %161

.critedge67:                                      ; preds = %.thread, %.preheader
  %157 = invoke noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %158 unwind label %71

158:                                              ; preds = %.critedge67
  %159 = icmp eq ptr %157, null
  br i1 %159, label %161, label %160

160:                                              ; preds = %158
  call void @_ZdlPvm(ptr noundef nonnull %157, i64 noundef 1) #11
  br label %161

161:                                              ; preds = %156, %158, %160
  %.not5982 = phi i1 [ true, %156 ], [ false, %158 ], [ false, %160 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #10
  br label %163

162:                                              ; preds = %71, %73, %153, %121, %69
  %.pn60.pn = phi { ptr, i32 } [ %70, %69 ], [ %72, %71 ], [ %74, %73 ], [ %.pn53.pn.pn.pn, %153 ], [ %.pn, %121 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #10
  br label %164

163:                                              ; preds = %45, %47, %33, %35, %161
  %.5 = phi i1 [ %.not5982, %161 ], [ true, %35 ], [ true, %33 ], [ true, %47 ], [ true, %45 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #10
  call void @_ZNSt11shared_lockISt12shared_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #10
  ret i1 %.5

164:                                              ; preds = %36, %162, %28
  %.pn63.pn = phi { ptr, i32 } [ %29, %28 ], [ %37, %36 ], [ %.pn60.pn, %162 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #10
  call void @_ZNSt11shared_lockISt12shared_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #10
  resume { ptr, i32 } %.pn63.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt11shared_lockISt12shared_mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

declare { ptr, i64 } @_ZN8koishidb17CreateMemtableKeyERKNS_5SliceEmS2_NS_7KeyTypeE(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, ptr noundef nonnull align 8 dereferenceable(16), i8 noundef zeroext) local_unnamed_addr #5

declare noundef zeroext i1 @_ZN8koishidb8Memtable3GetERKNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #5

declare noundef ptr @_ZNK8koishidb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

declare { ptr, i64 } @_ZN8koishidb17CreateInternalKeyERKNS_5SliceEmNS_7KeyTypeE(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i8 noundef zeroext) local_unnamed_addr #5

declare void @_ZN8koishidb6OptionC1EPKNS_10ComparatorE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #5

declare { ptr, i64 } @_ZNK8koishidb11InternalKey7ToSliceEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt7__cxx119to_stringEm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6 align 2

declare void @_ZN8koishidb16RandomAccessFileC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) unnamed_addr #5

declare { ptr, i8 } @_ZN8koishidb7SSTable4OpenEPKNS_6OptionEPNS_16RandomAccessFileEm(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #5

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

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

declare void @_ZN8koishidb7SSTable11InternalGetB5cxx11ERKNS_5SliceE(ptr dead_on_unwind writable sret(%"class.std::optional.8") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt11shared_lockISt12shared_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #2 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { "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 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 = { 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 #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 = { 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 #10 = { nounwind }
attributes #11 = { builtin nounwind }
attributes #12 = { builtin allocsize(0) }
attributes #13 = { noreturn 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, !12, i64 184}
!6 = !{!"_ZTSN8koishidb6DBimplE", !7, i64 0, !8, i64 8, !17, i64 88, !19, i64 144, !12, i64 184, !12, i64 192, !21, i64 200, !23, i64 248, !15, i64 256, !24, i64 264, !26, i64 272, !15, i64 296, !12, i64 304}
!7 = !{!"_ZTSN8koishidb2DBE"}
!8 = !{!"_ZTSSt5dequeIPN8koishidb6DBimpl6WriterESaIS3_EE", !9, i64 0}
!9 = !{!"_ZTSSt11_Deque_baseIPN8koishidb6DBimpl6WriterESaIS3_EE", !10, i64 0}
!10 = !{!"_ZTSNSt11_Deque_baseIPN8koishidb6DBimpl6WriterESaIS3_EE11_Deque_implE", !11, i64 0}
!11 = !{!"_ZTSNSt11_Deque_baseIPN8koishidb6DBimpl6WriterESaIS3_EE16_Deque_impl_dataE", !12, i64 0, !15, i64 8, !16, i64 16, !16, i64 48}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"long", !13, i64 0}
!16 = !{!"_ZTSSt15_Deque_iteratorIPN8koishidb6DBimpl6WriterERS3_PS3_E", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!17 = !{!"_ZTSSt12shared_mutex", !18, i64 0}
!18 = !{!"_ZTSSt22__shared_mutex_pthread", !13, i64 0}
!19 = !{!"_ZTSSt5mutex", !20, i64 0}
!20 = !{!"_ZTSSt12__mutex_base", !13, i64 0}
!21 = !{!"_ZTSSt18condition_variable", !22, i64 0}
!22 = !{!"_ZTSSt9__condvar", !13, i64 0}
!23 = !{!"bool", !13, i64 0}
!24 = !{!"_ZTSSt6atomicIbE", !25, i64 0}
!25 = !{!"_ZTSSt13__atomic_baseIbE", !23, i64 0}
!26 = !{!"_ZTSSt6vectorIPN8koishidb8FileMetaESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIPN8koishidb8FileMetaESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIPN8koishidb8FileMetaESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIPN8koishidb8FileMetaESaIS2_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!30 = !{!6, !12, i64 192}
!31 = !{!12, !12, i64 0}
!32 = !{!6, !12, i64 304}
!33 = !{!34, !34, i64 0}
!34 = !{!"vtable pointer", !14, i64 0}
!35 = !{!36, !15, i64 8}
!36 = !{!"_ZTSN8koishidb8FileMetaE", !15, i64 0, !15, i64 8, !37, i64 16, !37, i64 48}
!37 = !{!"_ZTSN8koishidb11InternalKeyE", !38, i64 0}
!38 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !39, i64 0, !15, i64 8, !13, i64 16}
!39 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!40 = !{!36, !15, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}


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