; 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.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.Command = type { i32, i32, i32, i16, i16 }

; 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
define hidden void @BrotliZopfliCreateCommands(i64 noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #1 {
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i32, align 4
  %30 = alloca i64, align 8
  store i64 %0, ptr %9, align 8, !tbaa !5
  store i64 %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !9
  store ptr %4, ptr %13, align 8, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !9
  store ptr %7, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %31 = load ptr, ptr %14, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %31, i32 0, i32 4
  %33 = load i64, ptr %32, align 8, !tbaa !11
  store i64 %33, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %34 = load ptr, ptr %14, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %34, i32 0, i32 2
  %36 = load i32, ptr %35, align 8, !tbaa !22
  %37 = zext i32 %36 to i64
  %38 = shl i64 1, %37
  %39 = sub i64 %38, 16
  store i64 %39, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store i64 0, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %40 = load ptr, ptr %11, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.ZopfliNode, ptr %40, i64 0
  %42 = getelementptr inbounds %struct.ZopfliNode, ptr %41, i32 0, i32 3
  %43 = load i32, ptr %42, align 4, !tbaa !23
  store i32 %43, ptr %20, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %44 = load ptr, ptr %14, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %44, i32 0, i32 10
  %46 = getelementptr inbounds %struct.SharedEncoderDictionary, ptr %45, i32 0, i32 1
  %47 = getelementptr inbounds %struct.CompoundDictionary, ptr %46, i32 0, i32 1
  %48 = load i64, ptr %47, align 8, !tbaa !25
  store i64 %48, ptr %22, align 8, !tbaa !5
  store i64 0, ptr %21, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %153, %8
  %50 = load i32, ptr %20, align 4, !tbaa !24
  %51 = icmp ne i32 %50, -1
  br i1 %51, label %52, label %156

52:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %53 = load ptr, ptr %11, align 8, !tbaa !9
  %54 = load i64, ptr %19, align 8, !tbaa !5
  %55 = load i32, ptr %20, align 4, !tbaa !24
  %56 = zext i32 %55 to i64
  %57 = add i64 %54, %56
  %58 = getelementptr inbounds %struct.ZopfliNode, ptr %53, i64 %57
  store ptr %58, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %59 = load ptr, ptr %23, align 8, !tbaa !9
  %60 = call i32 @ZopfliNodeCopyLength(ptr noundef %59)
  %61 = zext i32 %60 to i64
  store i64 %61, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %62 = load ptr, ptr %23, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.ZopfliNode, ptr %62, i32 0, i32 2
  %64 = load i32, ptr %63, align 4, !tbaa !26
  %65 = and i32 %64, 134217727
  %66 = zext i32 %65 to i64
  store i64 %66, ptr %25, align 8, !tbaa !5
  %67 = load i64, ptr %25, align 8, !tbaa !5
  %68 = load i64, ptr %19, align 8, !tbaa !5
  %69 = add i64 %68, %67
  store i64 %69, ptr %19, align 8, !tbaa !5
  %70 = load ptr, ptr %23, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.ZopfliNode, ptr %70, i32 0, i32 3
  %72 = load i32, ptr %71, align 4, !tbaa !23
  store i32 %72, ptr %20, align 4, !tbaa !24
  %73 = load i64, ptr %21, align 8, !tbaa !5
  %74 = icmp eq i64 %73, 0
  br i1 %74, label %75, label %81

75:                                               ; preds = %52
  %76 = load ptr, ptr %13, align 8, !tbaa !9
  %77 = load i64, ptr %76, align 8, !tbaa !5
  %78 = load i64, ptr %25, align 8, !tbaa !5
  %79 = add i64 %78, %77
  store i64 %79, ptr %25, align 8, !tbaa !5
  %80 = load ptr, ptr %13, align 8, !tbaa !9
  store i64 0, ptr %80, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %75, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %82 = load ptr, ptr %23, align 8, !tbaa !9
  %83 = call i32 @ZopfliNodeCopyDistance(ptr noundef %82)
  %84 = zext i32 %83 to i64
  store i64 %84, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  %85 = load ptr, ptr %23, align 8, !tbaa !9
  %86 = call i32 @ZopfliNodeLengthCode(ptr noundef %85)
  %87 = zext i32 %86 to i64
  store i64 %87, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  %88 = load i64, ptr %10, align 8, !tbaa !5
  %89 = load i64, ptr %19, align 8, !tbaa !5
  %90 = add i64 %88, %89
  %91 = load i64, ptr %17, align 8, !tbaa !5
  %92 = add i64 %90, %91
  %93 = load i64, ptr %18, align 8, !tbaa !5
  %94 = call i64 @brotli_min_size_t(i64 noundef %92, i64 noundef %93)
  store i64 %94, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  %95 = load i64, ptr %26, align 8, !tbaa !5
  %96 = load i64, ptr %28, align 8, !tbaa !5
  %97 = load i64, ptr %22, align 8, !tbaa !5
  %98 = add i64 %96, %97
  %99 = icmp ugt i64 %95, %98
  %100 = xor i1 %99, true
  %101 = xor i1 %100, true
  %102 = zext i1 %101 to i64
  %103 = select i1 %101, i32 1, i32 0
  store i32 %103, ptr %29, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  %104 = load ptr, ptr %23, align 8, !tbaa !9
  %105 = call i32 @ZopfliNodeDistanceCode(ptr noundef %104)
  %106 = zext i32 %105 to i64
  store i64 %106, ptr %30, align 8, !tbaa !5
  %107 = load ptr, ptr %15, align 8, !tbaa !9
  %108 = load i64, ptr %21, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.Command, ptr %107, i64 %108
  %110 = load ptr, ptr %14, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.BrotliEncoderParams, ptr %110, i32 0, i32 9
  %112 = load i64, ptr %25, align 8, !tbaa !5
  %113 = load i64, ptr %24, align 8, !tbaa !5
  %114 = load i64, ptr %27, align 8, !tbaa !5
  %115 = trunc i64 %114 to i32
  %116 = load i64, ptr %24, align 8, !tbaa !5
  %117 = trunc i64 %116 to i32
  %118 = sub nsw i32 %115, %117
  %119 = load i64, ptr %30, align 8, !tbaa !5
  call void @InitCommand(ptr noundef %109, ptr noundef %111, i64 noundef %112, i64 noundef %113, i32 noundef %118, i64 noundef %119)
  %120 = load i32, ptr %29, align 4, !tbaa !24
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %145, label %122

122:                                              ; preds = %81
  %123 = load i64, ptr %30, align 8, !tbaa !5
  %124 = icmp ugt i64 %123, 0
  br i1 %124, label %125, label %145

125:                                              ; preds = %122
  %126 = load ptr, ptr %12, align 8, !tbaa !9
  %127 = getelementptr inbounds i32, ptr %126, i64 2
  %128 = load i32, ptr %127, align 4, !tbaa !24
  %129 = load ptr, ptr %12, align 8, !tbaa !9
  %130 = getelementptr inbounds i32, ptr %129, i64 3
  store i32 %128, ptr %130, align 4, !tbaa !24
  %131 = load ptr, ptr %12, align 8, !tbaa !9
  %132 = getelementptr inbounds i32, ptr %131, i64 1
  %133 = load i32, ptr %132, align 4, !tbaa !24
  %134 = load ptr, ptr %12, align 8, !tbaa !9
  %135 = getelementptr inbounds i32, ptr %134, i64 2
  store i32 %133, ptr %135, align 4, !tbaa !24
  %136 = load ptr, ptr %12, align 8, !tbaa !9
  %137 = getelementptr inbounds i32, ptr %136, i64 0
  %138 = load i32, ptr %137, align 4, !tbaa !24
  %139 = load ptr, ptr %12, align 8, !tbaa !9
  %140 = getelementptr inbounds i32, ptr %139, i64 1
  store i32 %138, ptr %140, align 4, !tbaa !24
  %141 = load i64, ptr %26, align 8, !tbaa !5
  %142 = trunc i64 %141 to i32
  %143 = load ptr, ptr %12, align 8, !tbaa !9
  %144 = getelementptr inbounds i32, ptr %143, i64 0
  store i32 %142, ptr %144, align 4, !tbaa !24
  br label %145

145:                                              ; preds = %125, %122, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  %146 = load i64, ptr %25, align 8, !tbaa !5
  %147 = load ptr, ptr %16, align 8, !tbaa !9
  %148 = load i64, ptr %147, align 8, !tbaa !5
  %149 = add i64 %148, %146
  store i64 %149, ptr %147, align 8, !tbaa !5
  %150 = load i64, ptr %24, align 8, !tbaa !5
  %151 = load i64, ptr %19, align 8, !tbaa !5
  %152 = add i64 %151, %150
  store i64 %152, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %153

153:                                              ; preds = %145
  %154 = load i64, ptr %21, align 8, !tbaa !5
  %155 = add i64 %154, 1
  store i64 %155, ptr %21, align 8, !tbaa !5
  br label %49, !llvm.loop !28

156:                                              ; preds = %49
  %157 = load i64, ptr %9, align 8, !tbaa !5
  %158 = load i64, ptr %19, align 8, !tbaa !5
  %159 = sub i64 %157, %158
  %160 = load ptr, ptr %13, align 8, !tbaa !9
  %161 = load i64, ptr %160, align 8, !tbaa !5
  %162 = add i64 %161, %159
  store i64 %162, ptr %160, align 8, !tbaa !5
  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 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  ret void
}

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

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

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

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

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

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

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 = { 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 }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"BrotliEncoderParams", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !6, i64 16, !6, 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, !6, i64 16}
!16 = !{!"SharedEncoderDictionary", !13, i64 0, !17, i64 8, !18, i64 544, !13, i64 1312}
!17 = !{!"CompoundDictionary", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 144, !7, i64 272, !6, i64 400, !7, i64 408}
!18 = !{!"ContextualEncoderDictionary", !13, i64 0, !7, i64 4, !7, i64 5, !7, i64 72, !6, i64 584, !19, i64 592, !10, i64 760}
!19 = !{!"BrotliEncoderDictionary", !10, i64 0, !13, i64 8, !13, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !20, i64 56, !13, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !6, i64 128, !10, i64 136, !6, i64 144, !10, i64 152, !10, i64 160}
!20 = !{!"BrotliTrie", !10, i64 0, !6, i64 8, !6, 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 = !{!7, !7, i64 0}
!24 = !{!13, !13, i64 0}
!25 = !{!12, !6, i64 96}
!26 = !{!27, !13, i64 8}
!27 = !{!"ZopfliNode", !13, i64 0, !13, i64 4, !13, i64 8, !7, i64 12}
!28 = distinct !{!28, !29}
!29 = !{!"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.ZopfliNode = type { i32, i32, i32, %union.anon }
%union.anon = type { float }
%struct.Command = type { i32, i32, i32, i16, i16 }

; Function Attrs: nounwind uwtable
define hidden void @BrotliZopfliCreateCommands(i64 noundef %0, i64 noundef %1, ptr noundef %2, ptr nocapture noundef %3, ptr nocapture noundef %4, ptr noundef %5, ptr noundef %6, ptr nocapture noundef %7) local_unnamed_addr #0 {
  %9 = getelementptr inbounds i8, ptr %5, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = zext nneg i32 %10 to i64
  %12 = shl nuw i64 1, %11
  %13 = add i64 %12, -16
  %14 = getelementptr inbounds i8, ptr %2, i64 12
  %15 = load i32, ptr %14, align 4, !tbaa !20
  %16 = getelementptr inbounds i8, ptr %5, i64 96
  %17 = load i64, ptr %16, align 8, !tbaa !21
  %.not56 = icmp eq i32 %15, -1
  br i1 %.not56, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8
  %18 = getelementptr inbounds i8, ptr %5, i64 16
  %19 = load i64, ptr %18, align 8, !tbaa !22
  %20 = add i64 %19, %1
  %21 = getelementptr inbounds i8, ptr %5, i64 56
  %22 = getelementptr inbounds i8, ptr %3, i64 8
  %23 = getelementptr inbounds i8, ptr %3, i64 12
  %24 = getelementptr inbounds i8, ptr %3, i64 4
  br label %25

25:                                               ; preds = %.lr.ph, %58
  %.059 = phi i64 [ 0, %.lr.ph ], [ %61, %58 ]
  %.05358 = phi i32 [ %15, %.lr.ph ], [ %37, %58 ]
  %.05457 = phi i64 [ 0, %.lr.ph ], [ %62, %58 ]
  %26 = zext i32 %.05358 to i64
  %27 = getelementptr %struct.ZopfliNode, ptr %2, i64 %.059
  %28 = getelementptr %struct.ZopfliNode, ptr %27, i64 %26
  %29 = tail call i32 @ZopfliNodeCopyLength(ptr noundef %28)
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds i8, ptr %28, i64 8
  %32 = load i32, ptr %31, align 4, !tbaa !23
  %33 = and i32 %32, 134217727
  %34 = zext nneg i32 %33 to i64
  %35 = add i64 %.059, %34
  %36 = getelementptr inbounds i8, ptr %28, i64 12
  %37 = load i32, ptr %36, align 4, !tbaa !20
  %38 = icmp eq i64 %.05457, 0
  br i1 %38, label %39, label %42

39:                                               ; preds = %25
  %40 = load i64, ptr %4, align 8, !tbaa !25
  %41 = add i64 %40, %34
  store i64 0, ptr %4, align 8, !tbaa !25
  br label %42

42:                                               ; preds = %39, %25
  %.055 = phi i64 [ %41, %39 ], [ %34, %25 ]
  %43 = tail call i32 @ZopfliNodeCopyDistance(ptr noundef %28)
  %44 = zext i32 %43 to i64
  %45 = tail call i32 @ZopfliNodeLengthCode(ptr noundef %28)
  %46 = add i64 %20, %35
  %47 = tail call i64 @brotli_min_size_t(i64 noundef %46, i64 noundef %13)
  %48 = add i64 %47, %17
  %49 = icmp uge i64 %48, %44
  %50 = tail call i32 @ZopfliNodeDistanceCode(ptr noundef %28)
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds %struct.Command, ptr %6, i64 %.05457
  %53 = sub nsw i32 %45, %29
  tail call void @InitCommand(ptr noundef %52, ptr noundef nonnull %21, i64 noundef %.055, i64 noundef %30, i32 noundef %53, i64 noundef %51)
  %54 = icmp ne i32 %50, 0
  %or.cond = and i1 %49, %54
  br i1 %or.cond, label %55, label %58

55:                                               ; preds = %42
  %56 = load i32, ptr %22, align 4, !tbaa !26
  store i32 %56, ptr %23, align 4, !tbaa !26
  %57 = load <2 x i32>, ptr %3, align 4, !tbaa !26
  store <2 x i32> %57, ptr %24, align 4, !tbaa !26
  store i32 %43, ptr %3, align 4, !tbaa !26
  br label %58

58:                                               ; preds = %55, %42
  %59 = load i64, ptr %7, align 8, !tbaa !25
  %60 = add i64 %59, %.055
  store i64 %60, ptr %7, align 8, !tbaa !25
  %61 = add i64 %35, %30
  %62 = add i64 %.05457, 1
  %.not = icmp eq i32 %37, -1
  br i1 %.not, label %._crit_edge, label %25, !llvm.loop !27

._crit_edge:                                      ; preds = %58, %8
  %.0.lcssa = phi i64 [ 0, %8 ], [ %61, %58 ]
  %63 = sub i64 %0, %.0.lcssa
  %64 = load i64, ptr %4, align 8, !tbaa !25
  %65 = add i64 %63, %64
  store i64 %65, ptr %4, align 8, !tbaa !25
  ret void
}

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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" }

!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 8}
!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 = !{!8, !8, i64 0}
!21 = !{!6, !10, i64 96}
!22 = !{!6, !10, i64 16}
!23 = !{!24, !7, i64 8}
!24 = !{!"ZopfliNode", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12}
!25 = !{!10, !10, i64 0}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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