; LLVM IR from catid/Zpng :: zpng (ZPNG_Compress)

; 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.ZPNG_Buffer = type { ptr, i32 }
%struct.ZPNG_ImageData = type { %struct.ZPNG_Buffer, i32, i32, i32, i32, i32 }
%struct.ZPNG_Header = type { i16, i16, i16, i8, i8 }

; Function Attrs: mustprogress uwtable
define dso_local { ptr, i32 } @ZPNG_Compress(ptr noundef %0) #0 {
  %2 = alloca %struct.ZPNG_Buffer, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr null, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ZPNG_Buffer, ptr %2, i32 0, i32 0
  store ptr null, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds %struct.ZPNG_Buffer, ptr %2, i32 0, i32 1
  store i32 0, ptr %14, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.ZPNG_ImageData, ptr %15, i32 0, i32 3
  %17 = load i32, ptr %16, align 8, !tbaa !13
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ZPNG_ImageData, ptr %18, i32 0, i32 4
  %20 = load i32, ptr %19, align 4, !tbaa !15
  %21 = mul i32 %17, %20
  store i32 %21, ptr %6, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ZPNG_ImageData, ptr %22, i32 0, i32 1
  %24 = load i32, ptr %23, align 8, !tbaa !17
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ZPNG_ImageData, ptr %25, i32 0, i32 2
  %27 = load i32, ptr %26, align 4, !tbaa !18
  %28 = mul i32 %24, %27
  store i32 %28, ptr %7, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %29 = load i32, ptr %7, align 4, !tbaa !16
  %30 = load i32, ptr %6, align 4, !tbaa !16
  %31 = mul i32 %29, %30
  store i32 %31, ptr %8, align 4, !tbaa !16
  %32 = load i32, ptr %7, align 4, !tbaa !16
  %33 = icmp ugt i32 %32, 8
  br i1 %33, label %34, label %35

34:                                               ; preds = %1
  store i32 1, ptr %9, align 4
  br label %138

35:                                               ; preds = %1
  %36 = load i32, ptr %8, align 4, !tbaa !16
  %37 = zext i32 %36 to i64
  %38 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %37) #7
  store ptr %38, ptr %4, align 8, !tbaa !5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %51, label %41

41:                                               ; preds = %35
  br label %42

42:                                               ; preds = %137, %41
  %43 = getelementptr inbounds %struct.ZPNG_Buffer, ptr %2, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = icmp ne ptr %44, %45
  br i1 %46, label %47, label %49

47:                                               ; preds = %42
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %48) #6
  br label %49

49:                                               ; preds = %47, %42
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %50) #6
  store i32 1, ptr %9, align 4
  br label %138

51:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %52 = load i32, ptr %8, align 4, !tbaa !16
  %53 = zext i32 %52 to i64
  %54 = call i64 @ZSTD_compressBound(i64 noundef %53)
  %55 = trunc i64 %54 to i32
  store i32 %55, ptr %10, align 4, !tbaa !16
  %56 = load i32, ptr %10, align 4, !tbaa !16
  %57 = add i32 8, %56
  %58 = zext i32 %57 to i64
  %59 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %58) #7
  store ptr %59, ptr %5, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %63, label %62

62:                                               ; preds = %51
  store i32 2, ptr %9, align 4
  br label %137

63:                                               ; preds = %51
  %64 = load i32, ptr %7, align 4, !tbaa !16
  switch i32 %64, label %89 [
    i32 1, label %65
    i32 2, label %68
    i32 3, label %71
    i32 4, label %74
    i32 5, label %77
    i32 6, label %80
    i32 7, label %83
    i32 8, label %86
  ]

65:                                               ; preds = %63
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZL13PackAndFilterILi1EEvPK14ZPNG_ImageDataPh(ptr noundef %66, ptr noundef %67)
  br label %89

68:                                               ; preds = %63
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZL13PackAndFilterILi2EEvPK14ZPNG_ImageDataPh(ptr noundef %69, ptr noundef %70)
  br label %89

71:                                               ; preds = %63
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZL13PackAndFilterILi3EEvPK14ZPNG_ImageDataPh(ptr noundef %72, ptr noundef %73)
  br label %89

74:                                               ; preds = %63
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZL13PackAndFilterILi4EEvPK14ZPNG_ImageDataPh(ptr noundef %75, ptr noundef %76)
  br label %89

77:                                               ; preds = %63
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZL13PackAndFilterILi5EEvPK14ZPNG_ImageDataPh(ptr noundef %78, ptr noundef %79)
  br label %89

80:                                               ; preds = %63
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZL13PackAndFilterILi6EEvPK14ZPNG_ImageDataPh(ptr noundef %81, ptr noundef %82)
  br label %89

83:                                               ; preds = %63
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZL13PackAndFilterILi7EEvPK14ZPNG_ImageDataPh(ptr noundef %84, ptr noundef %85)
  br label %89

86:                                               ; preds = %63
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZL13PackAndFilterILi8EEvPK14ZPNG_ImageDataPh(ptr noundef %87, ptr noundef %88)
  br label %89

89:                                               ; preds = %86, %83, %80, %77, %74, %71, %68, %65, %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %90, i64 8
  %92 = load i32, ptr %10, align 4, !tbaa !16
  %93 = zext i32 %92 to i64
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !16
  %96 = zext i32 %95 to i64
  %97 = call i64 @ZSTD_compress(ptr noundef %91, i64 noundef %93, ptr noundef %94, i64 noundef %96, i32 noundef 1)
  store i64 %97, ptr %11, align 8, !tbaa !19
  %98 = load i64, ptr %11, align 8, !tbaa !19
  %99 = call i32 @ZSTD_isError(i64 noundef %98)
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %89
  store i32 2, ptr %9, align 4
  br label %136

102:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %103, ptr %12, align 8, !tbaa !5
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.ZPNG_Header, ptr %104, i32 0, i32 0
  store i16 -1032, ptr %105, align 2, !tbaa !21
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ZPNG_ImageData, ptr %106, i32 0, i32 3
  %108 = load i32, ptr %107, align 8, !tbaa !13
  %109 = trunc i32 %108 to i16
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ZPNG_Header, ptr %110, i32 0, i32 1
  store i16 %109, ptr %111, align 2, !tbaa !24
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.ZPNG_ImageData, ptr %112, i32 0, i32 4
  %114 = load i32, ptr %113, align 4, !tbaa !15
  %115 = trunc i32 %114 to i16
  %116 = load ptr, ptr %12, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ZPNG_Header, ptr %116, i32 0, i32 2
  store i16 %115, ptr %117, align 2, !tbaa !25
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.ZPNG_ImageData, ptr %118, i32 0, i32 2
  %120 = load i32, ptr %119, align 4, !tbaa !18
  %121 = trunc i32 %120 to i8
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ZPNG_Header, ptr %122, i32 0, i32 3
  store i8 %121, ptr %123, align 2, !tbaa !26
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.ZPNG_ImageData, ptr %124, i32 0, i32 1
  %126 = load i32, ptr %125, align 8, !tbaa !17
  %127 = trunc i32 %126 to i8
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.ZPNG_Header, ptr %128, i32 0, i32 4
  store i8 %127, ptr %129, align 1, !tbaa !27
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.ZPNG_Buffer, ptr %2, i32 0, i32 0
  store ptr %130, ptr %131, align 8, !tbaa !9
  %132 = load i64, ptr %11, align 8, !tbaa !19
  %133 = trunc i64 %132 to i32
  %134 = add i32 8, %133
  %135 = getelementptr inbounds %struct.ZPNG_Buffer, ptr %2, i32 0, i32 1
  store i32 %134, ptr %135, align 8, !tbaa !12
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %136

136:                                              ; preds = %102, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %137

137:                                              ; preds = %136, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %42

138:                                              ; preds = %49, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %139 = load { ptr, i32 }, ptr %2, align 8
  ret { ptr, i32 } %139
}

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare i64 @ZSTD_compressBound(i64 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi1EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi2EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi3EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi4EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi5EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi6EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi7EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi8EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) #5

declare i64 @ZSTD_compress(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) #4

declare i32 @ZSTD_isError(i64 noundef) #4

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0,1) "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }

!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, !6, i64 0}
!10 = !{!"_ZTS11ZPNG_Buffer", !6, i64 0, !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!14, !11, i64 24}
!14 = !{!"_ZTS14ZPNG_ImageData", !10, i64 0, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!15 = !{!14, !11, i64 28}
!16 = !{!11, !11, i64 0}
!17 = !{!14, !11, i64 16}
!18 = !{!14, !11, i64 20}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!22, !23, i64 0}
!22 = !{!"_ZTS11ZPNG_Header", !23, i64 0, !23, i64 2, !23, i64 4, !7, i64 6, !7, i64 7}
!23 = !{!"short", !7, i64 0}
!24 = !{!22, !23, i64 2}
!25 = !{!22, !23, i64 4}
!26 = !{!22, !7, i64 6}
!27 = !{!22, !7, i64 7}


; 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: mustprogress uwtable
define dso_local { ptr, i32 } @ZPNG_Compress(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 20
  %6 = load i32, ptr %5, align 4, !tbaa !12
  %7 = mul i32 %6, %4
  %8 = icmp ugt i32 %7, 8
  br i1 %8, label %49, label %9

9:                                                ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 28
  %11 = load i32, ptr %2, align 8, !tbaa !13
  %12 = load i32, ptr %10, align 4, !tbaa !14
  %13 = mul i32 %11, %7
  %14 = mul i32 %13, %12
  %15 = zext i32 %14 to i64
  %16 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %15) #5
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %.thread, label %18

17:                                               ; preds = %32
  tail call void @free(ptr noundef nonnull %22) #6
  br label %.thread

.thread:                                          ; preds = %18, %37, %9, %17
  %.sroa.4.059 = phi i32 [ 0, %17 ], [ %48, %37 ], [ 0, %9 ], [ 0, %18 ]
  %.sroa.0.058 = phi ptr [ null, %17 ], [ %22, %37 ], [ null, %9 ], [ null, %18 ]
  tail call void @free(ptr noundef %16) #6
  br label %49

18:                                               ; preds = %9
  %19 = tail call i64 @ZSTD_compressBound(i64 noundef %15)
  %20 = add i64 %19, 8
  %21 = and i64 %20, 4294967295
  %22 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %21) #5
  %.not51 = icmp eq ptr %22, null
  br i1 %.not51, label %.thread, label %23

23:                                               ; preds = %18
  switch i32 %7, label %32 [
    i32 1, label %24
    i32 2, label %25
    i32 3, label %26
    i32 4, label %27
    i32 5, label %28
    i32 6, label %29
    i32 7, label %30
    i32 8, label %31
  ]

24:                                               ; preds = %23
  tail call void @_ZL13PackAndFilterILi1EEvPK14ZPNG_ImageDataPh(ptr noundef nonnull %0, ptr noundef nonnull %16)
  br label %32

25:                                               ; preds = %23
  tail call void @_ZL13PackAndFilterILi2EEvPK14ZPNG_ImageDataPh(ptr noundef nonnull %0, ptr noundef nonnull %16)
  br label %32

26:                                               ; preds = %23
  tail call void @_ZL13PackAndFilterILi3EEvPK14ZPNG_ImageDataPh(ptr noundef nonnull %0, ptr noundef nonnull %16)
  br label %32

27:                                               ; preds = %23
  tail call void @_ZL13PackAndFilterILi4EEvPK14ZPNG_ImageDataPh(ptr noundef nonnull %0, ptr noundef nonnull %16)
  br label %32

28:                                               ; preds = %23
  tail call void @_ZL13PackAndFilterILi5EEvPK14ZPNG_ImageDataPh(ptr noundef nonnull %0, ptr noundef nonnull %16)
  br label %32

29:                                               ; preds = %23
  tail call void @_ZL13PackAndFilterILi6EEvPK14ZPNG_ImageDataPh(ptr noundef nonnull %0, ptr noundef nonnull %16)
  br label %32

30:                                               ; preds = %23
  tail call void @_ZL13PackAndFilterILi7EEvPK14ZPNG_ImageDataPh(ptr noundef nonnull %0, ptr noundef nonnull %16)
  br label %32

31:                                               ; preds = %23
  tail call void @_ZL13PackAndFilterILi8EEvPK14ZPNG_ImageDataPh(ptr noundef nonnull %0, ptr noundef nonnull %16)
  br label %32

32:                                               ; preds = %31, %30, %29, %28, %27, %26, %25, %24, %23
  %33 = getelementptr inbounds i8, ptr %22, i64 8
  %34 = and i64 %19, 4294967295
  %35 = tail call i64 @ZSTD_compress(ptr noundef nonnull %33, i64 noundef %34, ptr noundef nonnull %16, i64 noundef %15, i32 noundef 1)
  %36 = tail call i32 @ZSTD_isError(i64 noundef %35)
  %.not52 = icmp eq i32 %36, 0
  br i1 %.not52, label %37, label %17

37:                                               ; preds = %32
  store i16 -1032, ptr %22, align 2, !tbaa !15
  %38 = getelementptr inbounds i8, ptr %22, i64 2
  %39 = load <2 x i32>, ptr %2, align 8, !tbaa !18
  %40 = trunc <2 x i32> %39 to <2 x i16>
  store <2 x i16> %40, ptr %38, align 2, !tbaa !19
  %41 = load i32, ptr %5, align 4, !tbaa !12
  %42 = trunc i32 %41 to i8
  %43 = getelementptr inbounds i8, ptr %22, i64 6
  store i8 %42, ptr %43, align 2, !tbaa !20
  %44 = load i32, ptr %3, align 8, !tbaa !5
  %45 = trunc i32 %44 to i8
  %46 = getelementptr inbounds i8, ptr %22, i64 7
  store i8 %45, ptr %46, align 1, !tbaa !21
  %47 = trunc i64 %35 to i32
  %48 = add i32 %47, 8
  br label %.thread

49:                                               ; preds = %1, %.thread
  %.sroa.0.3 = phi ptr [ %.sroa.0.058, %.thread ], [ null, %1 ]
  %.sroa.4.3 = phi i32 [ %.sroa.4.059, %.thread ], [ 0, %1 ]
  %.fca.0.insert = insertvalue { ptr, i32 } poison, ptr %.sroa.0.3, 0
  %.fca.1.insert = insertvalue { ptr, i32 } %.fca.0.insert, i32 %.sroa.4.3, 1
  ret { ptr, i32 } %.fca.1.insert
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

declare i64 @ZSTD_compressBound(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi1EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi2EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi3EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi4EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi5EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi6EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi7EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13PackAndFilterILi8EEvPK14ZPNG_ImageDataPh(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i64 @ZSTD_compress(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @ZSTD_isError(i64 noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind allocsize(0,1) }
attributes #6 = { 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, !11, i64 16}
!6 = !{!"_ZTS14ZPNG_ImageData", !7, i64 0, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!7 = !{!"_ZTS11ZPNG_Buffer", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!6, !11, i64 20}
!13 = !{!6, !11, i64 24}
!14 = !{!6, !11, i64 28}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTS11ZPNG_Header", !17, i64 0, !17, i64 2, !17, i64 4, !9, i64 6, !9, i64 7}
!17 = !{!"short", !9, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!17, !17, i64 0}
!20 = !{!16, !9, i64 6}
!21 = !{!16, !9, i64 7}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass