; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/CPP/7zip/Common/FilterCoder.ll (ZN12CFilterCoder6Flush2Ev)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN12CFilterCoder6Flush2Ev(ptr noundef nonnull align 8 dereferenceable(256) %0) #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  br label %13

13:                                               ; preds = %95, %1
  %14 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 28
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %96

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %18 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 28
  %19 = load i32, ptr %18, align 8, !tbaa !9
  store i32 %19, ptr %4, align 4, !tbaa !41
  %20 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 21
  %21 = load i8, ptr %20, align 1, !tbaa !42, !range !43, !noundef !44
  %22 = trunc i8 %21 to i1
  br i1 %22, label %23, label %44

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %24 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 22
  %25 = load i64, ptr %24, align 8, !tbaa !45
  %26 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 23
  %27 = load i64, ptr %26, align 8, !tbaa !46
  %28 = sub i64 %25, %27
  store i64 %28, ptr %5, align 8, !tbaa !47
  %29 = load i32, ptr %4, align 4, !tbaa !41
  %30 = zext i32 %29 to i64
  %31 = load i64, ptr %5, align 8, !tbaa !47
  %32 = icmp ugt i64 %30, %31
  br i1 %32, label %33, label %36

33:                                               ; preds = %23
  %34 = load i64, ptr %5, align 8, !tbaa !47
  %35 = trunc i64 %34 to i32
  store i32 %35, ptr %4, align 4, !tbaa !41
  br label %36

36:                                               ; preds = %33, %23
  %37 = load i32, ptr %4, align 4, !tbaa !41
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store i32 536870928, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %41

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

41:                                               ; preds = %40, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %42 = load i32, ptr %6, align 4
  switch i32 %42, label %93 [
    i32 0, label %43
  ]

43:                                               ; preds = %41
  br label %44

44:                                               ; preds = %43, %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !41
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %45 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 25
  %46 = call noundef ptr @_ZNK9CMyComPtrI20ISequentialOutStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %45)
  %47 = getelementptr inbounds i8, ptr %12, i64 128
  %48 = getelementptr inbounds %struct.CAlignedMidBuffer, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !48
  %50 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 27
  %51 = load i32, ptr %50, align 4, !tbaa !49
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %49, i64 %52
  %54 = load i32, ptr %4, align 4, !tbaa !41
  %55 = load ptr, ptr %46, align 8, !tbaa !50
  %56 = getelementptr inbounds ptr, ptr %55, i64 5
  %57 = load ptr, ptr %56, align 8
  %58 = call noundef i32 %57(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef %53, i32 noundef %54, ptr noundef %7)
  store i32 %58, ptr %8, align 4, !tbaa !41
  %59 = load i32, ptr %7, align 4, !tbaa !41
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %69

61:                                               ; preds = %44
  %62 = load i32, ptr %8, align 4, !tbaa !41
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %66

64:                                               ; preds = %61
  %65 = load i32, ptr %8, align 4, !tbaa !41
  br label %67

66:                                               ; preds = %61
  br label %67

67:                                               ; preds = %66, %64
  %68 = phi i32 [ %65, %64 ], [ -2147467259, %66 ]
  store i32 %68, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %92

69:                                               ; preds = %44
  %70 = load i32, ptr %7, align 4, !tbaa !41
  %71 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 27
  %72 = load i32, ptr %71, align 4, !tbaa !49
  %73 = add i32 %72, %70
  store i32 %73, ptr %71, align 4, !tbaa !49
  %74 = load i32, ptr %7, align 4, !tbaa !41
  %75 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 28
  %76 = load i32, ptr %75, align 8, !tbaa !9
  %77 = sub i32 %76, %74
  store i32 %77, ptr %75, align 8, !tbaa !9
  %78 = load i32, ptr %7, align 4, !tbaa !41
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 23
  %81 = load i64, ptr %80, align 8, !tbaa !46
  %82 = add i64 %81, %79
  store i64 %82, ptr %80, align 8, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %83 = load i32, ptr %8, align 4, !tbaa !41
  store i32 %83, ptr %9, align 4, !tbaa !41
  %84 = load i32, ptr %9, align 4, !tbaa !41
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %69
  %87 = load i32, ptr %9, align 4, !tbaa !41
  store i32 %87, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %89

88:                                               ; preds = %69
  store i32 0, ptr %6, align 4
  br label %89

89:                                               ; preds = %88, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %90 = load i32, ptr %6, align 4
  switch i32 %90, label %92 [
    i32 0, label %91
  ]

91:                                               ; preds = %89
  store i32 0, ptr %6, align 4
  br label %92

92:                                               ; preds = %91, %89, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %93

93:                                               ; preds = %92, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %94 = load i32, ptr %6, align 4
  switch i32 %94, label %138 [
    i32 0, label %95
    i32 1, label %136
  ]

95:                                               ; preds = %93
  br label %13, !llvm.loop !52

96:                                               ; preds = %13
  %97 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 27
  %98 = load i32, ptr %97, align 4, !tbaa !49
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %135

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %101 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 26
  %102 = load i32, ptr %101, align 8, !tbaa !54
  %103 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 27
  %104 = load i32, ptr %103, align 4, !tbaa !49
  %105 = sub i32 %102, %104
  store i32 %105, ptr %10, align 4, !tbaa !41
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !41
  br label %106

106:                                              ; preds = %128, %100
  %107 = load i32, ptr %11, align 4, !tbaa !41
  %108 = load i32, ptr %10, align 4, !tbaa !41
  %109 = icmp ult i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 4, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %131

111:                                              ; preds = %106
  %112 = getelementptr inbounds i8, ptr %12, i64 128
  %113 = getelementptr inbounds %struct.CAlignedMidBuffer, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !48
  %115 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 27
  %116 = load i32, ptr %115, align 4, !tbaa !49
  %117 = load i32, ptr %11, align 4, !tbaa !41
  %118 = add i32 %116, %117
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds i8, ptr %114, i64 %119
  %121 = load i8, ptr %120, align 1, !tbaa !55
  %122 = getelementptr inbounds i8, ptr %12, i64 128
  %123 = getelementptr inbounds %struct.CAlignedMidBuffer, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !48
  %125 = load i32, ptr %11, align 4, !tbaa !41
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds i8, ptr %124, i64 %126
  store i8 %121, ptr %127, align 1, !tbaa !55
  br label %128

128:                                              ; preds = %111
  %129 = load i32, ptr %11, align 4, !tbaa !41
  %130 = add i32 %129, 1
  store i32 %130, ptr %11, align 4, !tbaa !41
  br label %106, !llvm.loop !56

131:                                              ; preds = %110
  %132 = load i32, ptr %10, align 4, !tbaa !41
  %133 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 26
  store i32 %132, ptr %133, align 8, !tbaa !54
  %134 = getelementptr inbounds %class.CFilterCoder, ptr %12, i32 0, i32 27
  store i32 0, ptr %134, align 4, !tbaa !49
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %135

135:                                              ; preds = %131, %96
  store i32 0, ptr %2, align 4
  br label %136

136:                                              ; preds = %135, %93
  %137 = load i32, ptr %2, align 4
  ret i32 %137

138:                                              ; preds = %93
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9CMyComPtrI20ISequentialOutStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #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, !28, i64 192}
!10 = !{!"_ZTS12CFilterCoder", !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, !22, i64 80, !23, i64 88, !24, i64 96, !25, i64 104, !26, i64 112, !27, i64 120, !29, i64 128, !28, i64 136, !28, i64 140, !28, i64 144, !30, i64 148, !30, i64 149, !31, i64 152, !31, i64 160, !32, i64 168, !33, i64 176, !28, i64 184, !28, i64 188, !28, i64 192, !34, i64 200, !35, i64 208, !36, i64 216, !37, i64 224, !38, i64 232, !39, i64 240, !40, i64 248}
!11 = !{!"_ZTS14ICompressCoder", !12, i64 0}
!12 = !{!"_ZTS8IUnknown"}
!13 = !{!"_ZTS25ICompressSetOutStreamSize", !12, i64 0}
!14 = !{!"_ZTS20ICompressInitEncoder", !12, i64 0}
!15 = !{!"_ZTS20ICompressSetInStream", !12, i64 0}
!16 = !{!"_ZTS19ISequentialInStream", !12, i64 0}
!17 = !{!"_ZTS21ICompressSetOutStream", !12, i64 0}
!18 = !{!"_ZTS20ISequentialOutStream", !12, i64 0}
!19 = !{!"_ZTS16IOutStreamFinish", !12, i64 0}
!20 = !{!"_ZTS19ICompressSetBufSize", !12, i64 0}
!21 = !{!"_ZTS18ICryptoSetPassword", !12, i64 0}
!22 = !{!"_ZTS17ICryptoProperties", !12, i64 0}
!23 = !{!"_ZTS27ICompressSetCoderProperties", !12, i64 0}
!24 = !{!"_ZTS29ICompressWriteCoderProperties", !12, i64 0}
!25 = !{!"_ZTS22ICryptoResetInitVector", !12, i64 0}
!26 = !{!"_ZTS30ICompressSetDecoderProperties2", !12, i64 0}
!27 = !{!"_ZTS13CMyUnknownImp", !28, i64 0}
!28 = !{!"int", !7, i64 0}
!29 = !{!"_ZTS17CAlignedMidBuffer", !6, i64 0}
!30 = !{!"bool", !7, i64 0}
!31 = !{!"long long", !7, i64 0}
!32 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !6, i64 0}
!33 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !6, i64 0}
!34 = !{!"_ZTS9CMyComPtrI18ICryptoSetPasswordE", !6, i64 0}
!35 = !{!"_ZTS9CMyComPtrI17ICryptoPropertiesE", !6, i64 0}
!36 = !{!"_ZTS9CMyComPtrI27ICompressSetCoderPropertiesE", !6, i64 0}
!37 = !{!"_ZTS9CMyComPtrI29ICompressWriteCoderPropertiesE", !6, i64 0}
!38 = !{!"_ZTS9CMyComPtrI22ICryptoResetInitVectorE", !6, i64 0}
!39 = !{!"_ZTS9CMyComPtrI30ICompressSetDecoderProperties2E", !6, i64 0}
!40 = !{!"_ZTS9CMyComPtrI15ICompressFilterE", !6, i64 0}
!41 = !{!28, !28, i64 0}
!42 = !{!10, !30, i64 149}
!43 = !{i8 0, i8 2}
!44 = !{}
!45 = !{!10, !31, i64 152}
!46 = !{!10, !31, i64 160}
!47 = !{!31, !31, i64 0}
!48 = !{!29, !6, i64 0}
!49 = !{!10, !28, i64 188}
!50 = !{!51, !51, i64 0}
!51 = !{!"vtable pointer", !8, i64 0}
!52 = distinct !{!52, !53}
!53 = !{!"llvm.loop.mustprogress"}
!54 = !{!10, !28, i64 184}
!55 = !{!7, !7, i64 0}
!56 = distinct !{!56, !53}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN12CFilterCoder6Flush2Ev(ptr noundef nonnull align 8 dereferenceable(256) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca i32, align 4
  %3 = getelementptr inbounds i8, ptr %0, i64 192
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %.not46 = icmp eq i32 %4, 0
  br i1 %.not46, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 188
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !40
  br label %._crit_edge

.lr.ph:                                           ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 149
  %6 = getelementptr inbounds i8, ptr %0, i64 152
  %7 = getelementptr inbounds i8, ptr %0, i64 160
  %8 = getelementptr inbounds i8, ptr %0, i64 176
  %9 = getelementptr inbounds i8, ptr %0, i64 128
  %10 = getelementptr inbounds i8, ptr %0, i64 188
  br label %11

11:                                               ; preds = %.lr.ph, %44
  %12 = phi i32 [ %4, %.lr.ph ], [ %40, %44 ]
  %13 = load i8, ptr %5, align 1, !tbaa !41, !range !42, !noundef !43
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %15, label %22

15:                                               ; preds = %11
  %16 = load i64, ptr %6, align 8, !tbaa !44
  %17 = load i64, ptr %7, align 8, !tbaa !45
  %18 = sub i64 %16, %17
  %19 = zext i32 %12 to i64
  %20 = icmp ult i64 %18, %19
  %21 = trunc nuw i64 %18 to i32
  %spec.select = select i1 %20, i32 %21, i32 %12
  %.not35 = icmp eq i32 %spec.select, 0
  br i1 %.not35, label %.thread, label %22

22:                                               ; preds = %15, %11
  %.123 = phi i32 [ %spec.select, %15 ], [ %12, %11 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 0, ptr %2, align 4, !tbaa !46
  %23 = call noundef ptr @_ZNK9CMyComPtrI20ISequentialOutStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %24 = load ptr, ptr %9, align 8, !tbaa !47
  %25 = load i32, ptr %10, align 4, !tbaa !40
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %24, i64 %26
  %28 = load ptr, ptr %23, align 8, !tbaa !48
  %29 = getelementptr inbounds i8, ptr %28, i64 40
  %30 = load ptr, ptr %29, align 8
  %31 = call noundef i32 %30(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef %27, i32 noundef %.123, ptr noundef nonnull %2)
  %32 = load i32, ptr %2, align 4, !tbaa !46
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %22
  %.not37 = icmp eq i32 %31, 0
  %35 = select i1 %.not37, i32 -2147467259, i32 %31
  br label %.thread41

36:                                               ; preds = %22
  %37 = load i32, ptr %10, align 4, !tbaa !40
  %38 = add i32 %37, %32
  store i32 %38, ptr %10, align 4, !tbaa !40
  %39 = load i32, ptr %3, align 8, !tbaa !5
  %40 = sub i32 %39, %32
  store i32 %40, ptr %3, align 8, !tbaa !5
  %41 = zext i32 %32 to i64
  %42 = load i64, ptr %7, align 8, !tbaa !45
  %43 = add i64 %42, %41
  store i64 %43, ptr %7, align 8, !tbaa !45
  %.not36 = icmp eq i32 %31, 0
  br i1 %.not36, label %44, label %.thread41

.thread41:                                        ; preds = %36, %34
  %.4.ph = phi i32 [ %35, %34 ], [ %31, %36 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br label %.thread

44:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  %.not = icmp eq i32 %40, 0
  br i1 %.not, label %._crit_edge, label %11

._crit_edge:                                      ; preds = %44, %.._crit_edge_crit_edge
  %45 = phi i32 [ %.pre, %.._crit_edge_crit_edge ], [ %38, %44 ]
  %46 = getelementptr inbounds i8, ptr %0, i64 188
  %.not34 = icmp eq i32 %45, 0
  br i1 %.not34, label %.thread, label %47

47:                                               ; preds = %._crit_edge
  %48 = getelementptr inbounds i8, ptr %0, i64 184
  %49 = load i32, ptr %48, align 8, !tbaa !50
  %50 = sub i32 %49, %45
  %.not51 = icmp eq i32 %49, %45
  br i1 %.not51, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %47
  %51 = getelementptr inbounds i8, ptr %0, i64 128
  %wide.trip.count = zext i32 %50 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %52 = icmp eq i32 %50, 1
  br i1 %52, label %._crit_edge50.loopexit.unr-lcssa, label %.lr.ph49.new

.lr.ph49.new:                                     ; preds = %.lr.ph49
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  br label %61

._crit_edge50.loopexit.unr-lcssa:                 ; preds = %61, %.lr.ph49
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph49 ], [ %indvars.iv.next.1, %61 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge50, label %._crit_edge50.loopexit.epilog-lcssa

._crit_edge50.loopexit.epilog-lcssa:              ; preds = %._crit_edge50.loopexit.unr-lcssa
  %53 = load ptr, ptr %51, align 8, !tbaa !47
  %54 = load i32, ptr %46, align 4, !tbaa !40
  %55 = trunc nuw i64 %indvars.iv.unr to i32
  %56 = add i32 %54, %55
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %53, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !51
  %60 = getelementptr inbounds i8, ptr %53, i64 %indvars.iv.unr
  store i8 %59, ptr %60, align 1, !tbaa !51
  br label %._crit_edge50

._crit_edge50:                                    ; preds = %._crit_edge50.loopexit.epilog-lcssa, %._crit_edge50.loopexit.unr-lcssa, %47
  store i32 %50, ptr %48, align 8, !tbaa !50
  store i32 0, ptr %46, align 4, !tbaa !40
  br label %.thread

61:                                               ; preds = %61, %.lr.ph49.new
  %indvars.iv = phi i64 [ 0, %.lr.ph49.new ], [ %indvars.iv.next.1, %61 ]
  %niter = phi i64 [ 0, %.lr.ph49.new ], [ %niter.next.1, %61 ]
  %62 = load ptr, ptr %51, align 8, !tbaa !47
  %63 = load i32, ptr %46, align 4, !tbaa !40
  %64 = trunc nuw i64 %indvars.iv to i32
  %65 = add i32 %63, %64
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %62, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !51
  %69 = getelementptr inbounds i8, ptr %62, i64 %indvars.iv
  store i8 %68, ptr %69, align 1, !tbaa !51
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %70 = load ptr, ptr %51, align 8, !tbaa !47
  %71 = load i32, ptr %46, align 4, !tbaa !40
  %72 = trunc nuw i64 %indvars.iv.next to i32
  %73 = add i32 %71, %72
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %70, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !51
  %77 = getelementptr inbounds i8, ptr %70, i64 %indvars.iv.next
  store i8 %76, ptr %77, align 1, !tbaa !51
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge50.loopexit.unr-lcssa, label %61, !llvm.loop !52

.thread:                                          ; preds = %15, %.thread41, %._crit_edge, %._crit_edge50
  %.6 = phi i32 [ 0, %._crit_edge50 ], [ 0, %._crit_edge ], [ %.4.ph, %.thread41 ], [ 536870928, %15 ]
  ret i32 %.6
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9CMyComPtrI20ISequentialOutStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_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 192}
!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, !20, i64 96, !21, i64 104, !22, i64 112, !23, i64 120, !27, i64 128, !24, i64 136, !24, i64 140, !24, i64 144, !29, i64 148, !29, i64 149, !30, i64 152, !30, i64 160, !31, i64 168, !32, i64 176, !24, i64 184, !24, i64 188, !24, i64 192, !33, i64 200, !34, i64 208, !35, i64 216, !36, i64 224, !37, i64 232, !38, i64 240, !39, i64 248}
!7 = !{!"_ZTS14ICompressCoder", !8, i64 0}
!8 = !{!"_ZTS8IUnknown"}
!9 = !{!"_ZTS25ICompressSetOutStreamSize", !8, i64 0}
!10 = !{!"_ZTS20ICompressInitEncoder", !8, i64 0}
!11 = !{!"_ZTS20ICompressSetInStream", !8, i64 0}
!12 = !{!"_ZTS19ISequentialInStream", !8, i64 0}
!13 = !{!"_ZTS21ICompressSetOutStream", !8, i64 0}
!14 = !{!"_ZTS20ISequentialOutStream", !8, i64 0}
!15 = !{!"_ZTS16IOutStreamFinish", !8, i64 0}
!16 = !{!"_ZTS19ICompressSetBufSize", !8, i64 0}
!17 = !{!"_ZTS18ICryptoSetPassword", !8, i64 0}
!18 = !{!"_ZTS17ICryptoProperties", !8, i64 0}
!19 = !{!"_ZTS27ICompressSetCoderProperties", !8, i64 0}
!20 = !{!"_ZTS29ICompressWriteCoderProperties", !8, i64 0}
!21 = !{!"_ZTS22ICryptoResetInitVector", !8, i64 0}
!22 = !{!"_ZTS30ICompressSetDecoderProperties2", !8, i64 0}
!23 = !{!"_ZTS13CMyUnknownImp", !24, i64 0}
!24 = !{!"int", !25, i64 0}
!25 = !{!"omnipotent char", !26, i64 0}
!26 = !{!"Simple C++ TBAA"}
!27 = !{!"_ZTS17CAlignedMidBuffer", !28, i64 0}
!28 = !{!"any pointer", !25, i64 0}
!29 = !{!"bool", !25, i64 0}
!30 = !{!"long long", !25, i64 0}
!31 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !28, i64 0}
!32 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !28, i64 0}
!33 = !{!"_ZTS9CMyComPtrI18ICryptoSetPasswordE", !28, i64 0}
!34 = !{!"_ZTS9CMyComPtrI17ICryptoPropertiesE", !28, i64 0}
!35 = !{!"_ZTS9CMyComPtrI27ICompressSetCoderPropertiesE", !28, i64 0}
!36 = !{!"_ZTS9CMyComPtrI29ICompressWriteCoderPropertiesE", !28, i64 0}
!37 = !{!"_ZTS9CMyComPtrI22ICryptoResetInitVectorE", !28, i64 0}
!38 = !{!"_ZTS9CMyComPtrI30ICompressSetDecoderProperties2E", !28, i64 0}
!39 = !{!"_ZTS9CMyComPtrI15ICompressFilterE", !28, i64 0}
!40 = !{!6, !24, i64 188}
!41 = !{!6, !29, i64 149}
!42 = !{i8 0, i8 2}
!43 = !{}
!44 = !{!6, !30, i64 152}
!45 = !{!6, !30, i64 160}
!46 = !{!24, !24, i64 0}
!47 = !{!27, !28, i64 0}
!48 = !{!49, !49, i64 0}
!49 = !{!"vtable pointer", !26, i64 0}
!50 = !{!6, !24, i64 184}
!51 = !{!25, !25, i64 0}
!52 = distinct !{!52, !53}
!53 = !{!"llvm.loop.mustprogress"}


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