; LLVM IR from JayXon/Leanify :: lib/zopflipng (zopflipng_lib)

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

%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z11TryOptimizeRKSt6vectorIhSaIhEEjjRKN7lodepng5StateEbbS3_23ZopfliPNGFilterStrategybiPK16ZopfliPNGOptionsPS1_(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(528), i1 noundef zeroext, i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i1 noundef zeroext, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24AutoChooseFilterStrategyRKSt6vectorIhSaIhEEjjRKN7lodepng5StateEbbS3_iP23ZopfliPNGFilterStrategyPb(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(528) %3, i1 noundef zeroext %4, i1 noundef zeroext %5, ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %7, ptr noundef %8, ptr noundef %9) #2 personality ptr @__gxx_personality_v0 {
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %"class.std::vector.8", align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store i32 %1, ptr %13, align 4, !tbaa !9
  store i32 %2, ptr %14, align 4, !tbaa !9
  store ptr %3, ptr %15, align 8, !tbaa !5
  %32 = zext i1 %4 to i8
  store i8 %32, ptr %16, align 1, !tbaa !11
  %33 = zext i1 %5 to i8
  store i8 %33, ptr %17, align 1, !tbaa !11
  store ptr %6, ptr %18, align 8, !tbaa !5
  store i32 %7, ptr %19, align 4, !tbaa !9
  store ptr %8, ptr %20, align 8, !tbaa !5
  store ptr %9, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #3
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  store i64 0, ptr %23, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  store i32 0, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  store i32 8192, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %79, %10
  %35 = load i32, ptr %26, align 4, !tbaa !9
  %36 = load i32, ptr %19, align 4, !tbaa !9
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 2, ptr %27, align 4
  br label %82

39:                                               ; preds = %34
  call void @_ZNSt6vectorIhSaIhEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = load i32, ptr %13, align 4, !tbaa !9
  %42 = load i32, ptr %14, align 4, !tbaa !9
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  %44 = load i8, ptr %16, align 1, !tbaa !11, !range !15, !noundef !16
  %45 = trunc i8 %44 to i1
  %46 = load i8, ptr %17, align 1, !tbaa !11, !range !15, !noundef !16
  %47 = trunc i8 %46 to i1
  %48 = load ptr, ptr %18, align 8, !tbaa !5
  %49 = load ptr, ptr %20, align 8, !tbaa !5
  %50 = load i32, ptr %26, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !17
  %54 = load i32, ptr %25, align 4, !tbaa !9
  %55 = invoke noundef i32 @_Z11TryOptimizeRKSt6vectorIhSaIhEEjjRKN7lodepng5StateEbbS3_23ZopfliPNGFilterStrategybiPK16ZopfliPNGOptionsPS1_(ptr noundef nonnull align 8 dereferenceable(24) %40, i32 noundef %41, i32 noundef %42, ptr noundef nonnull align 8 dereferenceable(528) %43, i1 noundef zeroext %45, i1 noundef zeroext %47, ptr noundef nonnull align 8 dereferenceable(24) %48, i32 noundef %53, i1 noundef zeroext false, i32 noundef %54, ptr noundef null, ptr noundef %22)
          to label %56 unwind label %61

56:                                               ; preds = %39
  store i32 %55, ptr %28, align 4, !tbaa !9
  %57 = load i32, ptr %28, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %65

59:                                               ; preds = %56
  %60 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %60, ptr %11, align 4
  store i32 1, ptr %27, align 4
  br label %76

61:                                               ; preds = %39
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %29, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #3
  br label %105

65:                                               ; preds = %56
  %66 = load i64, ptr %23, align 8, !tbaa !13
  %67 = icmp eq i64 %66, 0
  br i1 %67, label %72, label %68

68:                                               ; preds = %65
  %69 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #3
  %70 = load i64, ptr %23, align 8, !tbaa !13
  %71 = icmp ult i64 %69, %70
  br i1 %71, label %72, label %75

72:                                               ; preds = %68, %65
  %73 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #3
  store i64 %73, ptr %23, align 8, !tbaa !13
  %74 = load i32, ptr %26, align 4, !tbaa !9
  store i32 %74, ptr %24, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %72, %68
  store i32 0, ptr %27, align 4
  br label %76

76:                                               ; preds = %75, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  %77 = load i32, ptr %27, align 4
  switch i32 %77, label %82 [
    i32 0, label %78
  ]

78:                                               ; preds = %76
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %26, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %26, align 4, !tbaa !9
  br label %34, !llvm.loop !19

82:                                               ; preds = %76, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  %83 = load i32, ptr %27, align 4
  switch i32 %83, label %103 [
    i32 2, label %84
  ]

84:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #3
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %99, %84
  %86 = load i32, ptr %31, align 4, !tbaa !9
  %87 = load i32, ptr %19, align 4, !tbaa !9
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 5, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #3
  br label %102

90:                                               ; preds = %85
  %91 = load i32, ptr %31, align 4, !tbaa !9
  %92 = load i32, ptr %24, align 4, !tbaa !9
  %93 = icmp eq i32 %91, %92
  %94 = load ptr, ptr %21, align 8, !tbaa !5
  %95 = load i32, ptr %31, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %94, i64 %96
  %98 = zext i1 %93 to i8
  store i8 %98, ptr %97, align 1, !tbaa !11
  br label %99

99:                                               ; preds = %90
  %100 = load i32, ptr %31, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %31, align 4, !tbaa !9
  br label %85, !llvm.loop !21

102:                                              ; preds = %89
  store i32 0, ptr %11, align 4
  store i32 1, ptr %27, align 4
  br label %103

103:                                              ; preds = %102, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #3
  %104 = load i32, ptr %11, align 4
  ret i32 %104

105:                                              ; preds = %61
  %106 = load ptr, ptr %29, align 8
  %107 = load i32, ptr %30, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !18, i64 0}
!18 = !{!"_ZTS23ZopfliPNGFilterStrategy", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


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

%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z11TryOptimizeRKSt6vectorIhSaIhEEjjRKN7lodepng5StateEbbS3_23ZopfliPNGFilterStrategybiPK16ZopfliPNGOptionsPS1_(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(528), i1 noundef zeroext, i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i1 noundef zeroext, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24AutoChooseFilterStrategyRKSt6vectorIhSaIhEEjjRKN7lodepng5StateEbbS3_iP23ZopfliPNGFilterStrategyPb(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(528) %3, i1 noundef zeroext %4, i1 noundef zeroext %5, ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %7, ptr nocapture noundef readonly %8, ptr nocapture noundef writeonly %9) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %11 = alloca %"class.std::vector.8", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #3
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  %.not4255 = icmp sgt i32 %7, 0
  br i1 %.not4255, label %.lr.ph.preheader, label %.thread49

.lr.ph.preheader:                                 ; preds = %10
  %wide.trip.count = zext nneg i32 %7 to i64
  br label %.lr.ph

.preheader:                                       ; preds = %35
  %12 = zext i32 %.236.ph to i64
  br i1 %.not4255, label %iter.check, label %.thread49

iter.check:                                       ; preds = %.preheader
  %wide.trip.count67 = zext nneg i32 %7 to i64
  %min.iters.check = icmp ult i32 %7, 8
  br i1 %min.iters.check, label %.lr.ph60.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check74 = icmp ult i32 %7, 16
  br i1 %min.iters.check74, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %wide.trip.count, 2147483632
  %broadcast.splatinsert = insertelement <16 x i64> poison, i64 %12, i64 0
  %broadcast.splat = shufflevector <16 x i64> %broadcast.splatinsert, <16 x i64> poison, <16 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <16 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %13 = icmp eq <16 x i64> %vec.ind, %broadcast.splat
  %14 = getelementptr inbounds i8, ptr %9, i64 %index
  %15 = zext <16 x i1> %13 to <16 x i8>
  store <16 x i8> %15, ptr %14, align 1, !tbaa !5
  %index.next = add nuw i64 %index, 16
  %vec.ind.next = add <16 x i64> %vec.ind, <i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16>
  %16 = icmp eq i64 %index.next, %n.vec
  br i1 %16, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.thread49, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %wide.trip.count, 8
  %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check.not.not, label %.lr.ph60.preheader, label %vec.epilog.ph

.lr.ph60.preheader:                               ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv64.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec76, %vec.epilog.middle.block ]
  br label %.lr.ph60

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec76 = and i64 %wide.trip.count, 2147483640
  %.splatinsert = insertelement <8 x i64> poison, i64 %vec.epilog.resume.val, i64 0
  %.splat = shufflevector <8 x i64> %.splatinsert, <8 x i64> poison, <8 x i32> zeroinitializer
  %induction = or disjoint <8 x i64> %.splat, <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7>
  %broadcast.splatinsert81 = insertelement <8 x i64> poison, i64 %12, i64 0
  %broadcast.splat82 = shufflevector <8 x i64> %broadcast.splatinsert81, <8 x i64> poison, <8 x i32> zeroinitializer
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index78 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next83, %vec.epilog.vector.body ]
  %vec.ind79 = phi <8 x i64> [ %induction, %vec.epilog.ph ], [ %vec.ind.next80, %vec.epilog.vector.body ]
  %17 = icmp eq <8 x i64> %vec.ind79, %broadcast.splat82
  %18 = getelementptr inbounds i8, ptr %9, i64 %index78
  %19 = zext <8 x i1> %17 to <8 x i8>
  store <8 x i8> %19, ptr %18, align 1, !tbaa !5
  %index.next83 = add nuw i64 %index78, 8
  %vec.ind.next80 = add <8 x i64> %vec.ind79, <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8>
  %20 = icmp eq i64 %index.next83, %n.vec76
  br i1 %20, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !13

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n84 = icmp eq i64 %n.vec76, %wide.trip.count
  br i1 %cmp.n84, label %.thread49, label %.lr.ph60.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader, %35
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %35 ]
  %.03158 = phi i64 [ 0, %.lr.ph.preheader ], [ %.233.ph, %35 ]
  %.03457 = phi i32 [ 0, %.lr.ph.preheader ], [ %.236.ph, %35 ]
  call void @_ZNSt6vectorIhSaIhEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  %21 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv
  %22 = load i32, ptr %21, align 4, !tbaa !14
  %23 = invoke noundef i32 @_Z11TryOptimizeRKSt6vectorIhSaIhEEjjRKN7lodepng5StateEbbS3_23ZopfliPNGFilterStrategybiPK16ZopfliPNGOptionsPS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(528) %3, i1 noundef zeroext %4, i1 noundef zeroext %5, ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %22, i1 noundef zeroext false, i32 noundef 8192, ptr noundef null, ptr noundef nonnull %11)
          to label %24 unwind label %25

24:                                               ; preds = %.lr.ph
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %27, label %.thread49

25:                                               ; preds = %.lr.ph
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #3
  resume { ptr, i32 } %26

27:                                               ; preds = %24
  %28 = icmp eq i64 %.03158, 0
  br i1 %28, label %32, label %29

29:                                               ; preds = %27
  %30 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  %31 = icmp ult i64 %30, %.03158
  br i1 %31, label %32, label %35

32:                                               ; preds = %29, %27
  %33 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  %34 = trunc nuw nsw i64 %indvars.iv to i32
  br label %35

35:                                               ; preds = %29, %32
  %.236.ph = phi i32 [ %.03457, %29 ], [ %34, %32 ]
  %.233.ph = phi i64 [ %.03158, %29 ], [ %33, %32 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !16

.lr.ph60:                                         ; preds = %.lr.ph60.preheader, %.lr.ph60
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph60 ], [ %indvars.iv64.ph, %.lr.ph60.preheader ]
  %36 = icmp eq i64 %indvars.iv64, %12
  %37 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv64
  %38 = zext i1 %36 to i8
  store i8 %38, ptr %37, align 1, !tbaa !5
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count67
  br i1 %exitcond68.not, label %.thread49, label %.lr.ph60, !llvm.loop !17

.thread49:                                        ; preds = %24, %.lr.ph60, %middle.block, %vec.epilog.middle.block, %10, %.preheader
  %.3 = phi i32 [ 0, %.preheader ], [ 0, %10 ], [ 0, %vec.epilog.middle.block ], [ 0, %middle.block ], [ 0, %.lr.ph60 ], [ %23, %24 ]
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #3
  ret i32 %.3
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTS23ZopfliPNGFilterStrategy", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !12, !11}


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