; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (pngread)

; 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.png_image_read_control = type { ptr, ptr, i32, ptr, ptr, ptr, ptr, i64, i32, i32, i32 }
%struct.png_image = type { ptr, i32, i32, i32, i32, i32, i32, i32, [64 x i8] }

@.str.21 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [49 x i8], align 1

; 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 @png_safe_execute(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @png_image_error(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @png_image_finish_read(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.png_image_read_control, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %161

20:                                               ; preds = %5
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.png_image, ptr %21, i32 0, i32 1
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %161

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.png_image, ptr %26, i32 0, i32 4
  %28 = load i32, ptr %27, align 4, !tbaa !13
  %29 = and i32 %28, 8
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %25
  br label %38

32:                                               ; preds = %25
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.png_image, ptr %33, i32 0, i32 4
  %35 = load i32, ptr %34, align 4, !tbaa !13
  %36 = and i32 %35, 3
  %37 = add i32 %36, 1
  br label %38

38:                                               ; preds = %32, %31
  %39 = phi i32 [ 1, %31 ], [ %37, %32 ]
  store i32 %39, ptr %12, align 4, !tbaa !9
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.png_image, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 4, !tbaa !14
  %43 = load i32, ptr %12, align 4, !tbaa !9
  %44 = udiv i32 2147483647, %43
  %45 = icmp ule i32 %42, %44
  br i1 %45, label %46, label %157

46:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.png_image, ptr %47, i32 0, i32 2
  %49 = load i32, ptr %48, align 4, !tbaa !14
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = mul i32 %49, %50
  store i32 %51, ptr %14, align 4, !tbaa !9
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %56

54:                                               ; preds = %46
  %55 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %55, ptr %10, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %54, %46
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = icmp slt i32 %57, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %56
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = sub nsw i32 0, %60
  store i32 %61, ptr %13, align 4, !tbaa !9
  br label %64

62:                                               ; preds = %56
  %63 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %63, ptr %13, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %62, %59
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_image, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %153

69:                                               ; preds = %64
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %153

72:                                               ; preds = %69
  %73 = load i32, ptr %13, align 4, !tbaa !9
  %74 = load i32, ptr %14, align 4, !tbaa !9
  %75 = icmp uge i32 %73, %74
  br i1 %75, label %76, label %153

76:                                               ; preds = %72
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.png_image, ptr %77, i32 0, i32 3
  %79 = load i32, ptr %78, align 8, !tbaa !16
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.png_image, ptr %80, i32 0, i32 4
  %82 = load i32, ptr %81, align 4, !tbaa !13
  %83 = and i32 %82, 8
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %76
  br label %93

86:                                               ; preds = %76
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.png_image, ptr %87, i32 0, i32 4
  %89 = load i32, ptr %88, align 4, !tbaa !13
  %90 = and i32 %89, 4
  %91 = lshr i32 %90, 2
  %92 = add i32 %91, 1
  br label %93

93:                                               ; preds = %86, %85
  %94 = phi i32 [ 1, %85 ], [ %92, %86 ]
  %95 = udiv i32 -1, %94
  %96 = load i32, ptr %13, align 4, !tbaa !9
  %97 = udiv i32 %95, %96
  %98 = icmp ule i32 %79, %97
  br i1 %98, label %99, label %150

99:                                               ; preds = %93
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_image, ptr %100, i32 0, i32 4
  %102 = load i32, ptr %101, align 4, !tbaa !13
  %103 = and i32 %102, 8
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %113, label %105

105:                                              ; preds = %99
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_image, ptr %106, i32 0, i32 6
  %108 = load i32, ptr %107, align 4, !tbaa !17
  %109 = icmp ugt i32 %108, 0
  br i1 %109, label %110, label %147

110:                                              ; preds = %105
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %147

113:                                              ; preds = %110, %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #4
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 80, i1 false)
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.png_image_read_control, ptr %16, i32 0, i32 0
  store ptr %114, ptr %115, align 8, !tbaa !18
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.png_image_read_control, ptr %16, i32 0, i32 1
  store ptr %116, ptr %117, align 8, !tbaa !21
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = getelementptr inbounds %struct.png_image_read_control, ptr %16, i32 0, i32 2
  store i32 %118, ptr %119, align 8, !tbaa !22
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.png_image_read_control, ptr %16, i32 0, i32 3
  store ptr %120, ptr %121, align 8, !tbaa !23
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.png_image_read_control, ptr %16, i32 0, i32 4
  store ptr %122, ptr %123, align 8, !tbaa !24
  %124 = getelementptr inbounds %struct.png_image_read_control, ptr %16, i32 0, i32 5
  store ptr null, ptr %124, align 8, !tbaa !25
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.png_image, ptr %125, i32 0, i32 4
  %127 = load i32, ptr %126, align 4, !tbaa !13
  %128 = and i32 %127, 8
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %141

130:                                              ; preds = %113
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = call i32 @png_safe_execute(ptr noundef %131, ptr noundef @png_image_read_colormap, ptr noundef %16)
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %138

134:                                              ; preds = %130
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = call i32 @png_safe_execute(ptr noundef %135, ptr noundef @png_image_read_colormapped, ptr noundef %16)
  %137 = icmp ne i32 %136, 0
  br label %138

138:                                              ; preds = %134, %130
  %139 = phi i1 [ false, %130 ], [ %137, %134 ]
  %140 = zext i1 %139 to i32
  store i32 %140, ptr %15, align 4, !tbaa !9
  br label %144

141:                                              ; preds = %113
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = call i32 @png_safe_execute(ptr noundef %142, ptr noundef @png_image_read_direct, ptr noundef %16)
  store i32 %143, ptr %15, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %141, %138
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  call void @png_image_free(ptr noundef %145)
  %146 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %146, ptr %6, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %156

147:                                              ; preds = %110, %105
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = call i32 @png_image_error(ptr noundef %148, ptr noundef @.str.21)
  store i32 %149, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %156

150:                                              ; preds = %93
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = call i32 @png_image_error(ptr noundef %151, ptr noundef @.str.22)
  store i32 %152, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %156

153:                                              ; preds = %72, %69, %64
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = call i32 @png_image_error(ptr noundef %154, ptr noundef @.str.23)
  store i32 %155, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %156

156:                                              ; preds = %153, %150, %147, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %160

157:                                              ; preds = %38
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = call i32 @png_image_error(ptr noundef %158, ptr noundef @.str.24)
  store i32 %159, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %160

160:                                              ; preds = %157, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %169

161:                                              ; preds = %20, %5
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = icmp ne ptr %162, null
  br i1 %163, label %164, label %167

164:                                              ; preds = %161
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = call i32 @png_image_error(ptr noundef %165, ptr noundef @.str.25)
  store i32 %166, ptr %6, align 4
  br label %169

167:                                              ; preds = %161
  br label %168

168:                                              ; preds = %167
  store i32 0, ptr %6, align 4
  br label %169

169:                                              ; preds = %168, %164, %160
  %170 = load i32, ptr %6, align 4
  ret i32 %170
}

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

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

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

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

declare void @png_image_free(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !7, i64 36}
!13 = !{!12, !10, i64 20}
!14 = !{!12, !10, i64 12}
!15 = !{!12, !6, i64 0}
!16 = !{!12, !10, i64 16}
!17 = !{!12, !10, i64 28}
!18 = !{!19, !6, i64 0}
!19 = !{!"", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !20, i64 56, !10, i64 64, !10, i64 68, !10, i64 72}
!20 = !{!"long", !7, i64 0}
!21 = !{!19, !6, i64 8}
!22 = !{!19, !10, i64 16}
!23 = !{!19, !6, i64 24}
!24 = !{!19, !6, i64 32}
!25 = !{!19, !6, i64 40}


; 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.png_image_read_control = type { ptr, ptr, i32, ptr, ptr, ptr, ptr, i64, i32, i32, i32 }

@.str.21 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [49 x i8], align 1

; 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 @png_safe_execute(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @png_image_error(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @png_image_finish_read(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = alloca %struct.png_image_read_control, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %.critedge, label %7

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = icmp eq i32 %9, 1
  br i1 %10, label %11, label %65

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 20
  %13 = load i32, ptr %12, align 4, !tbaa !11
  %14 = and i32 %13, 8
  %.not52 = icmp eq i32 %14, 0
  %15 = and i32 %13, 3
  %16 = add nuw nsw i32 %15, 1
  %17 = select i1 %.not52, i32 %16, i32 1
  %18 = getelementptr inbounds i8, ptr %0, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !12
  %20 = udiv i32 2147483647, %17
  %.not53 = icmp ugt i32 %19, %20
  br i1 %.not53, label %63, label %21

21:                                               ; preds = %11
  %22 = mul i32 %17, %19
  %23 = icmp eq i32 %3, 0
  %spec.select = select i1 %23, i32 %22, i32 %3
  %.045 = tail call i32 @llvm.abs.i32(i32 %spec.select, i1 true)
  %24 = load ptr, ptr %0, align 8, !tbaa !13
  %25 = icmp eq ptr %24, null
  %26 = icmp eq ptr %2, null
  %or.cond.not62 = or i1 %26, %25
  %.not54 = icmp ult i32 %.045, %22
  %or.cond59 = select i1 %or.cond.not62, i1 true, i1 %.not54
  br i1 %or.cond59, label %61, label %27

27:                                               ; preds = %21
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = load i32, ptr %28, align 8, !tbaa !14
  %30 = lshr i32 %13, 2
  %31 = and i32 %30, 1
  %32 = add nuw nsw i32 %31, 1
  %33 = select i1 %.not52, i32 %32, i32 1
  %34 = udiv i32 -1, %33
  %35 = udiv i32 %34, %.045
  %.not56 = icmp ugt i32 %29, %35
  br i1 %.not56, label %59, label %36

36:                                               ; preds = %27
  br i1 %.not52, label %42, label %37

37:                                               ; preds = %36
  %38 = getelementptr inbounds i8, ptr %0, i64 28
  %39 = load i32, ptr %38, align 4, !tbaa !15
  %40 = icmp ne i32 %39, 0
  %41 = icmp ne ptr %4, null
  %or.cond3 = and i1 %41, %40
  br i1 %or.cond3, label %42, label %57

42:                                               ; preds = %37, %36
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #5
  %43 = getelementptr inbounds i8, ptr %6, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %43, i8 0, i64 64, i1 false)
  store ptr %0, ptr %6, align 8, !tbaa !16
  %44 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %2, ptr %44, align 8, !tbaa !19
  %45 = getelementptr inbounds i8, ptr %6, i64 16
  store i32 %spec.select, ptr %45, align 8, !tbaa !20
  %46 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %4, ptr %46, align 8, !tbaa !21
  %47 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr %1, ptr %47, align 8, !tbaa !22
  br i1 %.not52, label %54, label %48

48:                                               ; preds = %42
  %49 = call i32 @png_safe_execute(ptr noundef nonnull %0, ptr noundef nonnull @png_image_read_colormap, ptr noundef nonnull %6) #5
  %.not58 = icmp eq i32 %49, 0
  br i1 %.not58, label %56, label %50

50:                                               ; preds = %48
  %51 = call i32 @png_safe_execute(ptr noundef nonnull %0, ptr noundef nonnull @png_image_read_colormapped, ptr noundef nonnull %6) #5
  %52 = icmp ne i32 %51, 0
  %53 = zext i1 %52 to i32
  br label %56

54:                                               ; preds = %42
  %55 = call i32 @png_safe_execute(ptr noundef nonnull %0, ptr noundef nonnull @png_image_read_direct, ptr noundef nonnull %6) #5
  br label %56

56:                                               ; preds = %48, %50, %54
  %.0 = phi i32 [ %55, %54 ], [ 0, %48 ], [ %53, %50 ]
  call void @png_image_free(ptr noundef nonnull %0) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #5
  br label %.critedge

57:                                               ; preds = %37
  %58 = tail call i32 @png_image_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.21) #5
  br label %.critedge

59:                                               ; preds = %27
  %60 = tail call i32 @png_image_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.22) #5
  br label %.critedge

61:                                               ; preds = %21
  %62 = tail call i32 @png_image_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.23) #5
  br label %.critedge

63:                                               ; preds = %11
  %64 = tail call i32 @png_image_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.24) #5
  br label %.critedge

65:                                               ; preds = %7
  %66 = tail call i32 @png_image_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.25) #5
  br label %.critedge

.critedge:                                        ; preds = %5, %63, %61, %59, %57, %56, %65
  %.2 = phi i32 [ %66, %65 ], [ %64, %63 ], [ %.0, %56 ], [ %58, %57 ], [ %60, %59 ], [ %62, %61 ], [ 0, %5 ]
  ret i32 %.2
}

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

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

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

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

declare void @png_image_free(ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 8}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !8, i64 36}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 20}
!12 = !{!6, !10, i64 12}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !10, i64 16}
!15 = !{!6, !10, i64 28}
!16 = !{!17, !7, i64 0}
!17 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !18, i64 56, !10, i64 64, !10, i64 68, !10, i64 72}
!18 = !{!"long", !8, i64 0}
!19 = !{!17, !7, i64 8}
!20 = !{!17, !10, i64 16}
!21 = !{!17, !7, i64 24}
!22 = !{!17, !7, i64 32}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass