; 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"

%struct.GUID = type { i32, i16, i16, [8 x i8] }
%class.CMyComPtr.7 = type { ptr }
%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 }

@IID_IOutStreamFlush = external global %struct.GUID, align 4

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN12CFilterCoder5FlushEv(ptr noundef nonnull align 8 dereferenceable(200) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %class.CMyComPtr.7, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  %11 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 15
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %81

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %15 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 26
  %16 = call noundef ptr @_ZNK9CMyComPtrI15ICompressFilterEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %17 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 12
  %18 = load ptr, ptr %17, align 8, !tbaa !35
  %19 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 15
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = load ptr, ptr %16, align 8, !tbaa !36
  %22 = getelementptr inbounds ptr, ptr %21, i64 6
  %23 = load ptr, ptr %22, align 8
  %24 = call noundef i32 %23(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef %18, i32 noundef %20)
  store i32 %24, ptr %4, align 4, !tbaa !38
  %25 = load i32, ptr %4, align 4, !tbaa !38
  %26 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 15
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = icmp ugt i32 %25, %27
  br i1 %28, label %29, label %60

29:                                               ; preds = %14
  br label %30

30:                                               ; preds = %42, %29
  %31 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 15
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %33 = load i32, ptr %4, align 4, !tbaa !38
  %34 = icmp ult i32 %32, %33
  br i1 %34, label %35, label %46

35:                                               ; preds = %30
  %36 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 12
  %37 = load ptr, ptr %36, align 8, !tbaa !35
  %38 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 15
  %39 = load i32, ptr %38, align 8, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %37, i64 %40
  store i8 0, ptr %41, align 1, !tbaa !39
  br label %42

42:                                               ; preds = %35
  %43 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 15
  %44 = load i32, ptr %43, align 8, !tbaa !9
  %45 = add i32 %44, 1
  store i32 %45, ptr %43, align 8, !tbaa !9
  br label %30, !llvm.loop !40

46:                                               ; preds = %30
  %47 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 26
  %48 = call noundef ptr @_ZNK9CMyComPtrI15ICompressFilterEptEv(ptr noundef nonnull align 8 dereferenceable(8) %47)
  %49 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 12
  %50 = load ptr, ptr %49, align 8, !tbaa !35
  %51 = load i32, ptr %4, align 4, !tbaa !38
  %52 = load ptr, ptr %48, align 8, !tbaa !36
  %53 = getelementptr inbounds ptr, ptr %52, i64 6
  %54 = load ptr, ptr %53, align 8
  %55 = call noundef i32 %54(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef %50, i32 noundef %51)
  %56 = load i32, ptr %4, align 4, !tbaa !38
  %57 = icmp ne i32 %55, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %46
  store i32 -2147467259, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %78

59:                                               ; preds = %46
  br label %60

60:                                               ; preds = %59, %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %61 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 14
  %62 = call noundef ptr @_ZNK9CMyComPtrI20ISequentialOutStreamEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %61)
  %63 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 12
  %64 = load ptr, ptr %63, align 8, !tbaa !35
  %65 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 15
  %66 = load i32, ptr %65, align 8, !tbaa !9
  %67 = zext i32 %66 to i64
  %68 = call noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef %62, ptr noundef %64, i64 noundef %67)
  store i32 %68, ptr %6, align 4, !tbaa !38
  %69 = load i32, ptr %6, align 4, !tbaa !38
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %60
  %72 = load i32, ptr %6, align 4, !tbaa !38
  store i32 %72, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %74

73:                                               ; preds = %60
  store i32 0, ptr %5, align 4
  br label %74

74:                                               ; preds = %73, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %75 = load i32, ptr %5, align 4
  switch i32 %75, label %78 [
    i32 0, label %76
  ]

76:                                               ; preds = %74
  %77 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 15
  store i32 0, ptr %77, align 8, !tbaa !9
  store i32 0, ptr %5, align 4
  br label %78

78:                                               ; preds = %76, %74, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %79 = load i32, ptr %5, align 4
  switch i32 %79, label %111 [
    i32 0, label %80
    i32 1, label %104
  ]

80:                                               ; preds = %78
  br label %81

81:                                               ; preds = %80, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @_ZN9CMyComPtrI15IOutStreamFlushEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %82 = getelementptr inbounds %class.CFilterCoder, ptr %10, i32 0, i32 14
  %83 = invoke noundef ptr @_ZN9CMyComPtrI15IOutStreamFlushEadEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %84 unwind label %98

84:                                               ; preds = %81
  %85 = invoke noundef i32 @_ZNK9CMyComPtrI20ISequentialOutStreamE14QueryInterfaceI15IOutStreamFlushEEiRK4GUIDPPT_(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull align 4 dereferenceable(16) @IID_IOutStreamFlush, ptr noundef %83)
          to label %86 unwind label %98

86:                                               ; preds = %84
  %87 = invoke noundef ptr @_ZNK9CMyComPtrI15IOutStreamFlushEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %88 unwind label %98

88:                                               ; preds = %86
  %89 = icmp ne ptr %87, null
  br i1 %89, label %90, label %102

90:                                               ; preds = %88
  %91 = invoke noundef ptr @_ZNK9CMyComPtrI15IOutStreamFlushEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %92 unwind label %98

92:                                               ; preds = %90
  %93 = load ptr, ptr %91, align 8, !tbaa !36
  %94 = getelementptr inbounds ptr, ptr %93, i64 5
  %95 = load ptr, ptr %94, align 8
  %96 = invoke noundef i32 %95(ptr noundef nonnull align 8 dereferenceable(8) %91)
          to label %97 unwind label %98

97:                                               ; preds = %92
  store i32 %96, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %103

98:                                               ; preds = %92, %90, %86, %84, %81
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %8, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %9, align 4
  call void @_ZN9CMyComPtrI15IOutStreamFlushED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %106

102:                                              ; preds = %88
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %103

103:                                              ; preds = %102, %97
  call void @_ZN9CMyComPtrI15IOutStreamFlushED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %104

104:                                              ; preds = %103, %78
  %105 = load i32, ptr %2, align 4
  ret i32 %105

106:                                              ; preds = %98
  %107 = load ptr, ptr %8, align 8
  %108 = load i32, ptr %9, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110

111:                                              ; preds = %78
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9CMyComPtrI20ISequentialOutStreamE14QueryInterfaceI15IOutStreamFlushEEiRK4GUIDPPT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef) #3 align 2

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #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, !24, i64 120}
!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, !6, i64 96, !25, i64 104, !26, i64 112, !24, i64 120, !24, i64 124, !24, i64 128, !27, i64 132, !28, i64 136, !28, i64 144, !29, i64 152, !30, i64 160, !31, i64 168, !32, i64 176, !33, i64 184, !34, i64 192}
!11 = !{!"_ZTS14ICompressCoder", !12, i64 0}
!12 = !{!"_ZTS8IUnknown"}
!13 = !{!"_ZTS20ICompressSetInStream", !12, i64 0}
!14 = !{!"_ZTS19ISequentialInStream", !12, i64 0}
!15 = !{!"_ZTS21ICompressSetOutStream", !12, i64 0}
!16 = !{!"_ZTS20ISequentialOutStream", !12, i64 0}
!17 = !{!"_ZTS15IOutStreamFlush", !12, i64 0}
!18 = !{!"_ZTS18ICryptoSetPassword", !12, i64 0}
!19 = !{!"_ZTS27ICompressSetCoderProperties", !12, i64 0}
!20 = !{!"_ZTS29ICompressWriteCoderProperties", !12, i64 0}
!21 = !{!"_ZTS22ICryptoResetInitVector", !12, i64 0}
!22 = !{!"_ZTS30ICompressSetDecoderProperties2", !12, i64 0}
!23 = !{!"_ZTS13CMyUnknownImp", !24, i64 0}
!24 = !{!"int", !7, i64 0}
!25 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !6, i64 0}
!26 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !6, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"long long", !7, i64 0}
!29 = !{!"_ZTS9CMyComPtrI18ICryptoSetPasswordE", !6, i64 0}
!30 = !{!"_ZTS9CMyComPtrI27ICompressSetCoderPropertiesE", !6, i64 0}
!31 = !{!"_ZTS9CMyComPtrI29ICompressWriteCoderPropertiesE", !6, i64 0}
!32 = !{!"_ZTS9CMyComPtrI22ICryptoResetInitVectorE", !6, i64 0}
!33 = !{!"_ZTS9CMyComPtrI30ICompressSetDecoderProperties2E", !6, i64 0}
!34 = !{!"_ZTS9CMyComPtrI15ICompressFilterE", !6, i64 0}
!35 = !{!10, !6, i64 96}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !8, i64 0}
!38 = !{!24, !24, i64 0}
!39 = !{!7, !7, i64 0}
!40 = distinct !{!40, !41}
!41 = !{!"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"

%struct.GUID = type { i32, i16, i16, [8 x i8] }
%class.CMyComPtr.7 = type { ptr }

@IID_IOutStreamFlush = external global %struct.GUID, align 4

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN12CFilterCoder5FlushEv(ptr noundef nonnull align 8 dereferenceable(200) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.CMyComPtr.7, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 120
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %38, label %5

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 192
  %7 = tail call noundef ptr @_ZNK9CMyComPtrI15ICompressFilterEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %8 = getelementptr inbounds i8, ptr %0, i64 96
  %9 = load ptr, ptr %8, align 8, !tbaa !34
  %10 = load i32, ptr %3, align 8, !tbaa !5
  %11 = load ptr, ptr %7, align 8, !tbaa !35
  %12 = getelementptr inbounds i8, ptr %11, i64 48
  %13 = load ptr, ptr %12, align 8
  %14 = tail call noundef i32 %13(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %9, i32 noundef %10)
  %15 = load i32, ptr %3, align 8, !tbaa !5
  %16 = icmp ugt i32 %14, %15
  br i1 %16, label %.lr.ph, label %30

.lr.ph:                                           ; preds = %5, %.lr.ph
  %17 = phi i32 [ %22, %.lr.ph ], [ %15, %5 ]
  %18 = load ptr, ptr %8, align 8, !tbaa !34
  %19 = zext i32 %17 to i64
  %20 = getelementptr inbounds i8, ptr %18, i64 %19
  store i8 0, ptr %20, align 1, !tbaa !37
  %21 = load i32, ptr %3, align 8, !tbaa !5
  %22 = add i32 %21, 1
  store i32 %22, ptr %3, align 8, !tbaa !5
  %23 = icmp ult i32 %22, %14
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !38

._crit_edge:                                      ; preds = %.lr.ph
  %24 = tail call noundef ptr @_ZNK9CMyComPtrI15ICompressFilterEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %25 = load ptr, ptr %8, align 8, !tbaa !34
  %26 = load ptr, ptr %24, align 8, !tbaa !35
  %27 = getelementptr inbounds i8, ptr %26, i64 48
  %28 = load ptr, ptr %27, align 8
  %29 = tail call noundef i32 %28(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef %25, i32 noundef %14)
  %.not14 = icmp eq i32 %29, %14
  br i1 %.not14, label %30, label %.thread

30:                                               ; preds = %._crit_edge, %5
  %31 = getelementptr inbounds i8, ptr %0, i64 112
  %32 = tail call noundef ptr @_ZNK9CMyComPtrI20ISequentialOutStreamEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = load ptr, ptr %8, align 8, !tbaa !34
  %34 = load i32, ptr %3, align 8, !tbaa !5
  %35 = zext i32 %34 to i64
  %36 = tail call noundef i32 @_Z11WriteStreamP20ISequentialOutStreamPKvm(ptr noundef %32, ptr noundef %33, i64 noundef %35)
  %.not15 = icmp eq i32 %36, 0
  br i1 %.not15, label %37, label %.thread

37:                                               ; preds = %30
  store i32 0, ptr %3, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %37, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @_ZN9CMyComPtrI15IOutStreamFlushEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %39 = getelementptr inbounds i8, ptr %0, i64 112
  %40 = call noundef ptr @_ZN9CMyComPtrI15IOutStreamFlushEadEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %41 = invoke noundef i32 @_ZNK9CMyComPtrI20ISequentialOutStreamE14QueryInterfaceI15IOutStreamFlushEEiRK4GUIDPPT_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 4 dereferenceable(16) @IID_IOutStreamFlush, ptr noundef %40)
          to label %42 unwind label %50

42:                                               ; preds = %38
  %43 = call noundef ptr @_ZNK9CMyComPtrI15IOutStreamFlushEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %.not16 = icmp eq ptr %43, null
  br i1 %.not16, label %52, label %44

44:                                               ; preds = %42
  %45 = call noundef ptr @_ZNK9CMyComPtrI15IOutStreamFlushEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %46 = load ptr, ptr %45, align 8, !tbaa !35
  %47 = getelementptr inbounds i8, ptr %46, i64 40
  %48 = load ptr, ptr %47, align 8
  %49 = invoke noundef i32 %48(ptr noundef nonnull align 8 dereferenceable(8) %45)
          to label %52 unwind label %50

50:                                               ; preds = %44, %38
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9CMyComPtrI15IOutStreamFlushED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  resume { ptr, i32 } %51

52:                                               ; preds = %42, %44
  %.2 = phi i32 [ %49, %44 ], [ 0, %42 ]
  call void @_ZN9CMyComPtrI15IOutStreamFlushED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  br label %.thread

.thread:                                          ; preds = %._crit_edge, %30, %52
  %.3 = phi i32 [ %.2, %52 ], [ -2147467259, %._crit_edge ], [ %36, %30 ]
  ret i32 %.3
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9CMyComPtrI20ISequentialOutStreamE14QueryInterfaceI15IOutStreamFlushEEiRK4GUIDPPT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9CMyComPtrI15IOutStreamFlushED2Ev(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 = { "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 = { 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 #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, !20, i64 120}
!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 = !{!6, !23, i64 96}
!35 = !{!36, !36, i64 0}
!36 = !{!"vtable pointer", !22, i64 0}
!37 = !{!21, !21, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass