; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/CPP/7zip/Archive (SplitHandler)

; 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.CMyComPtr.3 = type { ptr }
%"struct.CMultiStream::CSubStreamInfo" = type { %class.CMyComPtr.1, i64, i64, i64 }
%class.CMyComPtr.1 = type { ptr }
%"class.NArchive::NSplit::CHandler" = type { %struct.IInArchive, %struct.IInArchiveGetStream, %class.CMyUnknownImp, %class.CObjectVector, %class.CRecordVector.0, %class.UString, i64 }
%struct.IInArchive = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.IInArchiveGetStream = type { %struct.IUnknown }
%class.CMyUnknownImp = type { i32 }
%class.CObjectVector = type { %class.CRecordVector }
%class.CRecordVector = type { ptr, i32, i32 }
%class.CRecordVector.0 = type { ptr, i32, i32 }
%class.UString = type { ptr, i32, i32 }
%class.CMultiStream = type { %struct.IInStream, %class.CMyUnknownImp, i64, i64, i32, %class.CObjectVector.7 }
%struct.IInStream = type { %struct.ISequentialInStream }
%struct.ISequentialInStream = type { %struct.IUnknown }
%class.CObjectVector.7 = type { %class.CRecordVector }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8NArchive6NSplit8CHandler9GetStreamEjPP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(80) %0, i32 noundef %1, ptr noundef %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %class.CMyComPtr.3, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.CMultiStream::CSubStreamInfo", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %3
  store i32 -2147024809, ptr %4, align 4
  br label %92

18:                                               ; preds = %3
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %20 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 56) #8
          to label %21 unwind label %31

21:                                               ; preds = %18
  invoke void @_ZN12CMultiStreamC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %20)
          to label %22 unwind label %35

22:                                               ; preds = %21
  store ptr %20, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN9CMyComPtrI19ISequentialInStreamEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %23) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %62, %22
  %25 = load i32, ptr %12, align 4, !tbaa !9
  %26 = getelementptr inbounds %"class.NArchive::NSplit::CHandler", ptr %14, i32 0, i32 3
  %27 = invoke noundef i32 @_ZNK13CObjectVectorI9CMyComPtrI9IInStreamEE4SizeEv(ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %28 unwind label %39

28:                                               ; preds = %24
  %29 = icmp ult i32 %25, %27
  br i1 %29, label %43, label %30

30:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %75

31:                                               ; preds = %18
  %32 = landingpad { ptr, i32 }
          catch ptr null
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  br label %87

35:                                               ; preds = %21
  %36 = landingpad { ptr, i32 }
          catch ptr null
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %9, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %20, i64 noundef 56) #9
  br label %87

39:                                               ; preds = %24
  %40 = landingpad { ptr, i32 }
          catch ptr null
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %9, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %10, align 4
  br label %74

43:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  invoke void @_ZN12CMultiStream14CSubStreamInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %44 unwind label %65

44:                                               ; preds = %43
  %45 = getelementptr inbounds %"class.NArchive::NSplit::CHandler", ptr %14, i32 0, i32 3
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN13CObjectVectorI9CMyComPtrI9IInStreamEEixEj(ptr noundef nonnull align 8 dereferenceable(16) %45, i32 noundef %46)
          to label %48 unwind label %69

48:                                               ; preds = %44
  %49 = getelementptr inbounds %"struct.CMultiStream::CSubStreamInfo", ptr %13, i32 0, i32 0
  %50 = invoke noundef ptr @_ZN9CMyComPtrI9IInStreamEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull align 8 dereferenceable(8) %47)
          to label %51 unwind label %69

51:                                               ; preds = %48
  %52 = getelementptr inbounds %"class.NArchive::NSplit::CHandler", ptr %14, i32 0, i32 4
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN13CRecordVectorIyEixEj(ptr noundef nonnull align 8 dereferenceable(16) %52, i32 noundef %53)
          to label %55 unwind label %69

55:                                               ; preds = %51
  %56 = load i64, ptr %54, align 8, !tbaa !11
  %57 = getelementptr inbounds %"struct.CMultiStream::CSubStreamInfo", ptr %13, i32 0, i32 1
  store i64 %56, ptr %57, align 8, !tbaa !13
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.CMultiStream, ptr %58, i32 0, i32 5
  %60 = invoke noundef i32 @_ZN13CObjectVectorIN12CMultiStream14CSubStreamInfoEE3AddERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %61 unwind label %69

61:                                               ; preds = %55
  call void @_ZN12CMultiStream14CSubStreamInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = add i32 %63, 1
  store i32 %64, ptr %12, align 4, !tbaa !9
  br label %24, !llvm.loop !16

65:                                               ; preds = %43
  %66 = landingpad { ptr, i32 }
          catch ptr null
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %9, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %10, align 4
  br label %73

69:                                               ; preds = %55, %51, %48, %44
  %70 = landingpad { ptr, i32 }
          catch ptr null
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %9, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %10, align 4
  call void @_ZN12CMultiStream14CSubStreamInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #7
  br label %73

73:                                               ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  br label %74

74:                                               ; preds = %73, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %86

75:                                               ; preds = %30
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = invoke noundef i32 @_ZN12CMultiStream4InitEv(ptr noundef nonnull align 8 dereferenceable(56) %76)
          to label %78 unwind label %82

78:                                               ; preds = %75
  %79 = invoke noundef ptr @_ZN9CMyComPtrI19ISequentialInStreamE6DetachEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %80 unwind label %82

80:                                               ; preds = %78
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %79, ptr %81, align 8, !tbaa !5
  store i32 0, ptr %4, align 4
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %92

82:                                               ; preds = %78, %75
  %83 = landingpad { ptr, i32 }
          catch ptr null
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %9, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %10, align 4
  br label %86

86:                                               ; preds = %82, %74
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %87

87:                                               ; preds = %86, %35, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %9, align 8
  %90 = call ptr @__cxa_begin_catch(ptr %89) #7
  store i32 -2147024882, ptr %4, align 4
  call void @__cxa_end_catch()
  br label %92

91:                                               ; No predecessors!
  unreachable

92:                                               ; preds = %88, %80, %17
  %93 = load i32, ptr %4, align 4
  ret i32 %93
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12CMultiStreamC2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12CMultiStream4InitEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 = { 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 #5 = { inlinehint 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 #6 = { inlinehint 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"_ZTSN12CMultiStream14CSubStreamInfoE", !15, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!15 = !{!"_ZTS9CMyComPtrI9IInStreamE", !6, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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

%class.CMyComPtr.3 = type { ptr }
%"struct.CMultiStream::CSubStreamInfo" = type { %class.CMyComPtr.1, i64, i64, i64 }
%class.CMyComPtr.1 = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -2147024882, 1) i32 @_ZN8NArchive6NSplit8CHandler9GetStreamEjPP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(80) %0, i32 noundef %1, ptr nocapture noundef writeonly %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.CMyComPtr.3, align 8
  %5 = alloca %"struct.CMultiStream::CSubStreamInfo", align 8
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %6, label %44

6:                                                ; preds = %3
  store ptr null, ptr %2, align 8, !tbaa !5
  %7 = invoke noalias noundef nonnull dereferenceable(56) ptr @_Znwm(i64 noundef 56) #7
          to label %8 unwind label %16

8:                                                ; preds = %6
  invoke void @_ZN12CMultiStreamC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7)
          to label %9 unwind label %18

9:                                                ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @_ZN9CMyComPtrI19ISequentialInStreamEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %7) #8
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = call noundef i32 @_ZNK13CObjectVectorI9CMyComPtrI9IInStreamEE4SizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %.not15 = icmp eq i32 %11, 0
  br i1 %.not15, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 40
  %13 = getelementptr inbounds i8, ptr %5, i64 8
  %14 = getelementptr inbounds i8, ptr %7, i64 40
  br label %20

._crit_edge:                                      ; preds = %28, %9
  %15 = invoke noundef i32 @_ZN12CMultiStream4InitEv(ptr noundef nonnull align 8 dereferenceable(56) %7)
          to label %37 unwind label %39

16:                                               ; preds = %6
  %17 = landingpad { ptr, i32 }
          catch ptr null
  br label %42

18:                                               ; preds = %8
  %19 = landingpad { ptr, i32 }
          catch ptr null
  tail call void @_ZdlPvm(ptr noundef nonnull %7, i64 noundef 56) #9
  br label %42

20:                                               ; preds = %.lr.ph, %28
  %.014 = phi i32 [ 0, %.lr.ph ], [ %29, %28 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  invoke void @_ZN12CMultiStream14CSubStreamInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %21 unwind label %32

21:                                               ; preds = %20
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN13CObjectVectorI9CMyComPtrI9IInStreamEEixEj(ptr noundef nonnull align 8 dereferenceable(16) %10, i32 noundef %.014)
  %23 = invoke noundef ptr @_ZN9CMyComPtrI9IInStreamEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %24 unwind label %34

24:                                               ; preds = %21
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN13CRecordVectorIyEixEj(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef %.014)
  %26 = load i64, ptr %25, align 8, !tbaa !9
  store i64 %26, ptr %13, align 8, !tbaa !11
  %27 = invoke noundef i32 @_ZN13CObjectVectorIN12CMultiStream14CSubStreamInfoEE3AddERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %28 unwind label %34

28:                                               ; preds = %24
  call void @_ZN12CMultiStream14CSubStreamInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  %29 = add nuw i32 %.014, 1
  %30 = call noundef i32 @_ZNK13CObjectVectorI9CMyComPtrI9IInStreamEE4SizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %31 = icmp ult i32 %29, %30
  br i1 %31, label %20, label %._crit_edge, !llvm.loop !14

32:                                               ; preds = %20
  %33 = landingpad { ptr, i32 }
          catch ptr null
  br label %36

34:                                               ; preds = %24, %21
  %35 = landingpad { ptr, i32 }
          catch ptr null
  call void @_ZN12CMultiStream14CSubStreamInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  br label %36

36:                                               ; preds = %34, %32
  %.pn = phi { ptr, i32 } [ %35, %34 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %41

37:                                               ; preds = %._crit_edge
  %38 = call noundef ptr @_ZN9CMyComPtrI19ISequentialInStreamE6DetachEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  store ptr %38, ptr %2, align 8, !tbaa !5
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br label %44

39:                                               ; preds = %._crit_edge
  %40 = landingpad { ptr, i32 }
          catch ptr null
  br label %41

41:                                               ; preds = %39, %36
  %.pn.pn = phi { ptr, i32 } [ %.pn, %36 ], [ %40, %39 ]
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br label %42

42:                                               ; preds = %41, %18, %16
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %41 ], [ %19, %18 ], [ %17, %16 ]
  %.2 = extractvalue { ptr, i32 } %.pn.pn.pn, 0
  %43 = call ptr @__cxa_begin_catch(ptr %.2) #8
  call void @__cxa_end_catch()
  br label %44

44:                                               ; preds = %3, %42, %37
  %.013 = phi i32 [ -2147024882, %42 ], [ 0, %37 ], [ -2147024809, %3 ]
  ret i32 %.013
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12CMultiStreamC2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN12CMultiStream4InitEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 = { 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 #5 = { inlinehint 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 #6 = { inlinehint 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 #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { builtin 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 = !{!"long long", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN12CMultiStream14CSubStreamInfoE", !13, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!13 = !{!"_ZTS9CMyComPtrI9IInStreamE", !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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