; LLVM IR from Koukyosyumei/AIJack :: aivalut/src/storage/data.pb.ll (ZNK7storage5Tuple12ByteSizeLongEv)

; 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.google::protobuf::internal::RepeatedPtrIterator" = type { ptr }
%"class.storage::Tuple" = type <{ %"class.google::protobuf::Message", %"class.google::protobuf::RepeatedPtrField", i64, i64, %"class.google::protobuf::internal::CachedSize", [4 x i8] }>
%"class.google::protobuf::Message" = type { %"class.google::protobuf::MessageLite" }
%"class.google::protobuf::MessageLite" = type { ptr, %"class.google::protobuf::internal::InternalMetadata" }
%"class.google::protobuf::internal::InternalMetadata" = type { ptr }
%"class.google::protobuf::RepeatedPtrField" = type { %"class.google::protobuf::internal::RepeatedPtrFieldBase" }
%"class.google::protobuf::internal::RepeatedPtrFieldBase" = type { ptr, i32, i32, ptr }
%"class.google::protobuf::internal::CachedSize" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #1

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

declare noundef i64 @_ZN6google8protobuf8internal24ComputeUnknownFieldsSizeERKNS1_16InternalMetadataEmPNS1_10CachedSizeE(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6google8protobuf8internal12ToCachedSizeEm(i64 noundef) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNK7storage5Tuple7mintxidEv(ptr noundef nonnull align 8 dereferenceable(64)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK7storage5Tuple17_internal_mintxidEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNK7storage5Tuple7maxtxidEv(ptr noundef nonnull align 8 dereferenceable(64)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK7storage5Tuple17_internal_maxtxidEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7storage5Tuple19_internal_data_sizeEv(ptr noundef nonnull align 8 dereferenceable(64)) #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZNK7storage5Tuple12ByteSizeLongEv(ptr noundef nonnull align 8 dereferenceable(64) %0) unnamed_addr #5 align 2 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %"class.google::protobuf::internal::RepeatedPtrIterator", align 8
  %8 = alloca %"class.google::protobuf::internal::RepeatedPtrIterator", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !11
  %13 = call noundef i32 @_ZNK7storage5Tuple19_internal_data_sizeEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
  %14 = sext i32 %13 to i64
  %15 = mul i64 1, %14
  %16 = load i64, ptr %4, align 8, !tbaa !9
  %17 = add i64 %16, %15
  store i64 %17, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %18 = getelementptr inbounds %"class.storage::Tuple", ptr %12, i32 0, i32 1
  store ptr %18, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call ptr @_ZNK6google8protobuf16RepeatedPtrFieldIN7storage9TupleDataEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19)
  %21 = getelementptr inbounds %"class.google::protobuf::internal::RepeatedPtrIterator", ptr %7, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call ptr @_ZNK6google8protobuf16RepeatedPtrFieldIN7storage9TupleDataEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  %24 = getelementptr inbounds %"class.google::protobuf::internal::RepeatedPtrIterator", ptr %8, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  br label %25

25:                                               ; preds = %34, %1
  %26 = call noundef zeroext i1 @_ZNK6google8protobuf8internal19RepeatedPtrIteratorIKN7storage9TupleDataEEneERKS6_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  br i1 %26, label %28, label %27

27:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %36

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %29 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK6google8protobuf8internal19RepeatedPtrIteratorIKN7storage9TupleDataEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  store ptr %29, ptr %9, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = call noundef i64 @_ZN6google8protobuf8internal14WireFormatLite11MessageSizeIN7storage9TupleDataEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(40) %30)
  %32 = load i64, ptr %4, align 8, !tbaa !9
  %33 = add i64 %32, %31
  store i64 %33, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %34

34:                                               ; preds = %28
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6google8protobuf8internal19RepeatedPtrIteratorIKN7storage9TupleDataEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  br label %25

36:                                               ; preds = %27
  %37 = call noundef i64 @_ZNK7storage5Tuple7mintxidEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
  %38 = icmp ne i64 %37, 0
  br i1 %38, label %39, label %45

39:                                               ; preds = %36
  %40 = call noundef i64 @_ZNK7storage5Tuple17_internal_mintxidEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
  %41 = call noundef i64 @_ZN6google8protobuf8internal14WireFormatLite10UInt64SizeEm(i64 noundef %40)
  %42 = add i64 1, %41
  %43 = load i64, ptr %4, align 8, !tbaa !9
  %44 = add i64 %43, %42
  store i64 %44, ptr %4, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %39, %36
  %46 = call noundef i64 @_ZNK7storage5Tuple7maxtxidEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
  %47 = icmp ne i64 %46, 0
  br i1 %47, label %48, label %54

48:                                               ; preds = %45
  %49 = call noundef i64 @_ZNK7storage5Tuple17_internal_maxtxidEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
  %50 = call noundef i64 @_ZN6google8protobuf8internal14WireFormatLite10UInt64SizeEm(i64 noundef %49)
  %51 = add i64 1, %50
  %52 = load i64, ptr %4, align 8, !tbaa !9
  %53 = add i64 %52, %51
  store i64 %53, ptr %4, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %48, %45
  %55 = getelementptr inbounds %"class.google::protobuf::MessageLite", ptr %12, i32 0, i32 1
  %56 = call noundef zeroext i1 @_ZNK6google8protobuf8internal16InternalMetadata19have_unknown_fieldsEv(ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = zext i1 %56 to i64
  %58 = call i64 @llvm.expect.i64(i64 %57, i64 0)
  %59 = icmp ne i64 %58, 0
  br i1 %59, label %60, label %65

60:                                               ; preds = %54
  %61 = getelementptr inbounds %"class.google::protobuf::MessageLite", ptr %12, i32 0, i32 1
  %62 = load i64, ptr %4, align 8, !tbaa !9
  %63 = getelementptr inbounds %"class.storage::Tuple", ptr %12, i32 0, i32 4
  %64 = call noundef i64 @_ZN6google8protobuf8internal24ComputeUnknownFieldsSizeERKNS1_16InternalMetadataEmPNS1_10CachedSizeE(ptr noundef nonnull align 8 dereferenceable(8) %61, i64 noundef %62, ptr noundef %63)
  store i64 %64, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %70

65:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %66 = load i64, ptr %4, align 8, !tbaa !9
  %67 = call noundef i32 @_ZN6google8protobuf8internal12ToCachedSizeEm(i64 noundef %66)
  store i32 %67, ptr %11, align 4, !tbaa !11
  %68 = load i32, ptr %11, align 4, !tbaa !11
  call void @_ZNK7storage5Tuple13SetCachedSizeEi(ptr noundef nonnull align 8 dereferenceable(64) %12, i32 noundef %68)
  %69 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %69, ptr %2, align 8
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %70

70:                                               ; preds = %65, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  %71 = load i64, ptr %2, align 8
  ret i64 %71
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZNK6google8protobuf16RepeatedPtrFieldIN7storage9TupleDataEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZNK6google8protobuf16RepeatedPtrFieldIN7storage9TupleDataEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #6 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN6google8protobuf8internal14WireFormatLite11MessageSizeIN7storage9TupleDataEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(40)) #6 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN6google8protobuf8internal14WireFormatLite10UInt64SizeEm(i64 noundef) #6 align 2

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


; 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.google::protobuf::internal::RepeatedPtrIterator" = type { ptr }

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

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

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

declare noundef i64 @_ZN6google8protobuf8internal24ComputeUnknownFieldsSizeERKNS1_16InternalMetadataEmPNS1_10CachedSizeE(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6google8protobuf8internal12ToCachedSizeEm(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7storage5Tuple13SetCachedSizeEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNK7storage5Tuple7mintxidEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK7storage5Tuple17_internal_mintxidEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNK7storage5Tuple7maxtxidEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK7storage5Tuple17_internal_maxtxidEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7storage5Tuple19_internal_data_sizeEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZNK7storage5Tuple12ByteSizeLongEv(ptr noundef nonnull align 8 dereferenceable(64) %0) unnamed_addr #4 align 2 {
  %2 = alloca %"class.google::protobuf::internal::RepeatedPtrIterator", align 8
  %3 = alloca %"class.google::protobuf::internal::RepeatedPtrIterator", align 8
  %4 = tail call noundef i32 @_ZNK7storage5Tuple19_internal_data_sizeEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %5 = sext i32 %4 to i64
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %7 = tail call ptr @_ZNK6google8protobuf16RepeatedPtrFieldIN7storage9TupleDataEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  store ptr %7, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %8 = tail call ptr @_ZNK6google8protobuf16RepeatedPtrFieldIN7storage9TupleDataEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  store ptr %8, ptr %3, align 8
  %9 = call noundef zeroext i1 @_ZNK6google8protobuf8internal19RepeatedPtrIteratorIKN7storage9TupleDataEEneERKS6_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %1
  %.012.lcssa = phi i64 [ %5, %1 ], [ %13, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %10 = call noundef i64 @_ZNK7storage5Tuple7mintxidEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %21, label %16

.lr.ph:                                           ; preds = %1, %.lr.ph
  %.01214 = phi i64 [ %13, %.lr.ph ], [ %5, %1 ]
  %11 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK6google8protobuf8internal19RepeatedPtrIteratorIKN7storage9TupleDataEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %12 = call noundef i64 @_ZN6google8protobuf8internal14WireFormatLite11MessageSizeIN7storage9TupleDataEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(40) %11)
  %13 = add i64 %12, %.01214
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6google8protobuf8internal19RepeatedPtrIteratorIKN7storage9TupleDataEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %15 = call noundef zeroext i1 @_ZNK6google8protobuf8internal19RepeatedPtrIteratorIKN7storage9TupleDataEEneERKS6_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br i1 %15, label %.lr.ph, label %._crit_edge

16:                                               ; preds = %._crit_edge
  %17 = call noundef i64 @_ZNK7storage5Tuple17_internal_mintxidEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %18 = call noundef i64 @_ZN6google8protobuf8internal14WireFormatLite10UInt64SizeEm(i64 noundef %17)
  %19 = add i64 %.012.lcssa, 1
  %20 = add i64 %19, %18
  br label %21

21:                                               ; preds = %16, %._crit_edge
  %.1 = phi i64 [ %20, %16 ], [ %.012.lcssa, %._crit_edge ]
  %22 = call noundef i64 @_ZNK7storage5Tuple7maxtxidEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %.not13 = icmp eq i64 %22, 0
  br i1 %.not13, label %28, label %23

23:                                               ; preds = %21
  %24 = call noundef i64 @_ZNK7storage5Tuple17_internal_maxtxidEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %25 = call noundef i64 @_ZN6google8protobuf8internal14WireFormatLite10UInt64SizeEm(i64 noundef %24)
  %26 = add i64 %.1, 1
  %27 = add i64 %26, %25
  br label %28

28:                                               ; preds = %23, %21
  %.2 = phi i64 [ %27, %23 ], [ %.1, %21 ]
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = call noundef zeroext i1 @_ZNK6google8protobuf8internal16InternalMetadata19have_unknown_fieldsEv(ptr noundef nonnull align 8 dereferenceable(8) %29)
  br i1 %30, label %31, label %34, !prof !5

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %0, i64 56
  %33 = call noundef i64 @_ZN6google8protobuf8internal24ComputeUnknownFieldsSizeERKNS1_16InternalMetadataEmPNS1_10CachedSizeE(ptr noundef nonnull align 8 dereferenceable(8) %29, i64 noundef %.2, ptr noundef nonnull %32)
  br label %36

34:                                               ; preds = %28
  %35 = call noundef i32 @_ZN6google8protobuf8internal12ToCachedSizeEm(i64 noundef %.2)
  call void @_ZNK7storage5Tuple13SetCachedSizeEi(ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %35)
  br label %36

36:                                               ; preds = %34, %31
  %.0 = phi i64 [ %33, %31 ], [ %.2, %34 ]
  ret i64 %.0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN6google8protobuf8internal14WireFormatLite11MessageSizeIN7storage9TupleDataEEEmRKT_(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN6google8protobuf8internal14WireFormatLite10UInt64SizeEm(i64 noundef) local_unnamed_addr #5 align 2

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


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