; LLVM IR from mncoppola/rpef :: utilities_src/squashfs2.1/lzma/C/7zip/Compress/LZMA (LZMAEncoder)

; 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::NLZMA::CEncoder" = type <{ %struct.ICompressCoder, %struct.ICompressSetOutStream, %struct.ICompressSetCoderProperties, %struct.ICompressWriteCoderProperties, %"class.NCompress::NLZMA::CBaseState", %class.CMyUnknownImp, [4096 x %"struct.NCompress::NLZMA::COptimal"], %class.CMyComPtr.5, %"class.NCompress::NRangeCoder::CEncoder", [12 x [16 x %"class.NCompress::NRangeCoder::CBitEncoder"]], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x [16 x %"class.NCompress::NRangeCoder::CBitEncoder"]], [4 x %"class.NCompress::NRangeCoder::CBitTreeEncoder.7"], [114 x %"class.NCompress::NRangeCoder::CBitEncoder"], %"class.NCompress::NRangeCoder::CBitTreeEncoder.8", %"class.NCompress::NLZMA::NLength::CPriceTableEncoder", %"class.NCompress::NLZMA::NLength::CPriceTableEncoder", %"class.NCompress::NLZMA::CLiteralEncoder", [274 x i32], i8, i8, [2 x i8], i32, i32, i32, i32, i32, i8, [3 x i8], [4 x [64 x i32]], [4 x [128 x i32]], [16 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i8, [7 x i8], ptr, i32, i8, i8, [2 x i8] }>
%struct.ICompressCoder = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressSetOutStream = type { %struct.IUnknown }
%struct.ICompressSetCoderProperties = type { %struct.IUnknown }
%struct.ICompressWriteCoderProperties = type { %struct.IUnknown }
%"class.NCompress::NLZMA::CBaseState" = type { %"class.NCompress::NLZMA::CState", i8, [4 x i32] }
%"class.NCompress::NLZMA::CState" = type { i8 }
%class.CMyUnknownImp = type { i32 }
%"struct.NCompress::NLZMA::COptimal" = type { %"class.NCompress::NLZMA::CState", i8, i8, i32, i32, i32, i32, i32, [4 x i32] }
%class.CMyComPtr.5 = type { ptr }
%"class.NCompress::NRangeCoder::CEncoder" = type { i32, i8, i64, i32, [4 x i8], %class.COutBuffer }
%class.COutBuffer = type <{ ptr, i32, i32, i32, i32, %class.CMyComPtr.6, i64, ptr, i8, [7 x i8] }>
%class.CMyComPtr.6 = type { ptr }
%"class.NCompress::NRangeCoder::CBitEncoder" = type { %"class.NCompress::NRangeCoder::CBitModel" }
%"class.NCompress::NRangeCoder::CBitModel" = type { i32 }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.7" = type { [64 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.8" = type { [16 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NLZMA::NLength::CPriceTableEncoder" = type { %"class.NCompress::NLZMA::NLength::CEncoder", [272 x [16 x i32]], i32, [16 x i32] }
%"class.NCompress::NLZMA::NLength::CEncoder" = type { %"class.NCompress::NRangeCoder::CBitEncoder", %"class.NCompress::NRangeCoder::CBitEncoder", [16 x %"class.NCompress::NRangeCoder::CBitTreeEncoder"], [16 x %"class.NCompress::NRangeCoder::CBitTreeEncoder"], %"class.NCompress::NRangeCoder::CBitTreeEncoder.4" }
%"class.NCompress::NRangeCoder::CBitTreeEncoder" = type { [8 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.4" = type { [256 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NLZMA::CLiteralEncoder" = type <{ ptr, i32, i32, i32, [4 x i8] }>

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9NCompress5NLZMA8CEncoder17FillPosSlotPricesEv(ptr noundef nonnull align 8 dereferenceable(210678) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %6

6:                                                ; preds = %68, %1
  %7 = load i32, ptr %3, align 4, !tbaa !9
  %8 = icmp ult i32 %7, 4
  br i1 %8, label %10, label %9

9:                                                ; preds = %6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %71

10:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %35, %10
  %12 = load i32, ptr %4, align 4, !tbaa !9
  %13 = icmp ult i32 %12, 14
  br i1 %13, label %14, label %19

14:                                               ; preds = %11
  %15 = load i32, ptr %4, align 4, !tbaa !9
  %16 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %5, i32 0, i32 36
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = icmp ult i32 %15, %17
  br label %19

19:                                               ; preds = %14, %11
  %20 = phi i1 [ false, %11 ], [ %18, %14 ]
  br i1 %20, label %21, label %38

21:                                               ; preds = %19
  %22 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %5, i32 0, i32 15
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds [4 x %"class.NCompress::NRangeCoder::CBitTreeEncoder.7"], ptr %22, i64 0, i64 %24
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %25, i32 noundef %26)
  %28 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %5, i32 0, i32 32
  %29 = load i32, ptr %3, align 4, !tbaa !9
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds [4 x [64 x i32]], ptr %28, i64 0, i64 %30
  %32 = load i32, ptr %4, align 4, !tbaa !9
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds [64 x i32], ptr %31, i64 0, i64 %33
  store i32 %27, ptr %34, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %21
  %36 = load i32, ptr %4, align 4, !tbaa !9
  %37 = add i32 %36, 1
  store i32 %37, ptr %4, align 4, !tbaa !9
  br label %11, !llvm.loop !34

38:                                               ; preds = %19
  br label %39

39:                                               ; preds = %64, %38
  %40 = load i32, ptr %4, align 4, !tbaa !9
  %41 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %5, i32 0, i32 36
  %42 = load i32, ptr %41, align 8, !tbaa !11
  %43 = icmp ult i32 %40, %42
  br i1 %43, label %44, label %67

44:                                               ; preds = %39
  %45 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %5, i32 0, i32 15
  %46 = load i32, ptr %3, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds [4 x %"class.NCompress::NRangeCoder::CBitTreeEncoder.7"], ptr %45, i64 0, i64 %47
  %49 = load i32, ptr %4, align 4, !tbaa !9
  %50 = call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %48, i32 noundef %49)
  %51 = load i32, ptr %4, align 4, !tbaa !9
  %52 = lshr i32 %51, 1
  %53 = sub i32 %52, 1
  %54 = sub i32 %53, 4
  %55 = shl i32 %54, 6
  %56 = add i32 %50, %55
  %57 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %5, i32 0, i32 32
  %58 = load i32, ptr %3, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds [4 x [64 x i32]], ptr %57, i64 0, i64 %59
  %61 = load i32, ptr %4, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds [64 x i32], ptr %60, i64 0, i64 %62
  store i32 %56, ptr %63, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %44
  %65 = load i32, ptr %4, align 4, !tbaa !9
  %66 = add i32 %65, 1
  store i32 %66, ptr %4, align 4, !tbaa !9
  br label %39, !llvm.loop !36

67:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %3, align 4, !tbaa !9
  %70 = add i32 %69, 1
  store i32 %70, ptr %3, align 4, !tbaa !9
  br label %6, !llvm.loop !37

71:                                               ; preds = %9
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256), i32 noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 210608}
!12 = !{!"_ZTSN9NCompress5NLZMA8CEncoderE", !13, i64 0, !15, i64 8, !16, i64 16, !17, i64 24, !18, i64 32, !20, i64 52, !7, i64 56, !21, i64 163896, !22, i64 163904, !7, i64 163984, !7, i64 164752, !7, i64 164800, !7, i64 164848, !7, i64 164896, !7, i64 164944, !7, i64 165712, !7, i64 166736, !27, i64 167192, !28, i64 167256, !28, i64 186788, !33, i64 206320, !7, i64 206344, !26, i64 207440, !26, i64 207441, !10, i64 207444, !10, i64 207448, !10, i64 207452, !10, i64 207456, !10, i64 207460, !26, i64 207464, !7, i64 207468, !7, i64 208492, !7, i64 210540, !10, i64 210604, !10, i64 210608, !10, i64 210612, !10, i64 210616, !10, i64 210620, !10, i64 210624, !10, i64 210628, !10, i64 210632, !10, i64 210636, !23, i64 210640, !23, i64 210648, !26, i64 210656, !6, i64 210664, !10, i64 210672, !26, i64 210676, !26, i64 210677}
!13 = !{!"_ZTS14ICompressCoder", !14, i64 0}
!14 = !{!"_ZTS8IUnknown"}
!15 = !{!"_ZTS21ICompressSetOutStream", !14, i64 0}
!16 = !{!"_ZTS27ICompressSetCoderProperties", !14, i64 0}
!17 = !{!"_ZTS29ICompressWriteCoderProperties", !14, i64 0}
!18 = !{!"_ZTSN9NCompress5NLZMA10CBaseStateE", !19, i64 0, !7, i64 1, !7, i64 4}
!19 = !{!"_ZTSN9NCompress5NLZMA6CStateE", !7, i64 0}
!20 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!21 = !{!"_ZTS9CMyComPtrI12IMatchFinderE", !6, i64 0}
!22 = !{!"_ZTSN9NCompress11NRangeCoder8CEncoderE", !10, i64 0, !7, i64 4, !23, i64 8, !10, i64 16, !24, i64 24}
!23 = !{!"long long", !7, i64 0}
!24 = !{!"_ZTS10COutBuffer", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !25, i64 24, !23, i64 32, !6, i64 40, !26, i64 48}
!25 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !6, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi4EEE", !7, i64 0}
!28 = !{!"_ZTSN9NCompress5NLZMA7NLength18CPriceTableEncoderE", !29, i64 0, !7, i64 2056, !10, i64 19464, !7, i64 19468}
!29 = !{!"_ZTSN9NCompress5NLZMA7NLength8CEncoderE", !30, i64 0, !30, i64 4, !7, i64 8, !7, i64 520, !32, i64 1032}
!30 = !{!"_ZTSN9NCompress11NRangeCoder11CBitEncoderILi5EEE", !31, i64 0}
!31 = !{!"_ZTSN9NCompress11NRangeCoder9CBitModelILi5EEE", !10, i64 0}
!32 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi8EEE", !7, i64 0}
!33 = !{!"_ZTSN9NCompress5NLZMA15CLiteralEncoderE", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}
!37 = distinct !{!37, !35}


; 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 nounwind uwtable
define dso_local void @_ZN9NCompress5NLZMA8CEncoder17FillPosSlotPricesEv(ptr noundef nonnull align 8 dereferenceable(210678) %0) local_unnamed_addr #0 align 2 {
.preheader:
  %1 = getelementptr inbounds i8, ptr %0, i64 210608
  %2 = getelementptr inbounds i8, ptr %0, i64 165712
  %3 = getelementptr inbounds i8, ptr %0, i64 207468
  %4 = load i32, ptr %1, align 8
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %.critedge._crit_edge.3, label %.lr.ph

.critedge.preheader:                              ; preds = %.lr.ph
  %5 = trunc nuw nsw i64 %indvars.iv.next to i32
  %6 = icmp ugt i32 %12, %5
  br i1 %6, label %.lr.ph21, label %.critedge._crit_edge

.lr.ph21:                                         ; preds = %.critedge.preheader
  %7 = and i64 %indvars.iv.next, 4294967295
  br label %.critedge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %8 = trunc nuw nsw i64 %indvars.iv to i32
  %9 = tail call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %2, i32 noundef %8)
  %10 = getelementptr inbounds [4 x [64 x i32]], ptr %3, i64 0, i64 0, i64 %indvars.iv
  store i32 %9, ptr %10, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = icmp ult i64 %indvars.iv, 13
  %12 = load i32, ptr %1, align 8
  %13 = zext i32 %12 to i64
  %14 = icmp ult i64 %indvars.iv.next, %13
  %or.cond = select i1 %11, i1 %14, i1 false
  br i1 %or.cond, label %.lr.ph, label %.critedge.preheader, !llvm.loop !9

.critedge:                                        ; preds = %.lr.ph21, %.critedge
  %indvars.iv24 = phi i64 [ %7, %.lr.ph21 ], [ %indvars.iv.next25, %.critedge ]
  %15 = trunc nuw i64 %indvars.iv24 to i32
  %16 = tail call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %2, i32 noundef %15)
  %17 = shl i32 %15, 5
  %18 = and i32 %17, -64
  %19 = add i32 %18, -320
  %20 = add i32 %19, %16
  %21 = getelementptr inbounds [4 x [64 x i32]], ptr %3, i64 0, i64 0, i64 %indvars.iv24
  store i32 %20, ptr %21, align 4, !tbaa !5
  %indvars.iv.next25 = add nuw nsw i64 %indvars.iv24, 1
  %22 = load i32, ptr %1, align 8
  %23 = zext i32 %22 to i64
  %24 = icmp ult i64 %indvars.iv.next25, %23
  br i1 %24, label %.critedge, label %.critedge._crit_edge, !llvm.loop !11

.critedge._crit_edge:                             ; preds = %.critedge, %.critedge.preheader
  %25 = phi i32 [ %12, %.critedge.preheader ], [ %22, %.critedge ]
  %.not.1 = icmp eq i32 %25, 0
  br i1 %.not.1, label %.critedge._crit_edge.3, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.critedge._crit_edge
  %26 = getelementptr inbounds i8, ptr %0, i64 165968
  br label %27

27:                                               ; preds = %27, %.lr.ph.1
  %indvars.iv.1 = phi i64 [ 0, %.lr.ph.1 ], [ %indvars.iv.next.1, %27 ]
  %28 = trunc nuw nsw i64 %indvars.iv.1 to i32
  %29 = tail call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %26, i32 noundef %28)
  %30 = getelementptr inbounds [4 x [64 x i32]], ptr %3, i64 0, i64 1, i64 %indvars.iv.1
  store i32 %29, ptr %30, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %31 = icmp ult i64 %indvars.iv.1, 13
  %32 = load i32, ptr %1, align 8
  %33 = zext i32 %32 to i64
  %34 = icmp ult i64 %indvars.iv.next.1, %33
  %or.cond.1 = select i1 %31, i1 %34, i1 false
  br i1 %or.cond.1, label %27, label %.critedge.preheader.1, !llvm.loop !9

.critedge.preheader.1:                            ; preds = %27
  %35 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  %36 = icmp ugt i32 %32, %35
  br i1 %36, label %.lr.ph21.1, label %.critedge._crit_edge.1

.lr.ph21.1:                                       ; preds = %.critedge.preheader.1
  %37 = getelementptr inbounds i8, ptr %0, i64 165968
  %38 = and i64 %indvars.iv.next.1, 4294967295
  br label %.critedge.1

.critedge.1:                                      ; preds = %.critedge.1, %.lr.ph21.1
  %indvars.iv24.1 = phi i64 [ %38, %.lr.ph21.1 ], [ %indvars.iv.next25.1, %.critedge.1 ]
  %39 = trunc nuw i64 %indvars.iv24.1 to i32
  %40 = tail call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %37, i32 noundef %39)
  %41 = shl i32 %39, 5
  %42 = and i32 %41, -64
  %43 = add i32 %42, -320
  %44 = add i32 %43, %40
  %45 = getelementptr inbounds [4 x [64 x i32]], ptr %3, i64 0, i64 1, i64 %indvars.iv24.1
  store i32 %44, ptr %45, align 4, !tbaa !5
  %indvars.iv.next25.1 = add nuw nsw i64 %indvars.iv24.1, 1
  %46 = load i32, ptr %1, align 8
  %47 = zext i32 %46 to i64
  %48 = icmp ult i64 %indvars.iv.next25.1, %47
  br i1 %48, label %.critedge.1, label %.critedge._crit_edge.1, !llvm.loop !11

.critedge._crit_edge.1:                           ; preds = %.critedge.1, %.critedge.preheader.1
  %49 = phi i32 [ %32, %.critedge.preheader.1 ], [ %46, %.critedge.1 ]
  %.not.2 = icmp eq i32 %49, 0
  br i1 %.not.2, label %.critedge._crit_edge.3, label %.lr.ph.2

.lr.ph.2:                                         ; preds = %.critedge._crit_edge.1
  %50 = getelementptr inbounds i8, ptr %0, i64 166224
  br label %51

51:                                               ; preds = %51, %.lr.ph.2
  %indvars.iv.2 = phi i64 [ 0, %.lr.ph.2 ], [ %indvars.iv.next.2, %51 ]
  %52 = trunc nuw nsw i64 %indvars.iv.2 to i32
  %53 = tail call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %50, i32 noundef %52)
  %54 = getelementptr inbounds [4 x [64 x i32]], ptr %3, i64 0, i64 2, i64 %indvars.iv.2
  store i32 %53, ptr %54, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %55 = icmp ult i64 %indvars.iv.2, 13
  %56 = load i32, ptr %1, align 8
  %57 = zext i32 %56 to i64
  %58 = icmp ult i64 %indvars.iv.next.2, %57
  %or.cond.2 = select i1 %55, i1 %58, i1 false
  br i1 %or.cond.2, label %51, label %.critedge.preheader.2, !llvm.loop !9

.critedge.preheader.2:                            ; preds = %51
  %59 = trunc nuw nsw i64 %indvars.iv.next.2 to i32
  %60 = icmp ugt i32 %56, %59
  br i1 %60, label %.lr.ph21.2, label %.critedge._crit_edge.2

.lr.ph21.2:                                       ; preds = %.critedge.preheader.2
  %61 = getelementptr inbounds i8, ptr %0, i64 166224
  %62 = and i64 %indvars.iv.next.2, 4294967295
  br label %.critedge.2

.critedge.2:                                      ; preds = %.critedge.2, %.lr.ph21.2
  %indvars.iv24.2 = phi i64 [ %62, %.lr.ph21.2 ], [ %indvars.iv.next25.2, %.critedge.2 ]
  %63 = trunc nuw i64 %indvars.iv24.2 to i32
  %64 = tail call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %61, i32 noundef %63)
  %65 = shl i32 %63, 5
  %66 = and i32 %65, -64
  %67 = add i32 %66, -320
  %68 = add i32 %67, %64
  %69 = getelementptr inbounds [4 x [64 x i32]], ptr %3, i64 0, i64 2, i64 %indvars.iv24.2
  store i32 %68, ptr %69, align 4, !tbaa !5
  %indvars.iv.next25.2 = add nuw nsw i64 %indvars.iv24.2, 1
  %70 = load i32, ptr %1, align 8
  %71 = zext i32 %70 to i64
  %72 = icmp ult i64 %indvars.iv.next25.2, %71
  br i1 %72, label %.critedge.2, label %.critedge._crit_edge.2, !llvm.loop !11

.critedge._crit_edge.2:                           ; preds = %.critedge.2, %.critedge.preheader.2
  %73 = phi i32 [ %56, %.critedge.preheader.2 ], [ %70, %.critedge.2 ]
  %.not.3 = icmp eq i32 %73, 0
  br i1 %.not.3, label %.critedge._crit_edge.3, label %.lr.ph.3

.lr.ph.3:                                         ; preds = %.critedge._crit_edge.2
  %74 = getelementptr inbounds i8, ptr %0, i64 166480
  br label %75

75:                                               ; preds = %75, %.lr.ph.3
  %indvars.iv.3 = phi i64 [ 0, %.lr.ph.3 ], [ %indvars.iv.next.3, %75 ]
  %76 = trunc nuw nsw i64 %indvars.iv.3 to i32
  %77 = tail call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %74, i32 noundef %76)
  %78 = getelementptr inbounds [4 x [64 x i32]], ptr %3, i64 0, i64 3, i64 %indvars.iv.3
  store i32 %77, ptr %78, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %79 = icmp ult i64 %indvars.iv.3, 13
  %80 = load i32, ptr %1, align 8
  %81 = zext i32 %80 to i64
  %82 = icmp ult i64 %indvars.iv.next.3, %81
  %or.cond.3 = select i1 %79, i1 %82, i1 false
  br i1 %or.cond.3, label %75, label %.critedge.preheader.3, !llvm.loop !9

.critedge.preheader.3:                            ; preds = %75
  %83 = trunc nuw nsw i64 %indvars.iv.next.3 to i32
  %84 = icmp ugt i32 %80, %83
  br i1 %84, label %.lr.ph21.3, label %.critedge._crit_edge.3

.lr.ph21.3:                                       ; preds = %.critedge.preheader.3
  %85 = getelementptr inbounds i8, ptr %0, i64 166480
  %86 = and i64 %indvars.iv.next.3, 4294967295
  br label %.critedge.3

.critedge.3:                                      ; preds = %.critedge.3, %.lr.ph21.3
  %indvars.iv24.3 = phi i64 [ %86, %.lr.ph21.3 ], [ %indvars.iv.next25.3, %.critedge.3 ]
  %87 = trunc nuw i64 %indvars.iv24.3 to i32
  %88 = tail call noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256) %85, i32 noundef %87)
  %89 = shl i32 %87, 5
  %90 = and i32 %89, -64
  %91 = add i32 %90, -320
  %92 = add i32 %91, %88
  %93 = getelementptr inbounds [4 x [64 x i32]], ptr %3, i64 0, i64 3, i64 %indvars.iv24.3
  store i32 %92, ptr %93, align 4, !tbaa !5
  %indvars.iv.next25.3 = add nuw nsw i64 %indvars.iv24.3, 1
  %94 = load i32, ptr %1, align 8, !tbaa !12
  %95 = zext i32 %94 to i64
  %96 = icmp ult i64 %indvars.iv.next25.3, %95
  br i1 %96, label %.critedge.3, label %.critedge._crit_edge.3, !llvm.loop !11

.critedge._crit_edge.3:                           ; preds = %.critedge.3, %.critedge._crit_edge.1, %.preheader, %.critedge._crit_edge, %.critedge._crit_edge.2, %.critedge.preheader.3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi6EE8GetPriceEj(ptr noundef nonnull align 4 dereferenceable(256), i32 noundef) local_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" }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 210608}
!13 = !{!"_ZTSN9NCompress5NLZMA8CEncoderE", !14, i64 0, !16, i64 8, !17, i64 16, !18, i64 24, !19, i64 32, !21, i64 52, !7, i64 56, !22, i64 163896, !24, i64 163904, !7, i64 163984, !7, i64 164752, !7, i64 164800, !7, i64 164848, !7, i64 164896, !7, i64 164944, !7, i64 165712, !7, i64 166736, !29, i64 167192, !30, i64 167256, !30, i64 186788, !35, i64 206320, !7, i64 206344, !28, i64 207440, !28, i64 207441, !6, i64 207444, !6, i64 207448, !6, i64 207452, !6, i64 207456, !6, i64 207460, !28, i64 207464, !7, i64 207468, !7, i64 208492, !7, i64 210540, !6, i64 210604, !6, i64 210608, !6, i64 210612, !6, i64 210616, !6, i64 210620, !6, i64 210624, !6, i64 210628, !6, i64 210632, !6, i64 210636, !25, i64 210640, !25, i64 210648, !28, i64 210656, !23, i64 210664, !6, i64 210672, !28, i64 210676, !28, i64 210677}
!14 = !{!"_ZTS14ICompressCoder", !15, i64 0}
!15 = !{!"_ZTS8IUnknown"}
!16 = !{!"_ZTS21ICompressSetOutStream", !15, i64 0}
!17 = !{!"_ZTS27ICompressSetCoderProperties", !15, i64 0}
!18 = !{!"_ZTS29ICompressWriteCoderProperties", !15, i64 0}
!19 = !{!"_ZTSN9NCompress5NLZMA10CBaseStateE", !20, i64 0, !7, i64 1, !7, i64 4}
!20 = !{!"_ZTSN9NCompress5NLZMA6CStateE", !7, i64 0}
!21 = !{!"_ZTS13CMyUnknownImp", !6, i64 0}
!22 = !{!"_ZTS9CMyComPtrI12IMatchFinderE", !23, i64 0}
!23 = !{!"any pointer", !7, i64 0}
!24 = !{!"_ZTSN9NCompress11NRangeCoder8CEncoderE", !6, i64 0, !7, i64 4, !25, i64 8, !6, i64 16, !26, i64 24}
!25 = !{!"long long", !7, i64 0}
!26 = !{!"_ZTS10COutBuffer", !23, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !27, i64 24, !25, i64 32, !23, i64 40, !28, i64 48}
!27 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !23, i64 0}
!28 = !{!"bool", !7, i64 0}
!29 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi4EEE", !7, i64 0}
!30 = !{!"_ZTSN9NCompress5NLZMA7NLength18CPriceTableEncoderE", !31, i64 0, !7, i64 2056, !6, i64 19464, !7, i64 19468}
!31 = !{!"_ZTSN9NCompress5NLZMA7NLength8CEncoderE", !32, i64 0, !32, i64 4, !7, i64 8, !7, i64 520, !34, i64 1032}
!32 = !{!"_ZTSN9NCompress11NRangeCoder11CBitEncoderILi5EEE", !33, i64 0}
!33 = !{!"_ZTSN9NCompress11NRangeCoder9CBitModelILi5EEE", !6, i64 0}
!34 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi8EEE", !7, i64 0}
!35 = !{!"_ZTSN9NCompress5NLZMA15CLiteralEncoderE", !23, i64 0, !6, i64 8, !6, i64 12, !6, i64 16}


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