; LLVM IR from vczh/herodb :: Kernel/Source/Vlpp.ll (ZN2vl6stream10LzwDecoder4ReadEPvl)

; 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.vl::stream::LzwDecoder" = type { %"class.vl::stream::LzwBase", %"class.vl::stream::IDecoder", ptr, %"class.vl::collections::List.22", ptr, [1024 x i8], i64, i64, %"class.vl::collections::Array.39", i64, i64 }
%"class.vl::stream::LzwBase" = type { %"class.vl::Object", %"class.vl::collections::PushOnlyAllocator", %"class.vl::collections::PushOnlyAllocator.30", ptr, i64, i64, i64 }
%"class.vl::Object" = type { ptr }
%"class.vl::collections::PushOnlyAllocator" = type { %"class.vl::Object", i64, i64, %"class.vl::collections::List.22" }
%"class.vl::collections::PushOnlyAllocator.30" = type { %"class.vl::Object", i64, i64, %"class.vl::collections::List.31" }
%"class.vl::collections::List.31" = type { %"class.vl::collections::ListBase.base.37", %"class.vl::collections::IEnumerable.35" }
%"class.vl::collections::ListBase.base.37" = type <{ %"class.vl::collections::ArrayBase.base.36", i64, i8 }>
%"class.vl::collections::ArrayBase.base.36" = type { %"class.vl::collections::ListStore.34", ptr, i64 }
%"class.vl::collections::ListStore.34" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.35" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"class.vl::stream::IDecoder" = type { %"class.vl::Interface" }
%"class.vl::collections::List.22" = type { %"class.vl::collections::ListBase.base.28", %"class.vl::collections::IEnumerable.26" }
%"class.vl::collections::ListBase.base.28" = type <{ %"class.vl::collections::ArrayBase.base.27", i64, i8 }>
%"class.vl::collections::ArrayBase.base.27" = type { %"class.vl::collections::ListStore.25", ptr, i64 }
%"class.vl::collections::ListStore.25" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.26" = type { %"class.vl::Interface" }
%"class.vl::collections::Array.39" = type { %"class.vl::collections::ArrayBase.base.43", %"class.vl::collections::IEnumerable.42" }
%"class.vl::collections::ArrayBase.base.43" = type { %"class.vl::collections::ListStore.41", ptr, i64 }
%"class.vl::collections::ListStore.41" = type { %"class.vl::Object" }
%"class.vl::collections::IEnumerable.42" = type { %"class.vl::Interface" }
%"struct.vl::stream::lzw::Code" = type { i8, i64, ptr, i64, %"class.vl::collections::ByteObjectMap" }
%"class.vl::collections::ByteObjectMap" = type { %"class.vl::Object", ptr }

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl6stream7LzwBase15UpdateIndexBitsEv(ptr noundef nonnull align 8 dereferenceable(184)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2vl6stream7LzwBase10CreateCodeEPNS0_3lzw4CodeEh(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef, i8 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl6stream10LzwDecoder10ReadNumberERll(ptr noundef nonnull align 8 dereferenceable(1344), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream10LzwDecoder24ExpandCodeToOutputBufferEPNS0_3lzw4CodeE(ptr noundef nonnull align 8 dereferenceable(1344), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_E3AddERKS5_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN2vl6stream10LzwDecoder4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(1344) %0, ptr noundef %1, i64 noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %16, ptr %8, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %124, %3
  %18 = load i64, ptr %7, align 8, !tbaa !9
  %19 = load i64, ptr %6, align 8, !tbaa !9
  %20 = icmp slt i64 %18, %19
  br i1 %20, label %21, label %125

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %22 = load i64, ptr %6, align 8, !tbaa !9
  %23 = load i64, ptr %7, align 8, !tbaa !9
  %24 = sub nsw i64 %22, %23
  store i64 %24, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %25 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 9
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 10
  %28 = load i64, ptr %27, align 8, !tbaa !31
  %29 = sub nsw i64 %26, %28
  store i64 %29, ptr %10, align 8, !tbaa !9
  %30 = load i64, ptr %10, align 8, !tbaa !9
  %31 = icmp eq i64 %30, 0
  br i1 %31, label %32, label %99

32:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !9
  %33 = getelementptr inbounds %"class.vl::stream::LzwBase", ptr %15, i32 0, i32 6
  %34 = load i64, ptr %33, align 8, !tbaa !32
  %35 = call noundef zeroext i1 @_ZN2vl6stream10LzwDecoder10ReadNumberERll(ptr noundef nonnull align 8 dereferenceable(1344) %15, ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef %34)
  br i1 %35, label %36, label %41

36:                                               ; preds = %32
  %37 = load i64, ptr %11, align 8, !tbaa !9
  %38 = getelementptr inbounds %"class.vl::stream::LzwBase", ptr %15, i32 0, i32 4
  %39 = load i64, ptr %38, align 8, !tbaa !33
  %40 = icmp eq i64 %37, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %36, %32
  store i32 3, ptr %12, align 4
  br label %96

42:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  %43 = load i64, ptr %11, align 8, !tbaa !9
  %44 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 3
  %45 = call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_6stream3lzw4CodeEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %44)
  %46 = icmp eq i64 %43, %45
  br i1 %46, label %47, label %63

47:                                               ; preds = %42
  %48 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !34
  store ptr %49, ptr %13, align 8, !tbaa !5
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.vl::stream::lzw::Code", ptr %50, i32 0, i32 3
  %52 = load i64, ptr %51, align 8, !tbaa !35
  %53 = add nsw i64 %52, 1
  call void @_ZN2vl6stream10LzwDecoder19PrepareOutputBufferEl(ptr noundef nonnull align 8 dereferenceable(1344) %15, i64 noundef %53)
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN2vl6stream10LzwDecoder24ExpandCodeToOutputBufferEPNS0_3lzw4CodeE(ptr noundef nonnull align 8 dereferenceable(1344) %15, ptr noundef %54)
  %55 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 8
  %56 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef 0)
  %57 = load i8, ptr %56, align 1, !tbaa !38
  %58 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 8
  %59 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 9
  %60 = load i64, ptr %59, align 8, !tbaa !11
  %61 = sub nsw i64 %60, 1
  %62 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %61)
  store i8 %57, ptr %62, align 1, !tbaa !38
  br label %72

63:                                               ; preds = %42
  %64 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 3
  %65 = load i64, ptr %11, align 8, !tbaa !9
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %64, i64 noundef %65)
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  store ptr %67, ptr %13, align 8, !tbaa !5
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.vl::stream::lzw::Code", ptr %68, i32 0, i32 3
  %70 = load i64, ptr %69, align 8, !tbaa !35
  call void @_ZN2vl6stream10LzwDecoder19PrepareOutputBufferEl(ptr noundef nonnull align 8 dereferenceable(1344) %15, i64 noundef %70)
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN2vl6stream10LzwDecoder24ExpandCodeToOutputBufferEPNS0_3lzw4CodeE(ptr noundef nonnull align 8 dereferenceable(1344) %15, ptr noundef %71)
  br label %72

72:                                               ; preds = %63, %47
  %73 = getelementptr inbounds %"class.vl::stream::LzwBase", ptr %15, i32 0, i32 5
  %74 = load i64, ptr %73, align 8, !tbaa !39
  %75 = icmp slt i64 %74, 16777216
  br i1 %75, label %76, label %90

76:                                               ; preds = %72
  %77 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !34
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %89

80:                                               ; preds = %76
  %81 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %82 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !34
  %84 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 8
  %85 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef 0)
  %86 = load i8, ptr %85, align 1, !tbaa !38
  %87 = call noundef ptr @_ZN2vl6stream7LzwBase10CreateCodeEPNS0_3lzw4CodeEh(ptr noundef nonnull align 8 dereferenceable(184) %15, ptr noundef %83, i8 noundef zeroext %86)
  store ptr %87, ptr %14, align 8, !tbaa !5
  %88 = call noundef i64 @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_E3AddERKS5_(ptr noundef nonnull align 8 dereferenceable(33) %81, ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %89

89:                                               ; preds = %80, %76
  call void @_ZN2vl6stream7LzwBase15UpdateIndexBitsEv(ptr noundef nonnull align 8 dereferenceable(184) %15)
  br label %90

90:                                               ; preds = %89, %72
  %91 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 3
  %92 = load i64, ptr %11, align 8, !tbaa !9
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %91, i64 noundef %92)
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 4
  store ptr %94, ptr %95, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  store i32 0, ptr %12, align 4
  br label %96

96:                                               ; preds = %90, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %97 = load i32, ptr %12, align 4
  switch i32 %97, label %122 [
    i32 0, label %98
  ]

98:                                               ; preds = %96
  br label %121

99:                                               ; preds = %21
  %100 = load i64, ptr %10, align 8, !tbaa !9
  %101 = load i64, ptr %9, align 8, !tbaa !9
  %102 = icmp sgt i64 %100, %101
  br i1 %102, label %103, label %105

103:                                              ; preds = %99
  %104 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %104, ptr %10, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %103, %99
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = load i64, ptr %7, align 8, !tbaa !9
  %108 = getelementptr inbounds i8, ptr %106, i64 %107
  %109 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 8
  %110 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 10
  %111 = load i64, ptr %110, align 8, !tbaa !31
  %112 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %109, i64 noundef %111)
  %113 = load i64, ptr %10, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %108, ptr align 1 %112, i64 %113, i1 false)
  %114 = load i64, ptr %10, align 8, !tbaa !9
  %115 = getelementptr inbounds %"class.vl::stream::LzwDecoder", ptr %15, i32 0, i32 10
  %116 = load i64, ptr %115, align 8, !tbaa !31
  %117 = add nsw i64 %116, %114
  store i64 %117, ptr %115, align 8, !tbaa !31
  %118 = load i64, ptr %10, align 8, !tbaa !9
  %119 = load i64, ptr %7, align 8, !tbaa !9
  %120 = add nsw i64 %119, %118
  store i64 %120, ptr %7, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %105, %98
  store i32 0, ptr %12, align 4
  br label %122

122:                                              ; preds = %121, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %123 = load i32, ptr %12, align 4
  switch i32 %123, label %127 [
    i32 0, label %124
    i32 3, label %125
  ]

124:                                              ; preds = %122
  br label %17, !llvm.loop !40

125:                                              ; preds = %122, %17
  %126 = load i64, ptr %7, align 8, !tbaa !9
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret i64 %126

127:                                              ; preds = %122
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !10, i64 1328}
!12 = !{!"_ZTSN2vl6stream10LzwDecoderE", !13, i64 0, !26, i64 184, !6, i64 192, !16, i64 200, !6, i64 248, !7, i64 256, !10, i64 1280, !10, i64 1288, !28, i64 1296, !10, i64 1328, !10, i64 1336}
!13 = !{!"_ZTSN2vl6stream7LzwBaseE", !14, i64 0, !15, i64 8, !21, i64 80, !6, i64 152, !10, i64 160, !10, i64 168, !10, i64 176}
!14 = !{!"_ZTSN2vl6ObjectE"}
!15 = !{!"_ZTSN2vl11collections17PushOnlyAllocatorINS_6stream3lzw4CodeEEE", !14, i64 0, !10, i64 8, !10, i64 16, !16, i64 24}
!16 = !{!"_ZTSN2vl11collections4ListIPNS_6stream3lzw4CodeES5_EE", !17, i64 0}
!17 = !{!"_ZTSN2vl11collections8ListBaseIPNS_6stream3lzw4CodeES5_EE", !18, i64 0, !10, i64 24, !20, i64 32}
!18 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS_6stream3lzw4CodeEEE", !19, i64 0, !6, i64 8, !10, i64 16}
!19 = !{!"_ZTSN2vl11collections9ListStoreIPNS_6stream3lzw4CodeELb1EEE", !14, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSN2vl11collections17PushOnlyAllocatorINS0_10bom_helper8TreeNodeEEE", !14, i64 0, !10, i64 8, !10, i64 16, !22, i64 24}
!22 = !{!"_ZTSN2vl11collections4ListIPNS0_10bom_helper8TreeNodeES4_EE", !23, i64 0}
!23 = !{!"_ZTSN2vl11collections8ListBaseIPNS0_10bom_helper8TreeNodeES4_EE", !24, i64 0, !10, i64 24, !20, i64 32}
!24 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS0_10bom_helper8TreeNodeEEE", !25, i64 0, !6, i64 8, !10, i64 16}
!25 = !{!"_ZTSN2vl11collections9ListStoreIPNS0_10bom_helper8TreeNodeELb1EEE", !14, i64 0}
!26 = !{!"_ZTSN2vl6stream8IDecoderE", !27, i64 0}
!27 = !{!"_ZTSN2vl9InterfaceE"}
!28 = !{!"_ZTSN2vl11collections5ArrayIhhEE", !29, i64 0}
!29 = !{!"_ZTSN2vl11collections9ArrayBaseIhEE", !30, i64 0, !6, i64 8, !10, i64 16}
!30 = !{!"_ZTSN2vl11collections9ListStoreIhLb1EEE", !14, i64 0}
!31 = !{!12, !10, i64 1336}
!32 = !{!13, !10, i64 176}
!33 = !{!13, !10, i64 160}
!34 = !{!12, !6, i64 248}
!35 = !{!36, !10, i64 24}
!36 = !{!"_ZTSN2vl6stream3lzw4CodeE", !7, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !37, i64 32}
!37 = !{!"_ZTSN2vl11collections13ByteObjectMapINS_6stream3lzw4CodeEEE", !14, i64 0, !6, i64 8}
!38 = !{!7, !7, i64 0}
!39 = !{!13, !10, i64 168}
!40 = distinct !{!40, !41}
!41 = !{!"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"

; 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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2vl6stream7LzwBase15UpdateIndexBitsEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2vl6stream7LzwBase10CreateCodeEPNS0_3lzw4CodeEh(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef, i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2vl6stream10LzwDecoder10ReadNumberERll(ptr noundef nonnull align 8 dereferenceable(1344), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream10LzwDecoder24ExpandCodeToOutputBufferEPNS0_3lzw4CodeE(ptr noundef nonnull align 8 dereferenceable(1344), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_E3AddERKS5_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN2vl6stream10LzwDecoder4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(1344) %0, ptr nocapture noundef writeonly %1, i64 noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = icmp sgt i64 %2, 0
  br i1 %6, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 1328
  %8 = getelementptr inbounds i8, ptr %0, i64 1336
  %9 = getelementptr inbounds i8, ptr %0, i64 1296
  %10 = getelementptr inbounds i8, ptr %0, i64 176
  %11 = getelementptr inbounds i8, ptr %0, i64 160
  %12 = getelementptr inbounds i8, ptr %0, i64 200
  %13 = getelementptr inbounds i8, ptr %0, i64 248
  %14 = getelementptr inbounds i8, ptr %0, i64 168
  br label %15

15:                                               ; preds = %.lr.ph, %68
  %.02338 = phi i64 [ 0, %.lr.ph ], [ %.2, %68 ]
  %16 = load i64, ptr %7, align 8, !tbaa !5
  %17 = load i64, ptr %8, align 8, !tbaa !29
  %18 = icmp eq i64 %16, %17
  br i1 %18, label %19, label %60

19:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 0, ptr %4, align 8, !tbaa !30
  %20 = load i64, ptr %10, align 8, !tbaa !31
  %21 = call noundef zeroext i1 @_ZN2vl6stream10LzwDecoder10ReadNumberERll(ptr noundef nonnull align 8 dereferenceable(1344) %0, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %20)
  br i1 %21, label %22, label %.thread32

22:                                               ; preds = %19
  %23 = load i64, ptr %4, align 8, !tbaa !30
  %24 = load i64, ptr %11, align 8, !tbaa !32
  %25 = icmp eq i64 %23, %24
  br i1 %25, label %.thread32, label %26

26:                                               ; preds = %22
  %27 = call noundef i64 @_ZNK2vl11collections9ArrayBaseIPNS_6stream3lzw4CodeEE5CountEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %28 = icmp eq i64 %23, %27
  br i1 %28, label %29, label %39

29:                                               ; preds = %26
  %30 = load ptr, ptr %13, align 8, !tbaa !33
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  %32 = load i64, ptr %31, align 8, !tbaa !34
  %33 = add nsw i64 %32, 1
  call void @_ZN2vl6stream10LzwDecoder19PrepareOutputBufferEl(ptr noundef nonnull align 8 dereferenceable(1344) %0, i64 noundef %33)
  call void @_ZN2vl6stream10LzwDecoder24ExpandCodeToOutputBufferEPNS0_3lzw4CodeE(ptr noundef nonnull align 8 dereferenceable(1344) %0, ptr noundef %30)
  %34 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 0)
  %35 = load i8, ptr %34, align 1, !tbaa !37
  %36 = load i64, ptr %7, align 8, !tbaa !5
  %37 = add nsw i64 %36, -1
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %37)
  store i8 %35, ptr %38, align 1, !tbaa !37
  br label %45

39:                                               ; preds = %26
  %40 = load i64, ptr %4, align 8, !tbaa !30
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %12, i64 noundef %40)
  %42 = load ptr, ptr %41, align 8, !tbaa !38
  %43 = getelementptr inbounds i8, ptr %42, i64 24
  %44 = load i64, ptr %43, align 8, !tbaa !34
  call void @_ZN2vl6stream10LzwDecoder19PrepareOutputBufferEl(ptr noundef nonnull align 8 dereferenceable(1344) %0, i64 noundef %44)
  call void @_ZN2vl6stream10LzwDecoder24ExpandCodeToOutputBufferEPNS0_3lzw4CodeE(ptr noundef nonnull align 8 dereferenceable(1344) %0, ptr noundef %42)
  br label %45

45:                                               ; preds = %39, %29
  %46 = load i64, ptr %14, align 8, !tbaa !39
  %47 = icmp slt i64 %46, 16777216
  br i1 %47, label %48, label %56

48:                                               ; preds = %45
  %49 = load ptr, ptr %13, align 8, !tbaa !33
  %.not = icmp eq ptr %49, null
  br i1 %.not, label %55, label %50

50:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 0)
  %52 = load i8, ptr %51, align 1, !tbaa !37
  %53 = call noundef ptr @_ZN2vl6stream7LzwBase10CreateCodeEPNS0_3lzw4CodeEh(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef nonnull %49, i8 noundef zeroext %52)
  store ptr %53, ptr %5, align 8, !tbaa !38
  %54 = call noundef i64 @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_E3AddERKS5_(ptr noundef nonnull align 8 dereferenceable(33) %12, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %55

55:                                               ; preds = %50, %48
  call void @_ZN2vl6stream7LzwBase15UpdateIndexBitsEv(ptr noundef nonnull align 8 dereferenceable(184) %0)
  br label %56

.thread32:                                        ; preds = %19, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %.loopexit

56:                                               ; preds = %55, %45
  %57 = load i64, ptr %4, align 8, !tbaa !30
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33) %12, i64 noundef %57)
  %59 = load ptr, ptr %58, align 8, !tbaa !38
  store ptr %59, ptr %13, align 8, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %68

60:                                               ; preds = %15
  %61 = sub nsw i64 %16, %17
  %62 = sub nsw i64 %2, %.02338
  %spec.select = call i64 @llvm.smin.i64(i64 %61, i64 %62)
  %63 = getelementptr inbounds i8, ptr %1, i64 %.02338
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %17)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %63, ptr nonnull align 1 %64, i64 %spec.select, i1 false)
  %65 = load i64, ptr %8, align 8, !tbaa !29
  %66 = add nsw i64 %65, %spec.select
  store i64 %66, ptr %8, align 8, !tbaa !29
  %67 = add nsw i64 %spec.select, %.02338
  br label %68

68:                                               ; preds = %56, %60
  %.2 = phi i64 [ %67, %60 ], [ %.02338, %56 ]
  %69 = icmp slt i64 %.2, %2
  br i1 %69, label %15, label %.loopexit

.loopexit:                                        ; preds = %68, %3, %.thread32
  %.02337 = phi i64 [ %.02338, %.thread32 ], [ 0, %3 ], [ %.2, %68 ]
  ret i64 %.02337
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN2vl11collections4ListIPNS_6stream3lzw4CodeES5_EixEl(ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) local_unnamed_addr #2 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 1328}
!6 = !{!"_ZTSN2vl6stream10LzwDecoderE", !7, i64 0, !24, i64 184, !17, i64 192, !13, i64 200, !17, i64 248, !11, i64 256, !10, i64 1280, !10, i64 1288, !26, i64 1296, !10, i64 1328, !10, i64 1336}
!7 = !{!"_ZTSN2vl6stream7LzwBaseE", !8, i64 0, !9, i64 8, !19, i64 80, !17, i64 152, !10, i64 160, !10, i64 168, !10, i64 176}
!8 = !{!"_ZTSN2vl6ObjectE"}
!9 = !{!"_ZTSN2vl11collections17PushOnlyAllocatorINS_6stream3lzw4CodeEEE", !8, i64 0, !10, i64 8, !10, i64 16, !13, i64 24}
!10 = !{!"long", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSN2vl11collections4ListIPNS_6stream3lzw4CodeES5_EE", !14, i64 0}
!14 = !{!"_ZTSN2vl11collections8ListBaseIPNS_6stream3lzw4CodeES5_EE", !15, i64 0, !10, i64 24, !18, i64 32}
!15 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS_6stream3lzw4CodeEEE", !16, i64 0, !17, i64 8, !10, i64 16}
!16 = !{!"_ZTSN2vl11collections9ListStoreIPNS_6stream3lzw4CodeELb1EEE", !8, i64 0}
!17 = !{!"any pointer", !11, i64 0}
!18 = !{!"bool", !11, i64 0}
!19 = !{!"_ZTSN2vl11collections17PushOnlyAllocatorINS0_10bom_helper8TreeNodeEEE", !8, i64 0, !10, i64 8, !10, i64 16, !20, i64 24}
!20 = !{!"_ZTSN2vl11collections4ListIPNS0_10bom_helper8TreeNodeES4_EE", !21, i64 0}
!21 = !{!"_ZTSN2vl11collections8ListBaseIPNS0_10bom_helper8TreeNodeES4_EE", !22, i64 0, !10, i64 24, !18, i64 32}
!22 = !{!"_ZTSN2vl11collections9ArrayBaseIPNS0_10bom_helper8TreeNodeEEE", !23, i64 0, !17, i64 8, !10, i64 16}
!23 = !{!"_ZTSN2vl11collections9ListStoreIPNS0_10bom_helper8TreeNodeELb1EEE", !8, i64 0}
!24 = !{!"_ZTSN2vl6stream8IDecoderE", !25, i64 0}
!25 = !{!"_ZTSN2vl9InterfaceE"}
!26 = !{!"_ZTSN2vl11collections5ArrayIhhEE", !27, i64 0}
!27 = !{!"_ZTSN2vl11collections9ArrayBaseIhEE", !28, i64 0, !17, i64 8, !10, i64 16}
!28 = !{!"_ZTSN2vl11collections9ListStoreIhLb1EEE", !8, i64 0}
!29 = !{!6, !10, i64 1336}
!30 = !{!10, !10, i64 0}
!31 = !{!7, !10, i64 176}
!32 = !{!7, !10, i64 160}
!33 = !{!6, !17, i64 248}
!34 = !{!35, !10, i64 24}
!35 = !{!"_ZTSN2vl6stream3lzw4CodeE", !11, i64 0, !10, i64 8, !17, i64 16, !10, i64 24, !36, i64 32}
!36 = !{!"_ZTSN2vl11collections13ByteObjectMapINS_6stream3lzw4CodeEEE", !8, i64 0, !17, i64 8}
!37 = !{!11, !11, i64 0}
!38 = !{!17, !17, i64 0}
!39 = !{!7, !10, i64 168}


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