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

; 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.CFilterCoder = type { %struct.ICompressCoder, %struct.ICompressSetInStream, %struct.ISequentialInStream, %struct.ICompressSetOutStream, %struct.ISequentialOutStream, %struct.IOutStreamFlush, %struct.ICryptoSetPassword, %struct.ICompressSetCoderProperties, %struct.ICompressWriteCoderProperties, %struct.ICryptoResetInitVector, %struct.ICompressSetDecoderProperties2, %class.CMyUnknownImp, ptr, %class.CMyComPtr, %class.CMyComPtr.0, i32, i32, i32, i8, i64, i64, %class.CMyComPtr.1, %class.CMyComPtr.2, %class.CMyComPtr.3, %class.CMyComPtr.4, %class.CMyComPtr.5, %class.CMyComPtr.6 }
%struct.ICompressCoder = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressSetInStream = type { %struct.IUnknown }
%struct.ISequentialInStream = type { %struct.IUnknown }
%struct.ICompressSetOutStream = type { %struct.IUnknown }
%struct.ISequentialOutStream = type { %struct.IUnknown }
%struct.IOutStreamFlush = type { %struct.IUnknown }
%struct.ICryptoSetPassword = type { %struct.IUnknown }
%struct.ICompressSetCoderProperties = type { %struct.IUnknown }
%struct.ICompressWriteCoderProperties = type { %struct.IUnknown }
%struct.ICryptoResetInitVector = type { %struct.IUnknown }
%struct.ICompressSetDecoderProperties2 = type { %struct.IUnknown }
%class.CMyUnknownImp = type { i32 }
%class.CMyComPtr = type { ptr }
%class.CMyComPtr.0 = type { ptr }
%class.CMyComPtr.1 = type { ptr }
%class.CMyComPtr.2 = type { ptr }
%class.CMyComPtr.3 = type { ptr }
%class.CMyComPtr.4 = type { ptr }
%class.CMyComPtr.5 = type { ptr }
%class.CMyComPtr.6 = type { ptr }

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12CFilterCoder14WriteWithLimitEP20ISequentialOutStreamj(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef, i32 noundef) #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 uwtable
define dso_local noundef i32 @_ZN12CFilterCoder4CodeEP19ISequentialInStreamP20ISequentialOutStreamPKyS5_P21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(200) %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 i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = 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
  %23 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %24 = call noundef i32 @_ZN12CFilterCoder4InitEv(ptr noundef nonnull align 8 dereferenceable(200) %23)
  store i32 %24, ptr %14, align 4, !tbaa !9
  %25 = load i32, ptr %14, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %6
  %28 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %28, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %30

29:                                               ; preds = %6
  store i32 0, ptr %15, align 4
  br label %30

30:                                               ; preds = %29, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %31 = load i32, ptr %15, align 4
  switch i32 %31, label %176 [
    i32 0, label %32
    i32 1, label %174
  ]

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  %35 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 18
  %36 = zext i1 %34 to i8
  store i8 %36, ptr %35, align 4, !tbaa !11
  %37 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 18
  %38 = load i8, ptr %37, align 4, !tbaa !11, !range !36, !noundef !37
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %44

40:                                               ; preds = %32
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = load i64, ptr %41, align 8, !tbaa !38
  %43 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 19
  store i64 %42, ptr %43, align 8, !tbaa !39
  br label %44

44:                                               ; preds = %40, %32
  br label %45

45:                                               ; preds = %171, %44
  %46 = call noundef zeroext i1 @_ZNK12CFilterCoder8NeedMoreEv(ptr noundef nonnull align 8 dereferenceable(200) %23)
  br i1 %46, label %47, label %172

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %48 = load i32, ptr %16, align 4, !tbaa !9
  %49 = sub i32 131072, %48
  %50 = zext i32 %49 to i64
  store i64 %50, ptr %17, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 12
  %53 = load ptr, ptr %52, align 8, !tbaa !42
  %54 = load i32, ptr %16, align 4, !tbaa !9
  %55 = zext i32 %54 to i64
  %56 = getelementptr inbounds i8, ptr %53, i64 %55
  %57 = call noundef i32 @_Z10ReadStreamP19ISequentialInStreamPvPm(ptr noundef %51, ptr noundef %56, ptr noundef %17)
  store i32 %57, ptr %18, align 4, !tbaa !9
  %58 = load i32, ptr %18, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %62

60:                                               ; preds = %47
  %61 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %61, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %63

62:                                               ; preds = %47
  store i32 0, ptr %15, align 4
  br label %63

63:                                               ; preds = %62, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  %64 = load i32, ptr %15, align 4
  switch i32 %64, label %169 [
    i32 0, label %65
  ]

65:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %66 = load i32, ptr %16, align 4, !tbaa !9
  %67 = load i64, ptr %17, align 8, !tbaa !40
  %68 = trunc i64 %67 to i32
  %69 = add i32 %66, %68
  store i32 %69, ptr %19, align 4, !tbaa !9
  %70 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 26
  %71 = call noundef ptr @_ZNK9CMyComPtrI15ICompressFilterEptEv(ptr noundef nonnull align 8 dereferenceable(8) %70)
  %72 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 12
  %73 = load ptr, ptr %72, align 8, !tbaa !42
  %74 = load i32, ptr %19, align 4, !tbaa !9
  %75 = load ptr, ptr %71, align 8, !tbaa !43
  %76 = getelementptr inbounds ptr, ptr %75, i64 6
  %77 = load ptr, ptr %76, align 8
  %78 = call noundef i32 %77(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef %73, i32 noundef %74)
  store i32 %78, ptr %16, align 4, !tbaa !9
  %79 = load i32, ptr %16, align 4, !tbaa !9
  %80 = load i32, ptr %19, align 4, !tbaa !9
  %81 = icmp ugt i32 %79, %80
  br i1 %81, label %82, label %106

82:                                               ; preds = %65
  br label %83

83:                                               ; preds = %93, %82
  %84 = load i32, ptr %19, align 4, !tbaa !9
  %85 = load i32, ptr %16, align 4, !tbaa !9
  %86 = icmp ult i32 %84, %85
  br i1 %86, label %87, label %96

87:                                               ; preds = %83
  %88 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 12
  %89 = load ptr, ptr %88, align 8, !tbaa !42
  %90 = load i32, ptr %19, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %89, i64 %91
  store i8 0, ptr %92, align 1, !tbaa !45
  br label %93

93:                                               ; preds = %87
  %94 = load i32, ptr %19, align 4, !tbaa !9
  %95 = add i32 %94, 1
  store i32 %95, ptr %19, align 4, !tbaa !9
  br label %83, !llvm.loop !46

96:                                               ; preds = %83
  %97 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 26
  %98 = call noundef ptr @_ZNK9CMyComPtrI15ICompressFilterEptEv(ptr noundef nonnull align 8 dereferenceable(8) %97)
  %99 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 12
  %100 = load ptr, ptr %99, align 8, !tbaa !42
  %101 = load i32, ptr %19, align 4, !tbaa !9
  %102 = load ptr, ptr %98, align 8, !tbaa !43
  %103 = getelementptr inbounds ptr, ptr %102, i64 6
  %104 = load ptr, ptr %103, align 8
  %105 = call noundef i32 %104(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef %100, i32 noundef %101)
  store i32 %105, ptr %16, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %96, %65
  %107 = load i32, ptr %16, align 4, !tbaa !9
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %117

109:                                              ; preds = %106
  %110 = load i32, ptr %19, align 4, !tbaa !9
  %111 = icmp ugt i32 %110, 0
  br i1 %111, label %112, label %116

112:                                              ; preds = %109
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = load i32, ptr %19, align 4, !tbaa !9
  %115 = call noundef i32 @_ZN12CFilterCoder14WriteWithLimitEP20ISequentialOutStreamj(ptr noundef nonnull align 8 dereferenceable(200) %23, ptr noundef %113, i32 noundef %114)
  store i32 %115, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %168

116:                                              ; preds = %109
  store i32 0, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %168

117:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = load i32, ptr %16, align 4, !tbaa !9
  %120 = call noundef i32 @_ZN12CFilterCoder14WriteWithLimitEP20ISequentialOutStreamj(ptr noundef nonnull align 8 dereferenceable(200) %23, ptr noundef %118, i32 noundef %119)
  store i32 %120, ptr %20, align 4, !tbaa !9
  %121 = load i32, ptr %20, align 4, !tbaa !9
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %125

123:                                              ; preds = %117
  %124 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %124, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %126

125:                                              ; preds = %117
  store i32 0, ptr %15, align 4
  br label %126

126:                                              ; preds = %125, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %127 = load i32, ptr %15, align 4
  switch i32 %127, label %168 [
    i32 0, label %128
  ]

128:                                              ; preds = %126
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = icmp ne ptr %129, null
  br i1 %130, label %131, label %147

131:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 20
  %134 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 20
  %135 = load ptr, ptr %132, align 8, !tbaa !43
  %136 = getelementptr inbounds ptr, ptr %135, i64 5
  %137 = load ptr, ptr %136, align 8
  %138 = call noundef i32 %137(ptr noundef nonnull align 8 dereferenceable(8) %132, ptr noundef %133, ptr noundef %134)
  store i32 %138, ptr %21, align 4, !tbaa !9
  %139 = load i32, ptr %21, align 4, !tbaa !9
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %143

141:                                              ; preds = %131
  %142 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %142, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %144

143:                                              ; preds = %131
  store i32 0, ptr %15, align 4
  br label %144

144:                                              ; preds = %143, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  %145 = load i32, ptr %15, align 4
  switch i32 %145, label %168 [
    i32 0, label %146
  ]

146:                                              ; preds = %144
  br label %147

147:                                              ; preds = %146, %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %148

148:                                              ; preds = %152, %147
  %149 = load i32, ptr %16, align 4, !tbaa !9
  %150 = load i32, ptr %19, align 4, !tbaa !9
  %151 = icmp ult i32 %149, %150
  br i1 %151, label %152, label %166

152:                                              ; preds = %148
  %153 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 12
  %154 = load ptr, ptr %153, align 8, !tbaa !42
  %155 = load i32, ptr %16, align 4, !tbaa !9
  %156 = add i32 %155, 1
  store i32 %156, ptr %16, align 4, !tbaa !9
  %157 = zext i32 %155 to i64
  %158 = getelementptr inbounds i8, ptr %154, i64 %157
  %159 = load i8, ptr %158, align 1, !tbaa !45
  %160 = getelementptr inbounds %class.CFilterCoder, ptr %23, i32 0, i32 12
  %161 = load ptr, ptr %160, align 8, !tbaa !42
  %162 = load i32, ptr %22, align 4, !tbaa !9
  %163 = add i32 %162, 1
  store i32 %163, ptr %22, align 4, !tbaa !9
  %164 = zext i32 %162 to i64
  %165 = getelementptr inbounds i8, ptr %161, i64 %164
  store i8 %159, ptr %165, align 1, !tbaa !45
  br label %148, !llvm.loop !48

166:                                              ; preds = %148
  %167 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %167, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  store i32 0, ptr %15, align 4
  br label %168

168:                                              ; preds = %166, %144, %126, %116, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %169

169:                                              ; preds = %168, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %170 = load i32, ptr %15, align 4
  switch i32 %170, label %173 [
    i32 0, label %171
  ]

171:                                              ; preds = %169
  br label %45, !llvm.loop !49

172:                                              ; preds = %45
  store i32 0, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %173

173:                                              ; preds = %172, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %174

174:                                              ; preds = %173, %30
  %175 = load i32, ptr %7, align 4
  ret i32 %175

176:                                              ; preds = %30
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12CFilterCoder4InitEv(ptr noundef nonnull align 8 dereferenceable(200)) #0 align 2

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

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

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

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 = { "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, !28, i64 132}
!12 = !{!"_ZTS12CFilterCoder", !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, !23, i64 72, !24, i64 80, !25, i64 88, !6, i64 96, !26, i64 104, !27, i64 112, !10, i64 120, !10, i64 124, !10, i64 128, !28, i64 132, !29, i64 136, !29, i64 144, !30, i64 152, !31, i64 160, !32, i64 168, !33, i64 176, !34, i64 184, !35, i64 192}
!13 = !{!"_ZTS14ICompressCoder", !14, i64 0}
!14 = !{!"_ZTS8IUnknown"}
!15 = !{!"_ZTS20ICompressSetInStream", !14, i64 0}
!16 = !{!"_ZTS19ISequentialInStream", !14, i64 0}
!17 = !{!"_ZTS21ICompressSetOutStream", !14, i64 0}
!18 = !{!"_ZTS20ISequentialOutStream", !14, i64 0}
!19 = !{!"_ZTS15IOutStreamFlush", !14, i64 0}
!20 = !{!"_ZTS18ICryptoSetPassword", !14, i64 0}
!21 = !{!"_ZTS27ICompressSetCoderProperties", !14, i64 0}
!22 = !{!"_ZTS29ICompressWriteCoderProperties", !14, i64 0}
!23 = !{!"_ZTS22ICryptoResetInitVector", !14, i64 0}
!24 = !{!"_ZTS30ICompressSetDecoderProperties2", !14, i64 0}
!25 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!26 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !6, i64 0}
!27 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !6, i64 0}
!28 = !{!"bool", !7, i64 0}
!29 = !{!"long long", !7, i64 0}
!30 = !{!"_ZTS9CMyComPtrI18ICryptoSetPasswordE", !6, i64 0}
!31 = !{!"_ZTS9CMyComPtrI27ICompressSetCoderPropertiesE", !6, i64 0}
!32 = !{!"_ZTS9CMyComPtrI29ICompressWriteCoderPropertiesE", !6, i64 0}
!33 = !{!"_ZTS9CMyComPtrI22ICryptoResetInitVectorE", !6, i64 0}
!34 = !{!"_ZTS9CMyComPtrI30ICompressSetDecoderProperties2E", !6, i64 0}
!35 = !{!"_ZTS9CMyComPtrI15ICompressFilterE", !6, i64 0}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = !{!29, !29, i64 0}
!39 = !{!12, !29, i64 136}
!40 = !{!41, !41, i64 0}
!41 = !{!"long", !7, i64 0}
!42 = !{!12, !6, i64 96}
!43 = !{!44, !44, i64 0}
!44 = !{!"vtable pointer", !8, i64 0}
!45 = !{!7, !7, i64 0}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}
!48 = distinct !{!48, !47}
!49 = distinct !{!49, !47}


; 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 @_ZN12CFilterCoder14WriteWithLimitEP20ISequentialOutStreamj(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef, i32 noundef) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN12CFilterCoder4CodeEP19ISequentialInStreamP20ISequentialOutStreamPKyS5_P21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(200) %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 i64, align 8
  %8 = tail call noundef i32 @_ZN12CFilterCoder4InitEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  %.not.not = icmp eq i32 %8, 0
  br i1 %.not.not, label %9, label %.loopexit

9:                                                ; preds = %6
  %10 = icmp ne ptr %4, null
  %11 = getelementptr inbounds i8, ptr %0, i64 132
  %12 = zext i1 %10 to i8
  store i8 %12, ptr %11, align 4, !tbaa !5
  br i1 %10, label %13, label %16

13:                                               ; preds = %9
  %14 = load i64, ptr %4, align 8, !tbaa !34
  %15 = getelementptr inbounds i8, ptr %0, i64 136
  store i64 %14, ptr %15, align 8, !tbaa !35
  br label %16

16:                                               ; preds = %13, %9
  %17 = tail call noundef zeroext i1 @_ZNK12CFilterCoder8NeedMoreEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  br i1 %17, label %.lr.ph81, label %.loopexit

.lr.ph81:                                         ; preds = %16
  %18 = getelementptr inbounds i8, ptr %0, i64 96
  %19 = getelementptr inbounds i8, ptr %0, i64 192
  %.not68 = icmp eq ptr %5, null
  %20 = getelementptr inbounds i8, ptr %0, i64 144
  br label %21

21:                                               ; preds = %.lr.ph81, %._crit_edge
  %.05378 = phi i32 [ 0, %.lr.ph81 ], [ %.0.lcssa, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %22 = sub i32 131072, %.05378
  %23 = zext i32 %22 to i64
  store i64 %23, ptr %7, align 8, !tbaa !36
  %24 = load ptr, ptr %18, align 8, !tbaa !38
  %25 = zext i32 %.05378 to i64
  %26 = getelementptr inbounds i8, ptr %24, i64 %25
  %27 = call noundef i32 @_Z10ReadStreamP19ISequentialInStreamPvPm(ptr noundef %1, ptr noundef %26, ptr noundef nonnull %7)
  %.not66 = icmp eq i32 %27, 0
  br i1 %.not66, label %28, label %.thread

28:                                               ; preds = %21
  %29 = load i64, ptr %7, align 8, !tbaa !36
  %30 = trunc i64 %29 to i32
  %31 = add i32 %.05378, %30
  %32 = call noundef ptr @_ZNK9CMyComPtrI15ICompressFilterEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %33 = load ptr, ptr %18, align 8, !tbaa !38
  %34 = load ptr, ptr %32, align 8, !tbaa !39
  %35 = getelementptr inbounds i8, ptr %34, i64 48
  %36 = load ptr, ptr %35, align 8
  %37 = call noundef i32 %36(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef %33, i32 noundef %31)
  %38 = icmp ugt i32 %37, %31
  br i1 %38, label %.preheader.preheader, label %65

.preheader.preheader:                             ; preds = %28
  %39 = zext i32 %31 to i64
  %40 = zext i32 %37 to i64
  %41 = sub nsw i64 %40, %39
  %xtraiter = and i64 %41, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader.prol.loopexit, label %.preheader.prol

.preheader.prol:                                  ; preds = %.preheader.preheader, %.preheader.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.preheader.prol ], [ %39, %.preheader.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.preheader.prol ], [ 0, %.preheader.preheader ]
  %42 = load ptr, ptr %18, align 8, !tbaa !38
  %43 = getelementptr inbounds i8, ptr %42, i64 %indvars.iv.prol
  store i8 0, ptr %43, align 1, !tbaa !41
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.preheader.prol.loopexit, label %.preheader.prol, !llvm.loop !42

.preheader.prol.loopexit:                         ; preds = %.preheader.prol, %.preheader.preheader
  %indvars.iv.unr = phi i64 [ %39, %.preheader.preheader ], [ %indvars.iv.next.prol, %.preheader.prol ]
  %indvars.iv.next.lcssa.unr = phi i64 [ poison, %.preheader.preheader ], [ %indvars.iv.next.prol, %.preheader.prol ]
  %44 = sub nsw i64 %39, %40
  %45 = icmp ugt i64 %44, -4
  br i1 %45, label %.unr-lcssa, label %.preheader

.preheader:                                       ; preds = %.preheader.prol.loopexit, %.preheader
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader ], [ %indvars.iv.unr, %.preheader.prol.loopexit ]
  %46 = load ptr, ptr %18, align 8, !tbaa !38
  %47 = getelementptr inbounds i8, ptr %46, i64 %indvars.iv
  store i8 0, ptr %47, align 1, !tbaa !41
  %48 = load ptr, ptr %18, align 8, !tbaa !38
  %49 = getelementptr i8, ptr %48, i64 %indvars.iv
  %50 = getelementptr i8, ptr %49, i64 1
  store i8 0, ptr %50, align 1, !tbaa !41
  %51 = load ptr, ptr %18, align 8, !tbaa !38
  %52 = getelementptr i8, ptr %51, i64 %indvars.iv
  %53 = getelementptr i8, ptr %52, i64 2
  store i8 0, ptr %53, align 1, !tbaa !41
  %54 = load ptr, ptr %18, align 8, !tbaa !38
  %55 = getelementptr i8, ptr %54, i64 %indvars.iv
  %56 = getelementptr i8, ptr %55, i64 3
  store i8 0, ptr %56, align 1, !tbaa !41
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %57 = icmp ult i64 %indvars.iv.next.3, %40
  br i1 %57, label %.preheader, label %.unr-lcssa, !llvm.loop !44

.unr-lcssa:                                       ; preds = %.preheader, %.preheader.prol.loopexit
  %indvars.iv.next.lcssa = phi i64 [ %indvars.iv.next.lcssa.unr, %.preheader.prol.loopexit ], [ %indvars.iv.next.3, %.preheader ]
  %58 = trunc nuw i64 %indvars.iv.next.lcssa to i32
  %59 = call noundef ptr @_ZNK9CMyComPtrI15ICompressFilterEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %60 = load ptr, ptr %18, align 8, !tbaa !38
  %61 = load ptr, ptr %59, align 8, !tbaa !39
  %62 = getelementptr inbounds i8, ptr %61, i64 48
  %63 = load ptr, ptr %62, align 8
  %64 = call noundef i32 %63(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef %60, i32 noundef %58)
  br label %65

65:                                               ; preds = %.unr-lcssa, %28
  %.154 = phi i32 [ %64, %.unr-lcssa ], [ %37, %28 ]
  %.152 = phi i32 [ %58, %.unr-lcssa ], [ %31, %28 ]
  %66 = icmp eq i32 %.154, 0
  br i1 %66, label %67, label %70

67:                                               ; preds = %65
  %.not70 = icmp eq i32 %.152, 0
  br i1 %.not70, label %.thread, label %68

68:                                               ; preds = %67
  %69 = call noundef i32 @_ZN12CFilterCoder14WriteWithLimitEP20ISequentialOutStreamj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %2, i32 noundef %.152)
  br label %.thread

70:                                               ; preds = %65
  %71 = call noundef i32 @_ZN12CFilterCoder14WriteWithLimitEP20ISequentialOutStreamj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %2, i32 noundef %.154)
  %.not67 = icmp eq i32 %71, 0
  br i1 %.not67, label %72, label %.thread

72:                                               ; preds = %70
  br i1 %.not68, label %78, label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %5, align 8, !tbaa !39
  %75 = getelementptr inbounds i8, ptr %74, i64 40
  %76 = load ptr, ptr %75, align 8
  %77 = call noundef i32 %76(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %20, ptr noundef nonnull %20)
  %.not69 = icmp eq i32 %77, 0
  br i1 %.not69, label %78, label %.thread

78:                                               ; preds = %73, %72
  %79 = icmp ult i32 %.154, %.152
  br i1 %79, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %78
  %80 = zext i32 %.154 to i64
  %81 = zext i32 %.152 to i64
  %82 = sub nsw i64 %81, %80
  %xtraiter95 = and i64 %82, 3
  %83 = sub nsw i64 %80, %81
  %84 = icmp ugt i64 %83, -4
  br i1 %84, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %82, -4
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv87 = phi i64 [ %80, %.lr.ph.preheader.new ], [ %indvars.iv.next88.3, %.lr.ph ]
  %indvars.iv85 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next86.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %85 = load ptr, ptr %18, align 8, !tbaa !38
  %86 = getelementptr inbounds i8, ptr %85, i64 %indvars.iv87
  %87 = load i8, ptr %86, align 1, !tbaa !41
  %indvars.iv.next86 = or disjoint i64 %indvars.iv85, 1
  %88 = getelementptr inbounds i8, ptr %85, i64 %indvars.iv85
  store i8 %87, ptr %88, align 1, !tbaa !41
  %89 = load ptr, ptr %18, align 8, !tbaa !38
  %90 = getelementptr inbounds i8, ptr %89, i64 %indvars.iv87
  %91 = getelementptr inbounds i8, ptr %90, i64 1
  %92 = load i8, ptr %91, align 1, !tbaa !41
  %indvars.iv.next86.1 = or disjoint i64 %indvars.iv85, 2
  %93 = getelementptr inbounds i8, ptr %89, i64 %indvars.iv.next86
  store i8 %92, ptr %93, align 1, !tbaa !41
  %94 = load ptr, ptr %18, align 8, !tbaa !38
  %95 = getelementptr inbounds i8, ptr %94, i64 %indvars.iv87
  %96 = getelementptr inbounds i8, ptr %95, i64 2
  %97 = load i8, ptr %96, align 1, !tbaa !41
  %indvars.iv.next86.2 = or disjoint i64 %indvars.iv85, 3
  %98 = getelementptr inbounds i8, ptr %94, i64 %indvars.iv.next86.1
  store i8 %97, ptr %98, align 1, !tbaa !41
  %99 = load ptr, ptr %18, align 8, !tbaa !38
  %indvars.iv.next88.3 = add nuw nsw i64 %indvars.iv87, 4
  %100 = getelementptr inbounds i8, ptr %99, i64 %indvars.iv87
  %101 = getelementptr inbounds i8, ptr %100, i64 3
  %102 = load i8, ptr %101, align 1, !tbaa !41
  %indvars.iv.next86.3 = add nuw nsw i64 %indvars.iv85, 4
  %103 = getelementptr inbounds i8, ptr %99, i64 %indvars.iv.next86.2
  store i8 %102, ptr %103, align 1, !tbaa !41
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !46

.thread:                                          ; preds = %21, %73, %70, %68, %67
  %.7.ph = phi i32 [ 0, %67 ], [ %69, %68 ], [ %27, %21 ], [ %77, %73 ], [ %71, %70 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %.loopexit

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv87.unr = phi i64 [ %80, %.lr.ph.preheader ], [ %indvars.iv.next88.3, %.lr.ph ]
  %indvars.iv85.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next86.3, %.lr.ph ]
  %lcmp.mod96.not = icmp eq i64 %xtraiter95, 0
  br i1 %lcmp.mod96.not, label %._crit_edge.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv87.epil = phi i64 [ %indvars.iv.next88.epil, %.lr.ph.epil ], [ %indvars.iv87.unr, %._crit_edge.loopexit.unr-lcssa ]
  %indvars.iv85.epil = phi i64 [ %indvars.iv.next86.epil, %.lr.ph.epil ], [ %indvars.iv85.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %104 = load ptr, ptr %18, align 8, !tbaa !38
  %indvars.iv.next88.epil = add nuw nsw i64 %indvars.iv87.epil, 1
  %105 = getelementptr inbounds i8, ptr %104, i64 %indvars.iv87.epil
  %106 = load i8, ptr %105, align 1, !tbaa !41
  %indvars.iv.next86.epil = add nuw nsw i64 %indvars.iv85.epil, 1
  %107 = getelementptr inbounds i8, ptr %104, i64 %indvars.iv85.epil
  store i8 %106, ptr %107, align 1, !tbaa !41
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter95
  br i1 %epil.iter.cmp.not, label %._crit_edge.loopexit, label %.lr.ph.epil, !llvm.loop !47

._crit_edge.loopexit:                             ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa
  %108 = sub i32 %.152, %.154
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %78
  %.0.lcssa = phi i32 [ 0, %78 ], [ %108, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  %109 = call noundef zeroext i1 @_ZNK12CFilterCoder8NeedMoreEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  br i1 %109, label %21, label %.loopexit, !llvm.loop !48

.loopexit:                                        ; preds = %._crit_edge, %16, %.thread, %6
  %.9 = phi i32 [ %8, %6 ], [ %.7.ph, %.thread ], [ 0, %16 ], [ 0, %._crit_edge ]
  ret i32 %.9
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12CFilterCoder4InitEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #0 align 2

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

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

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

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 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 = { "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, !26, i64 132}
!6 = !{!"_ZTS12CFilterCoder", !7, i64 0, !9, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !13, i64 40, !14, i64 48, !15, i64 56, !16, i64 64, !17, i64 72, !18, i64 80, !19, i64 88, !23, i64 96, !24, i64 104, !25, i64 112, !20, i64 120, !20, i64 124, !20, i64 128, !26, i64 132, !27, i64 136, !27, i64 144, !28, i64 152, !29, i64 160, !30, i64 168, !31, i64 176, !32, i64 184, !33, i64 192}
!7 = !{!"_ZTS14ICompressCoder", !8, i64 0}
!8 = !{!"_ZTS8IUnknown"}
!9 = !{!"_ZTS20ICompressSetInStream", !8, i64 0}
!10 = !{!"_ZTS19ISequentialInStream", !8, i64 0}
!11 = !{!"_ZTS21ICompressSetOutStream", !8, i64 0}
!12 = !{!"_ZTS20ISequentialOutStream", !8, i64 0}
!13 = !{!"_ZTS15IOutStreamFlush", !8, i64 0}
!14 = !{!"_ZTS18ICryptoSetPassword", !8, i64 0}
!15 = !{!"_ZTS27ICompressSetCoderProperties", !8, i64 0}
!16 = !{!"_ZTS29ICompressWriteCoderProperties", !8, i64 0}
!17 = !{!"_ZTS22ICryptoResetInitVector", !8, i64 0}
!18 = !{!"_ZTS30ICompressSetDecoderProperties2", !8, i64 0}
!19 = !{!"_ZTS13CMyUnknownImp", !20, i64 0}
!20 = !{!"int", !21, i64 0}
!21 = !{!"omnipotent char", !22, i64 0}
!22 = !{!"Simple C++ TBAA"}
!23 = !{!"any pointer", !21, i64 0}
!24 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !23, i64 0}
!25 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !23, i64 0}
!26 = !{!"bool", !21, i64 0}
!27 = !{!"long long", !21, i64 0}
!28 = !{!"_ZTS9CMyComPtrI18ICryptoSetPasswordE", !23, i64 0}
!29 = !{!"_ZTS9CMyComPtrI27ICompressSetCoderPropertiesE", !23, i64 0}
!30 = !{!"_ZTS9CMyComPtrI29ICompressWriteCoderPropertiesE", !23, i64 0}
!31 = !{!"_ZTS9CMyComPtrI22ICryptoResetInitVectorE", !23, i64 0}
!32 = !{!"_ZTS9CMyComPtrI30ICompressSetDecoderProperties2E", !23, i64 0}
!33 = !{!"_ZTS9CMyComPtrI15ICompressFilterE", !23, i64 0}
!34 = !{!27, !27, i64 0}
!35 = !{!6, !27, i64 136}
!36 = !{!37, !37, i64 0}
!37 = !{!"long", !21, i64 0}
!38 = !{!6, !23, i64 96}
!39 = !{!40, !40, i64 0}
!40 = !{!"vtable pointer", !22, i64 0}
!41 = !{!21, !21, i64 0}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.unroll.disable"}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}
!46 = distinct !{!46, !45}
!47 = distinct !{!47, !43}
!48 = distinct !{!48, !45}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass