; LLVM IR from nsccgz-storage/nvlsm :: db/write_batch.ll (ZNK7leveldb10WriteBatch7IterateEPNS0_7HandlerE)

; 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 }
%"class.leveldb::WriteBatch" = 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] }

@.str = external hidden unnamed_addr constant [33 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7leveldb10WriteBatch7IterateEPNS0_7HandlerE(ptr dead_on_unwind noalias writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.leveldb::Slice", align 8
  %8 = alloca %"class.leveldb::Slice", align 8
  %9 = alloca %"class.leveldb::Slice", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.leveldb::Slice", align 8
  %12 = alloca %"class.leveldb::Slice", align 8
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca %"class.leveldb::Slice", align 8
  %16 = alloca %"class.leveldb::Slice", align 8
  %17 = alloca %"class.leveldb::Slice", align 8
  %18 = alloca %"class.leveldb::Slice", align 8
  %19 = alloca %"class.leveldb::Slice", align 8
  %20 = alloca %"class.leveldb::Slice", align 8
  %21 = alloca %"class.leveldb::Slice", align 8
  %22 = alloca %"class.leveldb::Slice", 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
  %23 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #4
  %24 = getelementptr inbounds %"class.leveldb::WriteBatch", ptr %23, i32 0, i32 0
  call void @_ZN7leveldb5SliceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(32) %24)
  %25 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %26 = icmp ult i64 %25, 12
  br i1 %26, label %27, label %28

27:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  store i32 1, ptr %10, align 4
  br label %70

28:                                               ; preds = %3
  call void @_ZN7leveldb5Slice13remove_prefixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef 12)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %62, %28
  %30 = call noundef zeroext i1 @_ZNK7leveldb5Slice5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %31 = xor i1 %30, true
  br i1 %31, label %32, label %63

32:                                               ; preds = %29
  %33 = load i32, ptr %13, align 4, !tbaa !9
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #4
  %35 = call noundef signext i8 @_ZNK7leveldb5SliceixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef 0)
  store i8 %35, ptr %14, align 1, !tbaa !11
  call void @_ZN7leveldb5Slice13remove_prefixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef 1)
  %36 = load i8, ptr %14, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  switch i32 %37, label %58 [
    i32 1, label %38
    i32 0, label %49
  ]

38:                                               ; preds = %32
  %39 = call noundef zeroext i1 @_ZN7leveldb22GetLengthPrefixedSliceEPNS_5SliceES1_(ptr noundef %7, ptr noundef %11)
  br i1 %39, label %40, label %47

40:                                               ; preds = %38
  %41 = call noundef zeroext i1 @_ZN7leveldb22GetLengthPrefixedSliceEPNS_5SliceES1_(ptr noundef %7, ptr noundef %12)
  br i1 %41, label %42, label %47

42:                                               ; preds = %40
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %43, align 8, !tbaa !12
  %45 = getelementptr inbounds ptr, ptr %44, i64 2
  %46 = load ptr, ptr %45, align 8
  call void %46(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %12)
  br label %48

47:                                               ; preds = %40, %38
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef @.str.1)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  store i32 1, ptr %10, align 4
  br label %60

48:                                               ; preds = %42
  br label %59

49:                                               ; preds = %32
  %50 = call noundef zeroext i1 @_ZN7leveldb22GetLengthPrefixedSliceEPNS_5SliceES1_(ptr noundef %7, ptr noundef %11)
  br i1 %50, label %51, label %56

51:                                               ; preds = %49
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load ptr, ptr %52, align 8, !tbaa !12
  %54 = getelementptr inbounds ptr, ptr %53, i64 3
  %55 = load ptr, ptr %54, align 8
  call void %55(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull align 8 dereferenceable(16) %11)
  br label %57

56:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %18)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %18)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #4
  store i32 1, ptr %10, align 4
  br label %60

57:                                               ; preds = %51
  br label %59

58:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef @.str.3)
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #4
  store i32 1, ptr %10, align 4
  br label %60

59:                                               ; preds = %57, %48
  store i32 0, ptr %10, align 4
  br label %60

60:                                               ; preds = %59, %58, %56, %47
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  %61 = load i32, ptr %10, align 4
  switch i32 %61, label %69 [
    i32 0, label %62
  ]

62:                                               ; preds = %60
  br label %29, !llvm.loop !14

63:                                               ; preds = %29
  %64 = load i32, ptr %13, align 4, !tbaa !9
  %65 = call noundef i32 @_ZN7leveldb18WriteBatchInternal5CountEPKNS_10WriteBatchE(ptr noundef %23)
  %66 = icmp ne i32 %64, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef @.str.4)
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %22)
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #4
  store i32 1, ptr %10, align 4
  br label %69

68:                                               ; preds = %63
  call void @_ZN7leveldb6Status2OKEv(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0)
  store i32 1, ptr %10, align 4
  br label %69

69:                                               ; preds = %68, %67, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  br label %70

70:                                               ; preds = %69, %27
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  ret void
}

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZNK7leveldb5SliceixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #2 align 2

declare noundef zeroext i1 @_ZN7leveldb22GetLengthPrefixedSliceEPNS_5SliceES1_(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7leveldb18WriteBatchInternal5CountEPKNS_10WriteBatchE(ptr noundef) #0 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"vtable pointer", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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

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

@.str = external hidden unnamed_addr constant [33 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7leveldb10WriteBatch7IterateEPNS0_7HandlerE(ptr dead_on_unwind noalias writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2) local_unnamed_addr #0 align 2 {
  %4 = alloca %"class.leveldb::Slice", align 8
  %5 = alloca %"class.leveldb::Slice", align 8
  %6 = alloca %"class.leveldb::Slice", align 8
  %7 = alloca %"class.leveldb::Slice", align 8
  %8 = alloca %"class.leveldb::Slice", align 8
  %9 = alloca %"class.leveldb::Slice", align 8
  %10 = alloca %"class.leveldb::Slice", align 8
  %11 = alloca %"class.leveldb::Slice", align 8
  %12 = alloca %"class.leveldb::Slice", align 8
  %13 = alloca %"class.leveldb::Slice", align 8
  %14 = alloca %"class.leveldb::Slice", align 8
  %15 = alloca %"class.leveldb::Slice", align 8
  %16 = alloca %"class.leveldb::Slice", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @_ZN7leveldb5SliceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %17 = call noundef i64 @_ZNK7leveldb5Slice4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %18 = icmp ult i64 %17, 12
  br i1 %18, label %19, label %20

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull @.str)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  br label %46

20:                                               ; preds = %3
  call void @_ZN7leveldb5Slice13remove_prefixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef 12)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8)
  %21 = call noundef zeroext i1 @_ZNK7leveldb5Slice5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  br i1 %21, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %20, %41
  %.0610 = phi i32 [ %22, %41 ], [ 0, %20 ]
  %22 = add nuw nsw i32 %.0610, 1
  %23 = call noundef signext i8 @_ZNK7leveldb5SliceixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef 0)
  call void @_ZN7leveldb5Slice13remove_prefixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef 1)
  switch i8 %23, label %40 [
    i8 1, label %24
    i8 0, label %33
  ]

24:                                               ; preds = %.lr.ph
  %25 = call noundef zeroext i1 @_ZN7leveldb22GetLengthPrefixedSliceEPNS_5SliceES1_(ptr noundef nonnull %4, ptr noundef nonnull %7)
  br i1 %25, label %26, label %32

26:                                               ; preds = %24
  %27 = call noundef zeroext i1 @_ZN7leveldb22GetLengthPrefixedSliceEPNS_5SliceES1_(ptr noundef nonnull %4, ptr noundef nonnull %8)
  br i1 %27, label %28, label %32

28:                                               ; preds = %26
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %31 = load ptr, ptr %30, align 8
  call void %31(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %8)
  br label %41

32:                                               ; preds = %26, %24
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull @.str.1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  br label %.critedge

33:                                               ; preds = %.lr.ph
  %34 = call noundef zeroext i1 @_ZN7leveldb22GetLengthPrefixedSliceEPNS_5SliceES1_(ptr noundef nonnull %4, ptr noundef nonnull %7)
  br i1 %34, label %35, label %39

35:                                               ; preds = %33
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(16) %7)
  br label %41

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull @.str.2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  br label %.critedge

40:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull @.str.3)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  br label %.critedge

41:                                               ; preds = %28, %35
  %42 = call noundef zeroext i1 @_ZNK7leveldb5Slice5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  br i1 %42, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %41, %20
  %.06.lcssa = phi i32 [ 0, %20 ], [ %22, %41 ]
  %43 = call noundef i32 @_ZN7leveldb18WriteBatchInternal5CountEPKNS_10WriteBatchE(ptr noundef nonnull %1)
  %.not = icmp eq i32 %.06.lcssa, %43
  br i1 %.not, label %45, label %44

44:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #4
  call void @_ZN7leveldb5SliceC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull @.str.4)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #4
  call void @_ZN7leveldb5SliceC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @_ZN7leveldb6Status10CorruptionERKNS_5SliceES3_(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #4
  br label %.critedge

45:                                               ; preds = %._crit_edge
  call void @_ZN7leveldb6Status2OKEv(ptr dead_on_unwind writable sret(%"class.leveldb::Status") align 8 %0)
  br label %.critedge

.critedge:                                        ; preds = %40, %39, %32, %45, %44
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %46

46:                                               ; preds = %.critedge, %19
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  ret void
}

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZNK7leveldb5SliceixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN7leveldb22GetLengthPrefixedSliceEPNS_5SliceES1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7leveldb18WriteBatchInternal5CountEPKNS_10WriteBatchE(ptr noundef) local_unnamed_addr #0 align 2

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass