; LLVM IR from nsccgz-storage/nvlsm :: db (log_reader)

; 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::Slice" = type { ptr, i64 }
%"class.leveldb::log::Reader" = type <{ ptr, ptr, i8, [7 x i8], ptr, %"class.leveldb::Slice", i8, [7 x i8], i64, i64, i64, i8, [7 x i8] }>

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7leveldb3log6Reader10ReadRecordEPNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef %1, ptr noundef %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i64, align 8
  %10 = alloca %"class.leveldb::Slice", align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.leveldb::Slice", align 8
  %15 = alloca [40 x i8], align 16
  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
  %16 = load ptr, ptr %5, align 8
  %17 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 8
  %18 = load i64, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 10
  %20 = load i64, ptr %19, align 8, !tbaa !14
  %21 = icmp ult i64 %18, %20
  br i1 %21, label %22, label %26

22:                                               ; preds = %3
  %23 = call noundef zeroext i1 @_ZN7leveldb3log6Reader18SkipToInitialBlockEv(ptr noundef nonnull align 8 dereferenceable(81) %16)
  br i1 %23, label %25, label %24

24:                                               ; preds = %22
  store i1 false, ptr %4, align 1
  br label %151

25:                                               ; preds = %22
  br label %26

26:                                               ; preds = %25, %3
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %27) #5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN7leveldb5Slice5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %28)
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  store i8 0, ptr %8, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10)
  br label %29

29:                                               ; preds = %149, %147, %26
  br label %30

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %31 = call noundef i32 @_ZN7leveldb3log6Reader18ReadPhysicalRecordEPNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(81) %16, ptr noundef %10)
  store i32 %31, ptr %11, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %32 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 9
  %33 = load i64, ptr %32, align 8, !tbaa !19
  %34 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 5
  %35 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %34)
  %36 = sub i64 %33, %35
  %37 = sub i64 %36, 7
  %38 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %39 = sub i64 %37, %38
  store i64 %39, ptr %12, align 8, !tbaa !16
  %40 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 11
  %41 = load i8, ptr %40, align 8, !tbaa !20, !range !21, !noundef !22
  %42 = trunc i8 %41 to i1
  br i1 %42, label %43, label %56

43:                                               ; preds = %30
  %44 = load i32, ptr %11, align 4, !tbaa !17
  %45 = icmp eq i32 %44, 3
  br i1 %45, label %46, label %47

46:                                               ; preds = %43
  store i32 2, ptr %13, align 4
  br label %147, !llvm.loop !23

47:                                               ; preds = %43
  %48 = load i32, ptr %11, align 4, !tbaa !17
  %49 = icmp eq i32 %48, 4
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  %51 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 11
  store i8 0, ptr %51, align 8, !tbaa !20
  store i32 2, ptr %13, align 4
  br label %147, !llvm.loop !23

52:                                               ; preds = %47
  %53 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 11
  store i8 0, ptr %53, align 8, !tbaa !20
  br label %54

54:                                               ; preds = %52
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55, %30
  %57 = load i32, ptr %11, align 4, !tbaa !17
  switch i32 %57, label %130 [
    i32 1, label %58
    i32 2, label %74
    i32 3, label %90
    i32 4, label %101
    i32 5, label %116
    i32 6, label %122
  ]

58:                                               ; preds = %56
  %59 = load i8, ptr %8, align 1, !tbaa !15, !range !21, !noundef !22
  %60 = trunc i8 %59 to i1
  br i1 %60, label %61, label %68

61:                                               ; preds = %58
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %62) #5
  br i1 %63, label %67, label %64

64:                                               ; preds = %61
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %65) #5
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %16, i64 noundef %66, ptr noundef @.str)
  br label %67

67:                                               ; preds = %64, %61
  br label %68

68:                                               ; preds = %67, %58
  %69 = load i64, ptr %12, align 8, !tbaa !16
  store i64 %69, ptr %9, align 8, !tbaa !16
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %70) #5
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %71, ptr align 8 %10, i64 16, i1 false), !tbaa.struct !25
  %72 = load i64, ptr %9, align 8, !tbaa !16
  %73 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 8
  store i64 %72, ptr %73, align 8, !tbaa !9
  store i1 true, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %147

74:                                               ; preds = %56
  %75 = load i8, ptr %8, align 1, !tbaa !15, !range !21, !noundef !22
  %76 = trunc i8 %75 to i1
  br i1 %76, label %77, label %84

77:                                               ; preds = %74
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %78) #5
  br i1 %79, label %83, label %80

80:                                               ; preds = %77
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %81) #5
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %16, i64 noundef %82, ptr noundef @.str.1)
  br label %83

83:                                               ; preds = %80, %77
  br label %84

84:                                               ; preds = %83, %74
  %85 = load i64, ptr %12, align 8, !tbaa !16
  store i64 %85, ptr %9, align 8, !tbaa !16
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = call noundef ptr @_ZNK7leveldb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %88 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %89 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %86, ptr noundef %87, i64 noundef %88)
  store i8 1, ptr %8, align 1, !tbaa !15
  br label %146

90:                                               ; preds = %56
  %91 = load i8, ptr %8, align 1, !tbaa !15, !range !21, !noundef !22
  %92 = trunc i8 %91 to i1
  br i1 %92, label %95, label %93

93:                                               ; preds = %90
  %94 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %16, i64 noundef %94, ptr noundef @.str.2)
  br label %100

95:                                               ; preds = %90
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = call noundef ptr @_ZNK7leveldb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %98 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %99 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %96, ptr noundef %97, i64 noundef %98)
  br label %100

100:                                              ; preds = %95, %93
  br label %146

101:                                              ; preds = %56
  %102 = load i8, ptr %8, align 1, !tbaa !15, !range !21, !noundef !22
  %103 = trunc i8 %102 to i1
  br i1 %103, label %106, label %104

104:                                              ; preds = %101
  %105 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %16, i64 noundef %105, ptr noundef @.str.3)
  br label %115

106:                                              ; preds = %101
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = call noundef ptr @_ZNK7leveldb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %109 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %110 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %107, ptr noundef %108, i64 noundef %109)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN7leveldb5SliceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(32) %111)
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %112, ptr align 8 %14, i64 16, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  %113 = load i64, ptr %9, align 8, !tbaa !16
  %114 = getelementptr inbounds %"class.leveldb::log::Reader", ptr %16, i32 0, i32 8
  store i64 %113, ptr %114, align 8, !tbaa !9
  store i1 true, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %147

115:                                              ; preds = %104
  br label %146

116:                                              ; preds = %56
  %117 = load i8, ptr %8, align 1, !tbaa !15, !range !21, !noundef !22
  %118 = trunc i8 %117 to i1
  br i1 %118, label %119, label %121

119:                                              ; preds = %116
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %120) #5
  br label %121

121:                                              ; preds = %119, %116
  store i1 false, ptr %4, align 1
  store i32 1, ptr %13, align 4
  br label %147

122:                                              ; preds = %56
  %123 = load i8, ptr %8, align 1, !tbaa !15, !range !21, !noundef !22
  %124 = trunc i8 %123 to i1
  br i1 %124, label %125, label %129

125:                                              ; preds = %122
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %126) #5
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %16, i64 noundef %127, ptr noundef @.str.4)
  store i8 0, ptr %8, align 1, !tbaa !15
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %128) #5
  br label %129

129:                                              ; preds = %125, %122
  br label %146

130:                                              ; preds = %56
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #5
  %131 = getelementptr inbounds [40 x i8], ptr %15, i64 0, i64 0
  %132 = load i32, ptr %11, align 4, !tbaa !17
  %133 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %131, i64 noundef 40, ptr noundef @.str.5, i32 noundef %132) #5
  %134 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %135 = load i8, ptr %8, align 1, !tbaa !15, !range !21, !noundef !22
  %136 = trunc i8 %135 to i1
  br i1 %136, label %137, label %140

137:                                              ; preds = %130
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %138) #5
  br label %141

140:                                              ; preds = %130
  br label %141

141:                                              ; preds = %140, %137
  %142 = phi i64 [ %139, %137 ], [ 0, %140 ]
  %143 = add i64 %134, %142
  %144 = getelementptr inbounds [40 x i8], ptr %15, i64 0, i64 0
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %16, i64 noundef %143, ptr noundef %144)
  store i8 0, ptr %8, align 1, !tbaa !15
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %145) #5
  store i32 4, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #5
  br label %146

146:                                              ; preds = %141, %129, %115, %100, %84
  store i32 0, ptr %13, align 4
  br label %147

147:                                              ; preds = %146, %121, %106, %68, %50, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %148 = load i32, ptr %13, align 4
  switch i32 %148, label %150 [
    i32 0, label %149
    i32 2, label %29
  ]

149:                                              ; preds = %147
  br label %29, !llvm.loop !23

150:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  br label %151

151:                                              ; preds = %150, %24
  %152 = load i1, ptr %4, align 1
  ret i1 %152
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7leveldb3log6Reader18ReadPhysicalRecordEPNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81), i64 noundef, ptr noundef) #1 align 2

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

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

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

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

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

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

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #4

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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, !13, i64 56}
!10 = !{!"_ZTSN7leveldb3log6ReaderE", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !12, i64 32, !11, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !11, i64 80}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTSN7leveldb5SliceE", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !13, i64 72}
!15 = !{!11, !11, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!10, !13, i64 64}
!20 = !{!10, !11, i64 80}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{i64 0, i64 8, !5, i64 8, i64 8, !16}


; 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::Slice" = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7leveldb3log6Reader10ReadRecordEPNS_5SliceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 align 2 {
  %4 = alloca %"class.leveldb::Slice", align 8
  %5 = alloca %"class.leveldb::Slice", align 8
  %6 = alloca [40 x i8], align 16
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 72
  %10 = load i64, ptr %9, align 8, !tbaa !13
  %11 = icmp ult i64 %8, %10
  br i1 %11, label %12, label %14

12:                                               ; preds = %3
  %13 = tail call noundef zeroext i1 @_ZN7leveldb3log6Reader18SkipToInitialBlockEv(ptr noundef nonnull align 8 dereferenceable(81) %0)
  br i1 %13, label %14, label %81

14:                                               ; preds = %12, %3
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  tail call void @_ZN7leveldb5Slice5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = getelementptr inbounds i8, ptr %0, i64 80
  br label %18

18:                                               ; preds = %.backedge, %14
  %.039 = phi i64 [ 0, %14 ], [ %.039.be, %.backedge ]
  %.036 = phi i8 [ 0, %14 ], [ %.036.be, %.backedge ]
  %19 = call noundef i32 @_ZN7leveldb3log6Reader18ReadPhysicalRecordEPNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef nonnull %4)
  %20 = load i64, ptr %15, align 8, !tbaa !14
  %21 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %22 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %.neg49 = add i64 %20, -7
  %23 = add i64 %21, %22
  %24 = sub i64 %.neg49, %23
  %25 = load i8, ptr %17, align 8, !tbaa !15, !range !16, !noundef !17
  %26 = trunc nuw i8 %25 to i1
  br i1 %26, label %27, label %30

27:                                               ; preds = %18
  switch i32 %19, label %29 [
    i32 3, label %.backedge
    i32 4, label %28
  ]

28:                                               ; preds = %27
  store i8 0, ptr %17, align 8, !tbaa !15
  br label %.backedge

29:                                               ; preds = %27
  store i8 0, ptr %17, align 8, !tbaa !15
  br label %30

30:                                               ; preds = %29, %18
  switch i32 %19, label %71 [
    i32 1, label %31
    i32 2, label %38
    i32 3, label %48
    i32 4, label %56
    i32 5, label %64
    i32 6, label %67
  ]

31:                                               ; preds = %30
  %32 = trunc nuw i8 %.036 to i1
  br i1 %32, label %33, label %37

33:                                               ; preds = %31
  %34 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br i1 %34, label %37, label %35

35:                                               ; preds = %33
  %36 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %0, i64 noundef %36, ptr noundef nonnull @.str)
  br label %37

37:                                               ; preds = %33, %35, %31
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %4, i64 16, i1 false), !tbaa.struct !18
  store i64 %24, ptr %7, align 8, !tbaa !5
  br label %80

38:                                               ; preds = %30
  %39 = trunc nuw i8 %.036 to i1
  br i1 %39, label %40, label %44

40:                                               ; preds = %38
  %41 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br i1 %41, label %44, label %42

42:                                               ; preds = %40
  %43 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %0, i64 noundef %43, ptr noundef nonnull @.str.1)
  br label %44

44:                                               ; preds = %40, %42, %38
  %45 = call noundef ptr @_ZNK7leveldb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %46 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %47 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef %45, i64 noundef %46)
  br label %.backedge

.backedge:                                        ; preds = %44, %58, %77, %52, %50, %69, %67, %27, %28
  %.039.be = phi i64 [ %.039, %28 ], [ %.039, %27 ], [ %.039, %77 ], [ %.039, %69 ], [ %.039, %67 ], [ %.039, %58 ], [ %.039, %52 ], [ %.039, %50 ], [ %24, %44 ]
  %.036.be = phi i8 [ %.036, %28 ], [ %.036, %27 ], [ 0, %77 ], [ 0, %69 ], [ %.036, %67 ], [ %.036, %58 ], [ %.036, %52 ], [ %.036, %50 ], [ 1, %44 ]
  br label %18, !llvm.loop !21

48:                                               ; preds = %30
  %49 = trunc nuw i8 %.036 to i1
  br i1 %49, label %52, label %50

50:                                               ; preds = %48
  %51 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %0, i64 noundef %51, ptr noundef nonnull @.str.2)
  br label %.backedge

52:                                               ; preds = %48
  %53 = call noundef ptr @_ZNK7leveldb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %54 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %55 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef %53, i64 noundef %54)
  br label %.backedge

56:                                               ; preds = %30
  %57 = trunc nuw i8 %.036 to i1
  br i1 %57, label %60, label %58

58:                                               ; preds = %56
  %59 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %0, i64 noundef %59, ptr noundef nonnull @.str.3)
  br label %.backedge

60:                                               ; preds = %56
  %61 = call noundef ptr @_ZNK7leveldb5Slice4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %62 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %63 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef %61, i64 noundef %62)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN7leveldb5SliceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(32) %2)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %5, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  store i64 %.039, ptr %7, align 8, !tbaa !5
  br label %80

64:                                               ; preds = %30
  %65 = trunc nuw i8 %.036 to i1
  br i1 %65, label %66, label %80

66:                                               ; preds = %64
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %80

67:                                               ; preds = %30
  %68 = trunc nuw i8 %.036 to i1
  br i1 %68, label %69, label %.backedge

69:                                               ; preds = %67
  %70 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %0, i64 noundef %70, ptr noundef nonnull @.str.4)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %.backedge

71:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #5
  %72 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 40, ptr noundef nonnull @.str.5, i32 noundef %19) #5
  %73 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %74 = trunc nuw i8 %.036 to i1
  br i1 %74, label %75, label %77

75:                                               ; preds = %71
  %76 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %77

77:                                               ; preds = %71, %75
  %78 = phi i64 [ %76, %75 ], [ 0, %71 ]
  %79 = add i64 %78, %73
  call void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81) %0, i64 noundef %79, ptr noundef nonnull %6)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  br label %.backedge

80:                                               ; preds = %60, %37, %66, %64
  %.1.ph = phi i1 [ false, %64 ], [ false, %66 ], [ true, %37 ], [ true, %60 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %81

81:                                               ; preds = %12, %80
  %.2 = phi i1 [ %.1.ph, %80 ], [ false, %12 ]
  ret i1 %.2
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7leveldb3log6Reader18ReadPhysicalRecordEPNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7leveldb3log6Reader16ReportCorruptionEmPKc(ptr noundef nonnull align 8 dereferenceable(81), i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

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

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree 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 = { 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 56}
!6 = !{!"_ZTSN7leveldb3log6ReaderE", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !10, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !10, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSN7leveldb5SliceE", !7, i64 0, !12, i64 8}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !12, i64 72}
!14 = !{!6, !12, i64 64}
!15 = !{!6, !10, i64 80}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{i64 0, i64 8, !19, i64 8, i64 8, !20}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !12, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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