; LLVM IR from rdguez-mariano/fast_imas_IPOL :: io_png/libs/png (pngrutil)

; 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_struct_def = type { [1 x %struct.__jmp_buf_tag], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i64, i64, i64, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i64, i64, ptr, i16, i16, [5 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, float, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i64, i64, i32, float, float, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, i32, ptr, i8, i16, i16, i16, i64, i64, i8, i8, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i64, i64, %struct.png_unknown_chunk_t, i64, i64, ptr }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_row_info_struct = type { i64, i64, i8, i8, i8, i8 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }
%struct.png_text_struct = type { i32, ptr, ptr, i64 }

@.str.108 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [43 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

declare void @png_error(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) #0

; Function Attrs: nounwind uwtable
declare dso_local void @png_crc_read(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @png_crc_finish(ptr noundef, i64 noundef) #2

declare void @png_warning(ptr noundef, ptr noundef) #1

declare ptr @png_malloc_warn(ptr noundef, i64 noundef) #1

declare void @png_free(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_tEXt(ptr noundef %0, ptr noundef %1, i64 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.png_struct_def, ptr %14, i32 0, i32 12
  %16 = load i64, ptr %15, align 8, !tbaa !11
  %17 = and i64 %16, 1
  %18 = icmp ne i64 %17, 0
  br i1 %18, label %21, label %19

19:                                               ; preds = %3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %20, ptr noundef @.str.108)
  br label %21

21:                                               ; preds = %19, %3
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.png_struct_def, ptr %22, i32 0, i32 12
  %24 = load i64, ptr %23, align 8, !tbaa !11
  %25 = and i64 %24, 4
  %26 = icmp ne i64 %25, 0
  br i1 %26, label %27, label %32

27:                                               ; preds = %21
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.png_struct_def, ptr %28, i32 0, i32 12
  %30 = load i64, ptr %29, align 8, !tbaa !11
  %31 = or i64 %30, 8
  store i64 %31, ptr %29, align 8, !tbaa !11
  br label %32

32:                                               ; preds = %27, %21
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.png_struct_def, ptr %34, i32 0, i32 137
  %36 = load ptr, ptr %35, align 8, !tbaa !21
  call void @png_free(ptr noundef %33, ptr noundef %36)
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load i64, ptr %6, align 8, !tbaa !9
  %39 = add i64 %38, 1
  %40 = call ptr @png_malloc_warn(ptr noundef %37, i64 noundef %39)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_struct_def, ptr %41, i32 0, i32 137
  store ptr %40, ptr %42, align 8, !tbaa !21
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.png_struct_def, ptr %43, i32 0, i32 137
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %49

47:                                               ; preds = %32
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %48, ptr noundef @.str.109)
  store i32 1, ptr %13, align 4
  br label %135

49:                                               ; preds = %32
  %50 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %50, ptr %11, align 8, !tbaa !9
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.png_struct_def, ptr %52, i32 0, i32 137
  %54 = load ptr, ptr %53, align 8, !tbaa !21
  %55 = load i64, ptr %11, align 8, !tbaa !9
  call void @png_crc_read(ptr noundef %51, ptr noundef %54, i64 noundef %55)
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load i64, ptr %10, align 8, !tbaa !9
  %58 = call i32 @png_crc_finish(ptr noundef %56, i64 noundef %57)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %67

60:                                               ; preds = %49
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_struct_def, ptr %62, i32 0, i32 137
  %64 = load ptr, ptr %63, align 8, !tbaa !21
  call void @png_free(ptr noundef %61, ptr noundef %64)
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_struct_def, ptr %65, i32 0, i32 137
  store ptr null, ptr %66, align 8, !tbaa !21
  store i32 1, ptr %13, align 4
  br label %135

67:                                               ; preds = %49
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.png_struct_def, ptr %68, i32 0, i32 137
  %70 = load ptr, ptr %69, align 8, !tbaa !21
  store ptr %70, ptr %8, align 8, !tbaa !5
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load i64, ptr %11, align 8, !tbaa !9
  %73 = getelementptr inbounds i8, ptr %71, i64 %72
  store i8 0, ptr %73, align 1, !tbaa !22
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %74, ptr %9, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %80, %67
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load i8, ptr %76, align 1, !tbaa !22
  %78 = icmp ne i8 %77, 0
  br i1 %78, label %79, label %83

79:                                               ; preds = %75
  br label %80

80:                                               ; preds = %79
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i32 1
  store ptr %82, ptr %9, align 8, !tbaa !5
  br label %75, !llvm.loop !23

83:                                               ; preds = %75
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = load i64, ptr %11, align 8, !tbaa !9
  %87 = getelementptr inbounds i8, ptr %85, i64 %86
  %88 = icmp ne ptr %84, %87
  br i1 %88, label %89, label %92

89:                                               ; preds = %83
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %90, i32 1
  store ptr %91, ptr %9, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %89, %83
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = call ptr @png_malloc_warn(ptr noundef %93, i64 noundef 32)
  store ptr %94, ptr %7, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = icmp eq ptr %95, null
  br i1 %96, label %97, label %105

97:                                               ; preds = %92
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %98, ptr noundef @.str.110)
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.png_struct_def, ptr %100, i32 0, i32 137
  %102 = load ptr, ptr %101, align 8, !tbaa !21
  call void @png_free(ptr noundef %99, ptr noundef %102)
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_struct_def, ptr %103, i32 0, i32 137
  store ptr null, ptr %104, align 8, !tbaa !21
  store i32 1, ptr %13, align 4
  br label %135

105:                                              ; preds = %92
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_text_struct, ptr %106, i32 0, i32 0
  store i32 -1, ptr %107, align 8, !tbaa !25
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.png_text_struct, ptr %109, i32 0, i32 1
  store ptr %108, ptr %110, align 8, !tbaa !27
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_text_struct, ptr %112, i32 0, i32 2
  store ptr %111, ptr %113, align 8, !tbaa !28
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = call i64 @strlen(ptr noundef %114) #5
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.png_text_struct, ptr %116, i32 0, i32 3
  store i64 %115, ptr %117, align 8, !tbaa !29
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = call i32 @png_set_text_2(ptr noundef %118, ptr noundef %119, ptr noundef %120, i32 noundef 1)
  store i32 %121, ptr %12, align 4, !tbaa !30
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_struct_def, ptr %123, i32 0, i32 137
  %125 = load ptr, ptr %124, align 8, !tbaa !21
  call void @png_free(ptr noundef %122, ptr noundef %125)
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.png_struct_def, ptr %126, i32 0, i32 137
  store ptr null, ptr %127, align 8, !tbaa !21
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  call void @png_free(ptr noundef %128, ptr noundef %129)
  %130 = load i32, ptr %12, align 4, !tbaa !30
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %105
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %133, ptr noundef @.str.111)
  br label %134

134:                                              ; preds = %132, %105
  store i32 0, ptr %13, align 4
  br label %135

135:                                              ; preds = %134, %97, %60, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %136 = load i32, ptr %13, align 4
  switch i32 %136, label %138 [
    i32 0, label %137
    i32 1, label %137
  ]

137:                                              ; preds = %135, %135
  ret void

138:                                              ; preds = %135
  unreachable
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

declare i32 @png_set_text_2(ptr noundef, ptr noundef, ptr noundef, i32 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 = { nounwind willreturn memory(read) "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 }
attributes #5 = { nounwind willreturn memory(read) }

!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, !10, i64 280}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !13, i64 304, !6, i64 416, !10, i64 424, !14, i64 432, !14, i64 436, !14, i64 440, !14, i64 444, !14, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !15, i64 568, !10, i64 592, !10, i64 600, !6, i64 608, !16, i64 616, !16, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !16, i64 638, !7, i64 640, !17, i64 644, !18, i64 648, !18, i64 658, !6, i64 672, !10, i64 680, !10, i64 688, !14, i64 696, !17, i64 700, !17, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !19, i64 760, !19, i64 765, !6, i64 776, !18, i64 784, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !14, i64 920, !14, i64 924, !10, i64 928, !10, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !7, i64 984, !7, i64 985, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !10, i64 1040, !6, i64 1048, !6, i64 1056, !14, i64 1064, !6, i64 1072, !7, i64 1080, !16, i64 1082, !16, i64 1084, !16, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !6, i64 1128, !6, i64 1136, !6, i64 1144, !6, i64 1152, !6, i64 1160, !6, i64 1168, !6, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !20, i64 1208, !10, i64 1240, !10, i64 1248, !6, i64 1256}
!13 = !{!"z_stream_s", !6, i64 0, !14, i64 8, !10, i64 16, !6, i64 24, !14, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !10, i64 96, !10, i64 104}
!14 = !{!"int", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!16 = !{!"short", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"png_color_16_struct", !7, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8}
!19 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!20 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !10, i64 16, !7, i64 24}
!21 = !{!12, !6, i64 1256}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !14, i64 0}
!26 = !{!"png_text_struct", !14, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!27 = !{!26, !6, i64 8}
!28 = !{!26, !6, i64 16}
!29 = !{!26, !10, i64 24}
!30 = !{!14, !14, i64 0}


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

@.str.108 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [43 x i8], align 1

declare void @png_error(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @png_crc_finish(ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @png_warning(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @png_malloc_warn(ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @png_free(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @png_handle_tEXt(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 280
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = and i64 %5, 1
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %7, label %8

7:                                                ; preds = %3
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.108) #3
  %.pre = load i64, ptr %4, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %7, %3
  %9 = phi i64 [ %.pre, %7 ], [ %5, %3 ]
  %10 = and i64 %9, 4
  %.not54 = icmp eq i64 %10, 0
  br i1 %.not54, label %13, label %11

11:                                               ; preds = %8
  %12 = or i64 %9, 8
  store i64 %12, ptr %4, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %11, %8
  %14 = getelementptr inbounds i8, ptr %0, i64 1256
  %15 = load ptr, ptr %14, align 8, !tbaa !19
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %15) #3
  %16 = add i64 %2, 1
  %17 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %16) #3
  store ptr %17, ptr %14, align 8, !tbaa !19
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %13
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.109) #3
  br label %42

20:                                               ; preds = %13
  tail call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %17, i64 noundef %2)
  %21 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef 0)
  %.not55 = icmp eq i32 %21, 0
  %22 = load ptr, ptr %14, align 8, !tbaa !19
  br i1 %.not55, label %24, label %23

23:                                               ; preds = %20
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %22) #3
  store ptr null, ptr %14, align 8, !tbaa !19
  br label %42

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %22, i64 %2
  store i8 0, ptr %25, align 1, !tbaa !20
  br label %26

26:                                               ; preds = %26, %24
  %.0 = phi ptr [ %22, %24 ], [ %28, %26 ]
  %27 = load i8, ptr %.0, align 1, !tbaa !20
  %.not56 = icmp eq i8 %27, 0
  %28 = getelementptr inbounds i8, ptr %.0, i64 1
  br i1 %.not56, label %29, label %26, !llvm.loop !21

29:                                               ; preds = %26
  %30 = tail call ptr @png_malloc_warn(ptr noundef %0, i64 noundef 32) #3
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %34

32:                                               ; preds = %29
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.110) #3
  %33 = load ptr, ptr %14, align 8, !tbaa !19
  tail call void @png_free(ptr noundef %0, ptr noundef %33) #3
  store ptr null, ptr %14, align 8, !tbaa !19
  br label %42

34:                                               ; preds = %29
  %.not57 = icmp ne ptr %.0, %25
  %spec.select.idx = zext i1 %.not57 to i64
  %spec.select = getelementptr inbounds i8, ptr %.0, i64 %spec.select.idx
  store i32 -1, ptr %30, align 8, !tbaa !23
  %35 = getelementptr inbounds i8, ptr %30, i64 8
  store ptr %22, ptr %35, align 8, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %30, i64 16
  store ptr %spec.select, ptr %36, align 8, !tbaa !26
  %37 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %spec.select) #4
  %38 = getelementptr inbounds i8, ptr %30, i64 24
  store i64 %37, ptr %38, align 8, !tbaa !27
  %39 = tail call i32 @png_set_text_2(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %30, i32 noundef 1) #3
  %40 = load ptr, ptr %14, align 8, !tbaa !19
  tail call void @png_free(ptr noundef %0, ptr noundef %40) #3
  store ptr null, ptr %14, align 8, !tbaa !19
  tail call void @png_free(ptr noundef %0, ptr noundef nonnull %30) #3
  %.not58 = icmp eq i32 %39, 0
  br i1 %.not58, label %42, label %41

41:                                               ; preds = %34
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.111) #3
  br label %42

42:                                               ; preds = %34, %41, %32, %23, %19
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

declare i32 @png_set_text_2(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 }
attributes #4 = { nounwind willreturn memory(read) }

!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 280}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !11, i64 304, !9, i64 416, !10, i64 424, !12, i64 432, !12, i64 436, !12, i64 440, !12, i64 444, !12, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !9, i64 520, !9, i64 528, !9, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !13, i64 568, !10, i64 592, !10, i64 600, !9, i64 608, !14, i64 616, !14, i64 618, !7, i64 620, !7, i64 625, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !14, i64 638, !7, i64 640, !15, i64 644, !16, i64 648, !16, i64 658, !9, i64 672, !10, i64 680, !10, i64 688, !12, i64 696, !15, i64 700, !15, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !9, i64 744, !9, i64 752, !17, i64 760, !17, i64 765, !9, i64 776, !16, i64 784, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !9, i64 856, !9, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !12, i64 920, !12, i64 924, !10, i64 928, !10, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !7, i64 984, !7, i64 985, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !10, i64 1040, !9, i64 1048, !9, i64 1056, !12, i64 1064, !9, i64 1072, !7, i64 1080, !14, i64 1082, !14, i64 1084, !14, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !9, i64 1128, !9, i64 1136, !9, i64 1144, !9, i64 1152, !9, i64 1160, !9, i64 1168, !9, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !18, i64 1208, !10, i64 1240, !10, i64 1248, !9, i64 1256}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !12, i64 8, !10, i64 16, !9, i64 24, !12, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !12, i64 88, !10, i64 96, !10, i64 104}
!12 = !{!"int", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!19 = !{!6, !9, i64 1256}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !12, i64 0}
!24 = !{!"png_text_struct", !12, i64 0, !9, i64 8, !9, i64 16, !10, i64 24}
!25 = !{!24, !9, i64 8}
!26 = !{!24, !9, i64 16}
!27 = !{!24, !10, i64 24}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass