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

; 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::MemoryStream" = type { %"class.vl::Object", i64, ptr, i64, i64, i64, %"class.vl::stream::IStream" }
%"class.vl::Object" = type { ptr }
%"class.vl::stream::IStream" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"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::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::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" }
%"class.vl::stream::DecoderStream" = type { %"class.vl::stream::IStream", ptr, ptr, i64 }

@_ZN2vl7parsing3xml12parserBufferE = external dso_local global [5 x ptr], align 16

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream13DecoderStreamC1ERNS0_7IStreamERNS0_8IDecoderE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream12MemoryStreamC1El(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream12MemoryStream13SeekFromBeginEl(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) unnamed_addr #1 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl7parsing3xml18XmlGetParserBufferERNS_6stream12MemoryStreamE(ptr noundef nonnull align 8 dereferenceable(48) %0) #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.vl::stream::MemoryStream", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.vl::stream::LzwDecoder", align 8
  %9 = alloca %"class.vl::stream::DecoderStream", align 8
  %10 = alloca %"class.vl::collections::Array.39", align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %3) #3
  call void @_ZN2vl6stream12MemoryStreamC1El(ptr noundef nonnull align 8 dereferenceable(48) %3, i64 noundef 65536)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  store i64 0, ptr %4, align 8, !tbaa !9
  br label %13

13:                                               ; preds = %28, %1
  %14 = load i64, ptr %4, align 8, !tbaa !9
  %15 = icmp slt i64 %14, 5
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  br label %35

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %18 = load i64, ptr %4, align 8, !tbaa !9
  %19 = icmp eq i64 %18, 4
  %20 = zext i1 %19 to i64
  %21 = select i1 %19, i64 821, i64 1024
  store i64 %21, ptr %5, align 8, !tbaa !9
  %22 = load i64, ptr %4, align 8, !tbaa !9
  %23 = getelementptr inbounds [5 x ptr], ptr @_ZN2vl7parsing3xml12parserBufferE, i64 0, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = load i64, ptr %5, align 8, !tbaa !9
  %26 = invoke noundef i64 @_ZN2vl6stream12MemoryStream5WriteEPvl(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef %24, i64 noundef %25)
          to label %27 unwind label %31

27:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br label %28

28:                                               ; preds = %27
  %29 = load i64, ptr %4, align 8, !tbaa !9
  %30 = add nsw i64 %29, 1
  store i64 %30, ptr %4, align 8, !tbaa !9
  br label %13, !llvm.loop !11

31:                                               ; preds = %17
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %6, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  br label %101

35:                                               ; preds = %16
  invoke void @_ZN2vl6stream12MemoryStream13SeekFromBeginEl(ptr noundef nonnull align 8 dereferenceable(48) %3, i64 noundef 0)
          to label %36 unwind label %54

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 1344, ptr %8) #3
  invoke void @_ZN2vl6stream10LzwDecoderC1Ev(ptr noundef nonnull align 8 dereferenceable(1344) %8)
          to label %37 unwind label %58

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #3
  %38 = load ptr, ptr %3, align 8, !tbaa !13
  %39 = getelementptr i8, ptr %38, i64 -24
  %40 = load i64, ptr %39, align 8
  %41 = getelementptr inbounds i8, ptr %3, i64 %40
  %42 = getelementptr inbounds i8, ptr %8, i64 184
  invoke void @_ZN2vl6stream13DecoderStreamC1ERNS0_7IStreamERNS0_8IDecoderE(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull align 8 dereferenceable(8) %42)
          to label %43 unwind label %62

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #3
  invoke void @_ZN2vl11collections5ArrayIhhEC1El(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 65536)
          to label %44 unwind label %66

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %86, %44
  br label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %47 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 0)
          to label %48 unwind label %70

48:                                               ; preds = %46
  %49 = invoke noundef i64 @_ZN2vl6stream13DecoderStream4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef %47, i64 noundef 65536)
          to label %50 unwind label %70

50:                                               ; preds = %48
  store i64 %49, ptr %11, align 8, !tbaa !9
  %51 = load i64, ptr %11, align 8, !tbaa !9
  %52 = icmp eq i64 %51, 0
  br i1 %52, label %53, label %74

53:                                               ; preds = %50
  store i32 6, ptr %12, align 4
  br label %84

54:                                               ; preds = %35
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %6, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %7, align 4
  br label %101

58:                                               ; preds = %36
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %6, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %7, align 4
  br label %100

62:                                               ; preds = %37
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %6, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %7, align 4
  br label %99

66:                                               ; preds = %43
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %6, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %7, align 4
  br label %98

70:                                               ; preds = %77, %74, %48, %46
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %6, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %97

74:                                               ; preds = %50
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 0)
          to label %77 unwind label %70

77:                                               ; preds = %74
  %78 = load i64, ptr %11, align 8, !tbaa !9
  %79 = load ptr, ptr %75, align 8, !tbaa !13
  %80 = getelementptr inbounds ptr, ptr %79, i64 15
  %81 = load ptr, ptr %80, align 8
  %82 = invoke noundef i64 %81(ptr noundef nonnull align 8 dereferenceable(48) %75, ptr noundef %76, i64 noundef %78)
          to label %83 unwind label %70

83:                                               ; preds = %77
  store i32 0, ptr %12, align 4
  br label %84

84:                                               ; preds = %83, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %85 = load i32, ptr %12, align 4
  switch i32 %85, label %107 [
    i32 0, label %86
    i32 6, label %87
  ]

86:                                               ; preds = %84
  br label %45, !llvm.loop !15

87:                                               ; preds = %84
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = load ptr, ptr %88, align 8, !tbaa !13
  %90 = getelementptr inbounds ptr, ptr %89, i64 12
  %91 = load ptr, ptr %90, align 8
  invoke void %91(ptr noundef nonnull align 8 dereferenceable(48) %88, i64 noundef 0)
          to label %92 unwind label %93

92:                                               ; preds = %87
  call void @_ZN2vl11collections5ArrayIhhED1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #3
  call void @_ZN2vl6stream13DecoderStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  call void @_ZN2vl6stream10LzwDecoderD1Ev(ptr noundef nonnull align 8 dereferenceable(1344) %8) #3
  call void @llvm.lifetime.end.p0(i64 1344, ptr %8) #3
  call void @_ZN2vl6stream12MemoryStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #3
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #3
  ret void

93:                                               ; preds = %87
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %6, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %7, align 4
  br label %97

97:                                               ; preds = %93, %70
  call void @_ZN2vl11collections5ArrayIhhED1Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #3
  br label %98

98:                                               ; preds = %97, %66
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #3
  call void @_ZN2vl6stream13DecoderStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  br label %99

99:                                               ; preds = %98, %62
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  call void @_ZN2vl6stream10LzwDecoderD1Ev(ptr noundef nonnull align 8 dereferenceable(1344) %8) #3
  br label %100

100:                                              ; preds = %99, %58
  call void @llvm.lifetime.end.p0(i64 1344, ptr %8) #3
  br label %101

101:                                              ; preds = %100, %54, %31
  call void @_ZN2vl6stream12MemoryStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #3
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #3
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %6, align 8
  %104 = load i32, ptr %7, align 4
  %105 = insertvalue { ptr, i32 } poison, ptr %103, 0
  %106 = insertvalue { ptr, i32 } %105, i32 %104, 1
  resume { ptr, i32 } %106

107:                                              ; preds = %84
  unreachable
}

declare void @_ZN2vl6stream10LzwDecoderC1Ev(ptr)

declare void @_ZN2vl6stream10LzwDecoderD1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = !{!"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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !12}


; 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.vl::stream::MemoryStream" = type { %"class.vl::Object", i64, ptr, i64, i64, i64, %"class.vl::stream::IStream" }
%"class.vl::Object" = type { ptr }
%"class.vl::stream::IStream" = type { %"class.vl::Interface" }
%"class.vl::Interface" = type { ptr }
%"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::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::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" }
%"class.vl::stream::DecoderStream" = type { %"class.vl::stream::IStream", ptr, ptr, i64 }

@_ZN2vl7parsing3xml12parserBufferE = external dso_local local_unnamed_addr global [5 x ptr], align 16

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream13DecoderStreamC1ERNS0_7IStreamERNS0_8IDecoderE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream12MemoryStreamC1El(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2vl6stream12MemoryStream13SeekFromBeginEl(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) unnamed_addr #1 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2vl7parsing3xml18XmlGetParserBufferERNS_6stream12MemoryStreamE(ptr noundef nonnull align 8 dereferenceable(48) %0) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.vl::stream::MemoryStream", align 8
  %3 = alloca %"class.vl::stream::LzwDecoder", align 8
  %4 = alloca %"class.vl::stream::DecoderStream", align 8
  %5 = alloca %"class.vl::collections::Array.39", align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #3
  call void @_ZN2vl6stream12MemoryStreamC1El(ptr noundef nonnull align 8 dereferenceable(48) %2, i64 noundef 65536)
  %6 = load ptr, ptr @_ZN2vl7parsing3xml12parserBufferE, align 16, !tbaa !5
  %7 = invoke noundef i64 @_ZN2vl6stream12MemoryStream5WriteEPvl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef %6, i64 noundef 1024)
          to label %8 unwind label %21

8:                                                ; preds = %1
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2vl7parsing3xml12parserBufferE, i64 8), align 8, !tbaa !5
  %10 = invoke noundef i64 @_ZN2vl6stream12MemoryStream5WriteEPvl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef %9, i64 noundef 1024)
          to label %11 unwind label %21

11:                                               ; preds = %8
  %12 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2vl7parsing3xml12parserBufferE, i64 16), align 16, !tbaa !5
  %13 = invoke noundef i64 @_ZN2vl6stream12MemoryStream5WriteEPvl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef %12, i64 noundef 1024)
          to label %14 unwind label %21

14:                                               ; preds = %11
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2vl7parsing3xml12parserBufferE, i64 24), align 8, !tbaa !5
  %16 = invoke noundef i64 @_ZN2vl6stream12MemoryStream5WriteEPvl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef %15, i64 noundef 1024)
          to label %17 unwind label %21

17:                                               ; preds = %14
  %18 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2vl7parsing3xml12parserBufferE, i64 32), align 16, !tbaa !5
  %19 = invoke noundef i64 @_ZN2vl6stream12MemoryStream5WriteEPvl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef %18, i64 noundef 821)
          to label %20 unwind label %21

20:                                               ; preds = %17
  invoke void @_ZN2vl6stream12MemoryStream13SeekFromBeginEl(ptr noundef nonnull align 8 dereferenceable(48) %2, i64 noundef 0)
          to label %23 unwind label %36

21:                                               ; preds = %17, %14, %11, %8, %1
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %64

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 1344, ptr nonnull %3) #3
  invoke void @_ZN2vl6stream10LzwDecoderC1Ev(ptr noundef nonnull align 8 dereferenceable(1344) %3)
          to label %24 unwind label %38

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  %25 = load ptr, ptr %2, align 8, !tbaa !9
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr %2, i64 %27
  %29 = getelementptr inbounds i8, ptr %3, i64 184
  invoke void @_ZN2vl6stream13DecoderStreamC1ERNS0_7IStreamERNS0_8IDecoderE(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %30 unwind label %40

30:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  invoke void @_ZN2vl11collections5ArrayIhhEC1El(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 65536)
          to label %.preheader unwind label %42

.preheader:                                       ; preds = %30, %48
  %31 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0)
          to label %32 unwind label %44

32:                                               ; preds = %.preheader
  %33 = invoke noundef i64 @_ZN2vl6stream13DecoderStream4ReadEPvl(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull %31, i64 noundef 65536)
          to label %34 unwind label %44

34:                                               ; preds = %32
  %35 = icmp eq i64 %33, 0
  br i1 %35, label %53, label %46

36:                                               ; preds = %20
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %64

38:                                               ; preds = %23
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %63

40:                                               ; preds = %24
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %62

42:                                               ; preds = %30
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %61

44:                                               ; preds = %48, %46, %32, %.preheader
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %60

46:                                               ; preds = %34
  %47 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN2vl11collections5ArrayIhhEixEl(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0)
          to label %48 unwind label %44

48:                                               ; preds = %46
  %49 = load ptr, ptr %0, align 8, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %49, i64 120
  %51 = load ptr, ptr %50, align 8
  %52 = invoke noundef i64 %51(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull %47, i64 noundef %33)
          to label %.preheader unwind label %44

53:                                               ; preds = %34
  %54 = load ptr, ptr %0, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %54, i64 96
  %56 = load ptr, ptr %55, align 8
  invoke void %56(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef 0)
          to label %57 unwind label %58

57:                                               ; preds = %53
  call void @_ZN2vl11collections5ArrayIhhED1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZN2vl6stream13DecoderStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  call void @_ZN2vl6stream10LzwDecoderD1Ev(ptr noundef nonnull align 8 dereferenceable(1344) %3) #3
  call void @llvm.lifetime.end.p0(i64 1344, ptr nonnull %3) #3
  call void @_ZN2vl6stream12MemoryStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #3
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #3
  ret void

58:                                               ; preds = %53
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %60

60:                                               ; preds = %58, %44
  %.pn = phi { ptr, i32 } [ %59, %58 ], [ %45, %44 ]
  call void @_ZN2vl11collections5ArrayIhhED1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  br label %61

61:                                               ; preds = %60, %42
  %.pn.pn = phi { ptr, i32 } [ %.pn, %60 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZN2vl6stream13DecoderStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #3
  br label %62

62:                                               ; preds = %61, %40
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %61 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  call void @_ZN2vl6stream10LzwDecoderD1Ev(ptr noundef nonnull align 8 dereferenceable(1344) %3) #3
  br label %63

63:                                               ; preds = %62, %38
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %62 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 1344, ptr nonnull %3) #3
  br label %64

64:                                               ; preds = %63, %36, %21
  %.pn23 = phi { ptr, i32 } [ %22, %21 ], [ %.pn.pn.pn.pn, %63 ], [ %37, %36 ]
  call void @_ZN2vl6stream12MemoryStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #3
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #3
  resume { ptr, i32 } %.pn23
}

declare void @_ZN2vl6stream10LzwDecoderC1Ev(ptr) local_unnamed_addr

declare void @_ZN2vl6stream10LzwDecoderD1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass