; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/CPP/7zip/Compress (LzmaDecoder)

; 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.NCompress::NLzma::CDecoder" = type { %struct.ICompressCoder, %struct.ICompressSetDecoderProperties2, %struct.ICompressSetFinishMode, %struct.ICompressGetInStreamProcessedSize, %struct.ICompressSetBufSize, %struct.ICompressSetInStream, %struct.ICompressSetOutStreamSize, %struct.ISequentialInStream, %class.CMyUnknownImp, ptr, i32, i32, i32, i8, i8, i8, i64, i64, i64, i32, i32, i32, %struct.CLzmaDec, %class.CMyComPtr }
%struct.ICompressCoder = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressSetDecoderProperties2 = type { %struct.IUnknown }
%struct.ICompressSetFinishMode = type { %struct.IUnknown }
%struct.ICompressGetInStreamProcessedSize = type { %struct.IUnknown }
%struct.ICompressSetBufSize = type { %struct.IUnknown }
%struct.ICompressSetInStream = type { %struct.IUnknown }
%struct.ICompressSetOutStreamSize = type { %struct.IUnknown }
%struct.ISequentialInStream = type { %struct.IUnknown }
%class.CMyUnknownImp = type { i32 }
%struct.CLzmaDec = type { %struct._CLzmaProps, ptr, ptr, ptr, i64, i64, ptr, i32, i32, i32, i32, [4 x i32], i32, i32, i32, i32, [20 x i8] }
%struct._CLzmaProps = type { i8, i8, i8, i8, i32 }
%class.CMyComPtr = type { 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: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NLzma8CDecoder4ReadEPvjPj(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) unnamed_addr #1 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %23

21:                                               ; preds = %4
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %21, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !11
  %24 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 15
  %25 = load i8, ptr %24, align 2, !tbaa !13, !range !32, !noundef !33
  %26 = trunc i8 %25 to i1
  br i1 %26, label %27, label %46

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %28 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 16
  %29 = load i64, ptr %28, align 8, !tbaa !34
  %30 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 18
  %31 = load i64, ptr %30, align 8, !tbaa !35
  %32 = sub i64 %29, %31
  store i64 %32, ptr %11, align 8, !tbaa !36
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = load i64, ptr %11, align 8, !tbaa !36
  %36 = icmp uge i64 %34, %35
  br i1 %36, label %37, label %45

37:                                               ; preds = %27
  %38 = load i64, ptr %11, align 8, !tbaa !36
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %8, align 4, !tbaa !9
  %40 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 13
  %41 = load i8, ptr %40, align 4, !tbaa !37, !range !32, !noundef !33
  %42 = trunc i8 %41 to i1
  br i1 %42, label %43, label %44

43:                                               ; preds = %37
  store i32 1, ptr %10, align 4, !tbaa !11
  br label %44

44:                                               ; preds = %43, %37
  br label %45

45:                                               ; preds = %44, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %46

46:                                               ; preds = %45, %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %134, %46
  %48 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 10
  %49 = load i32, ptr %48, align 8, !tbaa !38
  %50 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 11
  %51 = load i32, ptr %50, align 4, !tbaa !39
  %52 = icmp eq i32 %49, %51
  br i1 %52, label %53, label %70

53:                                               ; preds = %47
  %54 = load i32, ptr %12, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %70

56:                                               ; preds = %53
  %57 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 11
  store i32 0, ptr %57, align 4, !tbaa !39
  %58 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 10
  store i32 0, ptr %58, align 8, !tbaa !38
  %59 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 23
  %60 = call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %59)
  %61 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 9
  %62 = load ptr, ptr %61, align 8, !tbaa !40
  %63 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 20
  %64 = load i32, ptr %63, align 4, !tbaa !41
  %65 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 11
  %66 = load ptr, ptr %60, align 8, !tbaa !42
  %67 = getelementptr inbounds ptr, ptr %66, i64 5
  %68 = load ptr, ptr %67, align 8
  %69 = call noundef i32 %68(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef %62, i32 noundef %64, ptr noundef %65)
  store i32 %69, ptr %12, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %56, %53, %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %71 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 11
  %72 = load i32, ptr %71, align 4, !tbaa !39
  %73 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 10
  %74 = load i32, ptr %73, align 8, !tbaa !38
  %75 = sub i32 %72, %74
  %76 = zext i32 %75 to i64
  store i64 %76, ptr %13, align 8, !tbaa !44
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = zext i32 %77 to i64
  store i64 %78, ptr %14, align 8, !tbaa !44
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %79 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 22
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 9
  %82 = load ptr, ptr %81, align 8, !tbaa !40
  %83 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 10
  %84 = load i32, ptr %83, align 8, !tbaa !38
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %82, i64 %85
  %87 = load i32, ptr %10, align 4, !tbaa !11
  %88 = call i32 @LzmaDec_DecodeToBuf(ptr noundef %79, ptr noundef %80, ptr noundef %14, ptr noundef %86, ptr noundef %13, i32 noundef %87, ptr noundef %15)
  store i32 %88, ptr %16, align 4, !tbaa !9
  %89 = load i32, ptr %15, align 4, !tbaa !45
  %90 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 12
  store i32 %89, ptr %90, align 8, !tbaa !46
  %91 = load i64, ptr %13, align 8, !tbaa !44
  %92 = trunc i64 %91 to i32
  %93 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 10
  %94 = load i32, ptr %93, align 8, !tbaa !38
  %95 = add i32 %94, %92
  store i32 %95, ptr %93, align 8, !tbaa !38
  %96 = load i64, ptr %13, align 8, !tbaa !44
  %97 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 17
  %98 = load i64, ptr %97, align 8, !tbaa !47
  %99 = add i64 %98, %96
  store i64 %99, ptr %97, align 8, !tbaa !47
  %100 = load i64, ptr %14, align 8, !tbaa !44
  %101 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %18, i32 0, i32 18
  %102 = load i64, ptr %101, align 8, !tbaa !35
  %103 = add i64 %102, %100
  store i64 %103, ptr %101, align 8, !tbaa !35
  %104 = load i64, ptr %14, align 8, !tbaa !44
  %105 = trunc i64 %104 to i32
  %106 = load i32, ptr %8, align 4, !tbaa !9
  %107 = sub i32 %106, %105
  store i32 %107, ptr %8, align 4, !tbaa !9
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load i64, ptr %14, align 8, !tbaa !44
  %110 = getelementptr inbounds i8, ptr %108, i64 %109
  store ptr %110, ptr %7, align 8, !tbaa !5
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %119

113:                                              ; preds = %70
  %114 = load i64, ptr %14, align 8, !tbaa !44
  %115 = trunc i64 %114 to i32
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = add i32 %117, %115
  store i32 %118, ptr %116, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %113, %70
  %120 = load i32, ptr %16, align 4, !tbaa !9
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %123

122:                                              ; preds = %119
  store i32 1, ptr %5, align 4
  store i32 1, ptr %17, align 4
  br label %132

123:                                              ; preds = %119
  %124 = load i64, ptr %13, align 8, !tbaa !44
  %125 = icmp eq i64 %124, 0
  br i1 %125, label %126, label %131

126:                                              ; preds = %123
  %127 = load i64, ptr %14, align 8, !tbaa !44
  %128 = icmp eq i64 %127, 0
  br i1 %128, label %129, label %131

129:                                              ; preds = %126
  %130 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %130, ptr %5, align 4
  store i32 1, ptr %17, align 4
  br label %132

131:                                              ; preds = %126, %123
  store i32 0, ptr %17, align 4
  br label %132

132:                                              ; preds = %131, %129, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  %133 = load i32, ptr %17, align 4
  switch i32 %133, label %135 [
    i32 0, label %134
  ]

134:                                              ; preds = %132
  br label %47, !llvm.loop !48

135:                                              ; preds = %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %136 = load i32, ptr %5, align 4
  ret i32 %136
}

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

declare i32 @LzmaDec_DecodeToBuf(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS15ELzmaFinishMode", !7, i64 0}
!13 = !{!14, !26, i64 94}
!14 = !{!"_ZTSN9NCompress5NLzma8CDecoderE", !15, i64 0, !17, i64 8, !18, i64 16, !19, i64 24, !20, i64 32, !21, i64 40, !22, i64 48, !23, i64 56, !24, i64 64, !6, i64 72, !10, i64 80, !10, i64 84, !25, i64 88, !26, i64 92, !26, i64 93, !26, i64 94, !27, i64 96, !27, i64 104, !27, i64 112, !10, i64 120, !10, i64 124, !10, i64 128, !28, i64 136, !31, i64 264}
!15 = !{!"_ZTS14ICompressCoder", !16, i64 0}
!16 = !{!"_ZTS8IUnknown"}
!17 = !{!"_ZTS30ICompressSetDecoderProperties2", !16, i64 0}
!18 = !{!"_ZTS22ICompressSetFinishMode", !16, i64 0}
!19 = !{!"_ZTS33ICompressGetInStreamProcessedSize", !16, i64 0}
!20 = !{!"_ZTS19ICompressSetBufSize", !16, i64 0}
!21 = !{!"_ZTS20ICompressSetInStream", !16, i64 0}
!22 = !{!"_ZTS25ICompressSetOutStreamSize", !16, i64 0}
!23 = !{!"_ZTS19ISequentialInStream", !16, i64 0}
!24 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!25 = !{!"_ZTS11ELzmaStatus", !7, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"long long", !7, i64 0}
!28 = !{!"_ZTS8CLzmaDec", !29, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !30, i64 32, !30, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !7, i64 72, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !7, i64 104}
!29 = !{!"_ZTS11_CLzmaProps", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4}
!30 = !{!"long", !7, i64 0}
!31 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !6, i64 0}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!14, !27, i64 96}
!35 = !{!14, !27, i64 112}
!36 = !{!27, !27, i64 0}
!37 = !{!14, !26, i64 92}
!38 = !{!14, !10, i64 80}
!39 = !{!14, !10, i64 84}
!40 = !{!14, !6, i64 72}
!41 = !{!14, !10, i64 124}
!42 = !{!43, !43, i64 0}
!43 = !{!"vtable pointer", !8, i64 0}
!44 = !{!30, !30, i64 0}
!45 = !{!25, !25, i64 0}
!46 = !{!14, !25, i64 88}
!47 = !{!14, !27, i64 104}
!48 = distinct !{!48, !49}
!49 = !{!"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 uwtable
define dso_local noundef i32 @_ZN9NCompress5NLzma8CDecoder4ReadEPvjPj(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) unnamed_addr #1 align 2 {
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %9, label %8

8:                                                ; preds = %4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %8, %4
  %10 = getelementptr inbounds i8, ptr %0, i64 94
  %11 = load i8, ptr %10, align 2, !tbaa !9, !range !29, !noundef !30
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %13, label %24

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  %15 = load i64, ptr %14, align 8, !tbaa !31
  %16 = getelementptr inbounds i8, ptr %0, i64 112
  %17 = load i64, ptr %16, align 8, !tbaa !32
  %18 = sub i64 %15, %17
  %19 = zext i32 %2 to i64
  %.not31 = icmp ugt i64 %18, %19
  br i1 %.not31, label %24, label %20

20:                                               ; preds = %13
  %21 = trunc nuw i64 %18 to i32
  %22 = getelementptr inbounds i8, ptr %0, i64 92
  %23 = load i8, ptr %22, align 4, !tbaa !33, !range !29, !noundef !30
  %spec.select = zext nneg i8 %23 to i32
  br label %24

24:                                               ; preds = %20, %13, %9
  %.127 = phi i32 [ %2, %9 ], [ %2, %13 ], [ %21, %20 ]
  %.125 = phi i32 [ 0, %9 ], [ 0, %13 ], [ %spec.select, %20 ]
  %25 = getelementptr inbounds i8, ptr %0, i64 80
  %26 = getelementptr inbounds i8, ptr %0, i64 84
  %27 = getelementptr inbounds i8, ptr %0, i64 264
  %28 = getelementptr inbounds i8, ptr %0, i64 72
  %29 = getelementptr inbounds i8, ptr %0, i64 124
  %30 = getelementptr inbounds i8, ptr %0, i64 136
  %31 = getelementptr inbounds i8, ptr %0, i64 88
  %32 = getelementptr inbounds i8, ptr %0, i64 104
  %33 = getelementptr inbounds i8, ptr %0, i64 112
  br label %34

34:                                               ; preds = %74, %24
  %.2 = phi i32 [ %.127, %24 ], [ %68, %74 ]
  %.023 = phi ptr [ %1, %24 ], [ %69, %74 ]
  %.021 = phi i32 [ 0, %24 ], [ %.122, %74 ]
  %35 = load i32, ptr %25, align 8, !tbaa !34
  %36 = load i32, ptr %26, align 4, !tbaa !35
  %37 = icmp eq i32 %35, %36
  %38 = icmp eq i32 %.021, 0
  %or.cond = select i1 %37, i1 %38, i1 false
  br i1 %or.cond, label %39, label %47

39:                                               ; preds = %34
  store i32 0, ptr %26, align 4, !tbaa !35
  store i32 0, ptr %25, align 8, !tbaa !34
  %40 = call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %27)
  %41 = load ptr, ptr %28, align 8, !tbaa !36
  %42 = load i32, ptr %29, align 4, !tbaa !37
  %43 = load ptr, ptr %40, align 8, !tbaa !38
  %44 = getelementptr inbounds i8, ptr %43, i64 40
  %45 = load ptr, ptr %44, align 8
  %46 = call noundef i32 %45(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef %41, i32 noundef %42, ptr noundef nonnull %26)
  %.pre = load i32, ptr %26, align 4, !tbaa !35
  %.pre38 = load i32, ptr %25, align 8, !tbaa !34
  br label %47

47:                                               ; preds = %39, %34
  %48 = phi i32 [ %.pre38, %39 ], [ %35, %34 ]
  %49 = phi i32 [ %.pre, %39 ], [ %36, %34 ]
  %.122 = phi i32 [ %46, %39 ], [ %.021, %34 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %50 = sub i32 %49, %48
  %51 = zext i32 %50 to i64
  store i64 %51, ptr %5, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %52 = zext i32 %.2 to i64
  store i64 %52, ptr %6, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %53 = load ptr, ptr %28, align 8, !tbaa !36
  %54 = zext i32 %48 to i64
  %55 = getelementptr inbounds i8, ptr %53, i64 %54
  %56 = call i32 @LzmaDec_DecodeToBuf(ptr noundef nonnull %30, ptr noundef %.023, ptr noundef nonnull %6, ptr noundef %55, ptr noundef nonnull %5, i32 noundef %.125, ptr noundef nonnull %7)
  %57 = load i32, ptr %7, align 4, !tbaa !41
  store i32 %57, ptr %31, align 8, !tbaa !42
  %58 = load i64, ptr %5, align 8, !tbaa !40
  %59 = trunc i64 %58 to i32
  %60 = load i32, ptr %25, align 8, !tbaa !34
  %61 = add i32 %60, %59
  store i32 %61, ptr %25, align 8, !tbaa !34
  %62 = load i64, ptr %32, align 8, !tbaa !43
  %63 = add i64 %62, %58
  store i64 %63, ptr %32, align 8, !tbaa !43
  %64 = load i64, ptr %6, align 8
  %65 = load i64, ptr %33, align 8, !tbaa !32
  %66 = add i64 %65, %64
  store i64 %66, ptr %33, align 8, !tbaa !32
  %67 = trunc i64 %64 to i32
  %68 = sub i32 %.2, %67
  %69 = getelementptr inbounds i8, ptr %.023, i64 %64
  br i1 %.not, label %73, label %70

70:                                               ; preds = %47
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = add i32 %71, %67
  store i32 %72, ptr %3, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %70, %47
  %.not32 = icmp eq i32 %56, 0
  br i1 %.not32, label %74, label %.thread

.thread:                                          ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %.loopexit

74:                                               ; preds = %73
  %75 = icmp ne i64 %58, 0
  %76 = icmp ne i64 %64, 0
  %or.cond3.not = select i1 %75, i1 true, i1 %76
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br i1 %or.cond3.not, label %34, label %.loopexit, !llvm.loop !44

.loopexit:                                        ; preds = %74, %.thread
  %.135 = phi i32 [ 1, %.thread ], [ %.122, %74 ]
  ret i32 %.135
}

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

declare i32 @LzmaDec_DecodeToBuf(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !23, i64 94}
!10 = !{!"_ZTSN9NCompress5NLzma8CDecoderE", !11, i64 0, !13, i64 8, !14, i64 16, !15, i64 24, !16, i64 32, !17, i64 40, !18, i64 48, !19, i64 56, !20, i64 64, !21, i64 72, !6, i64 80, !6, i64 84, !22, i64 88, !23, i64 92, !23, i64 93, !23, i64 94, !24, i64 96, !24, i64 104, !24, i64 112, !6, i64 120, !6, i64 124, !6, i64 128, !25, i64 136, !28, i64 264}
!11 = !{!"_ZTS14ICompressCoder", !12, i64 0}
!12 = !{!"_ZTS8IUnknown"}
!13 = !{!"_ZTS30ICompressSetDecoderProperties2", !12, i64 0}
!14 = !{!"_ZTS22ICompressSetFinishMode", !12, i64 0}
!15 = !{!"_ZTS33ICompressGetInStreamProcessedSize", !12, i64 0}
!16 = !{!"_ZTS19ICompressSetBufSize", !12, i64 0}
!17 = !{!"_ZTS20ICompressSetInStream", !12, i64 0}
!18 = !{!"_ZTS25ICompressSetOutStreamSize", !12, i64 0}
!19 = !{!"_ZTS19ISequentialInStream", !12, i64 0}
!20 = !{!"_ZTS13CMyUnknownImp", !6, i64 0}
!21 = !{!"any pointer", !7, i64 0}
!22 = !{!"_ZTS11ELzmaStatus", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"long long", !7, i64 0}
!25 = !{!"_ZTS8CLzmaDec", !26, i64 0, !21, i64 8, !21, i64 16, !21, i64 24, !27, i64 32, !27, i64 40, !21, i64 48, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !7, i64 72, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !7, i64 104}
!26 = !{!"_ZTS11_CLzmaProps", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 4}
!27 = !{!"long", !7, i64 0}
!28 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !21, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!10, !24, i64 96}
!32 = !{!10, !24, i64 112}
!33 = !{!10, !23, i64 92}
!34 = !{!10, !6, i64 80}
!35 = !{!10, !6, i64 84}
!36 = !{!10, !21, i64 72}
!37 = !{!10, !6, i64 124}
!38 = !{!39, !39, i64 0}
!39 = !{!"vtable pointer", !8, i64 0}
!40 = !{!27, !27, i64 0}
!41 = !{!22, !22, i64 0}
!42 = !{!10, !22, i64 88}
!43 = !{!10, !24, i64 104}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}


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