; 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: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NLzma8CDecoder17CreateInputBufferEv(ptr noundef nonnull align 8 dereferenceable(272)) #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NLzma8CDecoder19ReadFromInputStreamEPvjPj(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #0 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 i32, align 4
  %12 = alloca i32, align 4
  %13 = 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
  %14 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %15 = call noundef i32 @_ZN9NCompress5NLzma8CDecoder17CreateInputBufferEv(ptr noundef nonnull align 8 dereferenceable(272) %14)
  store i32 %15, ptr %10, align 4, !tbaa !9
  %16 = load i32, ptr %10, align 4, !tbaa !9
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %20

18:                                               ; preds = %4
  %19 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %19, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %21

20:                                               ; preds = %4
  store i32 0, ptr %11, align 4
  br label %21

21:                                               ; preds = %20, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %22 = load i32, ptr %11, align 4
  switch i32 %22, label %110 [
    i32 0, label %23
    i32 1, label %108
  ]

23:                                               ; preds = %21
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %28

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

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

29:                                               ; preds = %105, %28
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %106

32:                                               ; preds = %29
  %33 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 10
  %34 = load i32, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 11
  %36 = load i32, ptr %35, align 4, !tbaa !30
  %37 = icmp eq i32 %34, %36
  br i1 %37, label %38, label %61

38:                                               ; preds = %32
  %39 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 11
  store i32 0, ptr %39, align 4, !tbaa !30
  %40 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 10
  store i32 0, ptr %40, align 8, !tbaa !11
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %55

43:                                               ; preds = %38
  %44 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 23
  %45 = call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 9
  %47 = load ptr, ptr %46, align 8, !tbaa !31
  %48 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 20
  %49 = load i32, ptr %48, align 4, !tbaa !32
  %50 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 11
  %51 = load ptr, ptr %45, align 8, !tbaa !33
  %52 = getelementptr inbounds ptr, ptr %51, i64 5
  %53 = load ptr, ptr %52, align 8
  %54 = call noundef i32 %53(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef %47, i32 noundef %49, ptr noundef %50)
  store i32 %54, ptr %12, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %43, %38
  %56 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 11
  %57 = load i32, ptr %56, align 4, !tbaa !30
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %55
  br label %106

60:                                               ; preds = %55
  br label %61

61:                                               ; preds = %60, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %62 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 11
  %63 = load i32, ptr %62, align 4, !tbaa !30
  %64 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 10
  %65 = load i32, ptr %64, align 8, !tbaa !11
  %66 = sub i32 %63, %65
  store i32 %66, ptr %13, align 4, !tbaa !9
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = icmp ugt i32 %67, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %61
  %71 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %71, ptr %13, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %70, %61
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 9
  %75 = load ptr, ptr %74, align 8, !tbaa !31
  %76 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 10
  %77 = load i32, ptr %76, align 8, !tbaa !11
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %75, i64 %78
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %73, ptr align 1 %79, i64 %81, i1 false)
  %82 = load i32, ptr %13, align 4, !tbaa !9
  %83 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 10
  %84 = load i32, ptr %83, align 8, !tbaa !11
  %85 = add i32 %84, %82
  store i32 %85, ptr %83, align 8, !tbaa !11
  %86 = load i32, ptr %13, align 4, !tbaa !9
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds %"class.NCompress::NLzma::CDecoder", ptr %14, i32 0, i32 17
  %89 = load i64, ptr %88, align 8, !tbaa !35
  %90 = add i64 %89, %87
  store i64 %90, ptr %88, align 8, !tbaa !35
  %91 = load i32, ptr %13, align 4, !tbaa !9
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = sub i32 %92, %91
  store i32 %93, ptr %8, align 4, !tbaa !9
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load i32, ptr %13, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %94, i64 %96
  store ptr %97, ptr %7, align 8, !tbaa !5
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = icmp ne ptr %98, null
  br i1 %99, label %100, label %105

100:                                              ; preds = %72
  %101 = load i32, ptr %13, align 4, !tbaa !9
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = add i32 %103, %101
  store i32 %104, ptr %102, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %100, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %29, !llvm.loop !36

106:                                              ; preds = %59, %29
  %107 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %107, ptr %5, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %108

108:                                              ; preds = %106, %21
  %109 = load i32, ptr %5, align 4
  ret i32 %109

110:                                              ; preds = %21
  unreachable
}

; 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) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 80}
!12 = !{!"_ZTSN9NCompress5NLzma8CDecoderE", !13, i64 0, !15, i64 8, !16, i64 16, !17, i64 24, !18, i64 32, !19, i64 40, !20, i64 48, !21, i64 56, !22, i64 64, !6, i64 72, !10, i64 80, !10, i64 84, !23, i64 88, !24, i64 92, !24, i64 93, !24, i64 94, !25, i64 96, !25, i64 104, !25, i64 112, !10, i64 120, !10, i64 124, !10, i64 128, !26, i64 136, !29, i64 264}
!13 = !{!"_ZTS14ICompressCoder", !14, i64 0}
!14 = !{!"_ZTS8IUnknown"}
!15 = !{!"_ZTS30ICompressSetDecoderProperties2", !14, i64 0}
!16 = !{!"_ZTS22ICompressSetFinishMode", !14, i64 0}
!17 = !{!"_ZTS33ICompressGetInStreamProcessedSize", !14, i64 0}
!18 = !{!"_ZTS19ICompressSetBufSize", !14, i64 0}
!19 = !{!"_ZTS20ICompressSetInStream", !14, i64 0}
!20 = !{!"_ZTS25ICompressSetOutStreamSize", !14, i64 0}
!21 = !{!"_ZTS19ISequentialInStream", !14, i64 0}
!22 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!23 = !{!"_ZTS11ELzmaStatus", !7, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"long long", !7, i64 0}
!26 = !{!"_ZTS8CLzmaDec", !27, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !28, i64 32, !28, 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}
!27 = !{!"_ZTS11_CLzmaProps", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4}
!28 = !{!"long", !7, i64 0}
!29 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !6, i64 0}
!30 = !{!12, !10, i64 84}
!31 = !{!12, !6, i64 72}
!32 = !{!12, !10, i64 124}
!33 = !{!34, !34, i64 0}
!34 = !{!"vtable pointer", !8, i64 0}
!35 = !{!12, !25, i64 104}
!36 = distinct !{!36, !37}
!37 = !{!"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 uwtable
declare dso_local noundef i32 @_ZN9NCompress5NLzma8CDecoder17CreateInputBufferEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NLzma8CDecoder19ReadFromInputStreamEPvjPj(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr nocapture noundef writeonly %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 align 2 {
  %5 = tail call noundef i32 @_ZN9NCompress5NLzma8CDecoder17CreateInputBufferEv(ptr noundef nonnull align 8 dereferenceable(272) %0)
  %.not.not = icmp eq i32 %5, 0
  br i1 %.not.not, label %6, label %.thread

6:                                                ; preds = %4
  %.not32 = icmp eq ptr %3, null
  br i1 %.not32, label %7, label %.thread50

7:                                                ; preds = %6
  %8 = getelementptr inbounds i8, ptr %0, i64 264
  %.not3335 = icmp eq i32 %2, 0
  br i1 %.not3335, label %.thread, label %.lr.ph.split.us.preheader

.thread50:                                        ; preds = %6
  store i32 0, ptr %3, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 264
  %.not333551 = icmp eq i32 %2, 0
  br i1 %.not333551, label %.thread, label %.lr.ph.split.preheader

.lr.ph.split.preheader:                           ; preds = %.thread50
  %10 = getelementptr inbounds i8, ptr %0, i64 80
  %11 = getelementptr inbounds i8, ptr %0, i64 84
  %12 = getelementptr inbounds i8, ptr %0, i64 72
  %13 = getelementptr inbounds i8, ptr %0, i64 124
  %14 = getelementptr inbounds i8, ptr %0, i64 104
  br label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %7
  %15 = getelementptr inbounds i8, ptr %0, i64 80
  %16 = getelementptr inbounds i8, ptr %0, i64 84
  %17 = getelementptr inbounds i8, ptr %0, i64 72
  %18 = getelementptr inbounds i8, ptr %0, i64 124
  %19 = getelementptr inbounds i8, ptr %0, i64 104
  %.pre47 = load i32, ptr %15, align 8, !tbaa !9
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader, %34
  %20 = phi i32 [ %43, %34 ], [ %.pre47, %.lr.ph.split.us.preheader ]
  %.02338.us = phi i32 [ %.2.us, %34 ], [ 0, %.lr.ph.split.us.preheader ]
  %.02737.us = phi ptr [ %47, %34 ], [ %1, %.lr.ph.split.us.preheader ]
  %.02836.us = phi i32 [ %46, %34 ], [ %2, %.lr.ph.split.us.preheader ]
  %21 = load i32, ptr %16, align 4, !tbaa !29
  %22 = icmp eq i32 %20, %21
  br i1 %22, label %23, label %34

23:                                               ; preds = %.lr.ph.split.us
  store i32 0, ptr %16, align 4, !tbaa !29
  store i32 0, ptr %15, align 8, !tbaa !9
  %24 = icmp eq i32 %.02338.us, 0
  br i1 %24, label %25, label %.thread

25:                                               ; preds = %23
  %26 = tail call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %27 = load ptr, ptr %17, align 8, !tbaa !30
  %28 = load i32, ptr %18, align 4, !tbaa !31
  %29 = load ptr, ptr %26, align 8, !tbaa !32
  %30 = getelementptr inbounds i8, ptr %29, i64 40
  %31 = load ptr, ptr %30, align 8
  %32 = tail call noundef i32 %31(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef %27, i32 noundef %28, ptr noundef nonnull %16)
  %.pr.us = load i32, ptr %16, align 4, !tbaa !29
  %33 = icmp eq i32 %.pr.us, 0
  br i1 %33, label %.thread, label %._crit_edge48

._crit_edge48:                                    ; preds = %25
  %.pre49 = load i32, ptr %15, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %._crit_edge48, %.lr.ph.split.us
  %35 = phi i32 [ %.pre49, %._crit_edge48 ], [ %20, %.lr.ph.split.us ]
  %36 = phi i32 [ %.pr.us, %._crit_edge48 ], [ %21, %.lr.ph.split.us ]
  %.2.us = phi i32 [ %32, %._crit_edge48 ], [ %.02338.us, %.lr.ph.split.us ]
  %37 = sub i32 %36, %35
  %spec.select.us = tail call i32 @llvm.umin.i32(i32 %37, i32 %.02836.us)
  %38 = load ptr, ptr %17, align 8, !tbaa !30
  %39 = zext i32 %35 to i64
  %40 = getelementptr inbounds i8, ptr %38, i64 %39
  %41 = zext i32 %spec.select.us to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.02737.us, ptr align 1 %40, i64 %41, i1 false)
  %42 = load i32, ptr %15, align 8, !tbaa !9
  %43 = add i32 %42, %spec.select.us
  store i32 %43, ptr %15, align 8, !tbaa !9
  %44 = load i64, ptr %19, align 8, !tbaa !34
  %45 = add i64 %44, %41
  store i64 %45, ptr %19, align 8, !tbaa !34
  %46 = sub i32 %.02836.us, %spec.select.us
  %47 = getelementptr inbounds i8, ptr %.02737.us, i64 %41
  %.not33.us = icmp eq i32 %46, 0
  br i1 %.not33.us, label %.thread, label %.lr.ph.split.us, !llvm.loop !35

.lr.ph.split:                                     ; preds = %.lr.ph.split.preheader, %62
  %.02338 = phi i32 [ %.2, %62 ], [ 0, %.lr.ph.split.preheader ]
  %.02737 = phi ptr [ %75, %62 ], [ %1, %.lr.ph.split.preheader ]
  %.02836 = phi i32 [ %74, %62 ], [ %2, %.lr.ph.split.preheader ]
  %48 = load i32, ptr %10, align 8, !tbaa !9
  %49 = load i32, ptr %11, align 4, !tbaa !29
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %51, label %62

51:                                               ; preds = %.lr.ph.split
  store i32 0, ptr %11, align 4, !tbaa !29
  store i32 0, ptr %10, align 8, !tbaa !9
  %52 = icmp eq i32 %.02338, 0
  br i1 %52, label %53, label %.thread

53:                                               ; preds = %51
  %54 = tail call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %55 = load ptr, ptr %12, align 8, !tbaa !30
  %56 = load i32, ptr %13, align 4, !tbaa !31
  %57 = load ptr, ptr %54, align 8, !tbaa !32
  %58 = getelementptr inbounds i8, ptr %57, i64 40
  %59 = load ptr, ptr %58, align 8
  %60 = tail call noundef i32 %59(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef %55, i32 noundef %56, ptr noundef nonnull %11)
  %.pr = load i32, ptr %11, align 4, !tbaa !29
  %61 = icmp eq i32 %.pr, 0
  br i1 %61, label %.thread, label %._crit_edge

._crit_edge:                                      ; preds = %53
  %.pre = load i32, ptr %10, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %._crit_edge, %.lr.ph.split
  %63 = phi i32 [ %.pre, %._crit_edge ], [ %48, %.lr.ph.split ]
  %64 = phi i32 [ %.pr, %._crit_edge ], [ %49, %.lr.ph.split ]
  %.2 = phi i32 [ %60, %._crit_edge ], [ %.02338, %.lr.ph.split ]
  %65 = sub i32 %64, %63
  %spec.select = tail call i32 @llvm.umin.i32(i32 %65, i32 %.02836)
  %66 = load ptr, ptr %12, align 8, !tbaa !30
  %67 = zext i32 %63 to i64
  %68 = getelementptr inbounds i8, ptr %66, i64 %67
  %69 = zext i32 %spec.select to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.02737, ptr align 1 %68, i64 %69, i1 false)
  %70 = load i32, ptr %10, align 8, !tbaa !9
  %71 = add i32 %70, %spec.select
  store i32 %71, ptr %10, align 8, !tbaa !9
  %72 = load i64, ptr %14, align 8, !tbaa !34
  %73 = add i64 %72, %69
  store i64 %73, ptr %14, align 8, !tbaa !34
  %74 = sub i32 %.02836, %spec.select
  %75 = getelementptr inbounds i8, ptr %.02737, i64 %69
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = add i32 %76, %spec.select
  store i32 %77, ptr %3, align 4, !tbaa !5
  %.not33 = icmp eq i32 %74, 0
  br i1 %.not33, label %.thread, label %.lr.ph.split, !llvm.loop !35

.thread:                                          ; preds = %53, %62, %51, %25, %34, %23, %.thread50, %7, %4
  %.126 = phi i32 [ %5, %4 ], [ 0, %7 ], [ 0, %.thread50 ], [ %32, %25 ], [ %.2.us, %34 ], [ %.02338.us, %23 ], [ %60, %53 ], [ %.2, %62 ], [ %.02338, %51 ]
  ret i32 %.126
}

; 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) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #3

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

!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, !6, i64 80}
!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 = !{!10, !6, i64 84}
!30 = !{!10, !21, i64 72}
!31 = !{!10, !6, i64 124}
!32 = !{!33, !33, i64 0}
!33 = !{!"vtable pointer", !8, i64 0}
!34 = !{!10, !24, i64 104}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass