; LLVM IR from indygreg/python-zstandard :: zstd (zstd)

; 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.rawSeq = type { i32, i32, i32 }
%struct.ZSTD_matchState_t = type { %struct.ZSTD_window_t, i32, i32, i32, i32, ptr, [8 x i32], i64, i32, ptr, ptr, ptr, i32, i32, %struct.optState_t, ptr, %struct.ZSTD_compressionParameters, ptr, i32, i32 }
%struct.ZSTD_window_t = type { ptr, ptr, ptr, i32, i32, i32 }
%struct.optState_t = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32 }
%struct.ZSTD_compressionParameters = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.rawSeqStore_t = type { ptr, i64, i64, i64, i64 }

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @ZSTD_selectBlockCompressor(i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @ZSTD_storeSeq(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @ZSTD_ldm_skipRawSeqStoreBytes(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTD_ldm_blockCompress(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, i64 noundef %6) #2 {
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca %struct.rawSeq, align 4
  %25 = alloca { i64, i32 }, align 8
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store i32 %4, ptr %13, align 4, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !5
  store i64 %6, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ZSTD_matchState_t, ptr %28, i32 0, i32 16
  store ptr %29, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %30 = load ptr, ptr %16, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ZSTD_compressionParameters, ptr %30, i32 0, i32 4
  %32 = load i32, ptr %31, align 4, !tbaa !13
  store i32 %32, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %33 = load ptr, ptr %16, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ZSTD_compressionParameters, ptr %33, i32 0, i32 6
  %35 = load i32, ptr %34, align 4, !tbaa !15
  %36 = load i32, ptr %13, align 4, !tbaa !9
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = call i32 @ZSTD_matchState_dictMode(ptr noundef %37)
  %39 = call ptr @ZSTD_selectBlockCompressor(i32 noundef %35, i32 noundef %36, i32 noundef %38)
  store ptr %39, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %40, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %41 = load ptr, ptr %19, align 8, !tbaa !5
  %42 = load i64, ptr %15, align 8, !tbaa !11
  %43 = getelementptr inbounds i8, ptr %41, i64 %42
  store ptr %43, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %44 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %44, ptr %21, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %7
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ZSTD_compressionParameters, ptr %48, i32 0, i32 6
  %50 = load i32, ptr %49, align 4, !tbaa !15
  %51 = icmp uge i32 %50, 7
  br i1 %51, label %52, label %66

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ZSTD_matchState_t, ptr %54, i32 0, i32 17
  store ptr %53, ptr %55, align 8, !tbaa !16
  %56 = load ptr, ptr %18, align 8, !tbaa !5
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  %61 = load i64, ptr %15, align 8, !tbaa !11
  %62 = call i64 %56(ptr noundef %57, ptr noundef %58, ptr noundef %59, ptr noundef %60, i64 noundef %61)
  store i64 %62, ptr %22, align 8, !tbaa !11
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i64, ptr %15, align 8, !tbaa !11
  call void @ZSTD_ldm_skipRawSeqStoreBytes(ptr noundef %63, i64 noundef %64)
  %65 = load i64, ptr %22, align 8, !tbaa !11
  store i64 %65, ptr %8, align 8
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %178

66:                                               ; preds = %47
  br label %67

67:                                               ; preds = %160, %66
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.rawSeqStore_t, ptr %68, i32 0, i32 1
  %70 = load i64, ptr %69, align 8, !tbaa !20
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.rawSeqStore_t, ptr %71, i32 0, i32 3
  %73 = load i64, ptr %72, align 8, !tbaa !22
  %74 = icmp ult i64 %70, %73
  br i1 %74, label %75, label %79

75:                                               ; preds = %67
  %76 = load ptr, ptr %21, align 8, !tbaa !5
  %77 = load ptr, ptr %20, align 8, !tbaa !5
  %78 = icmp ult ptr %76, %77
  br label %79

79:                                               ; preds = %75, %67
  %80 = phi i1 [ false, %67 ], [ %78, %75 ]
  br i1 %80, label %81, label %161

81:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load ptr, ptr %20, align 8, !tbaa !5
  %84 = load ptr, ptr %21, align 8, !tbaa !5
  %85 = ptrtoint ptr %83 to i64
  %86 = ptrtoint ptr %84 to i64
  %87 = sub i64 %85, %86
  %88 = trunc i64 %87 to i32
  %89 = load i32, ptr %17, align 4, !tbaa !9
  %90 = call { i64, i32 } @maybeSplitSequence(ptr noundef %82, i32 noundef %88, i32 noundef %89)
  store { i64, i32 } %90, ptr %25, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 8 %25, i64 12, i1 false)
  %91 = getelementptr inbounds %struct.rawSeq, ptr %24, i32 0, i32 0
  %92 = load i32, ptr %91, align 4, !tbaa !23
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %81
  store i32 5, ptr %23, align 4
  br label %158

95:                                               ; preds = %81
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = load ptr, ptr %21, align 8, !tbaa !5
  call void @ZSTD_ldm_limitTableUpdate(ptr noundef %96, ptr noundef %97)
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = load ptr, ptr %21, align 8, !tbaa !5
  %100 = call i64 @ZSTD_ldm_fillFastTables(ptr noundef %98, ptr noundef %99)
  br label %101

101:                                              ; preds = %95
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %104 = load ptr, ptr %18, align 8, !tbaa !5
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = load ptr, ptr %21, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.rawSeq, ptr %24, i32 0, i32 1
  %110 = load i32, ptr %109, align 4, !tbaa !25
  %111 = zext i32 %110 to i64
  %112 = call i64 %104(ptr noundef %105, ptr noundef %106, ptr noundef %107, ptr noundef %108, i64 noundef %111)
  store i64 %112, ptr %27, align 8, !tbaa !11
  %113 = getelementptr inbounds %struct.rawSeq, ptr %24, i32 0, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !25
  %115 = load ptr, ptr %21, align 8, !tbaa !5
  %116 = zext i32 %114 to i64
  %117 = getelementptr inbounds i8, ptr %115, i64 %116
  store ptr %117, ptr %21, align 8, !tbaa !5
  store i32 2, ptr %26, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %132, %103
  %119 = load i32, ptr %26, align 4, !tbaa !9
  %120 = icmp sgt i32 %119, 0
  br i1 %120, label %121, label %135

121:                                              ; preds = %118
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = load i32, ptr %26, align 4, !tbaa !9
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i32, ptr %122, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !9
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = load i32, ptr %26, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %128, i64 %130
  store i32 %127, ptr %131, align 4, !tbaa !9
  br label %132

132:                                              ; preds = %121
  %133 = load i32, ptr %26, align 4, !tbaa !9
  %134 = add nsw i32 %133, -1
  store i32 %134, ptr %26, align 4, !tbaa !9
  br label %118, !llvm.loop !26

135:                                              ; preds = %118
  %136 = getelementptr inbounds %struct.rawSeq, ptr %24, i32 0, i32 0
  %137 = load i32, ptr %136, align 4, !tbaa !23
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  %139 = getelementptr inbounds i32, ptr %138, i64 0
  store i32 %137, ptr %139, align 4, !tbaa !9
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = load i64, ptr %27, align 8, !tbaa !11
  %142 = load ptr, ptr %21, align 8, !tbaa !5
  %143 = load i64, ptr %27, align 8, !tbaa !11
  %144 = sub i64 0, %143
  %145 = getelementptr inbounds i8, ptr %142, i64 %144
  %146 = load ptr, ptr %20, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.rawSeq, ptr %24, i32 0, i32 0
  %148 = load i32, ptr %147, align 4, !tbaa !23
  %149 = add i32 %148, 3
  %150 = getelementptr inbounds %struct.rawSeq, ptr %24, i32 0, i32 2
  %151 = load i32, ptr %150, align 4, !tbaa !28
  %152 = zext i32 %151 to i64
  call void @ZSTD_storeSeq(ptr noundef %140, i64 noundef %141, ptr noundef %145, ptr noundef %146, i32 noundef %149, i64 noundef %152)
  %153 = getelementptr inbounds %struct.rawSeq, ptr %24, i32 0, i32 2
  %154 = load i32, ptr %153, align 4, !tbaa !28
  %155 = load ptr, ptr %21, align 8, !tbaa !5
  %156 = zext i32 %154 to i64
  %157 = getelementptr inbounds i8, ptr %155, i64 %156
  store ptr %157, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  store i32 0, ptr %23, align 4
  br label %158

158:                                              ; preds = %135, %94
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #5
  %159 = load i32, ptr %23, align 4
  switch i32 %159, label %180 [
    i32 0, label %160
    i32 5, label %161
  ]

160:                                              ; preds = %158
  br label %67, !llvm.loop !29

161:                                              ; preds = %158, %79
  %162 = load ptr, ptr %10, align 8, !tbaa !5
  %163 = load ptr, ptr %21, align 8, !tbaa !5
  call void @ZSTD_ldm_limitTableUpdate(ptr noundef %162, ptr noundef %163)
  %164 = load ptr, ptr %10, align 8, !tbaa !5
  %165 = load ptr, ptr %21, align 8, !tbaa !5
  %166 = call i64 @ZSTD_ldm_fillFastTables(ptr noundef %164, ptr noundef %165)
  %167 = load ptr, ptr %18, align 8, !tbaa !5
  %168 = load ptr, ptr %10, align 8, !tbaa !5
  %169 = load ptr, ptr %11, align 8, !tbaa !5
  %170 = load ptr, ptr %12, align 8, !tbaa !5
  %171 = load ptr, ptr %21, align 8, !tbaa !5
  %172 = load ptr, ptr %20, align 8, !tbaa !5
  %173 = load ptr, ptr %21, align 8, !tbaa !5
  %174 = ptrtoint ptr %172 to i64
  %175 = ptrtoint ptr %173 to i64
  %176 = sub i64 %174, %175
  %177 = call i64 %167(ptr noundef %168, ptr noundef %169, ptr noundef %170, ptr noundef %171, i64 noundef %176)
  store i64 %177, ptr %8, align 8
  store i32 1, ptr %23, align 4
  br label %178

178:                                              ; preds = %161, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %179 = load i64, ptr %8, align 8
  ret i64 %179

180:                                              ; preds = %158
  unreachable
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ZSTD_matchState_dictMode(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden { i64, i32 } @maybeSplitSequence(ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @ZSTD_ldm_limitTableUpdate(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_ldm_fillFastTables(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { alwaysinline 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 #4 = { inlinehint 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 #5 = { 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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 16}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!15 = !{!14, !10, i64 24}
!16 = !{!17, !6, i64 288}
!17 = !{!"ZSTD_matchState_t", !18, i64 0, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !6, i64 56, !7, i64 64, !12, i64 96, !10, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !10, i64 136, !10, i64 140, !19, i64 144, !6, i64 248, !14, i64 256, !6, i64 288, !10, i64 296, !10, i64 300}
!18 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32}
!19 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !6, i64 88, !10, i64 96}
!20 = !{!21, !12, i64 8}
!21 = !{!"", !6, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!22 = !{!21, !12, i64 24}
!23 = !{!24, !10, i64 0}
!24 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!25 = !{!24, !10, i64 4}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!24, !10, i64 8}
!29 = distinct !{!29, !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: nounwind uwtable
declare dso_local ptr @ZSTD_selectBlockCompressor(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @ZSTD_storeSeq(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTD_ldm_blockCompress(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, i64 noundef %6) local_unnamed_addr #0 {
  %8 = getelementptr inbounds i8, ptr %1, i64 272
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 280
  %11 = load i32, ptr %10, align 4, !tbaa !10
  %12 = tail call i32 @ZSTD_matchState_dictMode(ptr noundef %1)
  %13 = tail call ptr @ZSTD_selectBlockCompressor(i32 noundef %11, i32 noundef %4, i32 noundef %12)
  %14 = getelementptr inbounds i8, ptr %5, i64 %6
  %15 = load i32, ptr %10, align 4, !tbaa !10
  %16 = icmp ugt i32 %15, 6
  br i1 %16, label %25, label %.preheader

.preheader:                                       ; preds = %7
  %17 = ptrtoint ptr %14 to i64
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load i64, ptr %18, align 8, !tbaa !11
  %21 = load i64, ptr %19, align 8, !tbaa !15
  %22 = icmp ult i64 %20, %21
  %23 = icmp sgt i64 %6, 0
  %24 = and i1 %22, %23
  br i1 %24, label %.lr.ph.preheader, label %.thread

.lr.ph.preheader:                                 ; preds = %.preheader
  %scevgep = getelementptr i8, ptr %3, i64 4
  br label %.lr.ph

25:                                               ; preds = %7
  %26 = getelementptr inbounds i8, ptr %1, i64 288
  store ptr %0, ptr %26, align 8, !tbaa !16
  %27 = tail call i64 %13(ptr noundef nonnull %1, ptr noundef %2, ptr noundef %3, ptr noundef %5, i64 noundef %6) #3
  tail call void @ZSTD_ldm_skipRawSeqStoreBytes(ptr noundef %0, i64 noundef %6)
  br label %52

.lr.ph:                                           ; preds = %.lr.ph.preheader, %33
  %.07481 = phi ptr [ %42, %33 ], [ %5, %.lr.ph.preheader ]
  %28 = ptrtoint ptr %.07481 to i64
  %29 = sub i64 %17, %28
  %30 = trunc i64 %29 to i32
  %31 = tail call { i64, i32 } @maybeSplitSequence(ptr noundef nonnull %0, i32 noundef %30, i32 noundef %9)
  %.fca.0.extract = extractvalue { i64, i32 } %31, 0
  %.sroa.06.0.extract.trunc = trunc i64 %.fca.0.extract to i32
  %32 = icmp eq i32 %.sroa.06.0.extract.trunc, 0
  br i1 %32, label %.thread, label %33

33:                                               ; preds = %.lr.ph
  %.fca.1.extract = extractvalue { i64, i32 } %31, 1
  tail call void @ZSTD_ldm_limitTableUpdate(ptr noundef %1, ptr noundef %.07481)
  %34 = tail call i64 @ZSTD_ldm_fillFastTables(ptr noundef %1, ptr noundef %.07481)
  %.sroa.06.4.extract.shift = lshr i64 %.fca.0.extract, 32
  %35 = tail call i64 %13(ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %.07481, i64 noundef %.sroa.06.4.extract.shift) #3
  %36 = load i64, ptr %3, align 4, !tbaa !20
  store i64 %36, ptr %scevgep, align 4, !tbaa !20
  %37 = getelementptr inbounds i8, ptr %.07481, i64 %.sroa.06.4.extract.shift
  store i32 %.sroa.06.0.extract.trunc, ptr %3, align 4, !tbaa !20
  %38 = sub i64 0, %35
  %39 = getelementptr inbounds i8, ptr %37, i64 %38
  %40 = add i32 %.sroa.06.0.extract.trunc, 3
  %41 = zext i32 %.fca.1.extract to i64
  tail call void @ZSTD_storeSeq(ptr noundef %2, i64 noundef %35, ptr noundef %39, ptr noundef nonnull %14, i32 noundef %40, i64 noundef %41)
  %42 = getelementptr inbounds i8, ptr %37, i64 %41
  %43 = load i64, ptr %18, align 8, !tbaa !11
  %44 = load i64, ptr %19, align 8, !tbaa !15
  %45 = icmp ult i64 %43, %44
  %46 = icmp ult ptr %42, %14
  %47 = select i1 %45, i1 %46, i1 false
  br i1 %47, label %.lr.ph, label %.thread

.thread:                                          ; preds = %33, %.lr.ph, %.preheader
  %.074.lcssa = phi ptr [ %5, %.preheader ], [ %.07481, %.lr.ph ], [ %42, %33 ]
  tail call void @ZSTD_ldm_limitTableUpdate(ptr noundef %1, ptr noundef %.074.lcssa)
  %48 = tail call i64 @ZSTD_ldm_fillFastTables(ptr noundef %1, ptr noundef %.074.lcssa)
  %49 = ptrtoint ptr %.074.lcssa to i64
  %50 = sub i64 %17, %49
  %51 = tail call i64 %13(ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %.074.lcssa, i64 noundef %50) #3
  br label %52

52:                                               ; preds = %.thread, %25
  %.0 = phi i64 [ %27, %25 ], [ %51, %.thread ]
  ret i64 %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ZSTD_matchState_dictMode(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden { i64, i32 } @maybeSplitSequence(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @ZSTD_ldm_limitTableUpdate(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_ldm_fillFastTables(ptr noundef, ptr noundef) local_unnamed_addr #0

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 = { alwaysinline nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint 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, !7, i64 16}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 24}
!11 = !{!12, !14, i64 8}
!12 = !{!"", !13, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!12, !14, i64 24}
!16 = !{!17, !13, i64 288}
!17 = !{!"ZSTD_matchState_t", !18, i64 0, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !13, i64 56, !8, i64 64, !14, i64 96, !7, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !7, i64 136, !7, i64 140, !19, i64 144, !13, i64 248, !6, i64 256, !13, i64 288, !7, i64 296, !7, i64 300}
!18 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !7, i64 24, !7, i64 28, !7, i64 32}
!19 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !13, i64 88, !7, i64 96}
!20 = !{!7, !7, i64 0}


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