; LLVM IR from KoishiDB/Koishi-DB :: src/disk/sstable.ll (ZN8koishidb9ReadBlockEPNS_16RandomAccessFileERKNS_11BlockHandleE)

; 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.koishidb::Status" = type { ptr }
%"class.std::optional.0" = type { %"struct.std::_Optional_base.1" }
%"struct.std::_Optional_base.1" = type { %"struct.std::_Optional_payload.3" }
%"struct.std::_Optional_payload.3" = type { %"struct.std::_Optional_payload.base.9", [7 x i8] }
%"struct.std::_Optional_payload.base.9" = type { %"struct.std::_Optional_payload_base.base.8" }
%"struct.std::_Optional_payload_base.base.8" = type <{ %"union.std::_Optional_payload_base<std::unique_ptr<koishidb::Slice>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::unique_ptr<koishidb::Slice>>::_Storage" = type { %"class.std::unique_ptr" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.7" }
%"struct.std::_Head_base.7" = type { ptr }

@.str = external hidden unnamed_addr constant [72 x i8], align 1
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@__FUNCTION__._ZN8koishidb9ReadBlockEPNS_16RandomAccessFileERKNS_11BlockHandleE = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z15OutputLogHeaderPKciS0_i(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #1

; 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare i32 @fflush(ptr noundef) #4

declare void @_ZN8koishidb5SliceC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @_ZN8koishidb16RandomAccessFile4ReadEmmPNS_5SliceEPc(ptr dead_on_unwind writable sret(%"class.koishidb::Status") align 8, ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef, ptr noundef, ptr noundef) #4

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8koishidb9ReadBlockEPNS_16RandomAccessFileERKNS_11BlockHandleE(ptr dead_on_unwind noalias writable sret(%"class.std::optional.0") align 8 %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2) #6 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::unique_ptr", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.koishidb::Status", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %15 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #9
  invoke void @_ZN8koishidb5SliceC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %16 unwind label %39

16:                                               ; preds = %3
  call void @_ZNSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = invoke noundef i64 @_ZNK8koishidb11BlockHandle4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %19 unwind label %43

19:                                               ; preds = %16
  %20 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %18) #9
          to label %21 unwind label %43

21:                                               ; preds = %19
  store ptr %20, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = invoke noundef i64 @_ZNK8koishidb11BlockHandle6offsetEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %25 unwind label %47

25:                                               ; preds = %21
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = invoke noundef i64 @_ZNK8koishidb11BlockHandle4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %28 unwind label %47

28:                                               ; preds = %25
  %29 = call noundef ptr @_ZNKSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN8koishidb16RandomAccessFile4ReadEmmPNS_5SliceEPc(ptr dead_on_unwind writable sret(%"class.koishidb::Status") align 8 %11, ptr noundef nonnull align 8 dereferenceable(48) %22, i64 noundef %24, i64 noundef %27, ptr noundef %29, ptr noundef %30)
          to label %31 unwind label %47

31:                                               ; preds = %28
  %32 = invoke noundef zeroext i1 @_ZNK8koishidb6Status2okEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %33 unwind label %51

33:                                               ; preds = %31
  br i1 %32, label %55, label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = icmp eq ptr %35, null
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  call void @_ZdaPv(ptr noundef %35) #10
  br label %38

38:                                               ; preds = %37, %34
  call void @_ZNSt8optionalISt10unique_ptrIN8koishidb5SliceESt14default_deleteIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #8
  store i32 1, ptr %12, align 4
  br label %78

39:                                               ; preds = %3
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %8, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %15, i64 noundef 16) #10
  br label %81

43:                                               ; preds = %19, %16
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %8, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %9, align 4
  br label %80

47:                                               ; preds = %28, %25, %21
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %8, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %9, align 4
  br label %79

51:                                               ; preds = %69, %67, %58, %55, %31
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %8, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %9, align 4
  call void @_ZN8koishidb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  br label %79

55:                                               ; preds = %33
  %56 = call noundef ptr @_ZNKSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  %57 = invoke noundef i64 @_ZNK8koishidb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %56)
          to label %58 unwind label %51

58:                                               ; preds = %55
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = invoke noundef i64 @_ZNK8koishidb11BlockHandle4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %59)
          to label %61 unwind label %51

61:                                               ; preds = %58
  %62 = icmp ne i64 %57, %60
  br i1 %62, label %63, label %77

63:                                               ; preds = %61
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = icmp eq ptr %64, null
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  call void @_ZdaPv(ptr noundef %64) #10
  br label %67

67:                                               ; preds = %66, %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store ptr getelementptr (i8, ptr @.str, i64 1), ptr %13, align 8, !tbaa !5
  store ptr getelementptr (i8, ptr @.str, i64 1), ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_Z15OutputLogHeaderPKciS0_i(ptr noundef %68, i32 noundef 100, ptr noundef @__FUNCTION__._ZN8koishidb9ReadBlockEPNS_16RandomAccessFileERKNS_11BlockHandleE, i32 noundef 500)
          to label %69 unwind label %51

69:                                               ; preds = %67
  %70 = load ptr, ptr @stdout, align 8, !tbaa !5
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.3) #8
  %72 = load ptr, ptr @stdout, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str.2) #8
  %74 = load ptr, ptr @stdout, align 8, !tbaa !5
  %75 = invoke i32 @fflush(ptr noundef %74)
          to label %76 unwind label %51

76:                                               ; preds = %69
  call void @_ZNSt8optionalISt10unique_ptrIN8koishidb5SliceESt14default_deleteIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #8
  store i32 1, ptr %12, align 4
  br label %78

77:                                               ; preds = %61
  call void @_ZNSt8optionalISt10unique_ptrIN8koishidb5SliceESt14default_deleteIS2_EEEC2IS5_TnNSt9enable_ifIX7__and_vISt6__not_ISt7is_sameIS6_NSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEES9_ISA_ISt10in_place_tSH_EESt16is_constructibleIS5_JSD_EESt14is_convertibleISD_S5_EEEbE4typeELb1EEEOSD_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  store i32 1, ptr %12, align 4
  br label %78

78:                                               ; preds = %77, %76, %38
  call void @_ZN8koishidb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @_ZNSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  ret void

79:                                               ; preds = %51, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %80

80:                                               ; preds = %79, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @_ZNSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br label %81

81:                                               ; preds = %80, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %8, align 8
  %84 = load i32, ptr %9, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86
}

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

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

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

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

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #0

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

declare noundef i64 @_ZNK8koishidb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #4

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; 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.koishidb::Status" = type { ptr }
%"class.std::optional.0" = type { %"struct.std::_Optional_base.1" }
%"struct.std::_Optional_base.1" = type { %"struct.std::_Optional_payload.3" }
%"struct.std::_Optional_payload.3" = type { %"struct.std::_Optional_payload.base.9", [7 x i8] }
%"struct.std::_Optional_payload.base.9" = type { %"struct.std::_Optional_payload_base.base.8" }
%"struct.std::_Optional_payload_base.base.8" = type <{ %"union.std::_Optional_payload_base<std::unique_ptr<koishidb::Slice>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::unique_ptr<koishidb::Slice>>::_Storage" = type { %"class.std::unique_ptr" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.7" }
%"struct.std::_Head_base.7" = type { ptr }

@.str = external hidden unnamed_addr constant [72 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@__FUNCTION__._ZN8koishidb9ReadBlockEPNS_16RandomAccessFileERKNS_11BlockHandleE = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z15OutputLogHeaderPKciS0_i(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

declare void @_ZN8koishidb5SliceC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @_ZN8koishidb16RandomAccessFile4ReadEmmPNS_5SliceEPc(ptr dead_on_unwind writable sret(%"class.koishidb::Status") align 8, ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8koishidb9ReadBlockEPNS_16RandomAccessFileERKNS_11BlockHandleE(ptr dead_on_unwind noalias writable sret(%"class.std::optional.0") align 8 %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::unique_ptr", align 8
  %5 = alloca %"class.koishidb::Status", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %6 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #9
  invoke void @_ZN8koishidb5SliceC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %7 unwind label %17

7:                                                ; preds = %3
  call void @_ZNSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %6) #8
  %8 = call noundef i64 @_ZNK8koishidb11BlockHandle4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %9 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %8) #9
          to label %10 unwind label %19

10:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %11 = call noundef i64 @_ZNK8koishidb11BlockHandle6offsetEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %12 = call noundef i64 @_ZNK8koishidb11BlockHandle4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %13 = call noundef ptr @_ZNKSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  invoke void @_ZN8koishidb16RandomAccessFile4ReadEmmPNS_5SliceEPc(ptr dead_on_unwind nonnull writable sret(%"class.koishidb::Status") align 8 %5, ptr noundef nonnull align 8 dereferenceable(48) %1, i64 noundef %11, i64 noundef %12, ptr noundef %13, ptr noundef nonnull %9)
          to label %14 unwind label %21

14:                                               ; preds = %10
  %15 = call noundef zeroext i1 @_ZNK8koishidb6Status2okEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %15, label %25, label %16

16:                                               ; preds = %14
  call void @_ZdaPv(ptr noundef nonnull %9) #10
  call void @_ZNSt8optionalISt10unique_ptrIN8koishidb5SliceESt14default_deleteIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #8
  br label %38

17:                                               ; preds = %3
  %18 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %6, i64 noundef 16) #10
  br label %41

19:                                               ; preds = %7
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %40

21:                                               ; preds = %10
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %39

23:                                               ; preds = %25
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8koishidb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  br label %39

25:                                               ; preds = %14
  %26 = call noundef ptr @_ZNKSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %27 = invoke noundef i64 @_ZNK8koishidb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %28 unwind label %23

28:                                               ; preds = %25
  %29 = call noundef i64 @_ZNK8koishidb11BlockHandle4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %.not = icmp eq i64 %27, %29
  br i1 %.not, label %37, label %30

30:                                               ; preds = %28
  call void @_ZdaPv(ptr noundef nonnull %9) #10
  call void @_Z15OutputLogHeaderPKciS0_i(ptr noundef nonnull getelementptr inbounds (i8, ptr @.str, i64 1), i32 noundef 100, ptr noundef nonnull @__FUNCTION__._ZN8koishidb9ReadBlockEPNS_16RandomAccessFileERKNS_11BlockHandleE, i32 noundef 500)
  %31 = load ptr, ptr @stdout, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.3) #8
  %33 = load ptr, ptr @stdout, align 8, !tbaa !5
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.2) #8
  %35 = load ptr, ptr @stdout, align 8, !tbaa !5
  %36 = call i32 @fflush(ptr noundef %35)
  call void @_ZNSt8optionalISt10unique_ptrIN8koishidb5SliceESt14default_deleteIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #8
  br label %38

37:                                               ; preds = %28
  call void @_ZNSt8optionalISt10unique_ptrIN8koishidb5SliceESt14default_deleteIS2_EEEC2IS5_TnNSt9enable_ifIX7__and_vISt6__not_ISt7is_sameIS6_NSt9remove_cvINSt16remove_referenceIT_E4typeEE4typeEEES9_ISA_ISt10in_place_tSH_EESt16is_constructibleIS5_JSD_EESt14is_convertibleISD_S5_EEEbE4typeELb1EEEOSD_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br label %38

38:                                               ; preds = %37, %30, %16
  call void @_ZN8koishidb6StatusD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @_ZNSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  ret void

39:                                               ; preds = %23, %21
  %.pn = phi { ptr, i32 } [ %24, %23 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %40

40:                                               ; preds = %39, %19
  %.pn.pn = phi { ptr, i32 } [ %.pn, %39 ], [ %20, %19 ]
  call void @_ZNSt10unique_ptrIN8koishidb5SliceESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br label %41

41:                                               ; preds = %40, %17
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %40 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

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

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #0

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

declare noundef i64 @_ZNK8koishidb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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