; LLVM IR from mncoppola/rpef :: utilities_src/squashfs4.2/lzma465/CPP/7zip/Archive/7z (7zFolderInStream)

; 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 = type { ptr }
%class.CMyComPtr.3 = type { ptr }
%"class.NArchive::N7z::CFolderInStream" = type { %struct.ISequentialInStream, %struct.ICompressGetSubStreamSize, %class.CMyUnknownImp, ptr, %class.CMyComPtr, %class.CMyComPtr.0, i8, i64, i8, i64, ptr, i32, i32, %class.CRecordVector, %class.CRecordVector.1, %class.CRecordVector.2 }
%struct.ISequentialInStream = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressGetSubStreamSize = type { %struct.IUnknown }
%class.CMyUnknownImp = type { i32 }
%class.CMyComPtr.0 = type { ptr }
%class.CRecordVector = type { %class.CBaseRecordVector }
%class.CBaseRecordVector = type { ptr, i32, i32, ptr, i64 }
%class.CRecordVector.1 = type { %class.CBaseRecordVector }
%class.CRecordVector.2 = type { %class.CBaseRecordVector }

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8NArchive3N7z15CFolderInStream10OpenStreamEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %class.CMyComPtr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %class.CMyComPtr.3, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  %13 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 9
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %141, %1
  %15 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 12
  %16 = load i32, ptr %15, align 4, !tbaa !25
  %17 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 11
  %18 = load i32, ptr %17, align 8, !tbaa !26
  %19 = icmp ult i32 %16, %18
  br i1 %19, label %20, label %144

20:                                               ; preds = %14
  %21 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 6
  store i8 0, ptr %21, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @_ZN9CMyComPtrI19ISequentialInStreamEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %22 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 5
  %23 = invoke noundef ptr @_ZNK9CMyComPtrI22IArchiveUpdateCallbackEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %24 unwind label %46

24:                                               ; preds = %20
  %25 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 10
  %26 = load ptr, ptr %25, align 8, !tbaa !28
  %27 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 12
  %28 = load i32, ptr %27, align 4, !tbaa !25
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %26, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !29
  %32 = invoke noundef ptr @_ZN9CMyComPtrI19ISequentialInStreamEadEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %33 unwind label %46

33:                                               ; preds = %24
  %34 = load ptr, ptr %23, align 8, !tbaa !30
  %35 = getelementptr inbounds ptr, ptr %34, i64 9
  %36 = load ptr, ptr %35, align 8
  %37 = invoke noundef i32 %36(ptr noundef nonnull align 8 dereferenceable(8) %23, i32 noundef %31, ptr noundef %32)
          to label %38 unwind label %46

38:                                               ; preds = %33
  store i32 %37, ptr %5, align 4, !tbaa !29
  %39 = load i32, ptr %5, align 4, !tbaa !29
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %50

41:                                               ; preds = %38
  %42 = load i32, ptr %5, align 4, !tbaa !29
  %43 = icmp ne i32 %42, 1
  br i1 %43, label %44, label %50

44:                                               ; preds = %41
  %45 = load i32, ptr %5, align 4, !tbaa !29
  store i32 %45, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %141

46:                                               ; preds = %92, %87, %84, %61, %58, %57, %50, %33, %24, %20
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %6, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %7, align 4
  br label %143

50:                                               ; preds = %41, %38
  %51 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 12
  %52 = load i32, ptr %51, align 4, !tbaa !25
  %53 = add i32 %52, 1
  store i32 %53, ptr %51, align 4, !tbaa !25
  %54 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 3
  %55 = load ptr, ptr %54, align 8, !tbaa !32
  %56 = invoke noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %57 unwind label %46

57:                                               ; preds = %50
  invoke void @_ZN26CSequentialInStreamWithCRC9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(37) %55, ptr noundef %56)
          to label %58 unwind label %46

58:                                               ; preds = %57
  %59 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 3
  %60 = load ptr, ptr %59, align 8, !tbaa !32
  invoke void @_ZN26CSequentialInStreamWithCRC4InitEv(ptr noundef nonnull align 8 dereferenceable(37) %60)
          to label %61 unwind label %46

61:                                               ; preds = %58
  %62 = invoke noundef zeroext i1 @_ZNK9CMyComPtrI19ISequentialInStreamEntEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %63 unwind label %46

63:                                               ; preds = %61
  br i1 %62, label %64, label %94

64:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %65 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 5
  %66 = invoke noundef ptr @_ZNK9CMyComPtrI22IArchiveUpdateCallbackEptEv(ptr noundef nonnull align 8 dereferenceable(8) %65)
          to label %67 unwind label %77

67:                                               ; preds = %64
  %68 = load ptr, ptr %66, align 8, !tbaa !30
  %69 = getelementptr inbounds ptr, ptr %68, i64 10
  %70 = load ptr, ptr %69, align 8
  %71 = invoke noundef i32 %70(ptr noundef nonnull align 8 dereferenceable(8) %66, i32 noundef 0)
          to label %72 unwind label %77

72:                                               ; preds = %67
  store i32 %71, ptr %9, align 4, !tbaa !29
  %73 = load i32, ptr %9, align 4, !tbaa !29
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %81

75:                                               ; preds = %72
  %76 = load i32, ptr %9, align 4, !tbaa !29
  store i32 %76, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %82

77:                                               ; preds = %67, %64
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %6, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %143

81:                                               ; preds = %72
  store i32 0, ptr %8, align 4
  br label %82

82:                                               ; preds = %81, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %83 = load i32, ptr %8, align 4
  switch i32 %83, label %141 [
    i32 0, label %84
  ]

84:                                               ; preds = %82
  %85 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 15
  %86 = invoke noundef i32 @_ZN13CRecordVectorIyE3AddEy(ptr noundef nonnull align 8 dereferenceable(32) %85, i64 noundef 0)
          to label %87 unwind label %46

87:                                               ; preds = %84
  %88 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 13
  %89 = load i32, ptr %5, align 4, !tbaa !29
  %90 = icmp eq i32 %89, 0
  %91 = invoke noundef i32 @_ZN13CRecordVectorIbE3AddEb(ptr noundef nonnull align 8 dereferenceable(32) %88, i1 noundef zeroext %90)
          to label %92 unwind label %46

92:                                               ; preds = %87
  invoke void @_ZN8NArchive3N7z15CFolderInStream9AddDigestEv(ptr noundef nonnull align 8 dereferenceable(192) %12)
          to label %93 unwind label %46

93:                                               ; preds = %92
  store i32 2, ptr %8, align 4
  br label %141, !llvm.loop !33

94:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  invoke void @_ZN9CMyComPtrI14IStreamGetSizeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %95 unwind label %119

95:                                               ; preds = %94
  %96 = invoke noundef ptr @_ZN9CMyComPtrI14IStreamGetSizeEadEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %97 unwind label %123

97:                                               ; preds = %95
  %98 = invoke noundef i32 @_ZNK9CMyComPtrI19ISequentialInStreamE14QueryInterfaceI14IStreamGetSizeEEiRK4GUIDPPT_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(16) @IID_IStreamGetSize, ptr noundef %96)
          to label %99 unwind label %123

99:                                               ; preds = %97
  %100 = icmp eq i32 %98, 0
  br i1 %100, label %101, label %136

101:                                              ; preds = %99
  %102 = invoke noundef ptr @_ZNK9CMyComPtrI14IStreamGetSizeEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %103 unwind label %123

103:                                              ; preds = %101
  %104 = icmp ne ptr %102, null
  br i1 %104, label %105, label %135

105:                                              ; preds = %103
  %106 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 6
  store i8 1, ptr %106, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %107 = invoke noundef ptr @_ZNK9CMyComPtrI14IStreamGetSizeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %108 unwind label %127

108:                                              ; preds = %105
  %109 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 7
  %110 = load ptr, ptr %107, align 8, !tbaa !30
  %111 = getelementptr inbounds ptr, ptr %110, i64 5
  %112 = load ptr, ptr %111, align 8
  %113 = invoke noundef i32 %112(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef %109)
          to label %114 unwind label %127

114:                                              ; preds = %108
  store i32 %113, ptr %11, align 4, !tbaa !29
  %115 = load i32, ptr %11, align 4, !tbaa !29
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %131

117:                                              ; preds = %114
  %118 = load i32, ptr %11, align 4, !tbaa !29
  store i32 %118, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %132

119:                                              ; preds = %94
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %6, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %7, align 4
  br label %140

123:                                              ; preds = %101, %97, %95
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %6, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %7, align 4
  br label %139

127:                                              ; preds = %108, %105
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %6, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %139

131:                                              ; preds = %114
  store i32 0, ptr %8, align 4
  br label %132

132:                                              ; preds = %131, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  %133 = load i32, ptr %8, align 4
  switch i32 %133, label %138 [
    i32 0, label %134
  ]

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134, %103
  br label %136

136:                                              ; preds = %135, %99
  %137 = getelementptr inbounds %"class.NArchive::N7z::CFolderInStream", ptr %12, i32 0, i32 8
  store i8 1, ptr %137, align 8, !tbaa !35
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %138

138:                                              ; preds = %136, %132
  call void @_ZN9CMyComPtrI14IStreamGetSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %141

139:                                              ; preds = %127, %123
  call void @_ZN9CMyComPtrI14IStreamGetSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #3
  br label %140

140:                                              ; preds = %139, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %143

141:                                              ; preds = %138, %93, %82, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %142 = load i32, ptr %8, align 4
  switch i32 %142, label %152 [
    i32 1, label %145
    i32 2, label %14
  ]

143:                                              ; preds = %140, %77, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  br label %147

144:                                              ; preds = %14
  store i32 0, ptr %2, align 4
  br label %145

145:                                              ; preds = %144, %141
  %146 = load i32, ptr %2, align 4
  ret i32 %146

147:                                              ; preds = %143
  %148 = load ptr, ptr %6, align 8
  %149 = load i32, ptr %7, align 4
  %150 = insertvalue { ptr, i32 } poison, ptr %148, 0
  %151 = insertvalue { ptr, i32 } %150, i32 %149, 1
  resume { ptr, i32 } %151

152:                                              ; preds = %141
  unreachable
}

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13CRecordVectorIyE3AddEy(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13CRecordVectorIbE3AddEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) #1 align 2

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

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

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

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

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

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

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

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !19, i64 72}
!10 = !{!"_ZTSN8NArchive3N7z15CFolderInStreamE", !11, i64 0, !13, i64 8, !14, i64 16, !6, i64 24, !16, i64 32, !17, i64 40, !18, i64 48, !19, i64 56, !18, i64 64, !19, i64 72, !6, i64 80, !15, i64 88, !15, i64 92, !20, i64 96, !23, i64 128, !24, i64 160}
!11 = !{!"_ZTS19ISequentialInStream", !12, i64 0}
!12 = !{!"_ZTS8IUnknown"}
!13 = !{!"_ZTS25ICompressGetSubStreamSize", !12, i64 0}
!14 = !{!"_ZTS13CMyUnknownImp", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !6, i64 0}
!17 = !{!"_ZTS9CMyComPtrI22IArchiveUpdateCallbackE", !6, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!"_ZTS13CRecordVectorIbE", !21, i64 0}
!21 = !{!"_ZTS17CBaseRecordVector", !15, i64 8, !15, i64 12, !6, i64 16, !22, i64 24}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTS13CRecordVectorIjE", !21, i64 0}
!24 = !{!"_ZTS13CRecordVectorIyE", !21, i64 0}
!25 = !{!10, !15, i64 92}
!26 = !{!10, !15, i64 88}
!27 = !{!10, !18, i64 48}
!28 = !{!10, !6, i64 80}
!29 = !{!15, !15, i64 0}
!30 = !{!31, !31, i64 0}
!31 = !{!"vtable pointer", !8, i64 0}
!32 = !{!10, !6, i64 24}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!10, !18, i64 64}


; 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 = type { ptr }
%class.CMyComPtr.3 = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8NArchive3N7z15CFolderInStream10OpenStreamEv(ptr noundef nonnull align 8 dereferenceable(192) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.CMyComPtr, align 8
  %3 = alloca %class.CMyComPtr.3, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 72
  store i64 0, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 92
  %6 = getelementptr inbounds i8, ptr %0, i64 88
  %7 = load i32, ptr %5, align 4, !tbaa !24
  %8 = load i32, ptr %6, align 8, !tbaa !25
  %9 = icmp ult i32 %7, %8
  br i1 %9, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 48
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  %12 = getelementptr inbounds i8, ptr %0, i64 80
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = getelementptr inbounds i8, ptr %0, i64 160
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  br label %16

16:                                               ; preds = %.lr.ph, %77
  store i8 0, ptr %10, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @_ZN9CMyComPtrI19ISequentialInStreamEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %17 = call noundef ptr @_ZNK9CMyComPtrI22IArchiveUpdateCallbackEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %18 = load ptr, ptr %12, align 8, !tbaa !27
  %19 = load i32, ptr %5, align 4, !tbaa !24
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr %18, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !28
  %23 = call noundef ptr @_ZN9CMyComPtrI19ISequentialInStreamEadEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %24 = load ptr, ptr %17, align 8, !tbaa !29
  %25 = getelementptr inbounds i8, ptr %24, i64 72
  %26 = load ptr, ptr %25, align 8
  %27 = invoke noundef i32 %26(ptr noundef nonnull align 8 dereferenceable(8) %17, i32 noundef %22, ptr noundef %23)
          to label %28 unwind label %29

28:                                               ; preds = %16
  %or.cond = icmp ugt i32 %27, 1
  br i1 %or.cond, label %.thread, label %31

29:                                               ; preds = %53, %50, %48, %31, %16
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %81

31:                                               ; preds = %28
  %32 = load i32, ptr %5, align 4, !tbaa !24
  %33 = add i32 %32, 1
  store i32 %33, ptr %5, align 4, !tbaa !24
  %34 = load ptr, ptr %13, align 8, !tbaa !31
  %35 = call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %2)
  invoke void @_ZN26CSequentialInStreamWithCRC9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(37) %34, ptr noundef %35)
          to label %36 unwind label %29

36:                                               ; preds = %31
  %37 = load ptr, ptr %13, align 8, !tbaa !31
  call void @_ZN26CSequentialInStreamWithCRC4InitEv(ptr noundef nonnull align 8 dereferenceable(37) %37)
  %38 = call noundef zeroext i1 @_ZNK9CMyComPtrI19ISequentialInStreamEntEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  br i1 %38, label %39, label %54

39:                                               ; preds = %36
  %40 = call noundef ptr @_ZNK9CMyComPtrI22IArchiveUpdateCallbackEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %41 = load ptr, ptr %40, align 8, !tbaa !29
  %42 = getelementptr inbounds i8, ptr %41, i64 80
  %43 = load ptr, ptr %42, align 8
  %44 = invoke noundef i32 %43(ptr noundef nonnull align 8 dereferenceable(8) %40, i32 noundef 0)
          to label %45 unwind label %46

45:                                               ; preds = %39
  %.not29 = icmp eq i32 %44, 0
  br i1 %.not29, label %48, label %.thread

46:                                               ; preds = %39
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %81

48:                                               ; preds = %45
  %49 = invoke noundef i32 @_ZN13CRecordVectorIyE3AddEy(ptr noundef nonnull align 8 dereferenceable(32) %14, i64 noundef 0)
          to label %50 unwind label %29

50:                                               ; preds = %48
  %51 = icmp eq i32 %27, 0
  %52 = invoke noundef i32 @_ZN13CRecordVectorIbE3AddEb(ptr noundef nonnull align 8 dereferenceable(32) %15, i1 noundef zeroext %51)
          to label %53 unwind label %29

53:                                               ; preds = %50
  invoke void @_ZN8NArchive3N7z15CFolderInStream9AddDigestEv(ptr noundef nonnull align 8 dereferenceable(192) %0)
          to label %77 unwind label %29, !llvm.loop !32

54:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @_ZN9CMyComPtrI14IStreamGetSizeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %55 = call noundef ptr @_ZN9CMyComPtrI14IStreamGetSizeEadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %56 = invoke noundef i32 @_ZNK9CMyComPtrI19ISequentialInStreamE14QueryInterfaceI14IStreamGetSizeEEiRK4GUIDPPT_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(16) @IID_IStreamGetSize, ptr noundef %55)
          to label %57 unwind label %69

57:                                               ; preds = %54
  %58 = icmp eq i32 %56, 0
  br i1 %58, label %59, label %73

59:                                               ; preds = %57
  %60 = call noundef ptr @_ZNK9CMyComPtrI14IStreamGetSizeEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %.not = icmp eq ptr %60, null
  br i1 %.not, label %73, label %61

61:                                               ; preds = %59
  store i8 1, ptr %10, align 8, !tbaa !26
  %62 = call noundef ptr @_ZNK9CMyComPtrI14IStreamGetSizeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %63 = getelementptr inbounds i8, ptr %0, i64 56
  %64 = load ptr, ptr %62, align 8, !tbaa !29
  %65 = getelementptr inbounds i8, ptr %64, i64 40
  %66 = load ptr, ptr %65, align 8
  %67 = invoke noundef i32 %66(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull %63)
          to label %68 unwind label %71

68:                                               ; preds = %61
  %.not28 = icmp eq i32 %67, 0
  br i1 %.not28, label %73, label %75

69:                                               ; preds = %54
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %76

71:                                               ; preds = %61
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %76

73:                                               ; preds = %59, %68, %57
  %74 = getelementptr inbounds i8, ptr %0, i64 64
  store i8 1, ptr %74, align 8, !tbaa !34
  br label %75

75:                                               ; preds = %68, %73
  %.3 = phi i32 [ 0, %73 ], [ %67, %68 ]
  call void @_ZN9CMyComPtrI14IStreamGetSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %.thread

76:                                               ; preds = %71, %69
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @_ZN9CMyComPtrI14IStreamGetSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %81

.thread:                                          ; preds = %45, %28, %75
  %.4.ph = phi i32 [ %.3, %75 ], [ %44, %45 ], [ %27, %28 ]
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  br label %.loopexit

77:                                               ; preds = %53
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  %78 = load i32, ptr %5, align 4, !tbaa !24
  %79 = load i32, ptr %6, align 8, !tbaa !25
  %80 = icmp ult i32 %78, %79
  br i1 %80, label %16, label %.loopexit

81:                                               ; preds = %76, %46, %29
  %.pn30 = phi { ptr, i32 } [ %30, %29 ], [ %47, %46 ], [ %.pn, %76 ]
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  resume { ptr, i32 } %.pn30

.loopexit:                                        ; preds = %77, %1, %.thread
  %.5 = phi i32 [ %.4.ph, %.thread ], [ 0, %1 ], [ 0, %77 ]
  ret i32 %.5
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN26CSequentialInStreamWithCRC9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(37), ptr noundef) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13CRecordVectorIyE3AddEy(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13CRecordVectorIbE3AddEb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) local_unnamed_addr #1 align 2

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

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

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

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

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

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

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

attributes #0 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !18, i64 72}
!6 = !{!"_ZTSN8NArchive3N7z15CFolderInStreamE", !7, i64 0, !9, i64 8, !10, i64 16, !14, i64 24, !15, i64 32, !16, i64 40, !17, i64 48, !18, i64 56, !17, i64 64, !18, i64 72, !14, i64 80, !11, i64 88, !11, i64 92, !19, i64 96, !22, i64 128, !23, i64 160}
!7 = !{!"_ZTS19ISequentialInStream", !8, i64 0}
!8 = !{!"_ZTS8IUnknown"}
!9 = !{!"_ZTS25ICompressGetSubStreamSize", !8, i64 0}
!10 = !{!"_ZTS13CMyUnknownImp", !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !14, i64 0}
!16 = !{!"_ZTS9CMyComPtrI22IArchiveUpdateCallbackE", !14, i64 0}
!17 = !{!"bool", !12, i64 0}
!18 = !{!"long long", !12, i64 0}
!19 = !{!"_ZTS13CRecordVectorIbE", !20, i64 0}
!20 = !{!"_ZTS17CBaseRecordVector", !11, i64 8, !11, i64 12, !14, i64 16, !21, i64 24}
!21 = !{!"long", !12, i64 0}
!22 = !{!"_ZTS13CRecordVectorIjE", !20, i64 0}
!23 = !{!"_ZTS13CRecordVectorIyE", !20, i64 0}
!24 = !{!6, !11, i64 92}
!25 = !{!6, !11, i64 88}
!26 = !{!6, !17, i64 48}
!27 = !{!6, !14, i64 80}
!28 = !{!11, !11, i64 0}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !13, i64 0}
!31 = !{!6, !14, i64 24}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!6, !17, i64 64}


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