; LLVM IR from trustwallet/wallet-core :: src/BinaryCoding.ll (ZN2TW12decodeVarIntERKSt6vectorIhSaIhEERm)

; 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.std::tuple" = type { %"struct.std::_Tuple_impl.base", [7 x i8] }
%"struct.std::_Tuple_impl.base" = type <{ %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }>
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i64 }
%"struct.std::_Head_base.1" = type { i8 }
%"class.std::tuple.2" = type { %"struct.std::_Tuple_impl.base.6", [3 x i8] }
%"struct.std::_Tuple_impl.base.6" = type <{ %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.1" }>
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base.5" }
%"struct.std::_Head_base.5" = type { i32 }

@.str = external hidden unnamed_addr constant [49 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__._ZN2TW12decodeVarIntERKSt6vectorIhSaIhEERm = external hidden unnamed_addr constant [63 x i8], align 1

; 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2TW10decode64LEEPKh(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2TW12decodeVarIntERKSt6vectorIhSaIhEERm(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::tuple.2", align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca %"class.std::tuple.2", align 4
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i8, align 1
  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
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = add i64 %21, 1
  %23 = icmp ult i64 %19, %22
  br i1 %23, label %24, label %25

24:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  store i8 0, ptr %8, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !13
  call void @_ZSt10make_tupleIJbiEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 4 %7, ptr noundef nonnull align 1 dereferenceable(1) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @_ZNSt5tupleIJbmEEC2IbiTnNSt9enable_ifIXclsr4_TCCILb1EEE29__is_implicitly_constructibleIT_T0_EEEbE4typeELb1EEEOS_IJS3_S4_EE(ptr noundef nonnull align 8 dereferenceable(9) %0, ptr noundef nonnull align 4 dereferenceable(5) %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %108

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  store i8 0, ptr %10, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %28) #5
  %30 = load i8, ptr %29, align 1, !tbaa !15
  store i8 %30, ptr %11, align 1, !tbaa !15
  %31 = load i8, ptr %11, align 1, !tbaa !15
  %32 = zext i8 %31 to i32
  switch i32 %32, label %36 [
    i32 253, label %33
    i32 254, label %34
    i32 255, label %35
  ]

33:                                               ; preds = %25
  store i8 2, ptr %10, align 1, !tbaa !15
  br label %37

34:                                               ; preds = %25
  store i8 4, ptr %10, align 1, !tbaa !15
  br label %37

35:                                               ; preds = %25
  store i8 8, ptr %10, align 1, !tbaa !15
  br label %37

36:                                               ; preds = %25
  store i8 0, ptr %10, align 1, !tbaa !15
  br label %37

37:                                               ; preds = %36, %35, %34, %33
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = add i64 %39, 1
  store i64 %40, ptr %38, align 8, !tbaa !9
  %41 = load i8, ptr %10, align 1, !tbaa !15
  %42 = zext i8 %41 to i32
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %56, label %44

44:                                               ; preds = %37
  %45 = load i8, ptr %10, align 1, !tbaa !15
  %46 = zext i8 %45 to i32
  %47 = icmp eq i32 %46, 2
  br i1 %47, label %56, label %48

48:                                               ; preds = %44
  %49 = load i8, ptr %10, align 1, !tbaa !15
  %50 = zext i8 %49 to i32
  %51 = icmp eq i32 %50, 4
  br i1 %51, label %56, label %52

52:                                               ; preds = %48
  %53 = load i8, ptr %10, align 1, !tbaa !15
  %54 = zext i8 %53 to i32
  %55 = icmp eq i32 %54, 8
  br label %56

56:                                               ; preds = %52, %48, %44, %37
  %57 = phi i1 [ true, %48 ], [ true, %44 ], [ true, %37 ], [ %55, %52 ]
  br i1 %57, label %58, label %59

58:                                               ; preds = %56
  br label %61

59:                                               ; preds = %56
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 96, ptr noundef @__PRETTY_FUNCTION__._ZN2TW12decodeVarIntERKSt6vectorIhSaIhEERm) #6
  unreachable

60:                                               ; No predecessors!
  br label %61

61:                                               ; preds = %60, %58
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #5
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = load i64, ptr %64, align 8, !tbaa !9
  %66 = load i8, ptr %10, align 1, !tbaa !15
  %67 = zext i8 %66 to i64
  %68 = add i64 %65, %67
  %69 = icmp ult i64 %63, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i8 0, ptr %13, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !13
  call void @_ZSt10make_tupleIJbiEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 4 %12, ptr noundef nonnull align 1 dereferenceable(1) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @_ZNSt5tupleIJbmEEC2IbiTnNSt9enable_ifIXclsr4_TCCILb1EEE29__is_implicitly_constructibleIT_T0_EEEbE4typeELb1EEEOS_IJS3_S4_EE(ptr noundef nonnull align 8 dereferenceable(9) %0, ptr noundef nonnull align 4 dereferenceable(5) %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  store i32 1, ptr %15, align 4
  br label %107

71:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 0, ptr %16, align 8, !tbaa !9
  %72 = load i8, ptr %10, align 1, !tbaa !15
  %73 = zext i8 %72 to i32
  switch i32 %73, label %74 [
    i32 0, label %75
    i32 2, label %78
    i32 4, label %86
    i32 8, label %94
  ]

74:                                               ; preds = %71
  br label %75

75:                                               ; preds = %74, %71
  %76 = load i8, ptr %11, align 1, !tbaa !15
  %77 = zext i8 %76 to i64
  store i64 %77, ptr %16, align 8, !tbaa !9
  br label %101

78:                                               ; preds = %71
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %79) #5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %80, i64 %82
  %84 = call noundef zeroext i16 @_ZN2TW10decode16LEEPKh(ptr noundef %83)
  %85 = zext i16 %84 to i64
  store i64 %85, ptr %16, align 8, !tbaa !9
  br label %101

86:                                               ; preds = %71
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %87) #5
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = getelementptr inbounds i8, ptr %88, i64 %90
  %92 = call noundef i32 @_ZN2TW10decode32LEEPKh(ptr noundef %91)
  %93 = zext i32 %92 to i64
  store i64 %93, ptr %16, align 8, !tbaa !9
  br label %101

94:                                               ; preds = %71
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %95) #5
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load i64, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds i8, ptr %96, i64 %98
  %100 = call noundef i64 @_ZN2TW10decode64LEEPKh(ptr noundef %99)
  store i64 %100, ptr %16, align 8, !tbaa !9
  br label %101

101:                                              ; preds = %94, %86, %78, %75
  %102 = load i8, ptr %10, align 1, !tbaa !15
  %103 = zext i8 %102 to i64
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = load i64, ptr %104, align 8, !tbaa !9
  %106 = add i64 %105, %103
  store i64 %106, ptr %104, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  store i8 1, ptr %17, align 1, !tbaa !11
  call void @_ZSt10make_tupleIJbRmEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 8 %0, ptr noundef nonnull align 1 dereferenceable(1) %17, ptr noundef nonnull align 8 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %107

107:                                              ; preds = %101, %70
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %108

108:                                              ; preds = %107, %24
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt10make_tupleIJbiEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.2") align 4, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN2TW10decode16LEEPKh(ptr noundef) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt10make_tupleIJbRmEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(8)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nounwind }
attributes #6 = { noreturn 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 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!7, !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.std::tuple" = type { %"struct.std::_Tuple_impl.base", [7 x i8] }
%"struct.std::_Tuple_impl.base" = type <{ %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }>
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i64 }
%"struct.std::_Head_base.1" = type { i8 }
%"class.std::tuple.2" = type { %"struct.std::_Tuple_impl.base.6", [3 x i8] }
%"struct.std::_Tuple_impl.base.6" = type <{ %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.1" }>
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base.5" }
%"struct.std::_Head_base.5" = type { i32 }

; 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2TW10decode64LEEPKh(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN2TW12decodeVarIntERKSt6vectorIhSaIhEERm(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr nocapture noundef nonnull align 8 dereferenceable(8) %2) local_unnamed_addr #1 {
  %4 = alloca %"class.std::tuple.2", align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::tuple.2", align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i8, align 1
  %12 = tail call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %13 = load i64, ptr %2, align 8, !tbaa !5
  %14 = add i64 %13, 1
  %15 = icmp ult i64 %12, %14
  br i1 %15, label %16, label %.critedge

16:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  store i8 0, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 0, ptr %6, align 4, !tbaa !11
  call void @_ZSt10make_tupleIJbiEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 4 %4, ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZNSt5tupleIJbmEEC2IbiTnNSt9enable_ifIXclsr4_TCCILb1EEE29__is_implicitly_constructibleIT_T0_EEEbE4typeELb1EEEOS_IJS3_S4_EE(ptr noundef nonnull align 8 dereferenceable(9) %0, ptr noundef nonnull align 4 dereferenceable(5) %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %51

.critedge:                                        ; preds = %3
  %17 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %13) #3
  %18 = load i8, ptr %17, align 1, !tbaa !13
  %switch.tableidx = add i8 %18, 3
  %19 = icmp ugt i8 %18, -4
  %switch.cast = zext i8 %switch.tableidx to i24
  %switch.shiftamt = shl nuw nsw i24 %switch.cast, 3
  %switch.downshift = lshr i24 525314, %switch.shiftamt
  %switch.masked = trunc i24 %switch.downshift to i8
  %.0 = select i1 %19, i8 %switch.masked, i8 0
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = add i64 %20, 1
  store i64 %21, ptr %2, align 8, !tbaa !5
  %22 = tail call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %23 = load i64, ptr %2, align 8, !tbaa !5
  %24 = zext nneg i8 %.0 to i64
  %25 = add i64 %23, %24
  %26 = icmp ult i64 %22, %25
  br i1 %26, label %27, label %28

27:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #3
  store i8 0, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #3
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @_ZSt10make_tupleIJbiEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 4 %7, ptr noundef nonnull align 1 dereferenceable(1) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @_ZNSt5tupleIJbmEEC2IbiTnNSt9enable_ifIXclsr4_TCCILb1EEE29__is_implicitly_constructibleIT_T0_EEEbE4typeELb1EEEOS_IJS3_S4_EE(ptr noundef nonnull align 8 dereferenceable(9) %0, ptr noundef nonnull align 4 dereferenceable(5) %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  br label %51

28:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  switch i8 %.0, label %29 [
    i8 8, label %43
    i8 2, label %31
    i8 4, label %37
  ]

29:                                               ; preds = %28
  %30 = zext i8 %18 to i64
  store i64 %30, ptr %10, align 8, !tbaa !5
  br label %48

31:                                               ; preds = %28
  %32 = tail call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %33 = load i64, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %32, i64 %33
  %35 = tail call noundef zeroext i16 @_ZN2TW10decode16LEEPKh(ptr noundef %34)
  %36 = zext i16 %35 to i64
  store i64 %36, ptr %10, align 8, !tbaa !5
  br label %48

37:                                               ; preds = %28
  %38 = tail call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %39 = load i64, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %38, i64 %39
  %41 = tail call noundef i32 @_ZN2TW10decode32LEEPKh(ptr noundef %40)
  %42 = zext i32 %41 to i64
  store i64 %42, ptr %10, align 8, !tbaa !5
  br label %48

43:                                               ; preds = %28
  %44 = tail call noundef ptr @_ZNKSt6vectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %45 = load i64, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %44, i64 %45
  %47 = tail call noundef i64 @_ZN2TW10decode64LEEPKh(ptr noundef %46)
  store i64 %47, ptr %10, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %43, %37, %31, %29
  %49 = load i64, ptr %2, align 8, !tbaa !5
  %50 = add i64 %49, %24
  store i64 %50, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #3
  store i8 1, ptr %11, align 1, !tbaa !9
  call void @_ZSt10make_tupleIJbRmEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 8 %0, ptr noundef nonnull align 1 dereferenceable(1) %11, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  br label %51

51:                                               ; preds = %27, %48, %16
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt10make_tupleIJbiEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.2") align 4, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN2TW10decode16LEEPKh(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2TW10decode32LEEPKh(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt10make_tupleIJbRmEESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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


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