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

; 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"

; Function Attrs: nounwind uwtable
define hidden void @BrotliStoreHuffmanTree(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca [704 x i8], align 16
  %12 = alloca [704 x i8], align 16
  %13 = alloca i64, align 8
  %14 = alloca [18 x i8], align 16
  %15 = alloca [18 x i16], align 16
  %16 = alloca [18 x i32], align 16
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 704, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 704, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store i64 0, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 18, ptr %14) #4
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 18, i1 false)
  call void @llvm.lifetime.start.p0(i64 36, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 72, ptr %16) #4
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 72, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store i64 0, ptr %19, align 8, !tbaa !9
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = load i64, ptr %7, align 8, !tbaa !9
  %22 = getelementptr inbounds [704 x i8], ptr %11, i64 0, i64 0
  %23 = getelementptr inbounds [704 x i8], ptr %12, i64 0, i64 0
  call void @BrotliWriteHuffmanTree(ptr noundef %20, i64 noundef %21, ptr noundef %13, ptr noundef %22, ptr noundef %23)
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %24

24:                                               ; preds = %36, %5
  %25 = load i64, ptr %17, align 8, !tbaa !9
  %26 = load i64, ptr %13, align 8, !tbaa !9
  %27 = icmp ult i64 %25, %26
  br i1 %27, label %28, label %39

28:                                               ; preds = %24
  %29 = load i64, ptr %17, align 8, !tbaa !9
  %30 = getelementptr inbounds [704 x i8], ptr %11, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !13
  %32 = zext i8 %31 to i64
  %33 = getelementptr inbounds [18 x i32], ptr %16, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = add i32 %34, 1
  store i32 %35, ptr %33, align 4, !tbaa !11
  br label %36

36:                                               ; preds = %28
  %37 = load i64, ptr %17, align 8, !tbaa !9
  %38 = add i64 %37, 1
  store i64 %38, ptr %17, align 8, !tbaa !9
  br label %24, !llvm.loop !14

39:                                               ; preds = %24
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %40

40:                                               ; preds = %60, %39
  %41 = load i64, ptr %17, align 8, !tbaa !9
  %42 = icmp ult i64 %41, 18
  br i1 %42, label %43, label %63

43:                                               ; preds = %40
  %44 = load i64, ptr %17, align 8, !tbaa !9
  %45 = getelementptr inbounds [18 x i32], ptr %16, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %59

48:                                               ; preds = %43
  %49 = load i32, ptr %18, align 4, !tbaa !11
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %53

51:                                               ; preds = %48
  %52 = load i64, ptr %17, align 8, !tbaa !9
  store i64 %52, ptr %19, align 8, !tbaa !9
  store i32 1, ptr %18, align 4, !tbaa !11
  br label %58

53:                                               ; preds = %48
  %54 = load i32, ptr %18, align 4, !tbaa !11
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  store i32 2, ptr %18, align 4, !tbaa !11
  br label %63

57:                                               ; preds = %53
  br label %58

58:                                               ; preds = %57, %51
  br label %59

59:                                               ; preds = %58, %43
  br label %60

60:                                               ; preds = %59
  %61 = load i64, ptr %17, align 8, !tbaa !9
  %62 = add i64 %61, 1
  store i64 %62, ptr %17, align 8, !tbaa !9
  br label %40, !llvm.loop !16

63:                                               ; preds = %56, %40
  %64 = getelementptr inbounds [18 x i32], ptr %16, i64 0, i64 0
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds [18 x i8], ptr %14, i64 0, i64 0
  call void @BrotliCreateHuffmanTree(ptr noundef %64, i64 noundef 18, i32 noundef 5, ptr noundef %65, ptr noundef %66)
  %67 = getelementptr inbounds [18 x i8], ptr %14, i64 0, i64 0
  %68 = getelementptr inbounds [18 x i16], ptr %15, i64 0, i64 0
  call void @BrotliConvertBitDepthsToSymbols(ptr noundef %67, i64 noundef 18, ptr noundef %68)
  %69 = load i32, ptr %18, align 4, !tbaa !11
  %70 = getelementptr inbounds [18 x i8], ptr %14, i64 0, i64 0
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  call void @BrotliStoreHuffmanTreeOfHuffmanTreeToBitMask(i32 noundef %69, ptr noundef %70, ptr noundef %71, ptr noundef %72)
  %73 = load i32, ptr %18, align 4, !tbaa !11
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %78

75:                                               ; preds = %63
  %76 = load i64, ptr %19, align 8, !tbaa !9
  %77 = getelementptr inbounds [18 x i8], ptr %14, i64 0, i64 %76
  store i8 0, ptr %77, align 1, !tbaa !13
  br label %78

78:                                               ; preds = %75, %63
  %79 = load i64, ptr %13, align 8, !tbaa !9
  %80 = getelementptr inbounds [704 x i8], ptr %11, i64 0, i64 0
  %81 = getelementptr inbounds [704 x i8], ptr %12, i64 0, i64 0
  %82 = getelementptr inbounds [18 x i8], ptr %14, i64 0, i64 0
  %83 = getelementptr inbounds [18 x i16], ptr %15, i64 0, i64 0
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  call void @BrotliStoreHuffmanTreeToBitMask(i64 noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef %82, ptr noundef %83, ptr noundef %84, ptr noundef %85)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 18, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 704, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 704, ptr %11) #4
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare hidden void @BrotliWriteHuffmanTree(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare hidden void @BrotliCreateHuffmanTree(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #3

declare hidden void @BrotliConvertBitDepthsToSymbols(ptr noundef, i64 noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden void @BrotliStoreHuffmanTreeToBitMask(i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noalias noundef, ptr noalias noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

; Function Attrs: nounwind uwtable
define hidden void @BrotliStoreHuffmanTree(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca [704 x i8], align 16
  %7 = alloca [704 x i8], align 16
  %8 = alloca i64, align 8
  %9 = alloca [18 x i8], align 16
  %10 = alloca [18 x i16], align 16
  %11 = alloca [18 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 704, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 704, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 18, ptr nonnull %9) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(18) %9, i8 0, i64 18, i1 false)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %11) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(72) %11, i8 0, i64 72, i1 false)
  call void @BrotliWriteHuffmanTree(ptr noundef %0, i64 noundef %1, ptr noundef nonnull %8, ptr noundef nonnull %6, ptr noundef nonnull %7) #4
  %12 = load i64, ptr %8, align 8, !tbaa !5
  %.not26 = icmp eq i64 %12, 0
  br i1 %.not26, label %.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %5
  %xtraiter = and i64 %12, 3
  %13 = icmp ult i64 %12, 4
  br i1 %13, label %.preheader.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %12, -4
  br label %.lr.ph

.preheader.unr-lcssa:                             ; preds = %.lr.ph, %.lr.ph.preheader
  %.02022.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %51, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader.unr-lcssa, %.lr.ph.epil
  %.02022.epil = phi i64 [ %20, %.lr.ph.epil ], [ %.02022.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader.unr-lcssa ]
  %14 = getelementptr inbounds [704 x i8], ptr %6, i64 0, i64 %.02022.epil
  %15 = load i8, ptr %14, align 1, !tbaa !9
  %16 = zext i8 %15 to i64
  %17 = getelementptr inbounds [18 x i32], ptr %11, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !10
  %19 = add i32 %18, 1
  store i32 %19, ptr %17, align 4, !tbaa !10
  %20 = add nuw i64 %.02022.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader, label %.lr.ph.epil, !llvm.loop !12

.preheader:                                       ; preds = %.lr.ph.epil, %.preheader.unr-lcssa
  %.pre = load i32, ptr %11, align 16, !tbaa !10
  %.not = icmp eq i32 %.pre, 0
  %21 = getelementptr inbounds i8, ptr %11, i64 4
  %22 = load i32, ptr %21, align 4, !tbaa !10
  %.not.1 = icmp eq i32 %22, 0
  %brmerge = select i1 %.not.1, i1 true, i1 %.not
  %23 = select i1 %.not.1, i1 %.not, i1 false
  %narrow = xor i1 %23, true
  %spec.select.mux = zext i1 %narrow to i32
  %not..not.1 = xor i1 %.not.1, true
  %.mux = zext i1 %not..not.1 to i64
  br i1 %brmerge, label %.thread34, label %.thread177

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.02022 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %51, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %24 = getelementptr inbounds [704 x i8], ptr %6, i64 0, i64 %.02022
  %25 = load i8, ptr %24, align 4, !tbaa !9
  %26 = zext i8 %25 to i64
  %27 = getelementptr inbounds [18 x i32], ptr %11, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !10
  %29 = add i32 %28, 1
  store i32 %29, ptr %27, align 4, !tbaa !10
  %30 = or disjoint i64 %.02022, 1
  %31 = getelementptr inbounds [704 x i8], ptr %6, i64 0, i64 %30
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = zext i8 %32 to i64
  %34 = getelementptr inbounds [18 x i32], ptr %11, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !10
  %36 = add i32 %35, 1
  store i32 %36, ptr %34, align 4, !tbaa !10
  %37 = or disjoint i64 %.02022, 2
  %38 = getelementptr inbounds [704 x i8], ptr %6, i64 0, i64 %37
  %39 = load i8, ptr %38, align 2, !tbaa !9
  %40 = zext i8 %39 to i64
  %41 = getelementptr inbounds [18 x i32], ptr %11, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !10
  %43 = add i32 %42, 1
  store i32 %43, ptr %41, align 4, !tbaa !10
  %44 = or disjoint i64 %.02022, 3
  %45 = getelementptr inbounds [704 x i8], ptr %6, i64 0, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !9
  %47 = zext i8 %46 to i64
  %48 = getelementptr inbounds [18 x i32], ptr %11, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !10
  %50 = add i32 %49, 1
  store i32 %50, ptr %48, align 4, !tbaa !10
  %51 = add nuw i64 %.02022, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.unr-lcssa, label %.lr.ph, !llvm.loop !14

.thread:                                          ; preds = %5
  %52 = getelementptr inbounds i8, ptr %11, i64 4
  %53 = load i32, ptr %52, align 4, !tbaa !10
  %.not.132 = icmp eq i32 %53, 0
  br i1 %.not.132, label %.thread36, label %.thread34

.thread34:                                        ; preds = %.preheader, %.thread
  %.119.1 = phi i32 [ %spec.select.mux, %.preheader ], [ 1, %.thread ]
  %.1.1 = phi i64 [ %.mux, %.preheader ], [ 1, %.thread ]
  %54 = getelementptr inbounds i8, ptr %11, i64 8
  %55 = load i32, ptr %54, align 8, !tbaa !10
  %.not.2 = icmp eq i32 %55, 0
  br i1 %.not.2, label %.thread42, label %58

.thread36:                                        ; preds = %.thread
  %56 = getelementptr inbounds i8, ptr %11, i64 8
  %57 = load i32, ptr %56, align 8, !tbaa !10
  %.not.239 = icmp eq i32 %57, 0
  br i1 %.not.239, label %.thread45, label %.thread42

58:                                               ; preds = %.thread34
  %59 = icmp eq i32 %.119.1, 0
  br i1 %59, label %.thread42, label %.thread177

.thread42:                                        ; preds = %.thread36, %58, %.thread34
  %.119.2 = phi i32 [ %.119.1, %.thread34 ], [ 1, %58 ], [ 1, %.thread36 ]
  %.1.2 = phi i64 [ %.1.1, %.thread34 ], [ 2, %58 ], [ 2, %.thread36 ]
  %60 = getelementptr inbounds i8, ptr %11, i64 12
  %61 = load i32, ptr %60, align 4, !tbaa !10
  %.not.3 = icmp eq i32 %61, 0
  br i1 %.not.3, label %.thread51, label %64

.thread45:                                        ; preds = %.thread36
  %62 = getelementptr inbounds i8, ptr %11, i64 12
  %63 = load i32, ptr %62, align 4, !tbaa !10
  %.not.348 = icmp eq i32 %63, 0
  br i1 %.not.348, label %.thread54, label %.thread51

64:                                               ; preds = %.thread42
  %65 = icmp eq i32 %.119.2, 0
  br i1 %65, label %.thread51, label %.thread177

.thread51:                                        ; preds = %.thread45, %64, %.thread42
  %.119.3 = phi i32 [ %.119.2, %.thread42 ], [ 1, %64 ], [ 1, %.thread45 ]
  %.1.3 = phi i64 [ %.1.2, %.thread42 ], [ 3, %64 ], [ 3, %.thread45 ]
  %66 = getelementptr inbounds i8, ptr %11, i64 16
  %67 = load i32, ptr %66, align 16, !tbaa !10
  %.not.4 = icmp eq i32 %67, 0
  br i1 %.not.4, label %.thread60, label %70

.thread54:                                        ; preds = %.thread45
  %68 = getelementptr inbounds i8, ptr %11, i64 16
  %69 = load i32, ptr %68, align 16, !tbaa !10
  %.not.457 = icmp eq i32 %69, 0
  br i1 %.not.457, label %.thread63, label %.thread60

70:                                               ; preds = %.thread51
  %71 = icmp eq i32 %.119.3, 0
  br i1 %71, label %.thread60, label %.thread177

.thread60:                                        ; preds = %.thread54, %70, %.thread51
  %.119.4 = phi i32 [ %.119.3, %.thread51 ], [ 1, %70 ], [ 1, %.thread54 ]
  %.1.4 = phi i64 [ %.1.3, %.thread51 ], [ 4, %70 ], [ 4, %.thread54 ]
  %72 = getelementptr inbounds i8, ptr %11, i64 20
  %73 = load i32, ptr %72, align 4, !tbaa !10
  %.not.5 = icmp eq i32 %73, 0
  br i1 %.not.5, label %.thread69, label %76

.thread63:                                        ; preds = %.thread54
  %74 = getelementptr inbounds i8, ptr %11, i64 20
  %75 = load i32, ptr %74, align 4, !tbaa !10
  %.not.566 = icmp eq i32 %75, 0
  br i1 %.not.566, label %.thread72, label %.thread69

76:                                               ; preds = %.thread60
  %77 = icmp eq i32 %.119.4, 0
  br i1 %77, label %.thread69, label %.thread177

.thread69:                                        ; preds = %.thread63, %76, %.thread60
  %.119.5 = phi i32 [ %.119.4, %.thread60 ], [ 1, %76 ], [ 1, %.thread63 ]
  %.1.5 = phi i64 [ %.1.4, %.thread60 ], [ 5, %76 ], [ 5, %.thread63 ]
  %78 = getelementptr inbounds i8, ptr %11, i64 24
  %79 = load i32, ptr %78, align 8, !tbaa !10
  %.not.6 = icmp eq i32 %79, 0
  br i1 %.not.6, label %.thread78, label %82

.thread72:                                        ; preds = %.thread63
  %80 = getelementptr inbounds i8, ptr %11, i64 24
  %81 = load i32, ptr %80, align 8, !tbaa !10
  %.not.675 = icmp eq i32 %81, 0
  br i1 %.not.675, label %.thread81, label %.thread78

82:                                               ; preds = %.thread69
  %83 = icmp eq i32 %.119.5, 0
  br i1 %83, label %.thread78, label %.thread177

.thread78:                                        ; preds = %.thread72, %82, %.thread69
  %.119.6 = phi i32 [ %.119.5, %.thread69 ], [ 1, %82 ], [ 1, %.thread72 ]
  %.1.6 = phi i64 [ %.1.5, %.thread69 ], [ 6, %82 ], [ 6, %.thread72 ]
  %84 = getelementptr inbounds i8, ptr %11, i64 28
  %85 = load i32, ptr %84, align 4, !tbaa !10
  %.not.7 = icmp eq i32 %85, 0
  br i1 %.not.7, label %.thread87, label %88

.thread81:                                        ; preds = %.thread72
  %86 = getelementptr inbounds i8, ptr %11, i64 28
  %87 = load i32, ptr %86, align 4, !tbaa !10
  %.not.784 = icmp eq i32 %87, 0
  br i1 %.not.784, label %.thread90, label %.thread87

88:                                               ; preds = %.thread78
  %89 = icmp eq i32 %.119.6, 0
  br i1 %89, label %.thread87, label %.thread177

.thread87:                                        ; preds = %.thread81, %88, %.thread78
  %.119.7 = phi i32 [ %.119.6, %.thread78 ], [ 1, %88 ], [ 1, %.thread81 ]
  %.1.7 = phi i64 [ %.1.6, %.thread78 ], [ 7, %88 ], [ 7, %.thread81 ]
  %90 = getelementptr inbounds i8, ptr %11, i64 32
  %91 = load i32, ptr %90, align 16, !tbaa !10
  %.not.8 = icmp eq i32 %91, 0
  br i1 %.not.8, label %.thread96, label %94

.thread90:                                        ; preds = %.thread81
  %92 = getelementptr inbounds i8, ptr %11, i64 32
  %93 = load i32, ptr %92, align 16, !tbaa !10
  %.not.893 = icmp eq i32 %93, 0
  br i1 %.not.893, label %.thread99, label %.thread96

94:                                               ; preds = %.thread87
  %95 = icmp eq i32 %.119.7, 0
  br i1 %95, label %.thread96, label %.thread177

.thread96:                                        ; preds = %.thread90, %94, %.thread87
  %.119.8 = phi i32 [ %.119.7, %.thread87 ], [ 1, %94 ], [ 1, %.thread90 ]
  %.1.8 = phi i64 [ %.1.7, %.thread87 ], [ 8, %94 ], [ 8, %.thread90 ]
  %96 = getelementptr inbounds i8, ptr %11, i64 36
  %97 = load i32, ptr %96, align 4, !tbaa !10
  %.not.9 = icmp eq i32 %97, 0
  br i1 %.not.9, label %.thread105, label %100

.thread99:                                        ; preds = %.thread90
  %98 = getelementptr inbounds i8, ptr %11, i64 36
  %99 = load i32, ptr %98, align 4, !tbaa !10
  %.not.9102 = icmp eq i32 %99, 0
  br i1 %.not.9102, label %.thread108, label %.thread105

100:                                              ; preds = %.thread96
  %101 = icmp eq i32 %.119.8, 0
  br i1 %101, label %.thread105, label %.thread177

.thread105:                                       ; preds = %.thread99, %100, %.thread96
  %.119.9 = phi i32 [ %.119.8, %.thread96 ], [ 1, %100 ], [ 1, %.thread99 ]
  %.1.9 = phi i64 [ %.1.8, %.thread96 ], [ 9, %100 ], [ 9, %.thread99 ]
  %102 = getelementptr inbounds i8, ptr %11, i64 40
  %103 = load i32, ptr %102, align 8, !tbaa !10
  %.not.10 = icmp eq i32 %103, 0
  br i1 %.not.10, label %.thread114, label %106

.thread108:                                       ; preds = %.thread99
  %104 = getelementptr inbounds i8, ptr %11, i64 40
  %105 = load i32, ptr %104, align 8, !tbaa !10
  %.not.10111 = icmp eq i32 %105, 0
  br i1 %.not.10111, label %.thread117, label %.thread114

106:                                              ; preds = %.thread105
  %107 = icmp eq i32 %.119.9, 0
  br i1 %107, label %.thread114, label %.thread177

.thread114:                                       ; preds = %.thread108, %106, %.thread105
  %.119.10 = phi i32 [ %.119.9, %.thread105 ], [ 1, %106 ], [ 1, %.thread108 ]
  %.1.10 = phi i64 [ %.1.9, %.thread105 ], [ 10, %106 ], [ 10, %.thread108 ]
  %108 = getelementptr inbounds i8, ptr %11, i64 44
  %109 = load i32, ptr %108, align 4, !tbaa !10
  %.not.11 = icmp eq i32 %109, 0
  br i1 %.not.11, label %.thread123, label %112

.thread117:                                       ; preds = %.thread108
  %110 = getelementptr inbounds i8, ptr %11, i64 44
  %111 = load i32, ptr %110, align 4, !tbaa !10
  %.not.11120 = icmp eq i32 %111, 0
  br i1 %.not.11120, label %.thread126, label %.thread123

112:                                              ; preds = %.thread114
  %113 = icmp eq i32 %.119.10, 0
  br i1 %113, label %.thread123, label %.thread177

.thread123:                                       ; preds = %.thread117, %112, %.thread114
  %.119.11 = phi i32 [ %.119.10, %.thread114 ], [ 1, %112 ], [ 1, %.thread117 ]
  %.1.11 = phi i64 [ %.1.10, %.thread114 ], [ 11, %112 ], [ 11, %.thread117 ]
  %114 = getelementptr inbounds i8, ptr %11, i64 48
  %115 = load i32, ptr %114, align 16, !tbaa !10
  %.not.12 = icmp eq i32 %115, 0
  br i1 %.not.12, label %.thread132, label %118

.thread126:                                       ; preds = %.thread117
  %116 = getelementptr inbounds i8, ptr %11, i64 48
  %117 = load i32, ptr %116, align 16, !tbaa !10
  %.not.12129 = icmp eq i32 %117, 0
  br i1 %.not.12129, label %.thread135, label %.thread132

118:                                              ; preds = %.thread123
  %119 = icmp eq i32 %.119.11, 0
  br i1 %119, label %.thread132, label %.thread177

.thread132:                                       ; preds = %.thread126, %118, %.thread123
  %.119.12 = phi i32 [ %.119.11, %.thread123 ], [ 1, %118 ], [ 1, %.thread126 ]
  %.1.12 = phi i64 [ %.1.11, %.thread123 ], [ 12, %118 ], [ 12, %.thread126 ]
  %120 = getelementptr inbounds i8, ptr %11, i64 52
  %121 = load i32, ptr %120, align 4, !tbaa !10
  %.not.13 = icmp eq i32 %121, 0
  br i1 %.not.13, label %.thread141, label %124

.thread135:                                       ; preds = %.thread126
  %122 = getelementptr inbounds i8, ptr %11, i64 52
  %123 = load i32, ptr %122, align 4, !tbaa !10
  %.not.13138 = icmp eq i32 %123, 0
  br i1 %.not.13138, label %.thread144, label %.thread141

124:                                              ; preds = %.thread132
  %125 = icmp eq i32 %.119.12, 0
  br i1 %125, label %.thread141, label %.thread177

.thread141:                                       ; preds = %.thread135, %124, %.thread132
  %.119.13 = phi i32 [ %.119.12, %.thread132 ], [ 1, %124 ], [ 1, %.thread135 ]
  %.1.13 = phi i64 [ %.1.12, %.thread132 ], [ 13, %124 ], [ 13, %.thread135 ]
  %126 = getelementptr inbounds i8, ptr %11, i64 56
  %127 = load i32, ptr %126, align 8, !tbaa !10
  %.not.14 = icmp eq i32 %127, 0
  br i1 %.not.14, label %.thread150, label %130

.thread144:                                       ; preds = %.thread135
  %128 = getelementptr inbounds i8, ptr %11, i64 56
  %129 = load i32, ptr %128, align 8, !tbaa !10
  %.not.14147 = icmp eq i32 %129, 0
  br i1 %.not.14147, label %.thread153, label %.thread150

130:                                              ; preds = %.thread141
  %131 = icmp eq i32 %.119.13, 0
  br i1 %131, label %.thread150, label %.thread177

.thread150:                                       ; preds = %.thread144, %130, %.thread141
  %.119.14 = phi i32 [ %.119.13, %.thread141 ], [ 1, %130 ], [ 1, %.thread144 ]
  %.1.14 = phi i64 [ %.1.13, %.thread141 ], [ 14, %130 ], [ 14, %.thread144 ]
  %132 = getelementptr inbounds i8, ptr %11, i64 60
  %133 = load i32, ptr %132, align 4, !tbaa !10
  %.not.15 = icmp eq i32 %133, 0
  br i1 %.not.15, label %.thread159, label %136

.thread153:                                       ; preds = %.thread144
  %134 = getelementptr inbounds i8, ptr %11, i64 60
  %135 = load i32, ptr %134, align 4, !tbaa !10
  %.not.15156 = icmp eq i32 %135, 0
  br i1 %.not.15156, label %.thread162, label %.thread159

136:                                              ; preds = %.thread150
  %137 = icmp eq i32 %.119.14, 0
  br i1 %137, label %.thread159, label %.thread177

.thread159:                                       ; preds = %.thread153, %136, %.thread150
  %.119.15 = phi i32 [ %.119.14, %.thread150 ], [ 1, %136 ], [ 1, %.thread153 ]
  %.1.15 = phi i64 [ %.1.14, %.thread150 ], [ 15, %136 ], [ 15, %.thread153 ]
  %138 = getelementptr inbounds i8, ptr %11, i64 64
  %139 = load i32, ptr %138, align 16, !tbaa !10
  %.not.16 = icmp eq i32 %139, 0
  br i1 %.not.16, label %.thread168, label %142

.thread162:                                       ; preds = %.thread153
  %140 = getelementptr inbounds i8, ptr %11, i64 64
  %141 = load i32, ptr %140, align 16, !tbaa !10
  %.not.16165 = icmp eq i32 %141, 0
  br i1 %.not.16165, label %.thread171, label %.thread168

142:                                              ; preds = %.thread159
  %143 = icmp eq i32 %.119.15, 0
  br i1 %143, label %.thread168, label %.thread177

.thread168:                                       ; preds = %.thread162, %142, %.thread159
  %.119.16 = phi i32 [ %.119.15, %.thread159 ], [ 1, %142 ], [ 1, %.thread162 ]
  %.1.16 = phi i64 [ %.1.15, %.thread159 ], [ 16, %142 ], [ 16, %.thread162 ]
  %144 = getelementptr inbounds i8, ptr %11, i64 68
  %145 = load i32, ptr %144, align 4, !tbaa !10
  %.not.17 = icmp eq i32 %145, 0
  br i1 %.not.17, label %.thread177, label %148

.thread171:                                       ; preds = %.thread162
  %146 = getelementptr inbounds i8, ptr %11, i64 68
  %147 = load i32, ptr %146, align 4, !tbaa !10
  %.not.17174 = icmp ne i32 %147, 0
  %spec.select180 = select i1 %.not.17174, i64 17, i64 0
  %spec.select181 = zext i1 %.not.17174 to i32
  br label %.thread177

148:                                              ; preds = %.thread168
  %149 = icmp eq i32 %.119.16, 0
  %spec.select182 = select i1 %149, i64 17, i64 %.1.16
  %spec.select183 = select i1 %149, i32 1, i32 2
  br label %.thread177

.thread177:                                       ; preds = %148, %.thread171, %.preheader, %.thread168, %142, %136, %130, %124, %118, %112, %106, %100, %94, %88, %82, %76, %70, %64, %58
  %.0.lcssa = phi i64 [ %.1.1, %58 ], [ %.1.2, %64 ], [ %.1.3, %70 ], [ %.1.4, %76 ], [ %.1.5, %82 ], [ %.1.6, %88 ], [ %.1.7, %94 ], [ %.1.8, %100 ], [ %.1.9, %106 ], [ %.1.10, %112 ], [ %.1.11, %118 ], [ %.1.12, %124 ], [ %.1.13, %130 ], [ %.1.14, %136 ], [ %.1.15, %142 ], [ %.1.16, %.thread168 ], [ 0, %.preheader ], [ %spec.select180, %.thread171 ], [ %spec.select182, %148 ]
  %.2 = phi i32 [ 2, %58 ], [ 2, %64 ], [ 2, %70 ], [ 2, %76 ], [ 2, %82 ], [ 2, %88 ], [ 2, %94 ], [ 2, %100 ], [ 2, %106 ], [ 2, %112 ], [ 2, %118 ], [ 2, %124 ], [ 2, %130 ], [ 2, %136 ], [ 2, %142 ], [ %.119.16, %.thread168 ], [ 2, %.preheader ], [ %spec.select181, %.thread171 ], [ %spec.select183, %148 ]
  call void @BrotliCreateHuffmanTree(ptr noundef nonnull %11, i64 noundef 18, i32 noundef 5, ptr noundef %2, ptr noundef nonnull %9) #4
  call void @BrotliConvertBitDepthsToSymbols(ptr noundef nonnull %9, i64 noundef 18, ptr noundef nonnull %10) #4
  call void @BrotliStoreHuffmanTreeOfHuffmanTreeToBitMask(i32 noundef %.2, ptr noundef nonnull %9, ptr noundef %3, ptr noundef %4)
  %150 = icmp eq i32 %.2, 1
  br i1 %150, label %151, label %153

151:                                              ; preds = %.thread177
  %152 = getelementptr inbounds [18 x i8], ptr %9, i64 0, i64 %.0.lcssa
  store i8 0, ptr %152, align 1, !tbaa !9
  br label %153

153:                                              ; preds = %151, %.thread177
  %154 = load i64, ptr %8, align 8, !tbaa !5
  call void @BrotliStoreHuffmanTreeToBitMask(i64 noundef %154, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 18, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 704, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 704, ptr nonnull %6) #4
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

declare hidden void @BrotliCreateHuffmanTree(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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