; LLVM IR from mncoppola/rpef :: utilities_src/squashfs4.2/lzma465/CPP/7zip/Compress (CopyCoder)

; 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::CCopyCoder" = type { %struct.ICompressCoder, %struct.ICompressGetInStreamProcessedSize, %class.CMyUnknownImp, ptr, i64 }
%struct.ICompressCoder = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressGetInStreamProcessedSize = type { %struct.IUnknown }
%class.CMyUnknownImp = type { i32 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress10CCopyCoder4CodeEP19ISequentialInStreamP20ISequentialOutStreamPKyS6_P21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) unnamed_addr #0 align 2 {
  %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 i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = 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
  %20 = load ptr, ptr %8, align 8
  %21 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %32

24:                                               ; preds = %6
  %25 = call ptr @MyAlloc(i64 noundef 131072)
  %26 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 3
  store ptr %25, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 3
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %24
  store i32 -2147024882, ptr %7, align 4
  br label %117

31:                                               ; preds = %24
  br label %32

32:                                               ; preds = %31, %6
  %33 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 4
  store i64 0, ptr %33, align 8, !tbaa !17
  br label %34

34:                                               ; preds = %115, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 131072, ptr %15, align 4, !tbaa !18
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %54

37:                                               ; preds = %34
  %38 = load i32, ptr %15, align 4, !tbaa !18
  %39 = zext i32 %38 to i64
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = load i64, ptr %40, align 8, !tbaa !19
  %42 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 4
  %43 = load i64, ptr %42, align 8, !tbaa !17
  %44 = sub i64 %41, %43
  %45 = icmp ugt i64 %39, %44
  br i1 %45, label %46, label %53

46:                                               ; preds = %37
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = load i64, ptr %47, align 8, !tbaa !19
  %49 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 4
  %50 = load i64, ptr %49, align 8, !tbaa !17
  %51 = sub i64 %48, %50
  %52 = trunc i64 %51 to i32
  store i32 %52, ptr %15, align 4, !tbaa !18
  br label %53

53:                                               ; preds = %46, %37
  br label %54

54:                                               ; preds = %53, %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = load i32, ptr %15, align 4, !tbaa !18
  %59 = load ptr, ptr %55, align 8, !tbaa !20
  %60 = getelementptr inbounds ptr, ptr %59, i64 5
  %61 = load ptr, ptr %60, align 8
  %62 = call noundef i32 %61(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef %57, i32 noundef %58, ptr noundef %14)
  store i32 %62, ptr %16, align 4, !tbaa !18
  %63 = load i32, ptr %16, align 4, !tbaa !18
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %67

65:                                               ; preds = %54
  %66 = load i32, ptr %16, align 4, !tbaa !18
  store i32 %66, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %68

67:                                               ; preds = %54
  store i32 0, ptr %17, align 4
  br label %68

68:                                               ; preds = %67, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  %69 = load i32, ptr %17, align 4
  switch i32 %69, label %113 [
    i32 0, label %70
  ]

70:                                               ; preds = %68
  %71 = load i32, ptr %14, align 4, !tbaa !18
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  store i32 2, ptr %17, align 4
  br label %113

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = load i32, ptr %14, align 4, !tbaa !18
  %79 = zext i32 %78 to i64
  %80 = call noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef %75, ptr noundef %77, i64 noundef %79)
  store i32 %80, ptr %18, align 4, !tbaa !18
  %81 = load i32, ptr %18, align 4, !tbaa !18
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %85

83:                                               ; preds = %74
  %84 = load i32, ptr %18, align 4, !tbaa !18
  store i32 %84, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %86

85:                                               ; preds = %74
  store i32 0, ptr %17, align 4
  br label %86

86:                                               ; preds = %85, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  %87 = load i32, ptr %17, align 4
  switch i32 %87, label %113 [
    i32 0, label %88
  ]

88:                                               ; preds = %86
  %89 = load i32, ptr %14, align 4, !tbaa !18
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 4
  %92 = load i64, ptr %91, align 8, !tbaa !17
  %93 = add i64 %92, %90
  store i64 %93, ptr %91, align 8, !tbaa !17
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %112

96:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 4
  %99 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %20, i32 0, i32 4
  %100 = load ptr, ptr %97, align 8, !tbaa !20
  %101 = getelementptr inbounds ptr, ptr %100, i64 5
  %102 = load ptr, ptr %101, align 8
  %103 = call noundef i32 %102(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef %98, ptr noundef %99)
  store i32 %103, ptr %19, align 4, !tbaa !18
  %104 = load i32, ptr %19, align 4, !tbaa !18
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %108

106:                                              ; preds = %96
  %107 = load i32, ptr %19, align 4, !tbaa !18
  store i32 %107, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %109

108:                                              ; preds = %96
  store i32 0, ptr %17, align 4
  br label %109

109:                                              ; preds = %108, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  %110 = load i32, ptr %17, align 4
  switch i32 %110, label %113 [
    i32 0, label %111
  ]

111:                                              ; preds = %109
  br label %112

112:                                              ; preds = %111, %88
  store i32 0, ptr %17, align 4
  br label %113

113:                                              ; preds = %112, %109, %86, %73, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %114 = load i32, ptr %17, align 4
  switch i32 %114, label %119 [
    i32 0, label %115
    i32 1, label %117
    i32 2, label %116
  ]

115:                                              ; preds = %113
  br label %34, !llvm.loop !22

116:                                              ; preds = %113
  store i32 0, ptr %7, align 4
  br label %117

117:                                              ; preds = %116, %113, %30
  %118 = load i32, ptr %7, align 4
  ret i32 %118

119:                                              ; preds = %113
  unreachable
}

declare ptr @MyAlloc(i64 noundef) #1

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

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

declare noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef, ptr noundef, i64 noundef) #1

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 24}
!10 = !{!"_ZTSN9NCompress10CCopyCoderE", !11, i64 0, !13, i64 8, !14, i64 16, !6, i64 24, !16, i64 32}
!11 = !{!"_ZTS14ICompressCoder", !12, i64 0}
!12 = !{!"_ZTS8IUnknown"}
!13 = !{!"_ZTS33ICompressGetInStreamProcessedSize", !12, i64 0}
!14 = !{!"_ZTS13CMyUnknownImp", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!10, !16, i64 32}
!18 = !{!15, !15, i64 0}
!19 = !{!16, !16, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"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
define dso_local noundef i32 @_ZN9NCompress10CCopyCoder4CodeEP19ISequentialInStreamP20ISequentialOutStreamPKyS6_P21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef readnone %3, ptr noundef readonly %4, ptr noundef %5) unnamed_addr #0 align 2 {
  %7 = alloca i32, align 4
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %14

11:                                               ; preds = %6
  %12 = tail call ptr @MyAlloc(i64 noundef 131072)
  store ptr %12, ptr %8, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %110, label %14

14:                                               ; preds = %11, %6
  %15 = phi ptr [ %12, %11 ], [ %9, %6 ]
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 0, ptr %16, align 8, !tbaa !16
  %.not = icmp eq ptr %4, null
  %.not36 = icmp eq ptr %5, null
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  br i1 %.not36, label %.split.us, label %.split

.split.us:                                        ; preds = %14
  br i1 %.not, label %.split.us.split.us, label %.split.us.split

.split.us.split.us:                               ; preds = %.split.us
  %17 = load ptr, ptr %1, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %17, i64 40
  %19 = load ptr, ptr %18, align 8
  %20 = call noundef i32 %19(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %15, i32 noundef 131072, ptr noundef nonnull %7)
  %.not34.us.us75 = icmp eq i32 %20, 0
  br i1 %.not34.us.us75, label %.lr.ph76, label %.thread

.lr.ph76:                                         ; preds = %.split.us.split.us, %select.unfold.us.us
  %21 = load i32, ptr %7, align 4, !tbaa !19
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %.split46.us, label %23

23:                                               ; preds = %.lr.ph76
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = zext i32 %21 to i64
  %26 = call noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef %2, ptr noundef %24, i64 noundef %25)
  %.not35.us.us = icmp eq i32 %26, 0
  br i1 %.not35.us.us, label %select.unfold.us.us, label %.thread

select.unfold.us.us:                              ; preds = %23
  %27 = load i32, ptr %7, align 4, !tbaa !19
  %28 = zext i32 %27 to i64
  %29 = load i64, ptr %16, align 8, !tbaa !16
  %30 = add i64 %29, %28
  store i64 %30, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = load ptr, ptr %1, align 8, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %32, i64 40
  %34 = load ptr, ptr %33, align 8
  %35 = call noundef i32 %34(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %31, i32 noundef 131072, ptr noundef nonnull %7)
  %.not34.us.us = icmp eq i32 %35, 0
  br i1 %.not34.us.us, label %.lr.ph76, label %.thread

.split.us.split:                                  ; preds = %.split.us
  %36 = load i64, ptr %4, align 8, !tbaa !20
  %spec.select44.us68 = tail call i64 @llvm.umin.i64(i64 %36, i64 131072)
  %spec.select.us69 = trunc nuw nsw i64 %spec.select44.us68 to i32
  %37 = load ptr, ptr %1, align 8, !tbaa !17
  %38 = getelementptr inbounds i8, ptr %37, i64 40
  %39 = load ptr, ptr %38, align 8
  %40 = call noundef i32 %39(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %15, i32 noundef %spec.select.us69, ptr noundef nonnull %7)
  %.not34.us70 = icmp eq i32 %40, 0
  br i1 %.not34.us70, label %.lr.ph71, label %.thread

.lr.ph71:                                         ; preds = %.split.us.split, %select.unfold.us
  %41 = load i32, ptr %7, align 4, !tbaa !19
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %.split46.us, label %43

43:                                               ; preds = %.lr.ph71
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = zext i32 %41 to i64
  %46 = call noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef %2, ptr noundef %44, i64 noundef %45)
  %.not35.us = icmp eq i32 %46, 0
  br i1 %.not35.us, label %select.unfold.us, label %.thread

select.unfold.us:                                 ; preds = %43
  %47 = load i32, ptr %7, align 4, !tbaa !19
  %48 = zext i32 %47 to i64
  %49 = load i64, ptr %16, align 8, !tbaa !16
  %50 = add i64 %49, %48
  store i64 %50, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %51 = load i64, ptr %4, align 8, !tbaa !20
  %52 = sub i64 %51, %50
  %spec.select44.us = call i64 @llvm.umin.i64(i64 %52, i64 131072)
  %spec.select.us = trunc nuw nsw i64 %spec.select44.us to i32
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = load ptr, ptr %1, align 8, !tbaa !17
  %55 = getelementptr inbounds i8, ptr %54, i64 40
  %56 = load ptr, ptr %55, align 8
  %57 = call noundef i32 %56(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %53, i32 noundef %spec.select.us, ptr noundef nonnull %7)
  %.not34.us = icmp eq i32 %57, 0
  br i1 %.not34.us, label %.lr.ph71, label %.thread

.split:                                           ; preds = %14
  br i1 %.not, label %.split.split.us, label %.split.split

.split.split.us:                                  ; preds = %.split
  %58 = load ptr, ptr %1, align 8, !tbaa !17
  %59 = getelementptr inbounds i8, ptr %58, i64 40
  %60 = load ptr, ptr %59, align 8
  %61 = call noundef i32 %60(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %15, i32 noundef 131072, ptr noundef nonnull %7)
  %.not34.us4860 = icmp eq i32 %61, 0
  br i1 %.not34.us4860, label %.lr.ph61, label %.thread

.lr.ph61:                                         ; preds = %.split.split.us, %select.unfold.us50
  %62 = load i32, ptr %7, align 4, !tbaa !19
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %.split46.us, label %64

64:                                               ; preds = %.lr.ph61
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = zext i32 %62 to i64
  %67 = call noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef %2, ptr noundef %65, i64 noundef %66)
  %.not35.us49 = icmp eq i32 %67, 0
  br i1 %.not35.us49, label %68, label %.thread

68:                                               ; preds = %64
  %69 = load i32, ptr %7, align 4, !tbaa !19
  %70 = zext i32 %69 to i64
  %71 = load i64, ptr %16, align 8, !tbaa !16
  %72 = add i64 %71, %70
  store i64 %72, ptr %16, align 8, !tbaa !16
  %73 = load ptr, ptr %5, align 8, !tbaa !17
  %74 = getelementptr inbounds i8, ptr %73, i64 40
  %75 = load ptr, ptr %74, align 8
  %76 = call noundef i32 %75(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %16, ptr noundef nonnull %16)
  %.not37.us = icmp eq i32 %76, 0
  br i1 %.not37.us, label %select.unfold.us50, label %.thread

select.unfold.us50:                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load ptr, ptr %1, align 8, !tbaa !17
  %79 = getelementptr inbounds i8, ptr %78, i64 40
  %80 = load ptr, ptr %79, align 8
  %81 = call noundef i32 %80(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %77, i32 noundef 131072, ptr noundef nonnull %7)
  %.not34.us48 = icmp eq i32 %81, 0
  br i1 %.not34.us48, label %.lr.ph61, label %.thread

.split.split:                                     ; preds = %.split
  %82 = load i64, ptr %4, align 8, !tbaa !20
  %spec.select4453 = tail call i64 @llvm.umin.i64(i64 %82, i64 131072)
  %spec.select54 = trunc nuw nsw i64 %spec.select4453 to i32
  %83 = load ptr, ptr %1, align 8, !tbaa !17
  %84 = getelementptr inbounds i8, ptr %83, i64 40
  %85 = load ptr, ptr %84, align 8
  %86 = call noundef i32 %85(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %15, i32 noundef %spec.select54, ptr noundef nonnull %7)
  %.not3455 = icmp eq i32 %86, 0
  br i1 %.not3455, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %.split.split, %select.unfold
  %87 = load i32, ptr %7, align 4, !tbaa !19
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %.split46.us, label %89

89:                                               ; preds = %.lr.ph
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = zext i32 %87 to i64
  %92 = call noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef %2, ptr noundef %90, i64 noundef %91)
  %.not35 = icmp eq i32 %92, 0
  br i1 %.not35, label %93, label %.thread

93:                                               ; preds = %89
  %94 = load i32, ptr %7, align 4, !tbaa !19
  %95 = zext i32 %94 to i64
  %96 = load i64, ptr %16, align 8, !tbaa !16
  %97 = add i64 %96, %95
  store i64 %97, ptr %16, align 8, !tbaa !16
  %98 = load ptr, ptr %5, align 8, !tbaa !17
  %99 = getelementptr inbounds i8, ptr %98, i64 40
  %100 = load ptr, ptr %99, align 8
  %101 = call noundef i32 %100(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %16, ptr noundef nonnull %16)
  %.not37 = icmp eq i32 %101, 0
  br i1 %.not37, label %select.unfold, label %.thread

.thread:                                          ; preds = %93, %select.unfold, %89, %select.unfold.us50, %64, %68, %select.unfold.us, %43, %select.unfold.us.us, %23, %.split.split.us, %.split.split, %.split.us.split.us, %.split.us.split
  %.us-phi = phi i32 [ %20, %.split.us.split.us ], [ %40, %.split.us.split ], [ %61, %.split.split.us ], [ %86, %.split.split ], [ %26, %23 ], [ %35, %select.unfold.us.us ], [ %46, %43 ], [ %57, %select.unfold.us ], [ %76, %68 ], [ %67, %64 ], [ %81, %select.unfold.us50 ], [ %92, %89 ], [ %109, %select.unfold ], [ %101, %93 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %110

select.unfold:                                    ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %102 = load i64, ptr %4, align 8, !tbaa !20
  %103 = load i64, ptr %16, align 8, !tbaa !16
  %104 = sub i64 %102, %103
  %spec.select44 = call i64 @llvm.umin.i64(i64 %104, i64 131072)
  %spec.select = trunc nuw nsw i64 %spec.select44 to i32
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = load ptr, ptr %1, align 8, !tbaa !17
  %107 = getelementptr inbounds i8, ptr %106, i64 40
  %108 = load ptr, ptr %107, align 8
  %109 = call noundef i32 %108(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %105, i32 noundef %spec.select, ptr noundef nonnull %7)
  %.not34 = icmp eq i32 %109, 0
  br i1 %.not34, label %.lr.ph, label %.thread

.split46.us:                                      ; preds = %.lr.ph, %.lr.ph61, %.lr.ph71, %.lr.ph76
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %110

110:                                              ; preds = %.thread, %11, %.split46.us
  %.6 = phi i32 [ 0, %.split46.us ], [ -2147024882, %11 ], [ %.us-phi, %.thread ]
  ret i32 %.6
}

declare ptr @MyAlloc(i64 noundef) local_unnamed_addr #1

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

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

declare noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #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 = { "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !14, i64 24}
!6 = !{!"_ZTSN9NCompress10CCopyCoderE", !7, i64 0, !9, i64 8, !10, i64 16, !14, i64 24, !15, i64 32}
!7 = !{!"_ZTS14ICompressCoder", !8, i64 0}
!8 = !{!"_ZTS8IUnknown"}
!9 = !{!"_ZTS33ICompressGetInStreamProcessedSize", !8, i64 0}
!10 = !{!"_ZTS13CMyUnknownImp", !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!"long long", !12, i64 0}
!16 = !{!6, !15, i64 32}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !13, i64 0}
!19 = !{!11, !11, i64 0}
!20 = !{!15, !15, i64 0}


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