; LLVM IR from ShaneYCG/wflz :: wfLZ (wfLZ_ChunkCompress)

; 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._wfLZ_ChunkDesc = type { i32 }
%struct._wfLZ_HeaderChunked = type { [4 x i8], i32, i32, i32 }

; Function Attrs: nounwind uwtable
declare dso_local i32 @wfLZ_RoundUp(i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @wfLZ_EndianSwap32(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @wfLZ_CompressFast(ptr noalias noundef, i32 noundef, ptr noalias noundef, ptr noalias noundef, i32 noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @wfLZ_MemSet(ptr noundef, i8 noundef zeroext, i32 noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @wfLZ_Compress(ptr noalias noundef, i32 noundef, ptr noalias noundef, ptr noalias noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @wfLZ_ChunkCompress(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5, i32 noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %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 i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store i32 %5, ptr %13, align 4, !tbaa !9
  store i32 %6, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #2
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = sub i32 %23, 1
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = udiv i32 %24, %25
  %27 = add i32 %26, 1
  store i32 %27, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #2
  store i32 0, ptr %19, align 4, !tbaa !9
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %28, ptr %15, align 8, !tbaa !5
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  store ptr %30, ptr %16, align 8, !tbaa !5
  %31 = load i32, ptr %18, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = mul i64 4, %32
  %34 = add i64 16, %33
  %35 = trunc i64 %34 to i32
  %36 = call i32 @wfLZ_RoundUp(i32 noundef %35, i32 noundef 16)
  %37 = load i32, ptr %19, align 4, !tbaa !9
  %38 = add i32 %37, %36
  store i32 %38, ptr %19, align 4, !tbaa !9
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = load i32, ptr %19, align 4, !tbaa !9
  call void @wfLZ_MemSet(ptr noundef %39, i8 noundef zeroext 0, i32 noundef %40)
  %41 = load i32, ptr %19, align 4, !tbaa !9
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = zext i32 %41 to i64
  %44 = getelementptr inbounds i8, ptr %42, i64 %43
  store ptr %44, ptr %11, align 8, !tbaa !5
  %45 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %45, ptr %17, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %97, %7
  %47 = load i32, ptr %17, align 4, !tbaa !9
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %114

49:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #2
  %50 = load i32, ptr %17, align 4, !tbaa !9
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = icmp uge i32 %50, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %49
  %54 = load i32, ptr %10, align 4, !tbaa !9
  br label %57

55:                                               ; preds = %49
  %56 = load i32, ptr %17, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %55, %53
  %58 = phi i32 [ %54, %53 ], [ %56, %55 ]
  store i32 %58, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #2
  %59 = load i32, ptr %14, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %68

61:                                               ; preds = %57
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = load i32, ptr %20, align 4, !tbaa !9
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = call i32 @wfLZ_Compress(ptr noundef %62, i32 noundef %63, ptr noundef %64, ptr noundef %65, i32 noundef %66)
  br label %75

68:                                               ; preds = %57
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = load i32, ptr %20, align 4, !tbaa !9
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load i32, ptr %13, align 4, !tbaa !9
  %74 = call i32 @wfLZ_CompressFast(ptr noundef %69, i32 noundef %70, ptr noundef %71, ptr noundef %72, i32 noundef %73)
  br label %75

75:                                               ; preds = %68, %61
  %76 = phi i32 [ %67, %61 ], [ %74, %68 ]
  store i32 %76, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #2
  %77 = load i32, ptr %21, align 4, !tbaa !9
  %78 = call i32 @wfLZ_RoundUp(i32 noundef %77, i32 noundef 16)
  %79 = load i32, ptr %21, align 4, !tbaa !9
  %80 = sub i32 %78, %79
  store i32 %80, ptr %22, align 4, !tbaa !9
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = load i32, ptr %21, align 4, !tbaa !9
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %81, i64 %83
  %85 = load i32, ptr %22, align 4, !tbaa !9
  call void @wfLZ_MemSet(ptr noundef %84, i8 noundef zeroext 0, i32 noundef %85)
  %86 = load i32, ptr %22, align 4, !tbaa !9
  %87 = load i32, ptr %21, align 4, !tbaa !9
  %88 = add i32 %87, %86
  store i32 %88, ptr %21, align 4, !tbaa !9
  %89 = load i32, ptr %19, align 4, !tbaa !9
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._wfLZ_ChunkDesc, ptr %90, i32 0, i32 0
  store i32 %89, ptr %91, align 4, !tbaa !11
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %97

94:                                               ; preds = %75
  %95 = load ptr, ptr %16, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._wfLZ_ChunkDesc, ptr %95, i32 0, i32 0
  call void @wfLZ_EndianSwap32(ptr noundef %96)
  br label %97

97:                                               ; preds = %94, %75
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._wfLZ_ChunkDesc, ptr %98, i32 1
  store ptr %99, ptr %16, align 8, !tbaa !5
  %100 = load i32, ptr %20, align 4, !tbaa !9
  %101 = load i32, ptr %17, align 4, !tbaa !9
  %102 = sub i32 %101, %100
  store i32 %102, ptr %17, align 4, !tbaa !9
  %103 = load i32, ptr %20, align 4, !tbaa !9
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = zext i32 %103 to i64
  %106 = getelementptr inbounds i8, ptr %104, i64 %105
  store ptr %106, ptr %8, align 8, !tbaa !5
  %107 = load i32, ptr %21, align 4, !tbaa !9
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = zext i32 %107 to i64
  %110 = getelementptr inbounds i8, ptr %108, i64 %109
  store ptr %110, ptr %11, align 8, !tbaa !5
  %111 = load i32, ptr %21, align 4, !tbaa !9
  %112 = load i32, ptr %19, align 4, !tbaa !9
  %113 = add i32 %112, %111
  store i32 %113, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #2
  br label %46, !llvm.loop !13

114:                                              ; preds = %46
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds [4 x i8], ptr %116, i64 0, i64 0
  store i8 90, ptr %117, align 4, !tbaa !15
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %118, i32 0, i32 0
  %120 = getelementptr inbounds [4 x i8], ptr %119, i64 0, i64 1
  store i8 76, ptr %120, align 1, !tbaa !15
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds [4 x i8], ptr %122, i64 0, i64 2
  store i8 70, ptr %123, align 2, !tbaa !15
  %124 = load ptr, ptr %15, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds [4 x i8], ptr %125, i64 0, i64 3
  store i8 87, ptr %126, align 1, !tbaa !15
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %128, i32 0, i32 2
  store i32 %127, ptr %129, align 4, !tbaa !16
  %130 = load i32, ptr %18, align 4, !tbaa !9
  %131 = load ptr, ptr %15, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %131, i32 0, i32 3
  store i32 %130, ptr %132, align 4, !tbaa !18
  %133 = load i32, ptr %19, align 4, !tbaa !9
  %134 = zext i32 %133 to i64
  %135 = sub i64 %134, 16
  %136 = trunc i64 %135 to i32
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %137, i32 0, i32 1
  store i32 %136, ptr %138, align 4, !tbaa !19
  %139 = load i32, ptr %13, align 4, !tbaa !9
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %148

141:                                              ; preds = %114
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %142, i32 0, i32 2
  call void @wfLZ_EndianSwap32(ptr noundef %143)
  %144 = load ptr, ptr %15, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %144, i32 0, i32 1
  call void @wfLZ_EndianSwap32(ptr noundef %145)
  %146 = load ptr, ptr %15, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._wfLZ_HeaderChunked, ptr %146, i32 0, i32 3
  call void @wfLZ_EndianSwap32(ptr noundef %147)
  br label %148

148:                                              ; preds = %141, %114
  %149 = load i32, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #2
  ret i32 %149
}

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_wfLZ_ChunkDesc", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !10, i64 8}
!17 = !{!"_wfLZ_HeaderChunked", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!18 = !{!17, !10, i64 12}
!19 = !{!17, !10, i64 4}


; 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: nounwind uwtable
declare dso_local i32 @wfLZ_RoundUp(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @wfLZ_EndianSwap32(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @wfLZ_CompressFast(ptr noalias noundef, i32 noundef, ptr noalias noundef, ptr noalias noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @wfLZ_MemSet(ptr noundef, i8 noundef zeroext, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @wfLZ_Compress(ptr noalias noundef, i32 noundef, ptr noalias noundef, ptr noalias noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @wfLZ_ChunkCompress(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5, i32 noundef %6) local_unnamed_addr #0 {
  %8 = add i32 %1, -1
  %9 = udiv i32 %8, %2
  %10 = add i32 %9, 1
  %11 = getelementptr inbounds i8, ptr %3, i64 16
  %12 = shl i32 %10, 2
  %13 = add i32 %12, 16
  %14 = tail call i32 @wfLZ_RoundUp(i32 noundef %13, i32 noundef 16)
  tail call void @wfLZ_MemSet(ptr noundef %3, i8 noundef zeroext 0, i32 noundef %14)
  %15 = zext i32 %14 to i64
  %16 = getelementptr inbounds i8, ptr %3, i64 %15
  %.not68 = icmp eq i32 %1, 0
  br i1 %.not68, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %17 = icmp eq i32 %6, 0
  %.not67 = icmp eq i32 %5, 0
  br i1 %17, label %.lr.ph.split.us, label %.lr.ph.split

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

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us, %.lr.ph.split.us.split.us
  %.073.us.us = phi ptr [ %27, %.lr.ph.split.us.split.us ], [ %0, %.lr.ph.split.us ]
  %.06172.us.us = phi ptr [ %29, %.lr.ph.split.us.split.us ], [ %16, %.lr.ph.split.us ]
  %.06271.us.us = phi i32 [ %30, %.lr.ph.split.us.split.us ], [ %14, %.lr.ph.split.us ]
  %.06370.us.us = phi ptr [ %24, %.lr.ph.split.us.split.us ], [ %11, %.lr.ph.split.us ]
  %.06469.us.us = phi i32 [ %25, %.lr.ph.split.us.split.us ], [ %1, %.lr.ph.split.us ]
  %18 = tail call i32 @llvm.umin.i32(i32 %.06469.us.us, i32 %2)
  %19 = tail call i32 @wfLZ_Compress(ptr noundef %.073.us.us, i32 noundef %18, ptr noundef %.06172.us.us, ptr noundef %4, i32 noundef 0)
  %20 = tail call i32 @wfLZ_RoundUp(i32 noundef %19, i32 noundef 16)
  %21 = sub i32 %20, %19
  %22 = zext i32 %19 to i64
  %23 = getelementptr inbounds i8, ptr %.06172.us.us, i64 %22
  tail call void @wfLZ_MemSet(ptr noundef %23, i8 noundef zeroext 0, i32 noundef %21)
  store i32 %.06271.us.us, ptr %.06370.us.us, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %.06370.us.us, i64 4
  %25 = sub i32 %.06469.us.us, %18
  %26 = zext i32 %18 to i64
  %27 = getelementptr inbounds i8, ptr %.073.us.us, i64 %26
  %28 = zext i32 %20 to i64
  %29 = getelementptr inbounds i8, ptr %.06172.us.us, i64 %28
  %30 = add i32 %20, %.06271.us.us
  %.not.us.us = icmp eq i32 %25, 0
  br i1 %.not.us.us, label %._crit_edge, label %.lr.ph.split.us.split.us, !llvm.loop !10

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us, %.lr.ph.split.us.split
  %.073.us = phi ptr [ %40, %.lr.ph.split.us.split ], [ %0, %.lr.ph.split.us ]
  %.06172.us = phi ptr [ %42, %.lr.ph.split.us.split ], [ %16, %.lr.ph.split.us ]
  %.06271.us = phi i32 [ %43, %.lr.ph.split.us.split ], [ %14, %.lr.ph.split.us ]
  %.06370.us = phi ptr [ %37, %.lr.ph.split.us.split ], [ %11, %.lr.ph.split.us ]
  %.06469.us = phi i32 [ %38, %.lr.ph.split.us.split ], [ %1, %.lr.ph.split.us ]
  %31 = tail call i32 @llvm.umin.i32(i32 %.06469.us, i32 %2)
  %32 = tail call i32 @wfLZ_Compress(ptr noundef %.073.us, i32 noundef %31, ptr noundef %.06172.us, ptr noundef %4, i32 noundef %5)
  %33 = tail call i32 @wfLZ_RoundUp(i32 noundef %32, i32 noundef 16)
  %34 = sub i32 %33, %32
  %35 = zext i32 %32 to i64
  %36 = getelementptr inbounds i8, ptr %.06172.us, i64 %35
  tail call void @wfLZ_MemSet(ptr noundef %36, i8 noundef zeroext 0, i32 noundef %34)
  store i32 %.06271.us, ptr %.06370.us, align 4, !tbaa !5
  tail call void @wfLZ_EndianSwap32(ptr noundef nonnull %.06370.us)
  %37 = getelementptr inbounds i8, ptr %.06370.us, i64 4
  %38 = sub i32 %.06469.us, %31
  %39 = zext i32 %31 to i64
  %40 = getelementptr inbounds i8, ptr %.073.us, i64 %39
  %41 = zext i32 %33 to i64
  %42 = getelementptr inbounds i8, ptr %.06172.us, i64 %41
  %43 = add i32 %33, %.06271.us
  %.not.us = icmp eq i32 %38, 0
  br i1 %.not.us, label %._crit_edge, label %.lr.ph.split.us.split, !llvm.loop !10

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

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split, %.lr.ph.split.split.us
  %.073.us74 = phi ptr [ %53, %.lr.ph.split.split.us ], [ %0, %.lr.ph.split ]
  %.06172.us75 = phi ptr [ %55, %.lr.ph.split.split.us ], [ %16, %.lr.ph.split ]
  %.06271.us76 = phi i32 [ %56, %.lr.ph.split.split.us ], [ %14, %.lr.ph.split ]
  %.06370.us77 = phi ptr [ %50, %.lr.ph.split.split.us ], [ %11, %.lr.ph.split ]
  %.06469.us78 = phi i32 [ %51, %.lr.ph.split.split.us ], [ %1, %.lr.ph.split ]
  %44 = tail call i32 @llvm.umin.i32(i32 %.06469.us78, i32 %2)
  %45 = tail call i32 @wfLZ_CompressFast(ptr noundef %.073.us74, i32 noundef %44, ptr noundef %.06172.us75, ptr noundef %4, i32 noundef 0)
  %46 = tail call i32 @wfLZ_RoundUp(i32 noundef %45, i32 noundef 16)
  %47 = sub i32 %46, %45
  %48 = zext i32 %45 to i64
  %49 = getelementptr inbounds i8, ptr %.06172.us75, i64 %48
  tail call void @wfLZ_MemSet(ptr noundef %49, i8 noundef zeroext 0, i32 noundef %47)
  store i32 %.06271.us76, ptr %.06370.us77, align 4, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %.06370.us77, i64 4
  %51 = sub i32 %.06469.us78, %44
  %52 = zext i32 %44 to i64
  %53 = getelementptr inbounds i8, ptr %.073.us74, i64 %52
  %54 = zext i32 %46 to i64
  %55 = getelementptr inbounds i8, ptr %.06172.us75, i64 %54
  %56 = add i32 %46, %.06271.us76
  %.not.us79 = icmp eq i32 %51, 0
  br i1 %.not.us79, label %._crit_edge, label %.lr.ph.split.split.us, !llvm.loop !10

.lr.ph.split.split:                               ; preds = %.lr.ph.split, %.lr.ph.split.split
  %.073 = phi ptr [ %66, %.lr.ph.split.split ], [ %0, %.lr.ph.split ]
  %.06172 = phi ptr [ %68, %.lr.ph.split.split ], [ %16, %.lr.ph.split ]
  %.06271 = phi i32 [ %69, %.lr.ph.split.split ], [ %14, %.lr.ph.split ]
  %.06370 = phi ptr [ %63, %.lr.ph.split.split ], [ %11, %.lr.ph.split ]
  %.06469 = phi i32 [ %64, %.lr.ph.split.split ], [ %1, %.lr.ph.split ]
  %57 = tail call i32 @llvm.umin.i32(i32 %.06469, i32 %2)
  %58 = tail call i32 @wfLZ_CompressFast(ptr noundef %.073, i32 noundef %57, ptr noundef %.06172, ptr noundef %4, i32 noundef %5)
  %59 = tail call i32 @wfLZ_RoundUp(i32 noundef %58, i32 noundef 16)
  %60 = sub i32 %59, %58
  %61 = zext i32 %58 to i64
  %62 = getelementptr inbounds i8, ptr %.06172, i64 %61
  tail call void @wfLZ_MemSet(ptr noundef %62, i8 noundef zeroext 0, i32 noundef %60)
  store i32 %.06271, ptr %.06370, align 4, !tbaa !5
  tail call void @wfLZ_EndianSwap32(ptr noundef nonnull %.06370)
  %63 = getelementptr inbounds i8, ptr %.06370, i64 4
  %64 = sub i32 %.06469, %57
  %65 = zext i32 %57 to i64
  %66 = getelementptr inbounds i8, ptr %.073, i64 %65
  %67 = zext i32 %59 to i64
  %68 = getelementptr inbounds i8, ptr %.06172, i64 %67
  %69 = add i32 %59, %.06271
  %.not = icmp eq i32 %64, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.split.split, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph.split.split, %.lr.ph.split.split.us, %.lr.ph.split.us.split, %.lr.ph.split.us.split.us, %7
  %.062.lcssa = phi i32 [ %14, %7 ], [ %30, %.lr.ph.split.us.split.us ], [ %43, %.lr.ph.split.us.split ], [ %56, %.lr.ph.split.split.us ], [ %69, %.lr.ph.split.split ]
  store <4 x i8> <i8 90, i8 76, i8 70, i8 87>, ptr %3, align 4, !tbaa !12
  %70 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %1, ptr %70, align 4, !tbaa !13
  %71 = getelementptr inbounds i8, ptr %3, i64 12
  store i32 %10, ptr %71, align 4, !tbaa !15
  %72 = add i32 %.062.lcssa, -16
  %73 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 %72, ptr %73, align 4, !tbaa !16
  %.not65 = icmp eq i32 %5, 0
  br i1 %.not65, label %75, label %74

74:                                               ; preds = %._crit_edge
  tail call void @wfLZ_EndianSwap32(ptr noundef nonnull %70)
  tail call void @wfLZ_EndianSwap32(ptr noundef nonnull %73)
  tail call void @wfLZ_EndianSwap32(ptr noundef nonnull %71)
  br label %75

75:                                               ; preds = %74, %._crit_edge
  ret i32 %.062.lcssa
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #1

attributes #0 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !7, i64 0}
!6 = !{!"_wfLZ_ChunkDesc", !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !7, i64 8}
!14 = !{!"_wfLZ_HeaderChunked", !8, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!15 = !{!14, !7, i64 12}
!16 = !{!14, !7, i64 4}


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