; 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.ldmParams_t = type { i32, i32, i32, i32, i32, i32 }
%struct.rawSeqStore_t = type { ptr, i64, i64, i64, i64 }
%struct.ldmState_t = type { %struct.ZSTD_window_t, ptr, i32, ptr, [64 x i64], [64 x %struct.ldmMatchCandidate_t] }
%struct.ZSTD_window_t = type { ptr, ptr, ptr, i32, i32, i32 }
%struct.ldmMatchCandidate_t = type { ptr, i32, i32, ptr }
%struct.rawSeq = type { i32, i32, i32 }

; 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: nounwind uwtable
declare dso_local i32 @ZSTD_isError(i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTD_ldm_generateSequences(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4) #1 {
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ldmParams_t, ptr %28, i32 0, i32 5
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = shl i32 1, %30
  store i32 %31, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %32, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = load i64, ptr %11, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %33, i64 %34
  store ptr %35, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store i64 1048576, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %36 = load i64, ptr %11, align 8, !tbaa !9
  %37 = udiv i64 %36, 1048576
  %38 = load i64, ptr %11, align 8, !tbaa !9
  %39 = urem i64 %38, 1048576
  %40 = icmp ne i64 %39, 0
  %41 = zext i1 %40 to i32
  %42 = sext i32 %41 to i64
  %43 = add i64 %37, %42
  store i64 %43, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  store i64 0, ptr %18, align 8, !tbaa !9
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %156, %5
  %45 = load i64, ptr %17, align 8, !tbaa !9
  %46 = load i64, ptr %16, align 8, !tbaa !9
  %47 = icmp ult i64 %45, %46
  br i1 %47, label %48, label %56

48:                                               ; preds = %44
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.rawSeqStore_t, ptr %49, i32 0, i32 3
  %51 = load i64, ptr %50, align 8, !tbaa !15
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.rawSeqStore_t, ptr %52, i32 0, i32 4
  %54 = load i64, ptr %53, align 8, !tbaa !17
  %55 = icmp ult i64 %51, %54
  br label %56

56:                                               ; preds = %48, %44
  %57 = phi i1 [ false, %44 ], [ %55, %48 ]
  br i1 %57, label %58, label %159

58:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = load i64, ptr %17, align 8, !tbaa !9
  %61 = mul i64 %60, 1048576
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  store ptr %62, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = load ptr, ptr %19, align 8, !tbaa !5
  %65 = ptrtoint ptr %63 to i64
  %66 = ptrtoint ptr %64 to i64
  %67 = sub i64 %65, %66
  store i64 %67, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %68 = load i64, ptr %20, align 8, !tbaa !9
  %69 = icmp ult i64 %68, 1048576
  br i1 %69, label %70, label %72

70:                                               ; preds = %58
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  br label %75

72:                                               ; preds = %58
  %73 = load ptr, ptr %19, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 1048576
  br label %75

75:                                               ; preds = %72, %70
  %76 = phi ptr [ %71, %70 ], [ %74, %72 ]
  store ptr %76, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %77 = load ptr, ptr %21, align 8, !tbaa !5
  %78 = load ptr, ptr %19, align 8, !tbaa !5
  %79 = ptrtoint ptr %77 to i64
  %80 = ptrtoint ptr %78 to i64
  %81 = sub i64 %79, %80
  store i64 %81, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.rawSeqStore_t, ptr %82, i32 0, i32 3
  %84 = load i64, ptr %83, align 8, !tbaa !15
  store i64 %84, ptr %24, align 8, !tbaa !9
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ldmState_t, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %12, align 4, !tbaa !14
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ldmState_t, ptr %88, i32 0, i32 2
  %90 = load i32, ptr %89, align 8, !tbaa !18
  %91 = load ptr, ptr %19, align 8, !tbaa !5
  %92 = load ptr, ptr %21, align 8, !tbaa !5
  %93 = call i32 @ZSTD_window_needOverflowCorrection(ptr noundef byval(%struct.ZSTD_window_t) align 8 %86, i32 noundef 0, i32 noundef %87, i32 noundef %90, ptr noundef %91, ptr noundef %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %112

95:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ldmParams_t, ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 4, !tbaa !21
  %99 = shl i32 1, %98
  store i32 %99, ptr %25, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ldmState_t, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %12, align 4, !tbaa !14
  %103 = load ptr, ptr %19, align 8, !tbaa !5
  %104 = call i32 @ZSTD_window_correctOverflow(ptr noundef %101, i32 noundef 0, i32 noundef %102, ptr noundef %103)
  store i32 %104, ptr %26, align 4, !tbaa !14
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ldmState_t, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !22
  %108 = load i32, ptr %25, align 4, !tbaa !14
  %109 = load i32, ptr %26, align 4, !tbaa !14
  call void @ZSTD_ldm_reduceTable(ptr noundef %107, i32 noundef %108, i32 noundef %109)
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ldmState_t, ptr %110, i32 0, i32 2
  store i32 0, ptr %111, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  br label %112

112:                                              ; preds = %95, %75
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.ldmState_t, ptr %113, i32 0, i32 0
  %115 = load ptr, ptr %21, align 8, !tbaa !5
  %116 = load i32, ptr %12, align 4, !tbaa !14
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.ldmState_t, ptr %117, i32 0, i32 2
  call void @ZSTD_window_enforceMaxDist(ptr noundef %114, ptr noundef %115, i32 noundef %116, ptr noundef %118, ptr noundef null)
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %19, align 8, !tbaa !5
  %123 = load i64, ptr %22, align 8, !tbaa !9
  %124 = call i64 @ZSTD_ldm_generateSequences_internal(ptr noundef %119, ptr noundef %120, ptr noundef %121, ptr noundef %122, i64 noundef %123)
  store i64 %124, ptr %23, align 8, !tbaa !9
  %125 = load i64, ptr %23, align 8, !tbaa !9
  %126 = call i32 @ZSTD_isError(i64 noundef %125)
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %130

128:                                              ; preds = %112
  %129 = load i64, ptr %23, align 8, !tbaa !9
  store i64 %129, ptr %6, align 8
  store i32 1, ptr %27, align 4
  br label %153

130:                                              ; preds = %112
  %131 = load i64, ptr %24, align 8, !tbaa !9
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.rawSeqStore_t, ptr %132, i32 0, i32 3
  %134 = load i64, ptr %133, align 8, !tbaa !15
  %135 = icmp ult i64 %131, %134
  br i1 %135, label %136, label %148

136:                                              ; preds = %130
  %137 = load i64, ptr %18, align 8, !tbaa !9
  %138 = trunc i64 %137 to i32
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.rawSeqStore_t, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !23
  %142 = load i64, ptr %24, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.rawSeq, ptr %141, i64 %142
  %144 = getelementptr inbounds %struct.rawSeq, ptr %143, i32 0, i32 1
  %145 = load i32, ptr %144, align 4, !tbaa !24
  %146 = add i32 %145, %138
  store i32 %146, ptr %144, align 4, !tbaa !24
  %147 = load i64, ptr %23, align 8, !tbaa !9
  store i64 %147, ptr %18, align 8, !tbaa !9
  br label %152

148:                                              ; preds = %130
  %149 = load i64, ptr %22, align 8, !tbaa !9
  %150 = load i64, ptr %18, align 8, !tbaa !9
  %151 = add i64 %150, %149
  store i64 %151, ptr %18, align 8, !tbaa !9
  br label %152

152:                                              ; preds = %148, %136
  store i32 0, ptr %27, align 4
  br label %153

153:                                              ; preds = %152, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  %154 = load i32, ptr %27, align 4
  switch i32 %154, label %160 [
    i32 0, label %155
  ]

155:                                              ; preds = %153
  br label %156

156:                                              ; preds = %155
  %157 = load i64, ptr %17, align 8, !tbaa !9
  %158 = add i64 %157, 1
  store i64 %158, ptr %17, align 8, !tbaa !9
  br label %44, !llvm.loop !26

159:                                              ; preds = %56
  store i64 0, ptr %6, align 8
  store i32 1, ptr %27, align 4
  br label %160

160:                                              ; preds = %159, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %161 = load i64, ptr %6, align 8
  ret i64 %161
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ZSTD_window_needOverflowCorrection(ptr noundef byval(%struct.ZSTD_window_t) align 8, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden void @ZSTD_ldm_reduceTable(ptr noundef, i32 noundef, i32 noundef) #1

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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, !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 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 20}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !10, i64 24}
!16 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!17 = !{!16, !10, i64 32}
!18 = !{!19, !13, i64 48}
!19 = !{!"", !20, i64 0, !6, i64 40, !13, i64 48, !6, i64 56, !7, i64 64, !7, i64 576}
!20 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 28, !13, i64 32}
!21 = !{!12, !13, i64 4}
!22 = !{!19, !6, i64 40}
!23 = !{!16, !6, i64 0}
!24 = !{!25, !13, i64 4}
!25 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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

%struct.ZSTD_window_t = type { ptr, ptr, ptr, i32, i32, i32 }
%struct.rawSeq = type { i32, i32, i32 }

; Function Attrs: nounwind uwtable
declare dso_local i32 @ZSTD_isError(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i64 @ZSTD_ldm_generateSequences(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %2, i64 20
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = shl nuw i32 1, %7
  %9 = getelementptr inbounds i8, ptr %3, i64 %4
  %10 = lshr i64 %4, 20
  %11 = and i64 %4, 1048575
  %12 = icmp ne i64 %11, 0
  %13 = zext i1 %12 to i64
  %14 = add nuw nsw i64 %10, %13
  %15 = getelementptr inbounds i8, ptr %1, i64 24
  %.not71 = icmp eq i64 %14, 0
  br i1 %.not71, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %5
  %16 = getelementptr inbounds i8, ptr %1, i64 32
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  %18 = getelementptr inbounds i8, ptr %2, i64 4
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  %.pre = load i64, ptr %15, align 8, !tbaa !10
  br label %20

20:                                               ; preds = %.lr.ph, %54
  %21 = phi i64 [ %.pre, %.lr.ph ], [ %44, %54 ]
  %.05566 = phi i64 [ 0, %.lr.ph ], [ %55, %54 ]
  %.05665 = phi i64 [ 0, %.lr.ph ], [ %.258.ph, %54 ]
  %22 = load i64, ptr %16, align 8, !tbaa !14
  %23 = icmp ult i64 %21, %22
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %20
  %25 = shl nuw i64 %.05566, 20
  %26 = getelementptr inbounds i8, ptr %3, i64 %25
  %27 = ptrtoint ptr %26 to i64
  %gepdiff = sub nsw i64 %4, %25
  %28 = icmp ult i64 %gepdiff, 1048576
  %29 = getelementptr inbounds i8, ptr %26, i64 1048576
  %30 = select i1 %28, ptr %9, ptr %29
  %31 = ptrtoint ptr %30 to i64
  %32 = sub i64 %31, %27
  %33 = load i32, ptr %17, align 8, !tbaa !15
  %34 = tail call i32 @ZSTD_window_needOverflowCorrection(ptr noundef byval(%struct.ZSTD_window_t) align 8 %0, i32 noundef 0, i32 noundef %8, i32 noundef %33, ptr noundef %26, ptr noundef %30)
  %.not = icmp eq i32 %34, 0
  br i1 %.not, label %40, label %35

35:                                               ; preds = %24
  %36 = load i32, ptr %18, align 4, !tbaa !18
  %37 = shl nuw i32 1, %36
  %38 = tail call i32 @ZSTD_window_correctOverflow(ptr noundef nonnull %0, i32 noundef 0, i32 noundef %8, ptr noundef %26)
  %39 = load ptr, ptr %19, align 8, !tbaa !19
  tail call void @ZSTD_ldm_reduceTable(ptr noundef %39, i32 noundef %37, i32 noundef %38)
  store i32 0, ptr %17, align 8, !tbaa !15
  br label %40

40:                                               ; preds = %35, %24
  tail call void @ZSTD_window_enforceMaxDist(ptr noundef nonnull %0, ptr noundef %30, i32 noundef %8, ptr noundef nonnull %17, ptr noundef null)
  %41 = tail call i64 @ZSTD_ldm_generateSequences_internal(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef %26, i64 noundef %32)
  %42 = tail call i32 @ZSTD_isError(i64 noundef %41)
  %.not60 = icmp eq i32 %42, 0
  br i1 %.not60, label %43, label %.critedge

43:                                               ; preds = %40
  %44 = load i64, ptr %15, align 8, !tbaa !10
  %45 = icmp ult i64 %21, %44
  br i1 %45, label %46, label %52

46:                                               ; preds = %43
  %47 = trunc i64 %.05665 to i32
  %48 = load ptr, ptr %1, align 8, !tbaa !20
  %49 = getelementptr inbounds %struct.rawSeq, ptr %48, i64 %21, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !21
  %51 = add i32 %50, %47
  store i32 %51, ptr %49, align 4, !tbaa !21
  br label %54

52:                                               ; preds = %43
  %53 = add i64 %32, %.05665
  br label %54

54:                                               ; preds = %46, %52
  %.258.ph = phi i64 [ %53, %52 ], [ %41, %46 ]
  %55 = add nuw nsw i64 %.05566, 1
  %exitcond.not = icmp eq i64 %55, %14
  br i1 %exitcond.not, label %.critedge, label %20, !llvm.loop !23

.critedge:                                        ; preds = %54, %20, %40, %5
  %.2 = phi i64 [ 0, %5 ], [ %41, %40 ], [ 0, %20 ], [ 0, %54 ]
  ret i64 %.2
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ZSTD_window_needOverflowCorrection(ptr noundef byval(%struct.ZSTD_window_t) align 8, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ZSTD_window_correctOverflow(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @ZSTD_window_enforceMaxDist(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_ldm_generateSequences_internal(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 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 = { 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" }

!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 20}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !13, i64 24}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"long", !8, i64 0}
!14 = !{!11, !13, i64 32}
!15 = !{!16, !7, i64 48}
!16 = !{!"", !17, i64 0, !12, i64 40, !7, i64 48, !12, i64 56, !8, i64 64, !8, i64 576}
!17 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !7, i64 24, !7, i64 28, !7, i64 32}
!18 = !{!6, !7, i64 4}
!19 = !{!16, !12, i64 40}
!20 = !{!11, !12, i64 0}
!21 = !{!22, !7, i64 4}
!22 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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