; LLVM IR from DanEngelbrecht/longtail :: lib/brotli/ext/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.StartPosQueue = type { [8 x %struct.PosData], i64 }
%struct.PosData = type { i64, [4 x i32], float, float }
%struct.BrotliEncoderParams = type { i32, i32, i32, i32, i64, i64, i32, i32, %struct.BrotliHasherParams, %struct.BrotliDistanceParams, %struct.SharedEncoderDictionary }
%struct.BrotliHasherParams = type { i32, i32, i32, i32 }
%struct.BrotliDistanceParams = type { i32, i32, i32, i32, i64 }
%struct.SharedEncoderDictionary = type { i32, %struct.CompoundDictionary, %struct.ContextualEncoderDictionary, i32 }
%struct.CompoundDictionary = type { i64, i64, [16 x ptr], [16 x ptr], [16 x i64], i64, [16 x ptr] }
%struct.ContextualEncoderDictionary = type { i32, i8, [64 x i8], [64 x ptr], i64, %struct.BrotliEncoderDictionary, ptr }
%struct.BrotliEncoderDictionary = type { ptr, i32, i32, i64, ptr, ptr, ptr, ptr, %struct.BrotliTrie, i32, ptr, ptr, ptr, i64, ptr, i64, ptr, ptr }
%struct.BrotliTrie = type { ptr, i64, i64, %struct.BrotliTrieNode }
%struct.BrotliTrieNode = type { i8, i8, i8, i32, i32 }
%struct.ZopfliNode = type { i32, i32, i32, %union.anon }
%union.anon = type { float }
%struct.Hasher = type { %struct.HasherCommon, %union.anon.0 }
%struct.HasherCommon = type { [4 x ptr], i32, i64, i64, %struct.BrotliHasherParams, i32 }
%union.anon.0 = type { %struct.H42 }
%struct.H42 = type { [512 x i16], i64, [2 x ptr], ptr }
%struct.BackwardMatch = type { 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 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, i64 noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #3 {
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca %struct.StartPosQueue, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca i64, align 8
  %37 = alloca i32, align 4
  %38 = alloca i8, align 1
  %39 = alloca i8, align 1
  %40 = alloca i64, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i64 %1, ptr %12, align 8, !tbaa !9
  store i64 %2, ptr %13, align 8, !tbaa !9
  store ptr %3, ptr %14, align 8, !tbaa !5
  store i64 %4, ptr %15, align 8, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !5
  store ptr %6, ptr %17, align 8, !tbaa !5
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  store ptr %9, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %41 = load ptr, ptr %17, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %41, i32 0, i32 4
  %43 = load i64, ptr %42, align 8, !tbaa !11
  store i64 %43, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %44 = load ptr, ptr %17, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %44, i32 0, i32 2
  %46 = load i32, ptr %45, align 8, !tbaa !22
  %47 = zext i32 %46 to i64
  %48 = shl i64 1, %47
  %49 = sub i64 %48, 16
  store i64 %49, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %50 = load ptr, ptr %17, align 8, !tbaa !5
  %51 = call i64 @MaxZopfliLen(ptr noundef %50)
  store i64 %51, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 264, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = call ptr @BrotliAllocate(ptr noundef %52, i64 noundef 3072)
  store ptr %53, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %54 = load i64, ptr %12, align 8, !tbaa !9
  %55 = call i64 @StoreLookaheadH10()
  %56 = icmp uge i64 %54, %55
  br i1 %56, label %57, label %64

57:                                               ; preds = %10
  %58 = load i64, ptr %13, align 8, !tbaa !9
  %59 = load i64, ptr %12, align 8, !tbaa !9
  %60 = add i64 %58, %59
  %61 = call i64 @StoreLookaheadH10()
  %62 = sub i64 %60, %61
  %63 = add i64 %62, 1
  br label %66

64:                                               ; preds = %10
  %65 = load i64, ptr %13, align 8, !tbaa !9
  br label %66

66:                                               ; preds = %64, %57
  %67 = phi i64 [ %63, %57 ], [ %65, %64 ]
  store i64 %67, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %68 = load ptr, ptr %17, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %68, i32 0, i32 10
  %70 = getelementptr inbounds %struct.SharedEncoderDictionary, ptr %69, i32 0, i32 1
  store ptr %70, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %71 = load ptr, ptr %28, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.CompoundDictionary, ptr %71, i32 0, i32 1
  %73 = load i64, ptr %72, align 8, !tbaa !23
  store i64 %73, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %74 = load ptr, ptr %28, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.CompoundDictionary, ptr %74, i32 0, i32 0
  %76 = load i64, ptr %75, align 8, !tbaa !24
  %77 = icmp ne i64 %76, 0
  %78 = zext i1 %77 to i64
  %79 = select i1 %77, i32 256, i32 0
  %80 = sext i32 %79 to i64
  store i64 %80, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = call ptr @BrotliAllocate(ptr noundef %81, i64 noundef 9896)
  store ptr %82, ptr %31, align 8, !tbaa !5
  %83 = load ptr, ptr %20, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ZopfliNode, ptr %83, i64 0
  %85 = getelementptr inbounds %struct.ZopfliNode, ptr %84, i32 0, i32 0
  store i32 0, ptr %85, align 4, !tbaa !25
  %86 = load ptr, ptr %20, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ZopfliNode, ptr %86, i64 0
  %88 = getelementptr inbounds %struct.ZopfliNode, ptr %87, i32 0, i32 3
  store float 0.000000e+00, ptr %88, align 4, !tbaa !27
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %31, align 8, !tbaa !5
  %91 = load ptr, ptr %17, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %91, i32 0, i32 9
  %93 = load i64, ptr %12, align 8, !tbaa !9
  call void @InitZopfliCostModel(ptr noundef %89, ptr noundef %90, ptr noundef %92, i64 noundef %93)
  %94 = load ptr, ptr %31, align 8, !tbaa !5
  %95 = load i64, ptr %13, align 8, !tbaa !9
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = load i64, ptr %15, align 8, !tbaa !9
  call void @ZopfliCostModelSetFromLiteralCosts(ptr noundef %94, i64 noundef %95, ptr noundef %96, i64 noundef %97)
  call void @InitStartPosQueue(ptr noundef %24)
  store i64 0, ptr %27, align 8, !tbaa !9
  br label %98

98:                                               ; preds = %331, %66
  %99 = load i64, ptr %27, align 8, !tbaa !9
  %100 = call i64 @HashTypeLengthH10()
  %101 = add i64 %99, %100
  %102 = sub i64 %101, 1
  %103 = load i64, ptr %12, align 8, !tbaa !9
  %104 = icmp ult i64 %102, %103
  br i1 %104, label %105, label %334

105:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %106 = load i64, ptr %13, align 8, !tbaa !9
  %107 = load i64, ptr %27, align 8, !tbaa !9
  %108 = add i64 %106, %107
  store i64 %108, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %109 = load i64, ptr %32, align 8, !tbaa !9
  %110 = load i64, ptr %22, align 8, !tbaa !9
  %111 = call i64 @brotli_min_size_t(i64 noundef %109, i64 noundef %110)
  store i64 %111, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  %112 = load i64, ptr %32, align 8, !tbaa !9
  %113 = load i64, ptr %21, align 8, !tbaa !9
  %114 = add i64 %112, %113
  %115 = load i64, ptr %22, align 8, !tbaa !9
  %116 = call i64 @brotli_min_size_t(i64 noundef %114, i64 noundef %115)
  store i64 %116, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #5
  store i32 0, ptr %37, align 4, !tbaa !28
  %117 = load ptr, ptr %17, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %117, i32 0, i32 10
  %119 = getelementptr inbounds %struct.SharedEncoderDictionary, ptr %118, i32 0, i32 2
  %120 = getelementptr inbounds %struct.ContextualEncoderDictionary, ptr %119, i32 0, i32 0
  %121 = load i32, ptr %120, align 8, !tbaa !29
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %176

123:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 1, ptr %38) #5
  %124 = load i64, ptr %32, align 8, !tbaa !9
  %125 = icmp uge i64 %124, 1
  br i1 %125, label %126, label %135

126:                                              ; preds = %123
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = load i64, ptr %32, align 8, !tbaa !9
  %129 = sub i64 %128, 1
  %130 = load i64, ptr %15, align 8, !tbaa !9
  %131 = and i64 %129, %130
  %132 = getelementptr inbounds i8, ptr %127, i64 %131
  %133 = load i8, ptr %132, align 1, !tbaa !27
  %134 = zext i8 %133 to i32
  br label %136

135:                                              ; preds = %123
  br label %136

136:                                              ; preds = %135, %126
  %137 = phi i32 [ %134, %126 ], [ 0, %135 ]
  %138 = trunc i32 %137 to i8
  store i8 %138, ptr %38, align 1, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 1, ptr %39) #5
  %139 = load i64, ptr %32, align 8, !tbaa !9
  %140 = icmp uge i64 %139, 2
  br i1 %140, label %141, label %150

141:                                              ; preds = %136
  %142 = load ptr, ptr %14, align 8, !tbaa !5
  %143 = load i64, ptr %32, align 8, !tbaa !9
  %144 = sub i64 %143, 2
  %145 = load i64, ptr %15, align 8, !tbaa !9
  %146 = and i64 %144, %145
  %147 = getelementptr inbounds i8, ptr %142, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !27
  %149 = zext i8 %148 to i32
  br label %151

150:                                              ; preds = %136
  br label %151

151:                                              ; preds = %150, %141
  %152 = phi i32 [ %149, %141 ], [ 0, %150 ]
  %153 = trunc i32 %152 to i8
  store i8 %153, ptr %39, align 1, !tbaa !27
  %154 = load ptr, ptr %17, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %154, i32 0, i32 10
  %156 = getelementptr inbounds %struct.SharedEncoderDictionary, ptr %155, i32 0, i32 2
  %157 = getelementptr inbounds %struct.ContextualEncoderDictionary, ptr %156, i32 0, i32 2
  %158 = load ptr, ptr %16, align 8, !tbaa !5
  %159 = load i8, ptr %38, align 1, !tbaa !27
  %160 = zext i8 %159 to i64
  %161 = getelementptr inbounds i8, ptr %158, i64 %160
  %162 = load i8, ptr %161, align 1, !tbaa !27
  %163 = zext i8 %162 to i32
  %164 = load ptr, ptr %16, align 8, !tbaa !5
  %165 = getelementptr inbounds i8, ptr %164, i64 256
  %166 = load i8, ptr %39, align 1, !tbaa !27
  %167 = zext i8 %166 to i64
  %168 = getelementptr inbounds i8, ptr %165, i64 %167
  %169 = load i8, ptr %168, align 1, !tbaa !27
  %170 = zext i8 %169 to i32
  %171 = or i32 %163, %170
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [64 x i8], ptr %157, i64 0, i64 %172
  %174 = load i8, ptr %173, align 1, !tbaa !27
  %175 = zext i8 %174 to i32
  store i32 %175, ptr %37, align 4, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %38) #5
  br label %176

176:                                              ; preds = %151, %105
  %177 = load ptr, ptr %19, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.Hasher, ptr %177, i32 0, i32 1
  %179 = load ptr, ptr %17, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %179, i32 0, i32 10
  %181 = getelementptr inbounds %struct.SharedEncoderDictionary, ptr %180, i32 0, i32 2
  %182 = getelementptr inbounds %struct.ContextualEncoderDictionary, ptr %181, i32 0, i32 3
  %183 = load i32, ptr %37, align 4, !tbaa !28
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [64 x ptr], ptr %182, i64 0, i64 %184
  %186 = load ptr, ptr %185, align 8, !tbaa !5
  %187 = load ptr, ptr %14, align 8, !tbaa !5
  %188 = load i64, ptr %15, align 8, !tbaa !9
  %189 = load i64, ptr %32, align 8, !tbaa !9
  %190 = load i64, ptr %12, align 8, !tbaa !9
  %191 = load i64, ptr %27, align 8, !tbaa !9
  %192 = sub i64 %190, %191
  %193 = load i64, ptr %33, align 8, !tbaa !9
  %194 = load i64, ptr %34, align 8, !tbaa !9
  %195 = load i64, ptr %29, align 8, !tbaa !9
  %196 = add i64 %194, %195
  %197 = load ptr, ptr %17, align 8, !tbaa !5
  %198 = load ptr, ptr %25, align 8, !tbaa !5
  %199 = load i64, ptr %30, align 8, !tbaa !9
  %200 = getelementptr inbounds %struct.BackwardMatch, ptr %198, i64 %199
  %201 = call i64 @FindAllMatchesH10(ptr noundef %178, ptr noundef %186, ptr noundef %187, i64 noundef %188, i64 noundef %189, i64 noundef %192, i64 noundef %193, i64 noundef %196, ptr noundef %197, ptr noundef %200)
  store i64 %201, ptr %36, align 8, !tbaa !9
  %202 = load ptr, ptr %28, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.CompoundDictionary, ptr %202, i32 0, i32 0
  %204 = load i64, ptr %203, align 8, !tbaa !24
  %205 = icmp ne i64 %204, 0
  br i1 %205, label %206, label %237

206:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #5
  %207 = load ptr, ptr %28, align 8, !tbaa !5
  %208 = load ptr, ptr %14, align 8, !tbaa !5
  %209 = load i64, ptr %15, align 8, !tbaa !9
  %210 = load i64, ptr %32, align 8, !tbaa !9
  %211 = load i64, ptr %12, align 8, !tbaa !9
  %212 = load i64, ptr %27, align 8, !tbaa !9
  %213 = sub i64 %211, %212
  %214 = load i64, ptr %34, align 8, !tbaa !9
  %215 = load ptr, ptr %17, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %215, i32 0, i32 9
  %217 = getelementptr inbounds %struct.BrotliDistanceParams, ptr %216, i32 0, i32 4
  %218 = load i64, ptr %217, align 8, !tbaa !30
  %219 = load ptr, ptr %25, align 8, !tbaa !5
  %220 = load i64, ptr %30, align 8, !tbaa !9
  %221 = sub i64 %220, 64
  %222 = getelementptr inbounds %struct.BackwardMatch, ptr %219, i64 %221
  %223 = call i64 @LookupAllCompoundDictionaryMatches(ptr noundef %207, ptr noundef %208, i64 noundef %209, i64 noundef %210, i64 noundef 3, i64 noundef %213, i64 noundef %214, i64 noundef %218, ptr noundef %222, i64 noundef 64)
  store i64 %223, ptr %40, align 8, !tbaa !9
  %224 = load ptr, ptr %25, align 8, !tbaa !5
  %225 = load ptr, ptr %25, align 8, !tbaa !5
  %226 = load i64, ptr %30, align 8, !tbaa !9
  %227 = sub i64 %226, 64
  %228 = getelementptr inbounds %struct.BackwardMatch, ptr %225, i64 %227
  %229 = load i64, ptr %40, align 8, !tbaa !9
  %230 = load ptr, ptr %25, align 8, !tbaa !5
  %231 = load i64, ptr %30, align 8, !tbaa !9
  %232 = getelementptr inbounds %struct.BackwardMatch, ptr %230, i64 %231
  %233 = load i64, ptr %36, align 8, !tbaa !9
  call void @MergeMatches(ptr noundef %224, ptr noundef %228, i64 noundef %229, ptr noundef %232, i64 noundef %233)
  %234 = load i64, ptr %40, align 8, !tbaa !9
  %235 = load i64, ptr %36, align 8, !tbaa !9
  %236 = add i64 %235, %234
  store i64 %236, ptr %36, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #5
  br label %237

237:                                              ; preds = %206, %176
  %238 = load i64, ptr %36, align 8, !tbaa !9
  %239 = icmp ugt i64 %238, 0
  br i1 %239, label %240, label %255

240:                                              ; preds = %237
  %241 = load ptr, ptr %25, align 8, !tbaa !5
  %242 = load i64, ptr %36, align 8, !tbaa !9
  %243 = sub i64 %242, 1
  %244 = getelementptr inbounds %struct.BackwardMatch, ptr %241, i64 %243
  %245 = call i64 @BackwardMatchLength(ptr noundef %244)
  %246 = load i64, ptr %23, align 8, !tbaa !9
  %247 = icmp ugt i64 %245, %246
  br i1 %247, label %248, label %255

248:                                              ; preds = %240
  %249 = load ptr, ptr %25, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.BackwardMatch, ptr %249, i64 0
  %251 = load ptr, ptr %25, align 8, !tbaa !5
  %252 = load i64, ptr %36, align 8, !tbaa !9
  %253 = sub i64 %252, 1
  %254 = getelementptr inbounds %struct.BackwardMatch, ptr %251, i64 %253
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %250, ptr align 4 %254, i64 8, i1 false), !tbaa.struct !31
  store i64 1, ptr %36, align 8, !tbaa !9
  br label %255

255:                                              ; preds = %248, %240, %237
  %256 = load i64, ptr %12, align 8, !tbaa !9
  %257 = load i64, ptr %13, align 8, !tbaa !9
  %258 = load i64, ptr %27, align 8, !tbaa !9
  %259 = load ptr, ptr %14, align 8, !tbaa !5
  %260 = load i64, ptr %15, align 8, !tbaa !9
  %261 = load ptr, ptr %17, align 8, !tbaa !5
  %262 = load i64, ptr %22, align 8, !tbaa !9
  %263 = load ptr, ptr %18, align 8, !tbaa !5
  %264 = load i64, ptr %36, align 8, !tbaa !9
  %265 = load ptr, ptr %25, align 8, !tbaa !5
  %266 = load ptr, ptr %31, align 8, !tbaa !5
  %267 = load ptr, ptr %20, align 8, !tbaa !5
  %268 = call i64 @UpdateNodes(i64 noundef %256, i64 noundef %257, i64 noundef %258, ptr noundef %259, i64 noundef %260, ptr noundef %261, i64 noundef %262, ptr noundef %263, i64 noundef %264, ptr noundef %265, ptr noundef %266, ptr noundef %24, ptr noundef %267)
  store i64 %268, ptr %35, align 8, !tbaa !9
  %269 = load i64, ptr %35, align 8, !tbaa !9
  %270 = icmp ult i64 %269, 16384
  br i1 %270, label %271, label %272

271:                                              ; preds = %255
  store i64 0, ptr %35, align 8, !tbaa !9
  br label %272

272:                                              ; preds = %271, %255
  %273 = load i64, ptr %36, align 8, !tbaa !9
  %274 = icmp eq i64 %273, 1
  br i1 %274, label %275, label %287

275:                                              ; preds = %272
  %276 = load ptr, ptr %25, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.BackwardMatch, ptr %276, i64 0
  %278 = call i64 @BackwardMatchLength(ptr noundef %277)
  %279 = load i64, ptr %23, align 8, !tbaa !9
  %280 = icmp ugt i64 %278, %279
  br i1 %280, label %281, label %287

281:                                              ; preds = %275
  %282 = load ptr, ptr %25, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.BackwardMatch, ptr %282, i64 0
  %284 = call i64 @BackwardMatchLength(ptr noundef %283)
  %285 = load i64, ptr %35, align 8, !tbaa !9
  %286 = call i64 @brotli_max_size_t(i64 noundef %284, i64 noundef %285)
  store i64 %286, ptr %35, align 8, !tbaa !9
  br label %287

287:                                              ; preds = %281, %275, %272
  %288 = load i64, ptr %35, align 8, !tbaa !9
  %289 = icmp ugt i64 %288, 1
  br i1 %289, label %290, label %330

290:                                              ; preds = %287
  %291 = load ptr, ptr %19, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.Hasher, ptr %291, i32 0, i32 1
  %293 = load ptr, ptr %14, align 8, !tbaa !5
  %294 = load i64, ptr %15, align 8, !tbaa !9
  %295 = load i64, ptr %32, align 8, !tbaa !9
  %296 = add i64 %295, 1
  %297 = load i64, ptr %32, align 8, !tbaa !9
  %298 = load i64, ptr %35, align 8, !tbaa !9
  %299 = add i64 %297, %298
  %300 = load i64, ptr %26, align 8, !tbaa !9
  %301 = call i64 @brotli_min_size_t(i64 noundef %299, i64 noundef %300)
  call void @StoreRangeH10(ptr noundef %292, ptr noundef %293, i64 noundef %294, i64 noundef %296, i64 noundef %301)
  %302 = load i64, ptr %35, align 8, !tbaa !9
  %303 = add i64 %302, -1
  store i64 %303, ptr %35, align 8, !tbaa !9
  br label %304

304:                                              ; preds = %317, %290
  %305 = load i64, ptr %35, align 8, !tbaa !9
  %306 = icmp ne i64 %305, 0
  br i1 %306, label %307, label %329

307:                                              ; preds = %304
  %308 = load i64, ptr %27, align 8, !tbaa !9
  %309 = add i64 %308, 1
  store i64 %309, ptr %27, align 8, !tbaa !9
  %310 = load i64, ptr %27, align 8, !tbaa !9
  %311 = call i64 @HashTypeLengthH10()
  %312 = add i64 %310, %311
  %313 = sub i64 %312, 1
  %314 = load i64, ptr %12, align 8, !tbaa !9
  %315 = icmp uge i64 %313, %314
  br i1 %315, label %316, label %317

316:                                              ; preds = %307
  br label %329

317:                                              ; preds = %307
  %318 = load i64, ptr %13, align 8, !tbaa !9
  %319 = load i64, ptr %21, align 8, !tbaa !9
  %320 = add i64 %318, %319
  %321 = load i64, ptr %27, align 8, !tbaa !9
  %322 = load i64, ptr %22, align 8, !tbaa !9
  %323 = load i64, ptr %29, align 8, !tbaa !9
  %324 = load ptr, ptr %18, align 8, !tbaa !5
  %325 = load ptr, ptr %31, align 8, !tbaa !5
  %326 = load ptr, ptr %20, align 8, !tbaa !5
  call void @EvaluateNode(i64 noundef %320, i64 noundef %321, i64 noundef %322, i64 noundef %323, ptr noundef %324, ptr noundef %325, ptr noundef %24, ptr noundef %326)
  %327 = load i64, ptr %35, align 8, !tbaa !9
  %328 = add i64 %327, -1
  store i64 %328, ptr %35, align 8, !tbaa !9
  br label %304, !llvm.loop !32

329:                                              ; preds = %316, %304
  br label %330

330:                                              ; preds = %329, %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %331

331:                                              ; preds = %330
  %332 = load i64, ptr %27, align 8, !tbaa !9
  %333 = add i64 %332, 1
  store i64 %333, ptr %27, align 8, !tbaa !9
  br label %98, !llvm.loop !34

334:                                              ; preds = %98
  %335 = load ptr, ptr %11, align 8, !tbaa !5
  %336 = load ptr, ptr %31, align 8, !tbaa !5
  call void @CleanupZopfliCostModel(ptr noundef %335, ptr noundef %336)
  %337 = load ptr, ptr %11, align 8, !tbaa !5
  %338 = load ptr, ptr %31, align 8, !tbaa !5
  call void @BrotliFree(ptr noundef %337, ptr noundef %338)
  store ptr null, ptr %31, align 8, !tbaa !5
  %339 = load ptr, ptr %11, align 8, !tbaa !5
  %340 = load ptr, ptr %25, align 8, !tbaa !5
  call void @BrotliFree(ptr noundef %339, ptr noundef %340)
  store ptr null, ptr %25, align 8, !tbaa !5
  %341 = load i64, ptr %12, align 8, !tbaa !9
  %342 = load ptr, ptr %20, align 8, !tbaa !5
  %343 = call i64 @ComputeShortestPathFromNodes(i64 noundef %341, ptr noundef %342)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 264, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  ret i64 %343
}

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

declare hidden ptr @BrotliAllocate(ptr noundef, i64 noundef) #4

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

; Function Attrs: nounwind uwtable
declare hidden void @InitZopfliCostModel(ptr noundef, 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 noalias noundef, ptr noundef, ptr noalias noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) #2

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

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

; 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 noalias noundef, ptr noalias 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

declare hidden void @BrotliFree(ptr noundef, ptr noundef) #4

; 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 = { "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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"BrotliEncoderParams", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !10, i64 16, !10, i64 24, !13, i64 32, !13, i64 36, !14, i64 40, !15, i64 56, !16, i64 80}
!13 = !{!"int", !7, i64 0}
!14 = !{!"BrotliHasherParams", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!15 = !{!"BrotliDistanceParams", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !10, i64 16}
!16 = !{!"SharedEncoderDictionary", !13, i64 0, !17, i64 8, !18, i64 544, !13, i64 1312}
!17 = !{!"CompoundDictionary", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 144, !7, i64 272, !10, i64 400, !7, i64 408}
!18 = !{!"ContextualEncoderDictionary", !13, i64 0, !7, i64 4, !7, i64 5, !7, i64 72, !10, i64 584, !19, i64 592, !6, i64 760}
!19 = !{!"BrotliEncoderDictionary", !6, i64 0, !13, i64 8, !13, i64 12, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !20, i64 56, !13, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !10, i64 128, !6, i64 136, !10, i64 144, !6, i64 152, !6, i64 160}
!20 = !{!"BrotliTrie", !6, i64 0, !10, i64 8, !10, i64 16, !21, i64 24}
!21 = !{!"BrotliTrieNode", !7, i64 0, !7, i64 1, !7, i64 2, !13, i64 4, !13, i64 8}
!22 = !{!12, !13, i64 8}
!23 = !{!17, !10, i64 8}
!24 = !{!17, !10, i64 0}
!25 = !{!26, !13, i64 0}
!26 = !{!"ZopfliNode", !13, i64 0, !13, i64 4, !13, i64 8, !7, i64 12}
!27 = !{!7, !7, i64 0}
!28 = !{!13, !13, i64 0}
!29 = !{!12, !13, i64 624}
!30 = !{!12, !10, i64 72}
!31 = !{i64 0, i64 4, !28, i64 4, i64 4, !28}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}


; 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.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, i64 noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr nocapture noundef readonly %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #2 {
  %11 = alloca %struct.StartPosQueue, align 8
  %12 = getelementptr inbounds i8, ptr %6, i64 16
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %6, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !20
  %16 = zext nneg i32 %15 to i64
  %17 = shl nuw i64 1, %16
  %18 = add i64 %17, -16
  %19 = tail call i64 @MaxZopfliLen(ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 264, ptr nonnull %11) #4
  %20 = tail call ptr @BrotliAllocate(ptr noundef %0, i64 noundef 3072) #4
  %21 = tail call i64 @StoreLookaheadH10()
  %.not = icmp ugt i64 %21, %1
  br i1 %.not, label %27, label %22

22:                                               ; preds = %10
  %23 = tail call i64 @StoreLookaheadH10()
  %24 = add i64 %1, 1
  %25 = add i64 %24, %2
  %26 = sub i64 %25, %23
  br label %27

27:                                               ; preds = %10, %22
  %28 = phi i64 [ %26, %22 ], [ %2, %10 ]
  %29 = getelementptr inbounds i8, ptr %6, i64 88
  %30 = getelementptr inbounds i8, ptr %6, i64 96
  %31 = load i64, ptr %30, align 8, !tbaa !21
  %32 = load i64, ptr %29, align 8, !tbaa !22
  %33 = tail call ptr @BrotliAllocate(ptr noundef %0, i64 noundef 9896) #4
  store i32 0, ptr %9, align 4, !tbaa !23
  %34 = getelementptr inbounds i8, ptr %9, i64 12
  store float 0.000000e+00, ptr %34, align 4, !tbaa !25
  %35 = getelementptr inbounds i8, ptr %6, i64 56
  tail call void @InitZopfliCostModel(ptr noundef %0, ptr noundef %33, ptr noundef nonnull %35, i64 noundef %1)
  tail call void @ZopfliCostModelSetFromLiteralCosts(ptr noundef %33, i64 noundef %2, ptr noundef %3, i64 noundef %4)
  call void @InitStartPosQueue(ptr noundef nonnull %11)
  %invariant.gep = getelementptr i8, ptr %20, i64 -8
  %36 = call i64 @HashTypeLengthH10()
  %37 = add i64 %36, -1
  %38 = icmp ult i64 %37, %1
  br i1 %38, label %.lr.ph159, label %._crit_edge

.lr.ph159:                                        ; preds = %27
  %.not144 = icmp eq i64 %32, 0
  %39 = select i1 %.not144, i64 0, i64 256
  %40 = getelementptr inbounds i8, ptr %6, i64 624
  %41 = getelementptr inbounds i8, ptr %6, i64 629
  %42 = getelementptr inbounds i8, ptr %5, i64 256
  %43 = getelementptr inbounds i8, ptr %8, i64 80
  %44 = getelementptr inbounds i8, ptr %6, i64 696
  %45 = getelementptr inbounds %struct.BackwardMatch, ptr %20, i64 %39
  %46 = getelementptr inbounds i8, ptr %6, i64 72
  %47 = getelementptr i8, ptr %45, i64 -512
  %48 = add i64 %13, %2
  br label %49

49:                                               ; preds = %.lr.ph159, %.loopexit
  %.0158 = phi i64 [ 0, %.lr.ph159 ], [ %115, %.loopexit ]
  %50 = add i64 %.0158, %2
  %51 = call i64 @brotli_min_size_t(i64 noundef %50, i64 noundef %18)
  %52 = add i64 %50, %13
  %53 = call i64 @brotli_min_size_t(i64 noundef %52, i64 noundef %18)
  %54 = load i32, ptr %40, align 8, !tbaa !26
  %.not145 = icmp eq i32 %54, 0
  br i1 %.not145, label %79, label %55

55:                                               ; preds = %49
  %.not146 = icmp eq i64 %50, 0
  br i1 %.not146, label %.thread, label %56

56:                                               ; preds = %55
  %57 = add i64 %50, -1
  %58 = and i64 %57, %4
  %59 = getelementptr inbounds i8, ptr %3, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !25
  %.not151 = icmp eq i64 %50, 1
  br i1 %.not151, label %.thread, label %61

61:                                               ; preds = %56
  %62 = add i64 %50, -2
  %63 = and i64 %62, %4
  %64 = getelementptr inbounds i8, ptr %3, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !25
  br label %.thread

.thread:                                          ; preds = %55, %56, %61
  %66 = phi i8 [ %60, %61 ], [ %60, %56 ], [ 0, %55 ]
  %67 = phi i8 [ %65, %61 ], [ 0, %56 ], [ 0, %55 ]
  %68 = zext i8 %66 to i64
  %69 = getelementptr inbounds i8, ptr %5, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !25
  %71 = zext i8 %67 to i64
  %72 = getelementptr inbounds i8, ptr %42, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !25
  %74 = or i8 %73, %70
  %75 = zext i8 %74 to i64
  %76 = getelementptr inbounds [64 x i8], ptr %41, i64 0, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !25
  %78 = zext i8 %77 to i64
  br label %79

79:                                               ; preds = %.thread, %49
  %.0134 = phi i64 [ %78, %.thread ], [ 0, %49 ]
  %80 = getelementptr inbounds [64 x ptr], ptr %44, i64 0, i64 %.0134
  %81 = load ptr, ptr %80, align 8, !tbaa !27
  %82 = sub i64 %1, %.0158
  %83 = add i64 %53, %31
  %84 = call i64 @FindAllMatchesH10(ptr noundef nonnull %43, ptr noundef %81, ptr noundef %3, i64 noundef %4, i64 noundef %50, i64 noundef %82, i64 noundef %51, i64 noundef %83, ptr noundef nonnull %6, ptr noundef %45)
  %85 = load i64, ptr %29, align 8, !tbaa !22
  %.not147 = icmp eq i64 %85, 0
  br i1 %.not147, label %90, label %86

86:                                               ; preds = %79
  %87 = load i64, ptr %46, align 8, !tbaa !28
  %88 = call i64 @LookupAllCompoundDictionaryMatches(ptr noundef nonnull %29, ptr noundef %3, i64 noundef %4, i64 noundef %50, i64 noundef 3, i64 noundef %82, i64 noundef %53, i64 noundef %87, ptr noundef %47, i64 noundef 64)
  call void @MergeMatches(ptr noundef %20, ptr noundef %47, i64 noundef %88, ptr noundef %45, i64 noundef %84)
  %89 = add i64 %88, %84
  br label %90

90:                                               ; preds = %86, %79
  %.0135 = phi i64 [ %89, %86 ], [ %84, %79 ]
  %.not148 = icmp eq i64 %.0135, 0
  br i1 %.not148, label %96, label %91

91:                                               ; preds = %90
  %gep = getelementptr %struct.BackwardMatch, ptr %invariant.gep, i64 %.0135
  %92 = call i64 @BackwardMatchLength(ptr noundef %gep)
  %93 = icmp ugt i64 %92, %19
  br i1 %93, label %94, label %96

94:                                               ; preds = %91
  %95 = load i64, ptr %gep, align 4
  store i64 %95, ptr %20, align 4
  br label %96

96:                                               ; preds = %94, %91, %90
  %.1136 = phi i64 [ 1, %94 ], [ %.0135, %91 ], [ 0, %90 ]
  %97 = call i64 @UpdateNodes(i64 noundef %1, i64 noundef %2, i64 noundef %.0158, ptr noundef %3, i64 noundef %4, ptr noundef nonnull %6, i64 noundef %18, ptr noundef %7, i64 noundef %.1136, ptr noundef %20, ptr noundef %33, ptr noundef nonnull %11, ptr noundef nonnull %9)
  %98 = icmp ult i64 %97, 16384
  %spec.store.select = select i1 %98, i64 0, i64 %97
  %99 = icmp eq i64 %.1136, 1
  br i1 %99, label %100, label %106

100:                                              ; preds = %96
  %101 = call i64 @BackwardMatchLength(ptr noundef %20)
  %102 = icmp ugt i64 %101, %19
  br i1 %102, label %103, label %106

103:                                              ; preds = %100
  %104 = call i64 @BackwardMatchLength(ptr noundef %20)
  %105 = call i64 @brotli_max_size_t(i64 noundef %104, i64 noundef %spec.store.select)
  br label %106

106:                                              ; preds = %103, %100, %96
  %.0137 = phi i64 [ %105, %103 ], [ %spec.store.select, %100 ], [ %spec.store.select, %96 ]
  %107 = icmp ugt i64 %.0137, 1
  br i1 %107, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %106
  %108 = add i64 %50, 1
  %109 = add i64 %.0137, %50
  %110 = call i64 @brotli_min_size_t(i64 noundef %109, i64 noundef %28)
  call void @StoreRangeH10(ptr noundef nonnull %43, ptr noundef %3, i64 noundef %4, i64 noundef %108, i64 noundef %110)
  %.1138152 = add i64 %.0137, -1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %114
  %.1138155 = phi i64 [ %.1138, %114 ], [ %.1138152, %.lr.ph.preheader ]
  %.1154 = phi i64 [ %111, %114 ], [ %.0158, %.lr.ph.preheader ]
  %111 = add i64 %.1154, 1
  %112 = call i64 @HashTypeLengthH10()
  %113 = add i64 %112, %.1154
  %.not150 = icmp ult i64 %113, %1
  br i1 %.not150, label %114, label %.loopexit

114:                                              ; preds = %.lr.ph
  call void @EvaluateNode(i64 noundef %48, i64 noundef %111, i64 noundef %18, i64 noundef %31, ptr noundef %7, ptr noundef %33, ptr noundef nonnull %11, ptr noundef nonnull %9)
  %.1138 = add i64 %.1138155, -1
  %.not149 = icmp eq i64 %.1138, 0
  br i1 %.not149, label %.loopexit, label %.lr.ph, !llvm.loop !29

.loopexit:                                        ; preds = %.lr.ph, %114, %106
  %.2 = phi i64 [ %.0158, %106 ], [ %111, %114 ], [ %111, %.lr.ph ]
  %115 = add i64 %.2, 1
  %116 = call i64 @HashTypeLengthH10()
  %117 = add i64 %.2, %116
  %118 = icmp ult i64 %117, %1
  br i1 %118, label %49, label %._crit_edge, !llvm.loop !31

._crit_edge:                                      ; preds = %.loopexit, %27
  call void @CleanupZopfliCostModel(ptr noundef %0, ptr noundef %33)
  call void @BrotliFree(ptr noundef %0, ptr noundef %33) #4
  call void @BrotliFree(ptr noundef %0, ptr noundef %20) #4
  %119 = call i64 @ComputeShortestPathFromNodes(i64 noundef %1, ptr noundef nonnull %9)
  call void @llvm.lifetime.end.p0(i64 264, ptr nonnull %11) #4
  ret i64 %119
}

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

declare hidden ptr @BrotliAllocate(ptr noundef, i64 noundef) local_unnamed_addr #3

; 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, 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 noalias noundef, ptr noundef, ptr noalias 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 @LookupAllCompoundDictionaryMatches(ptr noundef, ptr noalias noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

; 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 noalias noundef, ptr noalias 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

declare hidden void @BrotliFree(ptr noundef, ptr noundef) local_unnamed_addr #3

; 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 = { "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, !10, i64 16}
!6 = !{!"BrotliEncoderParams", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !11, i64 40, !12, i64 56, !13, i64 80}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"BrotliHasherParams", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!12 = !{!"BrotliDistanceParams", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16}
!13 = !{!"SharedEncoderDictionary", !7, i64 0, !14, i64 8, !15, i64 544, !7, i64 1312}
!14 = !{!"CompoundDictionary", !10, i64 0, !10, i64 8, !8, i64 16, !8, i64 144, !8, i64 272, !10, i64 400, !8, i64 408}
!15 = !{!"ContextualEncoderDictionary", !7, i64 0, !8, i64 4, !8, i64 5, !8, i64 72, !10, i64 584, !16, i64 592, !17, i64 760}
!16 = !{!"BrotliEncoderDictionary", !17, i64 0, !7, i64 8, !7, i64 12, !10, i64 16, !17, i64 24, !17, i64 32, !17, i64 40, !17, i64 48, !18, i64 56, !7, i64 96, !17, i64 104, !17, i64 112, !17, i64 120, !10, i64 128, !17, i64 136, !10, i64 144, !17, i64 152, !17, i64 160}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"BrotliTrie", !17, i64 0, !10, i64 8, !10, i64 16, !19, i64 24}
!19 = !{!"BrotliTrieNode", !8, i64 0, !8, i64 1, !8, i64 2, !7, i64 4, !7, i64 8}
!20 = !{!6, !7, i64 8}
!21 = !{!14, !10, i64 8}
!22 = !{!14, !10, i64 0}
!23 = !{!24, !7, i64 0}
!24 = !{!"ZopfliNode", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12}
!25 = !{!8, !8, i64 0}
!26 = !{!6, !7, i64 624}
!27 = !{!17, !17, i64 0}
!28 = !{!6, !10, i64 72}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


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