; LLVM IR from nsccgz-storage/nvlsm :: table_nvm (table_cache_nvm)

; 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.leveldb::Status" = type { ptr }
%"class.leveldb::Slice" = type { ptr, i64 }
%"struct.leveldb::SegmentMeta" = type { i32, i64, i64, i64, i64, i64, i64, i64, %"class.leveldb::InternalKey", %"class.leveldb::InternalKey" }
%"class.leveldb::InternalKey" = type { %"class.std::__cxx11::basic_string" }
%"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.leveldb::TableCacheNVM" = type { ptr, %"class.std::__cxx11::basic_string", ptr, ptr, ptr, ptr, %"class.std::__cxx11::basic_string" }
%"struct.leveldb::SegmentAndFileHandle" = type { ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN7leveldb13TableCacheNVM11FindSegmentEPKNS_11SegmentMetaEPPNS_5Cache6HandleE = external hidden unnamed_addr constant [82 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7leveldb13TableCacheNVM11FindSegmentEPKNS_11SegmentMetaEPPNS_5Cache6HandleE(ptr dead_on_unwind noalias writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(104) %1, ptr noundef %2, ptr noundef %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [9 x i8], align 1
  %10 = alloca i64, align 8
  %11 = alloca %"class.leveldb::Slice", align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.leveldb::Status", align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.leveldb::Status", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca %"class.leveldb::Status", align 8
  %22 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 9, ptr %9) #7
  %24 = getelementptr inbounds [9 x i8], ptr %9, i64 0, i64 0
  store i8 83, ptr %24, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.leveldb::SegmentMeta", ptr %25, i32 0, i32 7
  %27 = load i64, ptr %26, align 8, !tbaa !10
  store i64 %27, ptr %10, align 8, !tbaa !17
  %28 = getelementptr inbounds [9 x i8], ptr %9, i64 0, i64 0
  %29 = getelementptr inbounds i8, ptr %28, i64 1
  %30 = load i64, ptr %10, align 8, !tbaa !17
  call void @_ZN7leveldb13EncodeFixed64EPcm(ptr noundef %29, i64 noundef %30)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %31 = getelementptr inbounds [9 x i8], ptr %9, i64 0, i64 0
  call void @_ZN7leveldb5SliceC2EPKcm(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef %31, i64 noundef 9)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %32 = getelementptr inbounds %"class.leveldb::TableCacheNVM", ptr %23, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !18
  %34 = load ptr, ptr %33, align 8, !tbaa !20
  %35 = getelementptr inbounds ptr, ptr %34, i64 3
  %36 = load ptr, ptr %35, align 8
  %37 = call noundef ptr %36(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(16) %11)
  store ptr %37, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @_ZN7leveldb6StatusC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %138

40:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.leveldb::SegmentMeta", ptr %41, i32 0, i32 6
  %43 = load i64, ptr %42, align 8, !tbaa !22
  invoke void @_ZN7leveldb13TableCacheNVM8FindFileEmPPNS_5Cache6HandleE(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %16, ptr noundef nonnull align 8 dereferenceable(104) %23, i64 noundef %43, ptr noundef %15)
          to label %44 unwind label %49

44:                                               ; preds = %40
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7leveldb6StatusaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  call void @_ZN7leveldb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %46 = invoke noundef zeroext i1 @_ZNK7leveldb6Status2okEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %47 unwind label %53

47:                                               ; preds = %44
  br i1 %46, label %57, label %48

48:                                               ; preds = %47
  call void @_ZN7leveldb6StatusC2EOS0_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  store i32 1, ptr %19, align 4
  br label %129

49:                                               ; preds = %40
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %17, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %137

53:                                               ; preds = %44
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %17, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %18, align 4
  br label %137

57:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %58 = getelementptr inbounds %"class.leveldb::TableCacheNVM", ptr %23, i32 0, i32 5
  %59 = load ptr, ptr %58, align 8, !tbaa !23
  %60 = load ptr, ptr %15, align 8, !tbaa !5
  %61 = load ptr, ptr %59, align 8, !tbaa !20
  %62 = getelementptr inbounds ptr, ptr %61, i64 5
  %63 = load ptr, ptr %62, align 8
  %64 = invoke noundef ptr %63(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef %60)
          to label %65 unwind label %90

65:                                               ; preds = %57
  store ptr %64, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %66 = getelementptr inbounds %"class.leveldb::TableCacheNVM", ptr %23, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !24
  %68 = load ptr, ptr %20, align 8, !tbaa !5
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.leveldb::SegmentMeta", ptr %69, i32 0, i32 1
  %71 = load i64, ptr %70, align 8, !tbaa !25
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.leveldb::SegmentMeta", ptr %72, i32 0, i32 2
  %74 = load i64, ptr %73, align 8, !tbaa !26
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.leveldb::SegmentMeta", ptr %75, i32 0, i32 3
  %77 = load i64, ptr %76, align 8, !tbaa !27
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.leveldb::SegmentMeta", ptr %78, i32 0, i32 4
  %80 = load i64, ptr %79, align 8, !tbaa !28
  invoke void @_ZN7leveldb7Segment4OpenERKNS_7OptionsEPNS_16RandomAccessFileEmmmmPPS0_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %21, ptr noundef nonnull align 8 dereferenceable(104) %67, ptr noundef %68, i64 noundef %71, i64 noundef %74, i64 noundef %77, i64 noundef %80, ptr noundef %14)
          to label %81 unwind label %94

81:                                               ; preds = %65
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7leveldb6StatusaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  call void @_ZN7leveldb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  %83 = invoke noundef zeroext i1 @_ZNK7leveldb6Status2okEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %84 unwind label %90

84:                                               ; preds = %81
  br i1 %83, label %107, label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = icmp eq ptr %86, null
  br i1 %87, label %88, label %89

88:                                               ; preds = %85
  br label %99

89:                                               ; preds = %85
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.2, i32 noundef 293, ptr noundef @__PRETTY_FUNCTION__._ZN7leveldb13TableCacheNVM11FindSegmentEPKNS_11SegmentMetaEPPNS_5Cache6HandleE) #8
  unreachable

90:                                               ; preds = %81, %57
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %17, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %18, align 4
  br label %136

94:                                               ; preds = %65
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %17, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %136

98:                                               ; No predecessors!
  br label %99

99:                                               ; preds = %98, %88
  %100 = load ptr, ptr %20, align 8, !tbaa !5
  %101 = icmp eq ptr %100, null
  br i1 %101, label %106, label %102

102:                                              ; preds = %99
  %103 = load ptr, ptr %100, align 8, !tbaa !20
  %104 = getelementptr inbounds ptr, ptr %103, i64 1
  %105 = load ptr, ptr %104, align 8
  call void %105(ptr noundef nonnull align 8 dereferenceable(8) %100) #7
  br label %106

106:                                              ; preds = %102, %99
  call void @_ZN7leveldb6StatusC2EOS0_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  store i32 1, ptr %19, align 4
  br label %128

107:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %108 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #9
          to label %109 unwind label %132

109:                                              ; preds = %107
  store ptr %108, ptr %22, align 8, !tbaa !5
  %110 = getelementptr inbounds %"class.leveldb::TableCacheNVM", ptr %23, i32 0, i32 5
  %111 = load ptr, ptr %110, align 8, !tbaa !23
  %112 = load ptr, ptr %22, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.leveldb::SegmentAndFileHandle", ptr %112, i32 0, i32 0
  store ptr %111, ptr %113, align 8, !tbaa !29
  %114 = load ptr, ptr %15, align 8, !tbaa !5
  %115 = load ptr, ptr %22, align 8, !tbaa !5
  %116 = getelementptr inbounds %"struct.leveldb::SegmentAndFileHandle", ptr %115, i32 0, i32 2
  store ptr %114, ptr %116, align 8, !tbaa !31
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  %118 = load ptr, ptr %22, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.leveldb::SegmentAndFileHandle", ptr %118, i32 0, i32 1
  store ptr %117, ptr %119, align 8, !tbaa !32
  %120 = getelementptr inbounds %"class.leveldb::TableCacheNVM", ptr %23, i32 0, i32 4
  %121 = load ptr, ptr %120, align 8, !tbaa !18
  %122 = load ptr, ptr %22, align 8, !tbaa !5
  %123 = load ptr, ptr %121, align 8, !tbaa !20
  %124 = getelementptr inbounds ptr, ptr %123, i64 2
  %125 = load ptr, ptr %124, align 8
  %126 = invoke noundef ptr %125(ptr noundef nonnull align 8 dereferenceable(16) %121, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef %122, i64 noundef 1, ptr noundef @_ZN7leveldbL13DeleteSegmentERKNS_5SliceEPv)
          to label %127 unwind label %132

127:                                              ; preds = %109
  store ptr %126, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  store i32 0, ptr %19, align 4
  br label %128

128:                                              ; preds = %127, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %129

129:                                              ; preds = %128, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %130 = load i32, ptr %19, align 4
  switch i32 %130, label %146 [
    i32 0, label %131
  ]

131:                                              ; preds = %129
  br label %138

132:                                              ; preds = %109, %107
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %17, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %136

136:                                              ; preds = %132, %94, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %137

137:                                              ; preds = %136, %53, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %147

138:                                              ; preds = %131, %4
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %139, ptr %140, align 8, !tbaa !5
  invoke void @_ZN7leveldb6Status2OKEv(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0)
          to label %141 unwind label %142

141:                                              ; preds = %138
  store i32 1, ptr %19, align 4
  br label %146

142:                                              ; preds = %138
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %17, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %18, align 4
  br label %147

146:                                              ; preds = %141, %129
  call void @_ZN7leveldb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 9, ptr %9) #7
  ret void

147:                                              ; preds = %142, %137
  call void @_ZN7leveldb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 9, ptr %9) #7
  br label %148

148:                                              ; preds = %147
  %149 = load ptr, ptr %17, align 8
  %150 = load i32, ptr %18, align 4
  %151 = insertvalue { ptr, i32 } poison, ptr %149, 0
  %152 = insertvalue { ptr, i32 } %151, i32 %150, 1
  resume { ptr, i32 } %152
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7leveldb13EncodeFixed64EPcm(ptr noundef, i64 noundef) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7leveldb13TableCacheNVM8FindFileEmPPNS_5Cache6HandleE(ptr dead_on_unwind noalias writable sret(%"class.leveldb::Status") align 8, ptr noundef nonnull align 8 dereferenceable(104), i64 noundef, ptr noundef) #3 align 2

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

declare void @_ZN7leveldb7Segment4OpenERKNS_7OptionsEPNS_16RandomAccessFileEmmmmPPS0_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7leveldbL13DeleteSegmentERKNS_5SliceEPv(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7leveldb6Status2OKEv(ptr dead_on_unwind noalias writable sret(%"class.leveldb::Status") align 8) #1 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !13, i64 56}
!11 = !{!"_ZTSN7leveldb11SegmentMetaE", !12, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !14, i64 64, !14, i64 96}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN7leveldb11InternalKeyE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !13, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!13, !13, i64 0}
!18 = !{!19, !6, i64 56}
!19 = !{!"_ZTSN7leveldb13TableCacheNVME", !6, i64 0, !15, i64 8, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !15, i64 72}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !8, i64 0}
!22 = !{!11, !13, i64 48}
!23 = !{!19, !6, i64 64}
!24 = !{!19, !6, i64 40}
!25 = !{!11, !13, i64 8}
!26 = !{!11, !13, i64 16}
!27 = !{!11, !13, i64 24}
!28 = !{!11, !13, i64 32}
!29 = !{!30, !6, i64 0}
!30 = !{!"_ZTSN7leveldb20SegmentAndFileHandleE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!30, !6, i64 16}
!32 = !{!30, !6, i64 8}


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

%"class.leveldb::Status" = type { ptr }
%"class.leveldb::Slice" = type { ptr, i64 }

@.str.2 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN7leveldb13TableCacheNVM11FindSegmentEPKNS_11SegmentMetaEPPNS_5Cache6HandleE = external hidden unnamed_addr constant [82 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7leveldb6Status2okEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7leveldb13TableCacheNVM11FindSegmentEPKNS_11SegmentMetaEPPNS_5Cache6HandleE(ptr dead_on_unwind noalias writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(104) %1, ptr nocapture noundef readonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca [9 x i8], align 1
  %6 = alloca %"class.leveldb::Slice", align 8
  %7 = alloca %"class.leveldb::Status", align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.leveldb::Status", align 8
  %11 = alloca %"class.leveldb::Status", align 8
  call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %5) #7
  store i8 83, ptr %5, align 1, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %2, i64 56
  %13 = load i64, ptr %12, align 8, !tbaa !8
  %14 = getelementptr inbounds i8, ptr %5, i64 1
  call void @_ZN7leveldb13EncodeFixed64EPcm(ptr noundef nonnull %14, i64 noundef %13)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @_ZN7leveldb5SliceC2EPKcm(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull %5, i64 noundef 9)
  %15 = getelementptr inbounds i8, ptr %1, i64 56
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = load ptr, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %17, i64 24
  %19 = load ptr, ptr %18, align 8
  %20 = call noundef ptr %19(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @_ZN7leveldb6StatusC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %83

22:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store ptr null, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store ptr null, ptr %9, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %23 = getelementptr inbounds i8, ptr %2, i64 48
  %24 = load i64, ptr %23, align 8, !tbaa !21
  invoke void @_ZN7leveldb13TableCacheNVM8FindFileEmPPNS_5Cache6HandleE(ptr dead_on_unwind nonnull writable sret(%"class.leveldb::Status") align 8 %10, ptr noundef nonnull align 8 dereferenceable(104) %1, i64 noundef %24, ptr noundef nonnull %9)
          to label %25 unwind label %28

25:                                               ; preds = %22
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7leveldb6StatusaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @_ZN7leveldb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %27 = call noundef zeroext i1 @_ZNK7leveldb6Status2okEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  br i1 %27, label %30, label %.thread

28:                                               ; preds = %22
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %82

30:                                               ; preds = %25
  %31 = getelementptr inbounds i8, ptr %1, i64 64
  %32 = load ptr, ptr %31, align 8, !tbaa !22
  %33 = load ptr, ptr %9, align 8, !tbaa !20
  %34 = load ptr, ptr %32, align 8, !tbaa !18
  %35 = getelementptr inbounds i8, ptr %34, i64 40
  %36 = load ptr, ptr %35, align 8
  %37 = invoke noundef ptr %36(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef %33)
          to label %38 unwind label %56

38:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %39 = getelementptr inbounds i8, ptr %1, i64 40
  %40 = load ptr, ptr %39, align 8, !tbaa !23
  %41 = getelementptr inbounds i8, ptr %2, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !24
  %43 = getelementptr inbounds i8, ptr %2, i64 16
  %44 = load i64, ptr %43, align 8, !tbaa !25
  %45 = getelementptr inbounds i8, ptr %2, i64 24
  %46 = load i64, ptr %45, align 8, !tbaa !26
  %47 = getelementptr inbounds i8, ptr %2, i64 32
  %48 = load i64, ptr %47, align 8, !tbaa !27
  invoke void @_ZN7leveldb7Segment4OpenERKNS_7OptionsEPNS_16RandomAccessFileEmmmmPPS0_(ptr dead_on_unwind nonnull writable sret(%"class.leveldb::Status") align 8 %11, ptr noundef nonnull align 8 dereferenceable(104) %40, ptr noundef %37, i64 noundef %42, i64 noundef %44, i64 noundef %46, i64 noundef %48, ptr noundef nonnull %8)
          to label %49 unwind label %58

49:                                               ; preds = %38
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7leveldb6StatusaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @_ZN7leveldb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  %51 = call noundef zeroext i1 @_ZNK7leveldb6Status2okEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  br i1 %51, label %66, label %52

52:                                               ; preds = %49
  %53 = load ptr, ptr %8, align 8, !tbaa !20
  %54 = icmp eq ptr %53, null
  br i1 %54, label %60, label %55

55:                                               ; preds = %52
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.2, i32 noundef 293, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7leveldb13TableCacheNVM11FindSegmentEPKNS_11SegmentMetaEPPNS_5Cache6HandleE) #8
  unreachable

56:                                               ; preds = %30
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %82

58:                                               ; preds = %38
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %82

60:                                               ; preds = %52
  %61 = icmp eq ptr %37, null
  br i1 %61, label %.thread, label %62

62:                                               ; preds = %60
  %63 = load ptr, ptr %37, align 8, !tbaa !18
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load ptr, ptr %64, align 8
  call void %65(ptr noundef nonnull align 8 dereferenceable(8) %37) #7
  br label %.thread

66:                                               ; preds = %49
  %67 = invoke noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #9
          to label %68 unwind label %80

68:                                               ; preds = %66
  %69 = load ptr, ptr %31, align 8, !tbaa !22
  store ptr %69, ptr %67, align 8, !tbaa !28
  %70 = load ptr, ptr %9, align 8, !tbaa !20
  %71 = getelementptr inbounds i8, ptr %67, i64 16
  store ptr %70, ptr %71, align 8, !tbaa !30
  %72 = load ptr, ptr %8, align 8, !tbaa !20
  %73 = getelementptr inbounds i8, ptr %67, i64 8
  store ptr %72, ptr %73, align 8, !tbaa !31
  %74 = load ptr, ptr %15, align 8, !tbaa !16
  %75 = load ptr, ptr %74, align 8, !tbaa !18
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  %77 = load ptr, ptr %76, align 8
  %78 = invoke noundef ptr %77(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull %67, i64 noundef 1, ptr noundef nonnull @_ZN7leveldbL13DeleteSegmentERKNS_5SliceEPv)
          to label %79 unwind label %80

.thread:                                          ; preds = %60, %62, %25
  call void @_ZN7leveldb6StatusC2EOS0_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %84

79:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %83

80:                                               ; preds = %68, %66
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %82

82:                                               ; preds = %56, %58, %80, %28
  %.pn.pn = phi { ptr, i32 } [ %29, %28 ], [ %81, %80 ], [ %59, %58 ], [ %57, %56 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @_ZN7leveldb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn.pn

83:                                               ; preds = %79, %4
  %.2 = phi ptr [ %78, %79 ], [ %20, %4 ]
  store ptr %.2, ptr %3, align 8, !tbaa !20
  call void @_ZN7leveldb6Status2OKEv(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0)
  br label %84

84:                                               ; preds = %.thread, %83
  call void @_ZN7leveldb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %5) #7
  ret void
}

; 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 void @_ZN7leveldb6StatusC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7leveldb13EncodeFixed64EPcm(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7leveldb13TableCacheNVM8FindFileEmPPNS_5Cache6HandleE(ptr dead_on_unwind noalias writable sret(%"class.leveldb::Status") align 8, ptr noundef nonnull align 8 dereferenceable(104), i64 noundef, ptr noundef) local_unnamed_addr #3 align 2

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

declare void @_ZN7leveldb7Segment4OpenERKNS_7OptionsEPNS_16RandomAccessFileEmmmmPPS0_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7leveldbL13DeleteSegmentERKNS_5SliceEPv(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7leveldb6Status2OKEv(ptr dead_on_unwind noalias writable sret(%"class.leveldb::Status") align 8) local_unnamed_addr #1 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 56}
!9 = !{!"_ZTSN7leveldb11SegmentMetaE", !10, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !12, i64 64, !12, i64 96}
!10 = !{!"int", !6, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!"_ZTSN7leveldb11InternalKeyE", !13, i64 0}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !11, i64 8, !6, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !15, i64 0}
!15 = !{!"any pointer", !6, i64 0}
!16 = !{!17, !15, i64 56}
!17 = !{!"_ZTSN7leveldb13TableCacheNVME", !15, i64 0, !13, i64 8, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !13, i64 72}
!18 = !{!19, !19, i64 0}
!19 = !{!"vtable pointer", !7, i64 0}
!20 = !{!15, !15, i64 0}
!21 = !{!9, !11, i64 48}
!22 = !{!17, !15, i64 64}
!23 = !{!17, !15, i64 40}
!24 = !{!9, !11, i64 8}
!25 = !{!9, !11, i64 16}
!26 = !{!9, !11, i64 24}
!27 = !{!9, !11, i64 32}
!28 = !{!29, !15, i64 0}
!29 = !{!"_ZTSN7leveldb20SegmentAndFileHandleE", !15, i64 0, !15, i64 8, !15, i64 16}
!30 = !{!29, !15, i64 16}
!31 = !{!29, !15, i64 8}


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