; 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_info_struct = type { i64, i64, i64, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], float, i8, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i64, i64, i8, i64, i64, i8, ptr, float, float, float, float, float, float, float, float, ptr, i64, i64, ptr, ptr, i8, i8, i64, ptr, i64, ptr, ptr, i64, i8, ptr, i64, i8, double, double, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }

@.str.97 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.99 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.101 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [18 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_sCAL(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 double, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.png_struct_def, ptr %13, i32 0, i32 12
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %16 = and i64 %15, 1
  %17 = icmp ne i64 %16, 0
  br i1 %17, label %20, label %18

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

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

26:                                               ; preds = %20
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %27, ptr noundef @.str.98)
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = load i64, ptr %6, align 8, !tbaa !9
  %30 = call i32 @png_crc_finish(ptr noundef %28, i64 noundef %29)
  store i32 1, ptr %12, align 4
  br label %171

31:                                               ; preds = %20
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %45

34:                                               ; preds = %31
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_info_struct, ptr %35, i32 0, i32 2
  %37 = load i64, ptr %36, align 8, !tbaa !21
  %38 = and i64 %37, 16384
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %34
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %41, ptr noundef @.str.99)
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = load i64, ptr %6, align 8, !tbaa !9
  %44 = call i32 @png_crc_finish(ptr noundef %42, i64 noundef %43)
  store i32 1, ptr %12, align 4
  br label %171

45:                                               ; preds = %34, %31
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46, %18
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = load i64, ptr %6, align 8, !tbaa !9
  %50 = add i64 %49, 1
  %51 = call ptr @png_malloc_warn(ptr noundef %48, i64 noundef %50)
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.png_struct_def, ptr %52, i32 0, i32 137
  store ptr %51, ptr %53, align 8, !tbaa !25
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.png_struct_def, ptr %54, i32 0, i32 137
  %56 = load ptr, ptr %55, align 8, !tbaa !25
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %60

58:                                               ; preds = %47
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %59, ptr noundef @.str.100)
  store i32 1, ptr %12, align 4
  br label %171

60:                                               ; preds = %47
  %61 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %61, ptr %11, align 8, !tbaa !9
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.png_struct_def, ptr %63, i32 0, i32 137
  %65 = load ptr, ptr %64, align 8, !tbaa !25
  %66 = load i64, ptr %11, align 8, !tbaa !9
  call void @png_crc_read(ptr noundef %62, ptr noundef %65, i64 noundef %66)
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = call i32 @png_crc_finish(ptr noundef %67, i64 noundef 0)
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %77

70:                                               ; preds = %60
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.png_struct_def, ptr %72, i32 0, i32 137
  %74 = load ptr, ptr %73, align 8, !tbaa !25
  call void @png_free(ptr noundef %71, ptr noundef %74)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.png_struct_def, ptr %75, i32 0, i32 137
  store ptr null, ptr %76, align 8, !tbaa !25
  store i32 1, ptr %12, align 4
  br label %171

77:                                               ; preds = %60
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_struct_def, ptr %78, i32 0, i32 137
  %80 = load ptr, ptr %79, align 8, !tbaa !25
  %81 = load i64, ptr %11, align 8, !tbaa !9
  %82 = getelementptr inbounds i8, ptr %80, i64 %81
  store i8 0, ptr %82, align 1, !tbaa !26
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.png_struct_def, ptr %83, i32 0, i32 137
  %85 = load ptr, ptr %84, align 8, !tbaa !25
  %86 = getelementptr inbounds i8, ptr %85, i64 1
  store ptr %86, ptr %7, align 8, !tbaa !5
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = call double @strtod(ptr noundef %87, ptr noundef %10) #4
  store double %88, ptr %8, align 8, !tbaa !27
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load i8, ptr %89, align 1, !tbaa !26
  %91 = icmp ne i8 %90, 0
  br i1 %91, label %92, label %94

92:                                               ; preds = %77
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %93, ptr noundef @.str.101)
  store i32 1, ptr %12, align 4
  br label %171

94:                                               ; preds = %77
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.png_struct_def, ptr %95, i32 0, i32 137
  %97 = load ptr, ptr %96, align 8, !tbaa !25
  store ptr %97, ptr %7, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %103, %94
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = load i8, ptr %99, align 1, !tbaa !26
  %101 = icmp ne i8 %100, 0
  br i1 %101, label %102, label %106

102:                                              ; preds = %98
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i32 1
  store ptr %105, ptr %7, align 8, !tbaa !5
  br label %98, !llvm.loop !28

106:                                              ; preds = %98
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i32 1
  store ptr %108, ptr %7, align 8, !tbaa !5
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.png_struct_def, ptr %109, i32 0, i32 137
  %111 = load ptr, ptr %110, align 8, !tbaa !25
  %112 = load i64, ptr %11, align 8, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %111, i64 %112
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = icmp ult ptr %113, %114
  br i1 %115, label %116, label %124

116:                                              ; preds = %106
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %117, ptr noundef @.str.102)
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_struct_def, ptr %119, i32 0, i32 137
  %121 = load ptr, ptr %120, align 8, !tbaa !25
  call void @png_free(ptr noundef %118, ptr noundef %121)
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.png_struct_def, ptr %122, i32 0, i32 137
  store ptr null, ptr %123, align 8, !tbaa !25
  store i32 1, ptr %12, align 4
  br label %171

124:                                              ; preds = %106
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = call double @strtod(ptr noundef %125, ptr noundef %10) #4
  store double %126, ptr %9, align 8, !tbaa !27
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = load i8, ptr %127, align 1, !tbaa !26
  %129 = icmp ne i8 %128, 0
  br i1 %129, label %130, label %132

130:                                              ; preds = %124
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %131, ptr noundef @.str.103)
  store i32 1, ptr %12, align 4
  br label %171

132:                                              ; preds = %124
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.png_struct_def, ptr %133, i32 0, i32 137
  %135 = load ptr, ptr %134, align 8, !tbaa !25
  %136 = load i64, ptr %11, align 8, !tbaa !9
  %137 = getelementptr inbounds i8, ptr %135, i64 %136
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = icmp ult ptr %137, %138
  br i1 %139, label %146, label %140

140:                                              ; preds = %132
  %141 = load double, ptr %8, align 8, !tbaa !27
  %142 = fcmp ole double %141, 0.000000e+00
  br i1 %142, label %146, label %143

143:                                              ; preds = %140
  %144 = load double, ptr %9, align 8, !tbaa !27
  %145 = fcmp ole double %144, 0.000000e+00
  br i1 %145, label %146, label %154

146:                                              ; preds = %143, %140, %132
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %147, ptr noundef @.str.104)
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.png_struct_def, ptr %149, i32 0, i32 137
  %151 = load ptr, ptr %150, align 8, !tbaa !25
  call void @png_free(ptr noundef %148, ptr noundef %151)
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.png_struct_def, ptr %152, i32 0, i32 137
  store ptr null, ptr %153, align 8, !tbaa !25
  store i32 1, ptr %12, align 4
  br label %171

154:                                              ; preds = %143
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.png_struct_def, ptr %157, i32 0, i32 137
  %159 = load ptr, ptr %158, align 8, !tbaa !25
  %160 = getelementptr inbounds i8, ptr %159, i64 0
  %161 = load i8, ptr %160, align 1, !tbaa !26
  %162 = sext i8 %161 to i32
  %163 = load double, ptr %8, align 8, !tbaa !27
  %164 = load double, ptr %9, align 8, !tbaa !27
  call void @png_set_sCAL(ptr noundef %155, ptr noundef %156, i32 noundef %162, double noundef %163, double noundef %164)
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.png_struct_def, ptr %166, i32 0, i32 137
  %168 = load ptr, ptr %167, align 8, !tbaa !25
  call void @png_free(ptr noundef %165, ptr noundef %168)
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.png_struct_def, ptr %169, i32 0, i32 137
  store ptr null, ptr %170, align 8, !tbaa !25
  store i32 0, ptr %12, align 4
  br label %171

171:                                              ; preds = %154, %146, %130, %116, %92, %70, %58, %40, %26
  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
  %172 = load i32, ptr %12, align 4
  switch i32 %172, label %174 [
    i32 0, label %173
    i32 1, label %173
  ]

173:                                              ; preds = %171, %171
  ret void

174:                                              ; preds = %171
  unreachable
}

; Function Attrs: nounwind
declare double @strtod(ptr noundef, ptr noundef) #3

declare void @png_set_sCAL(ptr noundef, ptr noundef, i32 noundef, double noundef, double 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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !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 = !{!22, !10, i64 16}
!22 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !16, i64 40, !16, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52, !17, i64 60, !7, i64 64, !14, i64 68, !14, i64 72, !6, i64 80, !23, i64 88, !19, i64 96, !6, i64 104, !18, i64 112, !18, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !6, i64 184, !17, i64 192, !17, i64 196, !17, i64 200, !17, i64 204, !17, i64 208, !17, i64 212, !17, i64 216, !17, i64 220, !6, i64 224, !10, i64 232, !10, i64 240, !6, i64 248, !6, i64 256, !7, i64 264, !7, i64 265, !10, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !6, i64 304, !10, i64 312, !7, i64 320, !6, i64 328, !10, i64 336, !7, i64 344, !24, i64 352, !24, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456}
!23 = !{!"png_time_struct", !16, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!24 = !{!"double", !7, i64 0}
!25 = !{!12, !6, i64 1256}
!26 = !{!7, !7, i64 0}
!27 = !{!24, !24, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; 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.97 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.99 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.101 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [18 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

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

; Function Attrs: mustprogress 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) local_unnamed_addr #2

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

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

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

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

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

8:                                                ; preds = %3
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.97) #4
  br label %20

9:                                                ; preds = %3
  %10 = and i64 %6, 4
  %.not66 = icmp eq i64 %10, 0
  br i1 %.not66, label %13, label %11

11:                                               ; preds = %9
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.98) #4
  %12 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %65

13:                                               ; preds = %9
  %.not67 = icmp eq ptr %1, null
  br i1 %.not67, label %20, label %14

14:                                               ; preds = %13
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = load i64, ptr %15, align 8, !tbaa !19
  %17 = and i64 %16, 16384
  %.not68 = icmp eq i64 %17, 0
  br i1 %.not68, label %20, label %18

18:                                               ; preds = %14
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.99) #4
  %19 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef %2)
  br label %65

20:                                               ; preds = %14, %13, %8
  %21 = add i64 %2, 1
  %22 = tail call ptr @png_malloc_warn(ptr noundef nonnull %0, i64 noundef %21) #4
  %23 = getelementptr inbounds i8, ptr %0, i64 1256
  store ptr %22, ptr %23, align 8, !tbaa !23
  %24 = icmp eq ptr %22, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %20
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.100) #4
  br label %65

26:                                               ; preds = %20
  tail call void @png_crc_read(ptr noundef nonnull %0, ptr noundef nonnull %22, i64 noundef %2)
  %27 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i64 noundef 0)
  %.not69 = icmp eq i32 %27, 0
  %28 = load ptr, ptr %23, align 8, !tbaa !23
  br i1 %.not69, label %30, label %29

29:                                               ; preds = %26
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %28) #4
  store ptr null, ptr %23, align 8, !tbaa !23
  br label %65

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %28, i64 %2
  store i8 0, ptr %31, align 1, !tbaa !24
  %32 = load ptr, ptr %23, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %32, i64 1
  %34 = call double @strtod(ptr noundef nonnull %33, ptr noundef nonnull %4) #4
  %35 = load ptr, ptr %4, align 8, !tbaa !25
  %36 = load i8, ptr %35, align 1, !tbaa !24
  %.not70 = icmp eq i8 %36, 0
  br i1 %.not70, label %38, label %37

37:                                               ; preds = %30
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.101) #4
  br label %65

38:                                               ; preds = %30
  %39 = load ptr, ptr %23, align 8, !tbaa !23
  br label %40

40:                                               ; preds = %40, %38
  %.0 = phi ptr [ %39, %38 ], [ %42, %40 ]
  %41 = load i8, ptr %.0, align 1, !tbaa !24
  %.not71 = icmp eq i8 %41, 0
  %42 = getelementptr inbounds i8, ptr %.0, i64 1
  br i1 %.not71, label %43, label %40, !llvm.loop !26

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %39, i64 %2
  %45 = icmp ult ptr %44, %42
  br i1 %45, label %46, label %48

46:                                               ; preds = %43
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.102) #4
  %47 = load ptr, ptr %23, align 8, !tbaa !23
  tail call void @png_free(ptr noundef %0, ptr noundef %47) #4
  store ptr null, ptr %23, align 8, !tbaa !23
  br label %65

48:                                               ; preds = %43
  %49 = call double @strtod(ptr noundef nonnull %42, ptr noundef nonnull %4) #4
  %50 = load ptr, ptr %4, align 8, !tbaa !25
  %51 = load i8, ptr %50, align 1, !tbaa !24
  %.not72 = icmp eq i8 %51, 0
  br i1 %.not72, label %53, label %52

52:                                               ; preds = %48
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.103) #4
  br label %65

53:                                               ; preds = %48
  %54 = load ptr, ptr %23, align 8, !tbaa !23
  %55 = getelementptr inbounds i8, ptr %54, i64 %2
  %56 = icmp ult ptr %55, %42
  %57 = fcmp ole double %34, 0.000000e+00
  %or.cond = select i1 %56, i1 true, i1 %57
  %58 = fcmp ole double %49, 0.000000e+00
  %or.cond3 = select i1 %or.cond, i1 true, i1 %58
  br i1 %or.cond3, label %59, label %61

59:                                               ; preds = %53
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.104) #4
  %60 = load ptr, ptr %23, align 8, !tbaa !23
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %60) #4
  store ptr null, ptr %23, align 8, !tbaa !23
  br label %65

61:                                               ; preds = %53
  %62 = load i8, ptr %54, align 1, !tbaa !24
  %63 = sext i8 %62 to i32
  tail call void @png_set_sCAL(ptr noundef nonnull %0, ptr noundef %1, i32 noundef %63, double noundef %34, double noundef %49) #4
  %64 = load ptr, ptr %23, align 8, !tbaa !23
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %64) #4
  store ptr null, ptr %23, align 8, !tbaa !23
  br label %65

65:                                               ; preds = %61, %59, %52, %46, %37, %29, %25, %18, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn
declare double @strtod(ptr noundef readonly, ptr nocapture noundef) local_unnamed_addr #3

declare void @png_set_sCAL(ptr noundef, ptr noundef, i32 noundef, double noundef, double noundef) local_unnamed_addr #1

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 nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!20, !10, i64 16}
!20 = !{!"png_info_struct", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !9, i64 32, !14, i64 40, !14, i64 42, !7, i64 44, !7, i64 45, !7, i64 46, !7, i64 47, !7, i64 48, !7, i64 49, !7, i64 50, !7, i64 51, !7, i64 52, !15, i64 60, !7, i64 64, !12, i64 68, !12, i64 72, !9, i64 80, !21, i64 88, !17, i64 96, !9, i64 104, !16, i64 112, !16, i64 122, !10, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 168, !7, i64 176, !9, i64 184, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !9, i64 224, !10, i64 232, !10, i64 240, !9, i64 248, !9, i64 256, !7, i64 264, !7, i64 265, !10, i64 272, !9, i64 280, !10, i64 288, !9, i64 296, !9, i64 304, !10, i64 312, !7, i64 320, !9, i64 328, !10, i64 336, !7, i64 344, !22, i64 352, !22, i64 360, !9, i64 368, !9, i64 376, !9, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !10, i64 448, !10, i64 456}
!21 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!22 = !{!"double", !7, i64 0}
!23 = !{!6, !9, i64 1256}
!24 = !{!7, !7, i64 0}
!25 = !{!9, !9, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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