; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/CPP/7zip/Compress (CopyCoder)

; 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.NCompress::CCopyCoder" = type { %struct.ICompressCoder, %struct.ICompressSetInStream, %struct.ISequentialInStream, %struct.ICompressSetFinishMode, %struct.ICompressGetInStreamProcessedSize, %class.CMyUnknownImp, ptr, %class.CMyComPtr, i64 }
%struct.ICompressCoder = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressSetInStream = type { %struct.IUnknown }
%struct.ISequentialInStream = type { %struct.IUnknown }
%struct.ICompressSetFinishMode = type { %struct.IUnknown }
%struct.ICompressGetInStreamProcessedSize = type { %struct.IUnknown }
%class.CMyUnknownImp = type { i32 }
%class.CMyComPtr = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress10CCopyCoder4CodeEP19ISequentialInStreamP20ISequentialOutStreamPKyS6_P21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) unnamed_addr #0 align 2 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  %23 = load ptr, ptr %8, align 8
  %24 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 6
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = icmp ne ptr %25, null
  br i1 %26, label %35, label %27

27:                                               ; preds = %6
  %28 = call ptr @MyAlloc(i64 noundef 131072)
  %29 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 6
  store ptr %28, ptr %29, align 8, !tbaa !9
  %30 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 6
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = icmp ne ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %27
  store i32 -2147024882, ptr %7, align 4
  br label %163

34:                                               ; preds = %27
  br label %35

35:                                               ; preds = %34, %6
  %36 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 8
  store i64 0, ptr %36, align 8, !tbaa !21
  br label %37

37:                                               ; preds = %162, %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i32 131072, ptr %14, align 4, !tbaa !22
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %56

40:                                               ; preds = %37
  %41 = load i32, ptr %14, align 4, !tbaa !22
  %42 = zext i32 %41 to i64
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = load i64, ptr %43, align 8, !tbaa !23
  %45 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 8
  %46 = load i64, ptr %45, align 8, !tbaa !21
  %47 = sub i64 %44, %46
  %48 = icmp ugt i64 %42, %47
  br i1 %48, label %49, label %56

49:                                               ; preds = %40
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = load i64, ptr %50, align 8, !tbaa !23
  %52 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 8
  %53 = load i64, ptr %52, align 8, !tbaa !21
  %54 = sub i64 %51, %53
  %55 = trunc i64 %54 to i32
  store i32 %55, ptr %14, align 4, !tbaa !22
  br label %56

56:                                               ; preds = %49, %40, %37
  %57 = load i32, ptr %14, align 4, !tbaa !22
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  store i32 0, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %160

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 6
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = load i32, ptr %14, align 4, !tbaa !22
  %65 = load ptr, ptr %61, align 8, !tbaa !24
  %66 = getelementptr inbounds ptr, ptr %65, i64 5
  %67 = load ptr, ptr %66, align 8
  %68 = call noundef i32 %67(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef %63, i32 noundef %64, ptr noundef %14)
  store i32 %68, ptr %16, align 4, !tbaa !22
  %69 = load i32, ptr %14, align 4, !tbaa !22
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %60
  %72 = load i32, ptr %16, align 4, !tbaa !22
  store i32 %72, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %159

73:                                               ; preds = %60
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %124

76:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !22
  br label %77

77:                                               ; preds = %116, %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %78 = load i32, ptr %14, align 4, !tbaa !22
  %79 = load i32, ptr %17, align 4, !tbaa !22
  %80 = sub i32 %78, %79
  store i32 %80, ptr %18, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 6
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = load i32, ptr %17, align 4, !tbaa !22
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %83, i64 %85
  %87 = load i32, ptr %18, align 4, !tbaa !22
  %88 = load ptr, ptr %81, align 8, !tbaa !24
  %89 = getelementptr inbounds ptr, ptr %88, i64 5
  %90 = load ptr, ptr %89, align 8
  %91 = call noundef i32 %90(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef %86, i32 noundef %87, ptr noundef %18)
  store i32 %91, ptr %19, align 4, !tbaa !22
  %92 = load i32, ptr %18, align 4, !tbaa !22
  %93 = load i32, ptr %17, align 4, !tbaa !22
  %94 = add i32 %93, %92
  store i32 %94, ptr %17, align 4, !tbaa !22
  %95 = load i32, ptr %18, align 4, !tbaa !22
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 8
  %98 = load i64, ptr %97, align 8, !tbaa !21
  %99 = add i64 %98, %96
  store i64 %99, ptr %97, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %100 = load i32, ptr %19, align 4, !tbaa !22
  store i32 %100, ptr %20, align 4, !tbaa !22
  %101 = load i32, ptr %20, align 4, !tbaa !22
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %105

103:                                              ; preds = %77
  %104 = load i32, ptr %20, align 4, !tbaa !22
  store i32 %104, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %106

105:                                              ; preds = %77
  store i32 0, ptr %15, align 4
  br label %106

106:                                              ; preds = %105, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  %107 = load i32, ptr %15, align 4
  switch i32 %107, label %113 [
    i32 0, label %108
  ]

108:                                              ; preds = %106
  %109 = load i32, ptr %18, align 4, !tbaa !22
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %111, label %112

111:                                              ; preds = %108
  store i32 -2147467259, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %113

112:                                              ; preds = %108
  store i32 0, ptr %15, align 4
  br label %113

113:                                              ; preds = %112, %111, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  %114 = load i32, ptr %15, align 4
  switch i32 %114, label %121 [
    i32 0, label %115
  ]

115:                                              ; preds = %113
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %17, align 4, !tbaa !22
  %118 = load i32, ptr %14, align 4, !tbaa !22
  %119 = icmp ult i32 %117, %118
  br i1 %119, label %77, label %120, !llvm.loop !26

120:                                              ; preds = %116
  store i32 0, ptr %15, align 4
  br label %121

121:                                              ; preds = %120, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  %122 = load i32, ptr %15, align 4
  switch i32 %122, label %159 [
    i32 0, label %123
  ]

123:                                              ; preds = %121
  br label %130

124:                                              ; preds = %73
  %125 = load i32, ptr %14, align 4, !tbaa !22
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 8
  %128 = load i64, ptr %127, align 8, !tbaa !21
  %129 = add i64 %128, %126
  store i64 %129, ptr %127, align 8, !tbaa !21
  br label %130

130:                                              ; preds = %124, %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %131 = load i32, ptr %16, align 4, !tbaa !22
  store i32 %131, ptr %21, align 4, !tbaa !22
  %132 = load i32, ptr %21, align 4, !tbaa !22
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %136

134:                                              ; preds = %130
  %135 = load i32, ptr %21, align 4, !tbaa !22
  store i32 %135, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %137

136:                                              ; preds = %130
  store i32 0, ptr %15, align 4
  br label %137

137:                                              ; preds = %136, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  %138 = load i32, ptr %15, align 4
  switch i32 %138, label %159 [
    i32 0, label %139
  ]

139:                                              ; preds = %137
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = icmp ne ptr %140, null
  br i1 %141, label %142, label %158

142:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 8
  %145 = getelementptr inbounds %"class.NCompress::CCopyCoder", ptr %23, i32 0, i32 8
  %146 = load ptr, ptr %143, align 8, !tbaa !24
  %147 = getelementptr inbounds ptr, ptr %146, i64 5
  %148 = load ptr, ptr %147, align 8
  %149 = call noundef i32 %148(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef %144, ptr noundef %145)
  store i32 %149, ptr %22, align 4, !tbaa !22
  %150 = load i32, ptr %22, align 4, !tbaa !22
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %154

152:                                              ; preds = %142
  %153 = load i32, ptr %22, align 4, !tbaa !22
  store i32 %153, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %155

154:                                              ; preds = %142
  store i32 0, ptr %15, align 4
  br label %155

155:                                              ; preds = %154, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  %156 = load i32, ptr %15, align 4
  switch i32 %156, label %159 [
    i32 0, label %157
  ]

157:                                              ; preds = %155
  br label %158

158:                                              ; preds = %157, %139
  store i32 0, ptr %15, align 4
  br label %159

159:                                              ; preds = %158, %155, %137, %121, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %160

160:                                              ; preds = %159, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %161 = load i32, ptr %15, align 4
  switch i32 %161, label %165 [
    i32 0, label %162
    i32 1, label %163
  ]

162:                                              ; preds = %160
  br label %37, !llvm.loop !28

163:                                              ; preds = %160, %33
  %164 = load i32, ptr %7, align 4
  ret i32 %164

165:                                              ; preds = %160
  unreachable
}

declare ptr @MyAlloc(i64 noundef) #1

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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, !6, i64 48}
!10 = !{!"_ZTSN9NCompress10CCopyCoderE", !11, i64 0, !13, i64 8, !14, i64 16, !15, i64 24, !16, i64 32, !17, i64 40, !6, i64 48, !19, i64 56, !20, i64 64}
!11 = !{!"_ZTS14ICompressCoder", !12, i64 0}
!12 = !{!"_ZTS8IUnknown"}
!13 = !{!"_ZTS20ICompressSetInStream", !12, i64 0}
!14 = !{!"_ZTS19ISequentialInStream", !12, i64 0}
!15 = !{!"_ZTS22ICompressSetFinishMode", !12, i64 0}
!16 = !{!"_ZTS33ICompressGetInStreamProcessedSize", !12, i64 0}
!17 = !{!"_ZTS13CMyUnknownImp", !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !6, i64 0}
!20 = !{!"long long", !7, i64 0}
!21 = !{!10, !20, i64 64}
!22 = !{!18, !18, i64 0}
!23 = !{!20, !20, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !8, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress10CCopyCoder4CodeEP19ISequentialInStreamP20ISequentialOutStreamPKyS6_P21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef readnone %3, ptr noundef readonly %4, ptr noundef %5) unnamed_addr #0 align 2 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %11, label %13

11:                                               ; preds = %6
  %12 = tail call ptr @MyAlloc(i64 noundef 131072)
  store ptr %12, ptr %9, align 8, !tbaa !5
  %.not50 = icmp eq ptr %12, null
  br i1 %.not50, label %131, label %13

13:                                               ; preds = %11, %6
  %14 = phi ptr [ %12, %11 ], [ %10, %6 ]
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 0, ptr %15, align 8, !tbaa !20
  %.not51 = icmp eq ptr %4, null
  %.not52 = icmp eq ptr %2, null
  %.not55 = icmp eq ptr %5, null
  br i1 %.not52, label %.split.us, label %.split

.split.us:                                        ; preds = %13
  br i1 %.not51, label %.split.us.split.us, label %.split.us.split

.split.us.split.us:                               ; preds = %.split.us
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 131072, ptr %7, align 4, !tbaa !21
  %16 = load ptr, ptr %1, align 8, !tbaa !22
  %17 = getelementptr inbounds i8, ptr %16, i64 40
  %18 = load ptr, ptr %17, align 8
  %19 = call noundef i32 %18(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %14, i32 noundef 131072, ptr noundef nonnull %7)
  %20 = load i32, ptr %7, align 4, !tbaa !21
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %.split.us.split.us
  br i1 %.not55, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.critedge.us.us.us
  %22 = phi i32 [ %32, %.critedge.us.us.us ], [ %20, %.lr.ph ]
  %23 = phi i32 [ %31, %.critedge.us.us.us ], [ %19, %.lr.ph ]
  %24 = zext i32 %22 to i64
  %25 = load i64, ptr %15, align 8, !tbaa !20
  %26 = add i64 %25, %24
  store i64 %26, ptr %15, align 8, !tbaa !20
  %.not54.us.us.us = icmp eq i32 %23, 0
  br i1 %.not54.us.us.us, label %.critedge.us.us.us, label %.critedge.thread

.critedge.us.us.us:                               ; preds = %.lr.ph.split.us
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 131072, ptr %7, align 4, !tbaa !21
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load ptr, ptr %1, align 8, !tbaa !22
  %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) %1, ptr noundef %27, i32 noundef 131072, ptr noundef nonnull %7)
  %32 = load i32, ptr %7, align 4, !tbaa !21
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %.critedge.thread, label %.lr.ph.split.us

.lr.ph.split:                                     ; preds = %.lr.ph, %.critedge.us.us
  %34 = phi i32 [ %49, %.critedge.us.us ], [ %20, %.lr.ph ]
  %35 = phi i32 [ %48, %.critedge.us.us ], [ %19, %.lr.ph ]
  %36 = zext i32 %34 to i64
  %37 = load i64, ptr %15, align 8, !tbaa !20
  %38 = add i64 %37, %36
  store i64 %38, ptr %15, align 8, !tbaa !20
  %.not54.us.us = icmp eq i32 %35, 0
  br i1 %.not54.us.us, label %39, label %.critedge.thread

39:                                               ; preds = %.lr.ph.split
  %40 = load ptr, ptr %5, align 8, !tbaa !22
  %41 = getelementptr inbounds i8, ptr %40, i64 40
  %42 = load ptr, ptr %41, align 8
  %43 = call noundef i32 %42(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %15, ptr noundef nonnull %15)
  %.not56.us.us = icmp eq i32 %43, 0
  br i1 %.not56.us.us, label %.critedge.us.us, label %.critedge.thread

.critedge.us.us:                                  ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 131072, ptr %7, align 4, !tbaa !21
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = load ptr, ptr %1, align 8, !tbaa !22
  %46 = getelementptr inbounds i8, ptr %45, i64 40
  %47 = load ptr, ptr %46, align 8
  %48 = call noundef i32 %47(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %44, i32 noundef 131072, ptr noundef nonnull %7)
  %49 = load i32, ptr %7, align 4, !tbaa !21
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %.critedge.thread, label %.lr.ph.split

.split.us.split:                                  ; preds = %.split.us
  br i1 %.not55, label %.split.us.split.split.us, label %.split.us.split.split

.split.us.split.split.us:                         ; preds = %.split.us.split, %.critedge.us.us71
  %51 = phi i64 [ %68, %.critedge.us.us71 ], [ 0, %.split.us.split ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 131072, ptr %7, align 4, !tbaa !21
  %52 = load i64, ptr %4, align 8, !tbaa !24
  %53 = sub i64 %52, %51
  %54 = icmp ult i64 %53, 131072
  br i1 %54, label %thread-pre-split.us.us, label %.thread.us.us69

thread-pre-split.us.us:                           ; preds = %.split.us.split.split.us
  %55 = trunc nuw nsw i64 %53 to i32
  store i32 %55, ptr %7, align 4, !tbaa !21
  %56 = icmp eq i64 %52, %51
  br i1 %56, label %.critedge.thread, label %.thread.us.us69

.thread.us.us69:                                  ; preds = %.split.us.split.split.us, %thread-pre-split.us.us
  %57 = phi i32 [ %55, %thread-pre-split.us.us ], [ 131072, %.split.us.split.split.us ]
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load ptr, ptr %1, align 8, !tbaa !22
  %60 = getelementptr inbounds i8, ptr %59, i64 40
  %61 = load ptr, ptr %60, align 8
  %62 = call noundef i32 %61(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %58, i32 noundef %57, ptr noundef nonnull %7)
  %63 = load i32, ptr %7, align 4, !tbaa !21
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %.critedge.thread, label %65

65:                                               ; preds = %.thread.us.us69
  %66 = zext i32 %63 to i64
  %67 = load i64, ptr %15, align 8, !tbaa !20
  %68 = add i64 %67, %66
  store i64 %68, ptr %15, align 8, !tbaa !20
  %.not54.us.us70 = icmp eq i32 %62, 0
  br i1 %.not54.us.us70, label %.critedge.us.us71, label %.critedge.thread

.critedge.us.us71:                                ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br label %.split.us.split.split.us

.split.us.split.split:                            ; preds = %.split.us.split, %.critedge.us
  %69 = phi i64 [ %.pre, %.critedge.us ], [ 0, %.split.us.split ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 131072, ptr %7, align 4, !tbaa !21
  %70 = load i64, ptr %4, align 8, !tbaa !24
  %71 = sub i64 %70, %69
  %72 = icmp ult i64 %71, 131072
  br i1 %72, label %thread-pre-split.us, label %.thread.us

thread-pre-split.us:                              ; preds = %.split.us.split.split
  %73 = trunc nuw nsw i64 %71 to i32
  store i32 %73, ptr %7, align 4, !tbaa !21
  %74 = icmp eq i64 %70, %69
  br i1 %74, label %.critedge.thread, label %.thread.us

.thread.us:                                       ; preds = %.split.us.split.split, %thread-pre-split.us
  %75 = phi i32 [ %73, %thread-pre-split.us ], [ 131072, %.split.us.split.split ]
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load ptr, ptr %1, align 8, !tbaa !22
  %78 = getelementptr inbounds i8, ptr %77, i64 40
  %79 = load ptr, ptr %78, align 8
  %80 = call noundef i32 %79(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %76, i32 noundef %75, ptr noundef nonnull %7)
  %81 = load i32, ptr %7, align 4, !tbaa !21
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %.critedge.thread, label %83

83:                                               ; preds = %.thread.us
  %84 = zext i32 %81 to i64
  %85 = load i64, ptr %15, align 8, !tbaa !20
  %86 = add i64 %85, %84
  store i64 %86, ptr %15, align 8, !tbaa !20
  %.not54.us = icmp eq i32 %80, 0
  br i1 %.not54.us, label %87, label %.critedge.thread

87:                                               ; preds = %83
  %88 = load ptr, ptr %5, align 8, !tbaa !22
  %89 = getelementptr inbounds i8, ptr %88, i64 40
  %90 = load ptr, ptr %89, align 8
  %91 = call noundef i32 %90(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %15, ptr noundef nonnull %15)
  %.not56.us = icmp eq i32 %91, 0
  br i1 %.not56.us, label %.critedge.us, label %.critedge.thread

.critedge.us:                                     ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  %.pre = load i64, ptr %15, align 8, !tbaa !20
  br label %.split.us.split.split

.split:                                           ; preds = %13, %.critedge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 131072, ptr %7, align 4, !tbaa !21
  br i1 %.not51, label %.thread, label %92

92:                                               ; preds = %.split
  %93 = load i64, ptr %4, align 8, !tbaa !24
  %94 = load i64, ptr %15, align 8, !tbaa !20
  %95 = sub i64 %93, %94
  %96 = icmp ult i64 %95, 131072
  br i1 %96, label %thread-pre-split, label %.thread

thread-pre-split:                                 ; preds = %92
  %97 = trunc nuw nsw i64 %95 to i32
  store i32 %97, ptr %7, align 4, !tbaa !21
  %98 = icmp eq i64 %93, %94
  br i1 %98, label %.critedge.thread, label %.thread

.thread:                                          ; preds = %92, %.split, %thread-pre-split
  %99 = phi i32 [ %97, %thread-pre-split ], [ 131072, %.split ], [ 131072, %92 ]
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load ptr, ptr %1, align 8, !tbaa !22
  %102 = getelementptr inbounds i8, ptr %101, i64 40
  %103 = load ptr, ptr %102, align 8
  %104 = call noundef i32 %103(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %100, i32 noundef %99, ptr noundef nonnull %7)
  %105 = load i32, ptr %7, align 4, !tbaa !21
  %106 = icmp eq i32 %105, 0
  br i1 %106, label %.critedge.thread, label %.preheader

.preheader:                                       ; preds = %.thread, %122
  %107 = phi i32 [ %123, %122 ], [ %105, %.thread ]
  %.039 = phi i32 [ %117, %122 ], [ 0, %.thread ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #3
  %108 = sub i32 %107, %.039
  store i32 %108, ptr %8, align 4, !tbaa !21
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = zext i32 %.039 to i64
  %111 = getelementptr inbounds i8, ptr %109, i64 %110
  %112 = load ptr, ptr %2, align 8, !tbaa !22
  %113 = getelementptr inbounds i8, ptr %112, i64 40
  %114 = load ptr, ptr %113, align 8
  %115 = call noundef i32 %114(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %111, i32 noundef %108, ptr noundef nonnull %8)
  %116 = load i32, ptr %8, align 4, !tbaa !21
  %117 = add i32 %116, %.039
  %118 = zext i32 %116 to i64
  %119 = load i64, ptr %15, align 8, !tbaa !20
  %120 = add i64 %119, %118
  store i64 %120, ptr %15, align 8, !tbaa !20
  %.not53 = icmp eq i32 %115, 0
  br i1 %.not53, label %121, label %.thread57

.thread57:                                        ; preds = %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  br label %.critedge.thread

121:                                              ; preds = %.preheader
  %.not63 = icmp eq i32 %116, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  br i1 %.not63, label %.critedge.thread, label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %7, align 4, !tbaa !21
  %124 = icmp ult i32 %117, %123
  br i1 %124, label %.preheader, label %.loopexit, !llvm.loop !25

.loopexit:                                        ; preds = %122
  %.not54 = icmp eq i32 %104, 0
  br i1 %.not54, label %125, label %.critedge.thread

125:                                              ; preds = %.loopexit
  br i1 %.not55, label %.critedge, label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %5, align 8, !tbaa !22
  %128 = getelementptr inbounds i8, ptr %127, i64 40
  %129 = load ptr, ptr %128, align 8
  %130 = call noundef i32 %129(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %15, ptr noundef nonnull %15)
  %.not56 = icmp eq i32 %130, 0
  br i1 %.not56, label %.critedge, label %.critedge.thread

.critedge.thread:                                 ; preds = %126, %.thread, %.loopexit, %thread-pre-split, %121, %87, %83, %.thread.us, %thread-pre-split.us, %65, %.thread.us.us69, %thread-pre-split.us.us, %39, %.lr.ph.split, %.critedge.us.us, %.lr.ph.split.us, %.critedge.us.us.us, %.split.us.split.us, %.thread57
  %.9.ph = phi i32 [ %115, %.thread57 ], [ %19, %.split.us.split.us ], [ %23, %.lr.ph.split.us ], [ %31, %.critedge.us.us.us ], [ %43, %39 ], [ %35, %.lr.ph.split ], [ %48, %.critedge.us.us ], [ 0, %thread-pre-split.us.us ], [ %62, %65 ], [ %62, %.thread.us.us69 ], [ 0, %thread-pre-split.us ], [ %80, %83 ], [ %80, %.thread.us ], [ %91, %87 ], [ -2147467259, %121 ], [ 0, %thread-pre-split ], [ %104, %.loopexit ], [ %104, %.thread ], [ %130, %126 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br label %131

.critedge:                                        ; preds = %126, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br label %.split

131:                                              ; preds = %.critedge.thread, %11
  %.10 = phi i32 [ -2147024882, %11 ], [ %.9.ph, %.critedge.thread ]
  ret i32 %.10
}

declare ptr @MyAlloc(i64 noundef) local_unnamed_addr #1

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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, !17, i64 48}
!6 = !{!"_ZTSN9NCompress10CCopyCoderE", !7, i64 0, !9, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !13, i64 40, !17, i64 48, !18, i64 56, !19, i64 64}
!7 = !{!"_ZTS14ICompressCoder", !8, i64 0}
!8 = !{!"_ZTS8IUnknown"}
!9 = !{!"_ZTS20ICompressSetInStream", !8, i64 0}
!10 = !{!"_ZTS19ISequentialInStream", !8, i64 0}
!11 = !{!"_ZTS22ICompressSetFinishMode", !8, i64 0}
!12 = !{!"_ZTS33ICompressGetInStreamProcessedSize", !8, i64 0}
!13 = !{!"_ZTS13CMyUnknownImp", !14, i64 0}
!14 = !{!"int", !15, i64 0}
!15 = !{!"omnipotent char", !16, i64 0}
!16 = !{!"Simple C++ TBAA"}
!17 = !{!"any pointer", !15, i64 0}
!18 = !{!"_ZTS9CMyComPtrI19ISequentialInStreamE", !17, i64 0}
!19 = !{!"long long", !15, i64 0}
!20 = !{!6, !19, i64 64}
!21 = !{!14, !14, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !16, i64 0}
!24 = !{!19, !19, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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