; LLVM IR from mncoppola/rpef :: utilities_src/squashfs2.1/lzma/C/7zip/Compress/LZMA (LZMAEncoder)

; 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::CEncoder::CCoderReleaser" = type { ptr }
%"class.NCompress::NLZMA::CEncoder" = type <{ %struct.ICompressCoder, %struct.ICompressSetOutStream, %struct.ICompressSetCoderProperties, %struct.ICompressWriteCoderProperties, %"class.NCompress::NLZMA::CBaseState", %class.CMyUnknownImp, [4096 x %"struct.NCompress::NLZMA::COptimal"], %class.CMyComPtr.5, %"class.NCompress::NRangeCoder::CEncoder", [12 x [16 x %"class.NCompress::NRangeCoder::CBitEncoder"]], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x [16 x %"class.NCompress::NRangeCoder::CBitEncoder"]], [4 x %"class.NCompress::NRangeCoder::CBitTreeEncoder.7"], [114 x %"class.NCompress::NRangeCoder::CBitEncoder"], %"class.NCompress::NRangeCoder::CBitTreeEncoder.8", %"class.NCompress::NLZMA::NLength::CPriceTableEncoder", %"class.NCompress::NLZMA::NLength::CPriceTableEncoder", %"class.NCompress::NLZMA::CLiteralEncoder", [274 x i32], i8, i8, [2 x i8], i32, i32, i32, i32, i32, i8, [3 x i8], [4 x [64 x i32]], [4 x [128 x i32]], [16 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i8, [7 x i8], ptr, i32, i8, i8, [2 x i8] }>
%struct.ICompressCoder = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressSetOutStream = type { %struct.IUnknown }
%struct.ICompressSetCoderProperties = type { %struct.IUnknown }
%struct.ICompressWriteCoderProperties = type { %struct.IUnknown }
%"class.NCompress::NLZMA::CBaseState" = type { %"class.NCompress::NLZMA::CState", i8, [4 x i32] }
%"class.NCompress::NLZMA::CState" = type { i8 }
%class.CMyUnknownImp = type { i32 }
%"struct.NCompress::NLZMA::COptimal" = type { %"class.NCompress::NLZMA::CState", i8, i8, i32, i32, i32, i32, i32, [4 x i32] }
%class.CMyComPtr.5 = type { ptr }
%"class.NCompress::NRangeCoder::CEncoder" = type { i32, i8, i64, i32, [4 x i8], %class.COutBuffer }
%class.COutBuffer = type <{ ptr, i32, i32, i32, i32, %class.CMyComPtr.6, i64, ptr, i8, [7 x i8] }>
%class.CMyComPtr.6 = type { ptr }
%"class.NCompress::NRangeCoder::CBitEncoder" = type { %"class.NCompress::NRangeCoder::CBitModel" }
%"class.NCompress::NRangeCoder::CBitModel" = type { i32 }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.7" = type { [64 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.8" = type { [16 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NLZMA::NLength::CPriceTableEncoder" = type { %"class.NCompress::NLZMA::NLength::CEncoder", [272 x [16 x i32]], i32, [16 x i32] }
%"class.NCompress::NLZMA::NLength::CEncoder" = type { %"class.NCompress::NRangeCoder::CBitEncoder", %"class.NCompress::NRangeCoder::CBitEncoder", [16 x %"class.NCompress::NRangeCoder::CBitTreeEncoder"], [16 x %"class.NCompress::NRangeCoder::CBitTreeEncoder"], %"class.NCompress::NRangeCoder::CBitTreeEncoder.4" }
%"class.NCompress::NRangeCoder::CBitTreeEncoder" = type { [8 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.4" = type { [256 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NLZMA::CLiteralEncoder" = type <{ ptr, i32, i32, i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

; 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 @_ZN9NCompress5NLZMA8CEncoder8CodeRealEP19ISequentialInStreamP20ISequentialOutStreamPKyS7_P21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(210678) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.NCompress::NLZMA::CEncoder::CCoderReleaser", align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  %24 = load ptr, ptr %8, align 8
  %25 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %24, i32 0, i32 51
  store i8 0, ptr %25, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @_ZN9NCompress5NLZMA8CEncoder14CCoderReleaserC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef %24)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = invoke noundef i32 @_ZN9NCompress5NLZMA8CEncoder10SetStreamsEP19ISequentialInStreamP20ISequentialOutStreamPKyS7_(ptr noundef nonnull align 8 dereferenceable(210678) %24, ptr noundef %26, ptr noundef %27, ptr noundef %28, ptr noundef %29)
          to label %31 unwind label %36

31:                                               ; preds = %6
  store i32 %30, ptr %15, align 4, !tbaa !33
  %32 = load i32, ptr %15, align 4, !tbaa !33
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %40

34:                                               ; preds = %31
  %35 = load i32, ptr %15, align 4, !tbaa !33
  store i32 %35, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %41

36:                                               ; preds = %6
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %16, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %92

40:                                               ; preds = %31
  store i32 0, ptr %18, align 4
  br label %41

41:                                               ; preds = %40, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  %42 = load i32, ptr %18, align 4
  switch i32 %42, label %90 [
    i32 0, label %43
  ]

43:                                               ; preds = %41
  br label %44

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

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %46 = invoke noundef i32 @_ZN9NCompress5NLZMA8CEncoder12CodeOneBlockEPyS2_Pi(ptr noundef nonnull align 8 dereferenceable(210678) %24, ptr noundef %19, ptr noundef %20, ptr noundef %21)
          to label %47 unwind label %52

47:                                               ; preds = %45
  store i32 %46, ptr %22, align 4, !tbaa !33
  %48 = load i32, ptr %22, align 4, !tbaa !33
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %56

50:                                               ; preds = %47
  %51 = load i32, ptr %22, align 4, !tbaa !33
  store i32 %51, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %57

52:                                               ; preds = %45
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %16, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  br label %89

56:                                               ; preds = %47
  store i32 0, ptr %18, align 4
  br label %57

57:                                               ; preds = %56, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  %58 = load i32, ptr %18, align 4
  switch i32 %58, label %86 [
    i32 0, label %59
  ]

59:                                               ; preds = %57
  %60 = load i32, ptr %21, align 4, !tbaa !33
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  store i32 0, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %86

63:                                               ; preds = %59
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %85

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = load ptr, ptr %67, align 8, !tbaa !34
  %69 = getelementptr inbounds ptr, ptr %68, i64 3
  %70 = load ptr, ptr %69, align 8
  %71 = invoke noundef i32 %70(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef %19, ptr noundef %20)
          to label %72 unwind label %77

72:                                               ; preds = %66
  store i32 %71, ptr %23, align 4, !tbaa !33
  %73 = load i32, ptr %23, align 4, !tbaa !33
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %81

75:                                               ; preds = %72
  %76 = load i32, ptr %23, align 4, !tbaa !33
  store i32 %76, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %82

77:                                               ; preds = %66
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %16, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  br label %89

81:                                               ; preds = %72
  store i32 0, ptr %18, align 4
  br label %82

82:                                               ; preds = %81, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  %83 = load i32, ptr %18, align 4
  switch i32 %83, label %86 [
    i32 0, label %84
  ]

84:                                               ; preds = %82
  br label %85

85:                                               ; preds = %84, %63
  store i32 0, ptr %18, align 4
  br label %86

86:                                               ; preds = %85, %82, %62, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  %87 = load i32, ptr %18, align 4
  switch i32 %87, label %90 [
    i32 0, label %88
  ]

88:                                               ; preds = %86
  br label %44, !llvm.loop !36

89:                                               ; preds = %77, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %92

90:                                               ; preds = %86, %41
  call void @_ZN9NCompress5NLZMA8CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %91 = load i32, ptr %7, align 4
  ret i32 %91

92:                                               ; preds = %89, %36
  call void @_ZN9NCompress5NLZMA8CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  br label %93

93:                                               ; preds = %92
  %94 = load ptr, ptr %16, align 8
  %95 = load i32, ptr %17, align 4
  %96 = insertvalue { ptr, i32 } poison, ptr %94, 0
  %97 = insertvalue { ptr, i32 } %96, i32 %95, 1
  resume { ptr, i32 } %97
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NLZMA8CEncoder10SetStreamsEP19ISequentialInStreamP20ISequentialOutStreamPKyS7_(ptr noundef nonnull align 8 dereferenceable(210678), ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NLZMA8CEncoder12CodeOneBlockEPyS2_Pi(ptr noundef nonnull align 8 dereferenceable(210678), ptr noundef, ptr noundef, ptr noundef) #1 align 2

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

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, !25, i64 210677}
!10 = !{!"_ZTSN9NCompress5NLZMA8CEncoderE", !11, i64 0, !13, i64 8, !14, i64 16, !15, i64 24, !16, i64 32, !18, i64 52, !7, i64 56, !20, i64 163896, !21, i64 163904, !7, i64 163984, !7, i64 164752, !7, i64 164800, !7, i64 164848, !7, i64 164896, !7, i64 164944, !7, i64 165712, !7, i64 166736, !26, i64 167192, !27, i64 167256, !27, i64 186788, !32, i64 206320, !7, i64 206344, !25, i64 207440, !25, i64 207441, !19, i64 207444, !19, i64 207448, !19, i64 207452, !19, i64 207456, !19, i64 207460, !25, i64 207464, !7, i64 207468, !7, i64 208492, !7, i64 210540, !19, i64 210604, !19, i64 210608, !19, i64 210612, !19, i64 210616, !19, i64 210620, !19, i64 210624, !19, i64 210628, !19, i64 210632, !19, i64 210636, !22, i64 210640, !22, i64 210648, !25, i64 210656, !6, i64 210664, !19, i64 210672, !25, i64 210676, !25, i64 210677}
!11 = !{!"_ZTS14ICompressCoder", !12, i64 0}
!12 = !{!"_ZTS8IUnknown"}
!13 = !{!"_ZTS21ICompressSetOutStream", !12, i64 0}
!14 = !{!"_ZTS27ICompressSetCoderProperties", !12, i64 0}
!15 = !{!"_ZTS29ICompressWriteCoderProperties", !12, i64 0}
!16 = !{!"_ZTSN9NCompress5NLZMA10CBaseStateE", !17, i64 0, !7, i64 1, !7, i64 4}
!17 = !{!"_ZTSN9NCompress5NLZMA6CStateE", !7, i64 0}
!18 = !{!"_ZTS13CMyUnknownImp", !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTS9CMyComPtrI12IMatchFinderE", !6, i64 0}
!21 = !{!"_ZTSN9NCompress11NRangeCoder8CEncoderE", !19, i64 0, !7, i64 4, !22, i64 8, !19, i64 16, !23, i64 24}
!22 = !{!"long long", !7, i64 0}
!23 = !{!"_ZTS10COutBuffer", !6, i64 0, !19, i64 8, !19, i64 12, !19, i64 16, !19, i64 20, !24, i64 24, !22, i64 32, !6, i64 40, !25, i64 48}
!24 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !6, i64 0}
!25 = !{!"bool", !7, i64 0}
!26 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi4EEE", !7, i64 0}
!27 = !{!"_ZTSN9NCompress5NLZMA7NLength18CPriceTableEncoderE", !28, i64 0, !7, i64 2056, !19, i64 19464, !7, i64 19468}
!28 = !{!"_ZTSN9NCompress5NLZMA7NLength8CEncoderE", !29, i64 0, !29, i64 4, !7, i64 8, !7, i64 520, !31, i64 1032}
!29 = !{!"_ZTSN9NCompress11NRangeCoder11CBitEncoderILi5EEE", !30, i64 0}
!30 = !{!"_ZTSN9NCompress11NRangeCoder9CBitModelILi5EEE", !19, i64 0}
!31 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi8EEE", !7, i64 0}
!32 = !{!"_ZTSN9NCompress5NLZMA15CLiteralEncoderE", !6, i64 0, !19, i64 8, !19, i64 12, !19, i64 16}
!33 = !{!19, !19, i64 0}
!34 = !{!35, !35, i64 0}
!35 = !{!"vtable pointer", !8, i64 0}
!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"

%"class.NCompress::NLZMA::CEncoder::CCoderReleaser" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; 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 @_ZN9NCompress5NLZMA8CEncoder8CodeRealEP19ISequentialInStreamP20ISequentialOutStreamPKyS7_P21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(210678) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.NCompress::NLZMA::CEncoder::CCoderReleaser", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = getelementptr inbounds i8, ptr %0, i64 210677
  store i8 0, ptr %11, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @_ZN9NCompress5NLZMA8CEncoder14CCoderReleaserC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %0)
  %12 = invoke noundef i32 @_ZN9NCompress5NLZMA8CEncoder10SetStreamsEP19ISequentialInStreamP20ISequentialOutStreamPKyS7_(ptr noundef nonnull align 8 dereferenceable(210678) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4)
          to label %13 unwind label %18

13:                                               ; preds = %6
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %13
  %.not34 = icmp eq ptr %5, null
  br i1 %.not34, label %.preheader.split.us, label %.preheader.split

.preheader.split.us:                              ; preds = %.preheader, %.backedge.us
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #3
  %14 = invoke noundef i32 @_ZN9NCompress5NLZMA8CEncoder12CodeOneBlockEPyS2_Pi(ptr noundef nonnull align 8 dereferenceable(210678) %0, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
          to label %15 unwind label %.split.us

15:                                               ; preds = %.preheader.split.us
  %.not32.us = icmp eq i32 %14, 0
  %16 = load i32, ptr %10, align 4
  %.not33.us = icmp eq i32 %16, 0
  %or.cond.us = select i1 %.not32.us, i1 %.not33.us, i1 false
  br i1 %or.cond.us, label %.backedge.us, label %.thread

.backedge.us:                                     ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %.preheader.split.us, !llvm.loop !32

.split.us:                                        ; preds = %.preheader.split.us
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %31

18:                                               ; preds = %6
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %32

.preheader.split:                                 ; preds = %.preheader, %.backedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #3
  %20 = invoke noundef i32 @_ZN9NCompress5NLZMA8CEncoder12CodeOneBlockEPyS2_Pi(ptr noundef nonnull align 8 dereferenceable(210678) %0, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
          to label %21 unwind label %.split

21:                                               ; preds = %.preheader.split
  %.not32 = icmp eq i32 %20, 0
  %22 = load i32, ptr %10, align 4
  %.not33 = icmp eq i32 %22, 0
  %or.cond = select i1 %.not32, i1 %.not33, i1 false
  br i1 %or.cond, label %24, label %.thread

.split:                                           ; preds = %.preheader.split
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %31

24:                                               ; preds = %21
  %25 = load ptr, ptr %5, align 8, !tbaa !34
  %26 = getelementptr inbounds i8, ptr %25, i64 24
  %27 = load ptr, ptr %26, align 8
  %28 = invoke noundef i32 %27(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %8, ptr noundef nonnull %9)
          to label %.backedge unwind label %29

.backedge:                                        ; preds = %24
  %.not37 = icmp eq i32 %28, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br i1 %.not37, label %.preheader.split, label %.loopexit, !llvm.loop !32

29:                                               ; preds = %24
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %31

.thread:                                          ; preds = %21, %15
  %.us-phi43 = phi i32 [ %14, %15 ], [ %20, %21 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %.loopexit

31:                                               ; preds = %.split, %.split.us, %29
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %23, %.split ], [ %17, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %32

.loopexit:                                        ; preds = %.backedge, %.thread, %13
  %.6 = phi i32 [ %12, %13 ], [ %.us-phi43, %.thread ], [ %28, %.backedge ]
  call void @_ZN9NCompress5NLZMA8CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  ret i32 %.6

32:                                               ; preds = %31, %18
  %.pn.pn = phi { ptr, i32 } [ %.pn, %31 ], [ %19, %18 ]
  call void @_ZN9NCompress5NLZMA8CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NLZMA8CEncoder10SetStreamsEP19ISequentialInStreamP20ISequentialOutStreamPKyS7_(ptr noundef nonnull align 8 dereferenceable(210678), ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NLZMA8CEncoder12CodeOneBlockEPyS2_Pi(ptr noundef nonnull align 8 dereferenceable(210678), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

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

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, !24, i64 210677}
!6 = !{!"_ZTSN9NCompress5NLZMA8CEncoderE", !7, i64 0, !9, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !16, i64 52, !14, i64 56, !18, i64 163896, !20, i64 163904, !14, i64 163984, !14, i64 164752, !14, i64 164800, !14, i64 164848, !14, i64 164896, !14, i64 164944, !14, i64 165712, !14, i64 166736, !25, i64 167192, !26, i64 167256, !26, i64 186788, !31, i64 206320, !14, i64 206344, !24, i64 207440, !24, i64 207441, !17, i64 207444, !17, i64 207448, !17, i64 207452, !17, i64 207456, !17, i64 207460, !24, i64 207464, !14, i64 207468, !14, i64 208492, !14, i64 210540, !17, i64 210604, !17, i64 210608, !17, i64 210612, !17, i64 210616, !17, i64 210620, !17, i64 210624, !17, i64 210628, !17, i64 210632, !17, i64 210636, !21, i64 210640, !21, i64 210648, !24, i64 210656, !19, i64 210664, !17, i64 210672, !24, i64 210676, !24, i64 210677}
!7 = !{!"_ZTS14ICompressCoder", !8, i64 0}
!8 = !{!"_ZTS8IUnknown"}
!9 = !{!"_ZTS21ICompressSetOutStream", !8, i64 0}
!10 = !{!"_ZTS27ICompressSetCoderProperties", !8, i64 0}
!11 = !{!"_ZTS29ICompressWriteCoderProperties", !8, i64 0}
!12 = !{!"_ZTSN9NCompress5NLZMA10CBaseStateE", !13, i64 0, !14, i64 1, !14, i64 4}
!13 = !{!"_ZTSN9NCompress5NLZMA6CStateE", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C++ TBAA"}
!16 = !{!"_ZTS13CMyUnknownImp", !17, i64 0}
!17 = !{!"int", !14, i64 0}
!18 = !{!"_ZTS9CMyComPtrI12IMatchFinderE", !19, i64 0}
!19 = !{!"any pointer", !14, i64 0}
!20 = !{!"_ZTSN9NCompress11NRangeCoder8CEncoderE", !17, i64 0, !14, i64 4, !21, i64 8, !17, i64 16, !22, i64 24}
!21 = !{!"long long", !14, i64 0}
!22 = !{!"_ZTS10COutBuffer", !19, i64 0, !17, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !23, i64 24, !21, i64 32, !19, i64 40, !24, i64 48}
!23 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !19, i64 0}
!24 = !{!"bool", !14, i64 0}
!25 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi4EEE", !14, i64 0}
!26 = !{!"_ZTSN9NCompress5NLZMA7NLength18CPriceTableEncoderE", !27, i64 0, !14, i64 2056, !17, i64 19464, !14, i64 19468}
!27 = !{!"_ZTSN9NCompress5NLZMA7NLength8CEncoderE", !28, i64 0, !28, i64 4, !14, i64 8, !14, i64 520, !30, i64 1032}
!28 = !{!"_ZTSN9NCompress11NRangeCoder11CBitEncoderILi5EEE", !29, i64 0}
!29 = !{!"_ZTSN9NCompress11NRangeCoder9CBitModelILi5EEE", !17, i64 0}
!30 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi8EEE", !14, i64 0}
!31 = !{!"_ZTSN9NCompress5NLZMA15CLiteralEncoderE", !19, i64 0, !17, i64 8, !17, i64 12, !17, i64 16}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!35, !35, i64 0}
!35 = !{!"vtable pointer", !15, i64 0}


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