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

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

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

; Function Attrs: nounwind uwtable
define hidden void @BrotliSplitBlock(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #1 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, 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 ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca ptr, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  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 i64 %5, ptr %16, align 8, !tbaa !9
  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) #4
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = load i64, ptr %13, align 8, !tbaa !9
  %31 = call i64 @CountLiterals(ptr noundef %29, i64 noundef %30)
  store i64 %31, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %32 = load i64, ptr %21, align 8, !tbaa !9
  %33 = icmp ugt i64 %32, 0
  br i1 %33, label %34, label %39

34:                                               ; preds = %10
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = load i64, ptr %21, align 8, !tbaa !9
  %37 = mul i64 %36, 1
  %38 = call ptr @BrotliAllocate(ptr noundef %35, i64 noundef %37)
  br label %40

39:                                               ; preds = %10
  br label %40

40:                                               ; preds = %39, %34
  %41 = phi ptr [ %38, %34 ], [ null, %39 ]
  store ptr %41, ptr %22, align 8, !tbaa !5
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = load i64, ptr %13, align 8, !tbaa !9
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  %45 = load i64, ptr %15, align 8, !tbaa !9
  %46 = load i64, ptr %16, align 8, !tbaa !9
  %47 = load ptr, ptr %22, align 8, !tbaa !5
  call void @CopyLiteralsToByteArray(ptr noundef %42, i64 noundef %43, ptr noundef %44, i64 noundef %45, i64 noundef %46, ptr noundef %47)
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = load ptr, ptr %22, align 8, !tbaa !5
  %50 = load i64, ptr %21, align 8, !tbaa !9
  %51 = load ptr, ptr %17, align 8, !tbaa !5
  %52 = load ptr, ptr %18, align 8, !tbaa !5
  call void @SplitByteVectorLiteral(ptr noundef %48, ptr noundef %49, i64 noundef %50, i64 noundef 544, i64 noundef 100, i64 noundef 70, double noundef 2.810000e+01, ptr noundef %51, ptr noundef %52)
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load ptr, ptr %22, align 8, !tbaa !5
  call void @BrotliFree(ptr noundef %53, ptr noundef %54)
  store ptr null, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %55 = load i64, ptr %13, align 8, !tbaa !9
  %56 = icmp ugt i64 %55, 0
  br i1 %56, label %57, label %62

57:                                               ; preds = %40
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load i64, ptr %13, align 8, !tbaa !9
  %60 = mul i64 %59, 2
  %61 = call ptr @BrotliAllocate(ptr noundef %58, i64 noundef %60)
  br label %63

62:                                               ; preds = %40
  br label %63

63:                                               ; preds = %62, %57
  %64 = phi ptr [ %61, %57 ], [ null, %62 ]
  store ptr %64, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  store i64 0, ptr %24, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %78, %63
  %66 = load i64, ptr %24, align 8, !tbaa !9
  %67 = load i64, ptr %13, align 8, !tbaa !9
  %68 = icmp ult i64 %66, %67
  br i1 %68, label %69, label %81

69:                                               ; preds = %65
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = load i64, ptr %24, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.Command, ptr %70, i64 %71
  %73 = getelementptr inbounds %struct.Command, ptr %72, i32 0, i32 3
  %74 = load i16, ptr %73, align 4, !tbaa !11
  %75 = load ptr, ptr %23, align 8, !tbaa !5
  %76 = load i64, ptr %24, align 8, !tbaa !9
  %77 = getelementptr inbounds i16, ptr %75, i64 %76
  store i16 %74, ptr %77, align 2, !tbaa !15
  br label %78

78:                                               ; preds = %69
  %79 = load i64, ptr %24, align 8, !tbaa !9
  %80 = add i64 %79, 1
  store i64 %80, ptr %24, align 8, !tbaa !9
  br label %65, !llvm.loop !16

81:                                               ; preds = %65
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = load ptr, ptr %23, align 8, !tbaa !5
  %84 = load i64, ptr %13, align 8, !tbaa !9
  %85 = load ptr, ptr %17, align 8, !tbaa !5
  %86 = load ptr, ptr %19, align 8, !tbaa !5
  call void @SplitByteVectorCommand(ptr noundef %82, ptr noundef %83, i64 noundef %84, i64 noundef 530, i64 noundef 50, i64 noundef 40, double noundef 1.350000e+01, ptr noundef %85, ptr noundef %86)
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = load ptr, ptr %23, align 8, !tbaa !5
  call void @BrotliFree(ptr noundef %87, ptr noundef %88)
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %89 = load i64, ptr %13, align 8, !tbaa !9
  %90 = icmp ugt i64 %89, 0
  br i1 %90, label %91, label %96

91:                                               ; preds = %81
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = load i64, ptr %13, align 8, !tbaa !9
  %94 = mul i64 %93, 2
  %95 = call ptr @BrotliAllocate(ptr noundef %92, i64 noundef %94)
  br label %97

96:                                               ; preds = %81
  br label %97

97:                                               ; preds = %96, %91
  %98 = phi ptr [ %95, %91 ], [ null, %96 ]
  store ptr %98, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  store i64 0, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  store i64 0, ptr %27, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %125, %97
  %100 = load i64, ptr %27, align 8, !tbaa !9
  %101 = load i64, ptr %13, align 8, !tbaa !9
  %102 = icmp ult i64 %100, %101
  br i1 %102, label %103, label %128

103:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = load i64, ptr %27, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct.Command, ptr %104, i64 %105
  store ptr %106, ptr %28, align 8, !tbaa !5
  %107 = load ptr, ptr %28, align 8, !tbaa !5
  %108 = call i32 @CommandCopyLen(ptr noundef %107)
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %124

110:                                              ; preds = %103
  %111 = load ptr, ptr %28, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.Command, ptr %111, i32 0, i32 3
  %113 = load i16, ptr %112, align 4, !tbaa !11
  %114 = zext i16 %113 to i32
  %115 = icmp sge i32 %114, 128
  br i1 %115, label %116, label %124

116:                                              ; preds = %110
  %117 = load ptr, ptr %28, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.Command, ptr %117, i32 0, i32 4
  %119 = load i16, ptr %118, align 2, !tbaa !18
  %120 = load ptr, ptr %25, align 8, !tbaa !5
  %121 = load i64, ptr %26, align 8, !tbaa !9
  %122 = add i64 %121, 1
  store i64 %122, ptr %26, align 8, !tbaa !9
  %123 = getelementptr inbounds i16, ptr %120, i64 %121
  store i16 %119, ptr %123, align 2, !tbaa !15
  br label %124

124:                                              ; preds = %116, %110, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  br label %125

125:                                              ; preds = %124
  %126 = load i64, ptr %27, align 8, !tbaa !9
  %127 = add i64 %126, 1
  store i64 %127, ptr %27, align 8, !tbaa !9
  br label %99, !llvm.loop !19

128:                                              ; preds = %99
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = load ptr, ptr %25, align 8, !tbaa !5
  %131 = load i64, ptr %26, align 8, !tbaa !9
  %132 = load ptr, ptr %17, align 8, !tbaa !5
  %133 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SplitByteVectorDistance(ptr noundef %129, ptr noundef %130, i64 noundef %131, i64 noundef 544, i64 noundef 50, i64 noundef 40, double noundef 1.460000e+01, ptr noundef %132, ptr noundef %133)
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = load ptr, ptr %25, align 8, !tbaa !5
  call void @BrotliFree(ptr noundef %134, ptr noundef %135)
  store ptr null, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  ret void
}

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

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

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

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

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

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

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

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

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

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


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

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

; Function Attrs: nounwind uwtable
define hidden void @BrotliSplitBlock(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #1 {
  %11 = tail call i64 @CountLiterals(ptr noundef %1, i64 noundef %2)
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %14, label %12

12:                                               ; preds = %10
  %13 = tail call ptr @BrotliAllocate(ptr noundef %0, i64 noundef %11) #3
  br label %14

14:                                               ; preds = %10, %12
  %15 = phi ptr [ %13, %12 ], [ null, %10 ]
  tail call void @CopyLiteralsToByteArray(ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %15)
  tail call void @SplitByteVectorLiteral(ptr noundef %0, ptr noundef %15, i64 noundef %11, i64 noundef 544, i64 noundef 100, i64 noundef 70, double noundef 2.810000e+01, ptr noundef %6, ptr noundef %7)
  tail call void @BrotliFree(ptr noundef %0, ptr noundef %15) #3
  %.not59 = icmp eq i64 %2, 0
  br i1 %.not59, label %._crit_edge66.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %14
  %16 = shl i64 %2, 1
  %17 = tail call ptr @BrotliAllocate(ptr noundef %0, i64 noundef %16) #3
  %min.iters.check = icmp ult i64 %2, 16
  br i1 %min.iters.check, label %.lr.ph.preheader73, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph.preheader
  %18 = shl i64 %2, 1
  %scevgep = getelementptr i8, ptr %17, i64 %18
  %scevgep71 = getelementptr i8, ptr %1, i64 12
  %19 = shl i64 %2, 4
  %20 = getelementptr i8, ptr %1, i64 %19
  %scevgep72 = getelementptr i8, ptr %20, i64 -2
  %bound0 = icmp ult ptr %17, %scevgep72
  %bound1 = icmp ult ptr %scevgep71, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph.preheader73, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %2, -16
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %21 = or disjoint i64 %index, 1
  %22 = or disjoint i64 %index, 2
  %23 = or disjoint i64 %index, 3
  %24 = or disjoint i64 %index, 4
  %25 = or disjoint i64 %index, 5
  %26 = or disjoint i64 %index, 6
  %27 = or disjoint i64 %index, 7
  %28 = or disjoint i64 %index, 8
  %29 = or disjoint i64 %index, 9
  %30 = or disjoint i64 %index, 10
  %31 = or disjoint i64 %index, 11
  %32 = or disjoint i64 %index, 12
  %33 = or disjoint i64 %index, 13
  %34 = or disjoint i64 %index, 14
  %35 = or disjoint i64 %index, 15
  %36 = getelementptr inbounds %struct.Command, ptr %1, i64 %index, i32 3
  %37 = getelementptr inbounds %struct.Command, ptr %1, i64 %21, i32 3
  %38 = getelementptr inbounds %struct.Command, ptr %1, i64 %22, i32 3
  %39 = getelementptr inbounds %struct.Command, ptr %1, i64 %23, i32 3
  %40 = getelementptr inbounds %struct.Command, ptr %1, i64 %24, i32 3
  %41 = getelementptr inbounds %struct.Command, ptr %1, i64 %25, i32 3
  %42 = getelementptr inbounds %struct.Command, ptr %1, i64 %26, i32 3
  %43 = getelementptr inbounds %struct.Command, ptr %1, i64 %27, i32 3
  %44 = getelementptr inbounds %struct.Command, ptr %1, i64 %28, i32 3
  %45 = getelementptr inbounds %struct.Command, ptr %1, i64 %29, i32 3
  %46 = getelementptr inbounds %struct.Command, ptr %1, i64 %30, i32 3
  %47 = getelementptr inbounds %struct.Command, ptr %1, i64 %31, i32 3
  %48 = getelementptr inbounds %struct.Command, ptr %1, i64 %32, i32 3
  %49 = getelementptr inbounds %struct.Command, ptr %1, i64 %33, i32 3
  %50 = getelementptr inbounds %struct.Command, ptr %1, i64 %34, i32 3
  %51 = getelementptr inbounds %struct.Command, ptr %1, i64 %35, i32 3
  %52 = load i16, ptr %36, align 4, !tbaa !5, !alias.scope !11
  %53 = load i16, ptr %37, align 4, !tbaa !5, !alias.scope !11
  %54 = load i16, ptr %38, align 4, !tbaa !5, !alias.scope !11
  %55 = load i16, ptr %39, align 4, !tbaa !5, !alias.scope !11
  %56 = load i16, ptr %40, align 4, !tbaa !5, !alias.scope !11
  %57 = load i16, ptr %41, align 4, !tbaa !5, !alias.scope !11
  %58 = load i16, ptr %42, align 4, !tbaa !5, !alias.scope !11
  %59 = load i16, ptr %43, align 4, !tbaa !5, !alias.scope !11
  %60 = insertelement <8 x i16> poison, i16 %52, i64 0
  %61 = insertelement <8 x i16> %60, i16 %53, i64 1
  %62 = insertelement <8 x i16> %61, i16 %54, i64 2
  %63 = insertelement <8 x i16> %62, i16 %55, i64 3
  %64 = insertelement <8 x i16> %63, i16 %56, i64 4
  %65 = insertelement <8 x i16> %64, i16 %57, i64 5
  %66 = insertelement <8 x i16> %65, i16 %58, i64 6
  %67 = insertelement <8 x i16> %66, i16 %59, i64 7
  %68 = load i16, ptr %44, align 4, !tbaa !5, !alias.scope !11
  %69 = load i16, ptr %45, align 4, !tbaa !5, !alias.scope !11
  %70 = load i16, ptr %46, align 4, !tbaa !5, !alias.scope !11
  %71 = load i16, ptr %47, align 4, !tbaa !5, !alias.scope !11
  %72 = load i16, ptr %48, align 4, !tbaa !5, !alias.scope !11
  %73 = load i16, ptr %49, align 4, !tbaa !5, !alias.scope !11
  %74 = load i16, ptr %50, align 4, !tbaa !5, !alias.scope !11
  %75 = load i16, ptr %51, align 4, !tbaa !5, !alias.scope !11
  %76 = insertelement <8 x i16> poison, i16 %68, i64 0
  %77 = insertelement <8 x i16> %76, i16 %69, i64 1
  %78 = insertelement <8 x i16> %77, i16 %70, i64 2
  %79 = insertelement <8 x i16> %78, i16 %71, i64 3
  %80 = insertelement <8 x i16> %79, i16 %72, i64 4
  %81 = insertelement <8 x i16> %80, i16 %73, i64 5
  %82 = insertelement <8 x i16> %81, i16 %74, i64 6
  %83 = insertelement <8 x i16> %82, i16 %75, i64 7
  %84 = getelementptr inbounds i16, ptr %17, i64 %index
  %85 = getelementptr inbounds i8, ptr %84, i64 16
  store <8 x i16> %67, ptr %84, align 2, !tbaa !14, !alias.scope !15, !noalias !11
  store <8 x i16> %83, ptr %85, align 2, !tbaa !14, !alias.scope !15, !noalias !11
  %index.next = add nuw i64 %index, 16
  %86 = icmp eq i64 %index.next, %n.vec
  br i1 %86, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %2
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader73

.lr.ph.preheader73:                               ; preds = %middle.block, %vector.memcheck, %.lr.ph.preheader
  %.05561.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %2, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader73, %.lr.ph.prol
  %.05561.prol = phi i64 [ %90, %.lr.ph.prol ], [ %.05561.ph, %.lr.ph.preheader73 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader73 ]
  %87 = getelementptr inbounds %struct.Command, ptr %1, i64 %.05561.prol, i32 3
  %88 = load i16, ptr %87, align 4, !tbaa !5
  %89 = getelementptr inbounds i16, ptr %17, i64 %.05561.prol
  store i16 %88, ptr %89, align 2, !tbaa !14
  %90 = add nuw i64 %.05561.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !21

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader73
  %.05561.unr = phi i64 [ %.05561.ph, %.lr.ph.preheader73 ], [ %90, %.lr.ph.prol ]
  %91 = sub i64 %.05561.ph, %2
  %92 = icmp ugt i64 %91, -4
  br i1 %92, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.05561 = phi i64 [ %108, %.lr.ph ], [ %.05561.unr, %.lr.ph.prol.loopexit ]
  %93 = getelementptr inbounds %struct.Command, ptr %1, i64 %.05561, i32 3
  %94 = load i16, ptr %93, align 4, !tbaa !5
  %95 = getelementptr inbounds i16, ptr %17, i64 %.05561
  store i16 %94, ptr %95, align 2, !tbaa !14
  %96 = add nuw i64 %.05561, 1
  %97 = getelementptr inbounds %struct.Command, ptr %1, i64 %96, i32 3
  %98 = load i16, ptr %97, align 4, !tbaa !5
  %99 = getelementptr inbounds i16, ptr %17, i64 %96
  store i16 %98, ptr %99, align 2, !tbaa !14
  %100 = add nuw i64 %.05561, 2
  %101 = getelementptr inbounds %struct.Command, ptr %1, i64 %100, i32 3
  %102 = load i16, ptr %101, align 4, !tbaa !5
  %103 = getelementptr inbounds i16, ptr %17, i64 %100
  store i16 %102, ptr %103, align 2, !tbaa !14
  %104 = add nuw i64 %.05561, 3
  %105 = getelementptr inbounds %struct.Command, ptr %1, i64 %104, i32 3
  %106 = load i16, ptr %105, align 4, !tbaa !5
  %107 = getelementptr inbounds i16, ptr %17, i64 %104
  store i16 %106, ptr %107, align 2, !tbaa !14
  %108 = add nuw i64 %.05561, 4
  %exitcond.not.3 = icmp eq i64 %108, %2
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block
  tail call void @SplitByteVectorCommand(ptr noundef %0, ptr noundef %17, i64 noundef %2, i64 noundef 530, i64 noundef 50, i64 noundef 40, double noundef 1.350000e+01, ptr noundef %6, ptr noundef %8)
  tail call void @BrotliFree(ptr noundef %0, ptr noundef %17) #3
  %109 = shl i64 %2, 1
  %110 = tail call ptr @BrotliAllocate(ptr noundef %0, i64 noundef %109) #3
  br label %.lr.ph65

.lr.ph65:                                         ; preds = %._crit_edge, %122
  %.063 = phi i64 [ %123, %122 ], [ 0, %._crit_edge ]
  %.05462 = phi i64 [ %.1, %122 ], [ 0, %._crit_edge ]
  %111 = getelementptr inbounds %struct.Command, ptr %1, i64 %.063
  %112 = tail call i32 @CommandCopyLen(ptr noundef %111)
  %.not60 = icmp eq i32 %112, 0
  br i1 %.not60, label %122, label %113

113:                                              ; preds = %.lr.ph65
  %114 = getelementptr inbounds i8, ptr %111, i64 12
  %115 = load i16, ptr %114, align 4, !tbaa !5
  %116 = icmp ugt i16 %115, 127
  br i1 %116, label %117, label %122

117:                                              ; preds = %113
  %118 = getelementptr inbounds i8, ptr %111, i64 14
  %119 = load i16, ptr %118, align 2, !tbaa !24
  %120 = add i64 %.05462, 1
  %121 = getelementptr inbounds i16, ptr %110, i64 %.05462
  store i16 %119, ptr %121, align 2, !tbaa !14
  br label %122

122:                                              ; preds = %117, %113, %.lr.ph65
  %.1 = phi i64 [ %120, %117 ], [ %.05462, %113 ], [ %.05462, %.lr.ph65 ]
  %123 = add nuw i64 %.063, 1
  %exitcond69.not = icmp eq i64 %123, %2
  br i1 %exitcond69.not, label %._crit_edge66, label %.lr.ph65, !llvm.loop !25

._crit_edge66.critedge:                           ; preds = %14
  tail call void @SplitByteVectorCommand(ptr noundef %0, ptr noundef null, i64 noundef %2, i64 noundef 530, i64 noundef 50, i64 noundef 40, double noundef 1.350000e+01, ptr noundef %6, ptr noundef %8)
  tail call void @BrotliFree(ptr noundef %0, ptr noundef null) #3
  br label %._crit_edge66

._crit_edge66:                                    ; preds = %122, %._crit_edge66.critedge
  %124 = phi ptr [ null, %._crit_edge66.critedge ], [ %110, %122 ]
  %.054.lcssa = phi i64 [ 0, %._crit_edge66.critedge ], [ %.1, %122 ]
  tail call void @SplitByteVectorDistance(ptr noundef %0, ptr noundef %124, i64 noundef %.054.lcssa, i64 noundef 544, i64 noundef 50, i64 noundef 40, double noundef 1.460000e+01, ptr noundef %6, ptr noundef %9)
  tail call void @BrotliFree(ptr noundef %0, ptr noundef %124) #3
  ret void
}

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

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

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

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

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

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

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

attributes #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 = { 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, !10, i64 12}
!6 = !{!"Command", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12, !10, i64 14}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!12}
!12 = distinct !{!12, !13}
!13 = distinct !{!13, !"LVerDomain"}
!14 = !{!10, !10, i64 0}
!15 = !{!16}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !18, !19}
!24 = !{!6, !10, i64 14}
!25 = distinct !{!25, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass