; LLVM IR from itchio/go-brotli :: enc (backward_references_hq)

; 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.ZopfliCostModel = type { [704 x float], [520 x float], ptr, float, i64 }
%struct.StartPosQueue = type { [8 x %struct.PosData], i64 }
%struct.PosData = type { i64, [4 x i32], float, float }
%struct.BackwardMatch = type { i32, i32 }
%struct.ZopfliNode = type { i32, i32, i32, %union.anon }
%union.anon = type { float }

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

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

; Function Attrs: nounwind uwtable
define hidden i64 @BrotliZopfliComputeShortestPath(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10) #3 {
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca %struct.ZopfliCostModel, align 8
  %25 = alloca %struct.StartPosQueue, align 8
  %26 = alloca [384 x %struct.BackwardMatch], align 16
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store i64 %2, ptr %14, align 8, !tbaa !9
  store i64 %3, ptr %15, align 8, !tbaa !9
  store ptr %4, ptr %16, align 8, !tbaa !5
  store i64 %5, ptr %17, align 8, !tbaa !9
  store ptr %6, ptr %18, align 8, !tbaa !5
  store i64 %7, ptr %19, align 8, !tbaa !9
  store ptr %8, ptr %20, align 8, !tbaa !5
  store ptr %9, ptr %21, align 8, !tbaa !5
  store ptr %10, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %35 = load ptr, ptr %18, align 8, !tbaa !5
  %36 = call i64 @MaxZopfliLen(ptr noundef %35)
  store i64 %36, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4920, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 264, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 3072, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %37 = load i64, ptr %14, align 8, !tbaa !9
  %38 = call i64 @StoreLookaheadH10()
  %39 = icmp uge i64 %37, %38
  br i1 %39, label %40, label %47

40:                                               ; preds = %11
  %41 = load i64, ptr %15, align 8, !tbaa !9
  %42 = load i64, ptr %14, align 8, !tbaa !9
  %43 = add i64 %41, %42
  %44 = call i64 @StoreLookaheadH10()
  %45 = sub i64 %43, %44
  %46 = add i64 %45, 1
  br label %49

47:                                               ; preds = %11
  %48 = load i64, ptr %15, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %47, %40
  %50 = phi i64 [ %46, %40 ], [ %48, %47 ]
  store i64 %50, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  store i64 0, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  store i64 0, ptr %30, align 8, !tbaa !9
  %51 = load ptr, ptr %22, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ZopfliNode, ptr %51, i64 0
  %53 = getelementptr inbounds %struct.ZopfliNode, ptr %52, i32 0, i32 0
  store i32 0, ptr %53, align 4, !tbaa !11
  %54 = load ptr, ptr %22, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ZopfliNode, ptr %54, i64 0
  %56 = getelementptr inbounds %struct.ZopfliNode, ptr %55, i32 0, i32 3
  store float 0.000000e+00, ptr %56, align 4, !tbaa !14
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  %58 = load i64, ptr %14, align 8, !tbaa !9
  call void @InitZopfliCostModel(ptr noundef %57, ptr noundef %24, i64 noundef %58)
  %59 = load i64, ptr %15, align 8, !tbaa !9
  %60 = load ptr, ptr %16, align 8, !tbaa !5
  %61 = load i64, ptr %17, align 8, !tbaa !9
  call void @ZopfliCostModelSetFromLiteralCosts(ptr noundef %24, i64 noundef %59, ptr noundef %60, i64 noundef %61)
  call void @InitStartPosQueue(ptr noundef %25)
  store i64 0, ptr %28, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %173, %49
  %63 = load i64, ptr %28, align 8, !tbaa !9
  %64 = call i64 @HashTypeLengthH10()
  %65 = add i64 %63, %64
  %66 = sub i64 %65, 1
  %67 = load i64, ptr %14, align 8, !tbaa !9
  %68 = icmp ult i64 %66, %67
  br i1 %68, label %69, label %176

69:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  %70 = load i64, ptr %15, align 8, !tbaa !9
  %71 = load i64, ptr %28, align 8, !tbaa !9
  %72 = add i64 %70, %71
  store i64 %72, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  %73 = load i64, ptr %31, align 8, !tbaa !9
  %74 = load i64, ptr %19, align 8, !tbaa !9
  %75 = call i64 @brotli_min_size_t(i64 noundef %73, i64 noundef %74)
  store i64 %75, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #4
  %76 = load ptr, ptr %21, align 8, !tbaa !5
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = load ptr, ptr %16, align 8, !tbaa !5
  %79 = load i64, ptr %17, align 8, !tbaa !9
  %80 = load i64, ptr %31, align 8, !tbaa !9
  %81 = load i64, ptr %14, align 8, !tbaa !9
  %82 = load i64, ptr %28, align 8, !tbaa !9
  %83 = sub i64 %81, %82
  %84 = load i64, ptr %32, align 8, !tbaa !9
  %85 = load i64, ptr %29, align 8, !tbaa !9
  %86 = load ptr, ptr %18, align 8, !tbaa !5
  %87 = load i64, ptr %30, align 8, !tbaa !9
  %88 = getelementptr inbounds [384 x %struct.BackwardMatch], ptr %26, i64 0, i64 %87
  %89 = call i64 @FindAllMatchesH10(ptr noundef %76, ptr noundef %77, ptr noundef %78, i64 noundef %79, i64 noundef %80, i64 noundef %83, i64 noundef %84, i64 noundef %85, ptr noundef %86, ptr noundef %88)
  store i64 %89, ptr %34, align 8, !tbaa !9
  %90 = load i64, ptr %34, align 8, !tbaa !9
  %91 = icmp ugt i64 %90, 0
  br i1 %91, label %92, label %104

92:                                               ; preds = %69
  %93 = load i64, ptr %34, align 8, !tbaa !9
  %94 = sub i64 %93, 1
  %95 = getelementptr inbounds [384 x %struct.BackwardMatch], ptr %26, i64 0, i64 %94
  %96 = call i64 @BackwardMatchLength(ptr noundef %95)
  %97 = load i64, ptr %23, align 8, !tbaa !9
  %98 = icmp ugt i64 %96, %97
  br i1 %98, label %99, label %104

99:                                               ; preds = %92
  %100 = getelementptr inbounds [384 x %struct.BackwardMatch], ptr %26, i64 0, i64 0
  %101 = load i64, ptr %34, align 8, !tbaa !9
  %102 = sub i64 %101, 1
  %103 = getelementptr inbounds [384 x %struct.BackwardMatch], ptr %26, i64 0, i64 %102
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %100, ptr align 8 %103, i64 8, i1 false), !tbaa.struct !15
  store i64 1, ptr %34, align 8, !tbaa !9
  br label %104

104:                                              ; preds = %99, %92, %69
  %105 = load i64, ptr %14, align 8, !tbaa !9
  %106 = load i64, ptr %15, align 8, !tbaa !9
  %107 = load i64, ptr %28, align 8, !tbaa !9
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = load i64, ptr %17, align 8, !tbaa !9
  %110 = load ptr, ptr %18, align 8, !tbaa !5
  %111 = load i64, ptr %19, align 8, !tbaa !9
  %112 = load ptr, ptr %20, align 8, !tbaa !5
  %113 = load i64, ptr %34, align 8, !tbaa !9
  %114 = getelementptr inbounds [384 x %struct.BackwardMatch], ptr %26, i64 0, i64 0
  %115 = load ptr, ptr %22, align 8, !tbaa !5
  %116 = call i64 @UpdateNodes(i64 noundef %105, i64 noundef %106, i64 noundef %107, ptr noundef %108, i64 noundef %109, ptr noundef %110, i64 noundef %111, ptr noundef %112, i64 noundef %113, ptr noundef %114, ptr noundef %24, ptr noundef %25, ptr noundef %115)
  store i64 %116, ptr %33, align 8, !tbaa !9
  %117 = load i64, ptr %33, align 8, !tbaa !9
  %118 = icmp ult i64 %117, 16384
  br i1 %118, label %119, label %120

119:                                              ; preds = %104
  store i64 0, ptr %33, align 8, !tbaa !9
  br label %120

120:                                              ; preds = %119, %104
  %121 = load i64, ptr %34, align 8, !tbaa !9
  %122 = icmp eq i64 %121, 1
  br i1 %122, label %123, label %133

123:                                              ; preds = %120
  %124 = getelementptr inbounds [384 x %struct.BackwardMatch], ptr %26, i64 0, i64 0
  %125 = call i64 @BackwardMatchLength(ptr noundef %124)
  %126 = load i64, ptr %23, align 8, !tbaa !9
  %127 = icmp ugt i64 %125, %126
  br i1 %127, label %128, label %133

128:                                              ; preds = %123
  %129 = getelementptr inbounds [384 x %struct.BackwardMatch], ptr %26, i64 0, i64 0
  %130 = call i64 @BackwardMatchLength(ptr noundef %129)
  %131 = load i64, ptr %33, align 8, !tbaa !9
  %132 = call i64 @brotli_max_size_t(i64 noundef %130, i64 noundef %131)
  store i64 %132, ptr %33, align 8, !tbaa !9
  br label %133

133:                                              ; preds = %128, %123, %120
  %134 = load i64, ptr %33, align 8, !tbaa !9
  %135 = icmp ugt i64 %134, 1
  br i1 %135, label %136, label %172

136:                                              ; preds = %133
  %137 = load ptr, ptr %21, align 8, !tbaa !5
  %138 = load ptr, ptr %16, align 8, !tbaa !5
  %139 = load i64, ptr %17, align 8, !tbaa !9
  %140 = load i64, ptr %31, align 8, !tbaa !9
  %141 = add i64 %140, 1
  %142 = load i64, ptr %31, align 8, !tbaa !9
  %143 = load i64, ptr %33, align 8, !tbaa !9
  %144 = add i64 %142, %143
  %145 = load i64, ptr %27, align 8, !tbaa !9
  %146 = call i64 @brotli_min_size_t(i64 noundef %144, i64 noundef %145)
  call void @StoreRangeH10(ptr noundef %137, ptr noundef %138, i64 noundef %139, i64 noundef %141, i64 noundef %146)
  %147 = load i64, ptr %33, align 8, !tbaa !9
  %148 = add i64 %147, -1
  store i64 %148, ptr %33, align 8, !tbaa !9
  br label %149

149:                                              ; preds = %162, %136
  %150 = load i64, ptr %33, align 8, !tbaa !9
  %151 = icmp ne i64 %150, 0
  br i1 %151, label %152, label %171

152:                                              ; preds = %149
  %153 = load i64, ptr %28, align 8, !tbaa !9
  %154 = add i64 %153, 1
  store i64 %154, ptr %28, align 8, !tbaa !9
  %155 = load i64, ptr %28, align 8, !tbaa !9
  %156 = call i64 @HashTypeLengthH10()
  %157 = add i64 %155, %156
  %158 = sub i64 %157, 1
  %159 = load i64, ptr %14, align 8, !tbaa !9
  %160 = icmp uge i64 %158, %159
  br i1 %160, label %161, label %162

161:                                              ; preds = %152
  br label %171

162:                                              ; preds = %152
  %163 = load i64, ptr %15, align 8, !tbaa !9
  %164 = load i64, ptr %28, align 8, !tbaa !9
  %165 = load i64, ptr %19, align 8, !tbaa !9
  %166 = load i64, ptr %29, align 8, !tbaa !9
  %167 = load ptr, ptr %20, align 8, !tbaa !5
  %168 = load ptr, ptr %22, align 8, !tbaa !5
  call void @EvaluateNode(i64 noundef %163, i64 noundef %164, i64 noundef %165, i64 noundef %166, ptr noundef %167, ptr noundef %24, ptr noundef %25, ptr noundef %168)
  %169 = load i64, ptr %33, align 8, !tbaa !9
  %170 = add i64 %169, -1
  store i64 %170, ptr %33, align 8, !tbaa !9
  br label %149, !llvm.loop !17

171:                                              ; preds = %161, %149
  br label %172

172:                                              ; preds = %171, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  br label %173

173:                                              ; preds = %172
  %174 = load i64, ptr %28, align 8, !tbaa !9
  %175 = add i64 %174, 1
  store i64 %175, ptr %28, align 8, !tbaa !9
  br label %62, !llvm.loop !19

176:                                              ; preds = %62
  %177 = load ptr, ptr %12, align 8, !tbaa !5
  call void @CleanupZopfliCostModel(ptr noundef %177, ptr noundef %24)
  %178 = load i64, ptr %14, align 8, !tbaa !9
  %179 = load ptr, ptr %22, align 8, !tbaa !5
  %180 = call i64 @ComputeShortestPathFromNodes(i64 noundef %178, ptr noundef %179)
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 3072, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 264, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 4920, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  ret i64 %180
}

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @StoreLookaheadH10() #2

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

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @HashTypeLengthH10() #2

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 = { 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 0}
!12 = !{!"ZopfliNode", !13, i64 0, !13, i64 4, !13, i64 8, !7, i64 12}
!13 = !{!"int", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{i64 0, i64 4, !16, i64 4, i64 4, !16}
!16 = !{!13, !13, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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.ZopfliCostModel = type { [704 x float], [520 x float], ptr, float, i64 }
%struct.StartPosQueue = type { [8 x %struct.PosData], i64 }
%struct.PosData = type { i64, [4 x i32], float, float }
%struct.BackwardMatch = type { i32, i32 }

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @brotli_min_size_t(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define hidden i64 @BrotliZopfliComputeShortestPath(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10) local_unnamed_addr #2 {
  %12 = alloca %struct.ZopfliCostModel, align 8
  %13 = alloca %struct.StartPosQueue, align 8
  %14 = alloca [384 x %struct.BackwardMatch], align 16
  %15 = tail call i64 @MaxZopfliLen(ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 4920, ptr nonnull %12) #3
  call void @llvm.lifetime.start.p0(i64 264, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 3072, ptr nonnull %14) #3
  %16 = tail call i64 @StoreLookaheadH10()
  %.not = icmp ugt i64 %16, %2
  br i1 %.not, label %22, label %17

17:                                               ; preds = %11
  %18 = tail call i64 @StoreLookaheadH10()
  %19 = add i64 %2, 1
  %20 = add i64 %19, %3
  %21 = sub i64 %20, %18
  br label %22

22:                                               ; preds = %11, %17
  %23 = phi i64 [ %21, %17 ], [ %3, %11 ]
  store i32 0, ptr %10, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %10, i64 12
  store float 0.000000e+00, ptr %24, align 4, !tbaa !10
  call void @InitZopfliCostModel(ptr noundef %0, ptr noundef nonnull %12, i64 noundef %2)
  call void @ZopfliCostModelSetFromLiteralCosts(ptr noundef nonnull %12, i64 noundef %3, ptr noundef %4, i64 noundef %5)
  call void @InitStartPosQueue(ptr noundef nonnull %13)
  %25 = call i64 @HashTypeLengthH10()
  %26 = add i64 %25, -1
  %27 = icmp ult i64 %26, %2
  br i1 %27, label %.lr.ph88, label %._crit_edge

.lr.ph88:                                         ; preds = %22, %.loopexit
  %.07187 = phi i64 [ %58, %.loopexit ], [ 0, %22 ]
  %28 = add i64 %.07187, %3
  %29 = call i64 @brotli_min_size_t(i64 noundef %28, i64 noundef %7)
  %30 = sub i64 %2, %.07187
  %31 = call i64 @FindAllMatchesH10(ptr noundef %9, ptr noundef %1, ptr noundef %4, i64 noundef %5, i64 noundef %28, i64 noundef %30, i64 noundef %29, i64 noundef 0, ptr noundef %6, ptr noundef nonnull %14)
  %.not78 = icmp eq i64 %31, 0
  br i1 %.not78, label %39, label %32

32:                                               ; preds = %.lr.ph88
  %33 = add i64 %31, -1
  %34 = getelementptr inbounds [384 x %struct.BackwardMatch], ptr %14, i64 0, i64 %33
  %35 = call i64 @BackwardMatchLength(ptr noundef nonnull %34)
  %36 = icmp ugt i64 %35, %15
  br i1 %36, label %37, label %39

37:                                               ; preds = %32
  %38 = load i64, ptr %34, align 8
  store i64 %38, ptr %14, align 16
  br label %39

39:                                               ; preds = %37, %32, %.lr.ph88
  %.0 = phi i64 [ 1, %37 ], [ %31, %32 ], [ 0, %.lr.ph88 ]
  %40 = call i64 @UpdateNodes(i64 noundef %2, i64 noundef %3, i64 noundef %.07187, ptr noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, i64 noundef %.0, ptr noundef nonnull %14, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %10)
  %41 = icmp ult i64 %40, 16384
  %spec.store.select = select i1 %41, i64 0, i64 %40
  %42 = icmp eq i64 %.0, 1
  br i1 %42, label %43, label %49

43:                                               ; preds = %39
  %44 = call i64 @BackwardMatchLength(ptr noundef nonnull %14)
  %45 = icmp ugt i64 %44, %15
  br i1 %45, label %46, label %49

46:                                               ; preds = %43
  %47 = call i64 @BackwardMatchLength(ptr noundef nonnull %14)
  %48 = call i64 @brotli_max_size_t(i64 noundef %47, i64 noundef %spec.store.select)
  br label %49

49:                                               ; preds = %46, %43, %39
  %.070 = phi i64 [ %48, %46 ], [ %spec.store.select, %43 ], [ %spec.store.select, %39 ]
  %50 = icmp ugt i64 %.070, 1
  br i1 %50, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %49
  %51 = add i64 %28, 1
  %52 = add i64 %.070, %28
  %53 = call i64 @brotli_min_size_t(i64 noundef %52, i64 noundef %23)
  call void @StoreRangeH10(ptr noundef %9, ptr noundef %4, i64 noundef %5, i64 noundef %51, i64 noundef %53)
  %.181 = add i64 %.070, -1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %57
  %.184 = phi i64 [ %.1, %57 ], [ %.181, %.lr.ph.preheader ]
  %.17283 = phi i64 [ %54, %57 ], [ %.07187, %.lr.ph.preheader ]
  %54 = add i64 %.17283, 1
  %55 = call i64 @HashTypeLengthH10()
  %56 = add i64 %55, %.17283
  %.not80 = icmp ult i64 %56, %2
  br i1 %.not80, label %57, label %.loopexit

57:                                               ; preds = %.lr.ph
  call void @EvaluateNode(i64 noundef %3, i64 noundef %54, i64 noundef %7, i64 noundef 0, ptr noundef %8, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %10)
  %.1 = add i64 %.184, -1
  %.not79 = icmp eq i64 %.1, 0
  br i1 %.not79, label %.loopexit, label %.lr.ph, !llvm.loop !11

.loopexit:                                        ; preds = %.lr.ph, %57, %49
  %.2 = phi i64 [ %.07187, %49 ], [ %54, %57 ], [ %54, %.lr.ph ]
  %58 = add i64 %.2, 1
  %59 = call i64 @HashTypeLengthH10()
  %60 = add i64 %.2, %59
  %61 = icmp ult i64 %60, %2
  br i1 %61, label %.lr.ph88, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.loopexit, %22
  call void @CleanupZopfliCostModel(ptr noundef %0, ptr noundef nonnull %12)
  %62 = call i64 @ComputeShortestPathFromNodes(i64 noundef %2, ptr noundef nonnull %10)
  call void @llvm.lifetime.end.p0(i64 3072, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 264, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 4920, ptr nonnull %12) #3
  ret i64 %62
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @MaxZopfliLen(ptr noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @StoreLookaheadH10() local_unnamed_addr #1

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @InitStartPosQueue(ptr noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @HashTypeLengthH10() local_unnamed_addr #1

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @BackwardMatchLength(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @brotli_max_size_t(i64 noundef, i64 noundef) local_unnamed_addr #1

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 0}
!6 = !{!"ZopfliNode", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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