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

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

@png_libpng_ver = external constant [18 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [55 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @png_create_write_struct_2(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca [80 x i8], align 16
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %20 = load ptr, ptr %14, align 8, !tbaa !5
  %21 = load ptr, ptr %13, align 8, !tbaa !5
  %22 = call ptr @png_create_struct_2(i32 noundef 1, ptr noundef %20, ptr noundef %21)
  store volatile ptr %22, ptr %16, align 8, !tbaa !5
  %23 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %7
  store ptr null, ptr %8, align 8
  store i32 1, ptr %18, align 4
  br label %164

26:                                               ; preds = %7
  %27 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 132
  store i64 1000000, ptr %28, align 8, !tbaa !9
  %29 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.png_struct_def, ptr %29, i32 0, i32 133
  store i64 1000000, ptr %30, align 8, !tbaa !20
  %31 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.png_struct_def, ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %32, i64 0, i64 0
  %34 = call i32 @_setjmp(ptr noundef %33) #7
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %44

36:                                               ; preds = %26
  %37 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %38 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 16
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  call void @png_free(ptr noundef %37, ptr noundef %40)
  %41 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_struct_def, ptr %41, i32 0, i32 16
  store ptr null, ptr %42, align 8, !tbaa !21
  %43 = load volatile ptr, ptr %16, align 8, !tbaa !5
  call void @png_destroy_struct(ptr noundef %43)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %18, align 4
  br label %164

44:                                               ; preds = %26
  %45 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %46 = load ptr, ptr %13, align 8, !tbaa !5
  %47 = load ptr, ptr %14, align 8, !tbaa !5
  %48 = load ptr, ptr %15, align 8, !tbaa !5
  call void @png_set_mem_fn(ptr noundef %45, ptr noundef %46, ptr noundef %47, ptr noundef %48)
  %49 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  call void @png_set_error_fn(ptr noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %52)
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %83

55:                                               ; preds = %44
  store i32 0, ptr %17, align 4, !tbaa !22
  br label %56

56:                                               ; preds = %75, %55
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = load i32, ptr %17, align 4, !tbaa !22
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %57, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !23
  %62 = sext i8 %61 to i32
  %63 = load i32, ptr %17, align 4, !tbaa !22
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [18 x i8], ptr @png_libpng_ver, i64 0, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !23
  %67 = sext i8 %66 to i32
  %68 = icmp ne i32 %62, %67
  br i1 %68, label %69, label %74

69:                                               ; preds = %56
  %70 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.png_struct_def, ptr %70, i32 0, i32 13
  %72 = load i64, ptr %71, align 8, !tbaa !24
  %73 = or i64 %72, 131072
  store i64 %73, ptr %71, align 8, !tbaa !24
  br label %74

74:                                               ; preds = %69, %56
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %17, align 4, !tbaa !22
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %17, align 4, !tbaa !22
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds [18 x i8], ptr @png_libpng_ver, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !23
  %81 = icmp ne i8 %80, 0
  br i1 %81, label %56, label %82, !llvm.loop !25

82:                                               ; preds = %75
  br label %83

83:                                               ; preds = %82, %44
  %84 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.png_struct_def, ptr %84, i32 0, i32 13
  %86 = load i64, ptr %85, align 8, !tbaa !24
  %87 = and i64 %86, 131072
  %88 = icmp ne i64 %87, 0
  br i1 %88, label %89, label %144

89:                                               ; preds = %83
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = icmp eq ptr %90, null
  br i1 %91, label %126, label %92

92:                                               ; preds = %89
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 0
  %95 = load i8, ptr %94, align 1, !tbaa !23
  %96 = sext i8 %95 to i32
  %97 = load i8, ptr @png_libpng_ver, align 16, !tbaa !23
  %98 = sext i8 %97 to i32
  %99 = icmp ne i32 %96, %98
  br i1 %99, label %126, label %100

100:                                              ; preds = %92
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds i8, ptr %101, i64 0
  %103 = load i8, ptr %102, align 1, !tbaa !23
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 49
  br i1 %105, label %106, label %114

106:                                              ; preds = %100
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i64 2
  %109 = load i8, ptr %108, align 1, !tbaa !23
  %110 = sext i8 %109 to i32
  %111 = load i8, ptr getelementptr inbounds ([18 x i8], ptr @png_libpng_ver, i64 0, i64 2), align 2, !tbaa !23
  %112 = sext i8 %111 to i32
  %113 = icmp ne i32 %110, %112
  br i1 %113, label %126, label %114

114:                                              ; preds = %106, %100
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds i8, ptr %115, i64 0
  %117 = load i8, ptr %116, align 1, !tbaa !23
  %118 = sext i8 %117 to i32
  %119 = icmp eq i32 %118, 48
  br i1 %119, label %120, label %143

120:                                              ; preds = %114
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i64 2
  %123 = load i8, ptr %122, align 1, !tbaa !23
  %124 = sext i8 %123 to i32
  %125 = icmp slt i32 %124, 57
  br i1 %125, label %126, label %143

126:                                              ; preds = %120, %106, %92, %89
  call void @llvm.lifetime.start.p0(i64 80, ptr %19) #6
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %135

129:                                              ; preds = %126
  %130 = getelementptr inbounds [80 x i8], ptr %19, i64 0, i64 0
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %130, i64 noundef 80, ptr noundef @.str.5, ptr noundef %131) #6
  %133 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %134 = getelementptr inbounds [80 x i8], ptr %19, i64 0, i64 0
  call void @png_warning(ptr noundef %133, ptr noundef %134)
  br label %135

135:                                              ; preds = %129, %126
  %136 = getelementptr inbounds [80 x i8], ptr %19, i64 0, i64 0
  %137 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %136, i64 noundef 80, ptr noundef @.str.6, ptr noundef @png_libpng_ver) #6
  %138 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %139 = getelementptr inbounds [80 x i8], ptr %19, i64 0, i64 0
  call void @png_warning(ptr noundef %138, ptr noundef %139)
  %140 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.png_struct_def, ptr %140, i32 0, i32 13
  store i64 0, ptr %141, align 8, !tbaa !24
  %142 = load volatile ptr, ptr %16, align 8, !tbaa !5
  call void @png_error(ptr noundef %142, ptr noundef @.str.7)
  call void @llvm.lifetime.end.p0(i64 80, ptr %19) #6
  br label %143

143:                                              ; preds = %135, %120, %114
  br label %144

144:                                              ; preds = %143, %83
  %145 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.png_struct_def, ptr %145, i32 0, i32 17
  store i64 8192, ptr %146, align 8, !tbaa !27
  %147 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %148 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.png_struct_def, ptr %148, i32 0, i32 17
  %150 = load i64, ptr %149, align 8, !tbaa !27
  %151 = call ptr @png_malloc(ptr noundef %147, i64 noundef %150)
  %152 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.png_struct_def, ptr %152, i32 0, i32 16
  store ptr %151, ptr %153, align 8, !tbaa !21
  %154 = load volatile ptr, ptr %16, align 8, !tbaa !5
  call void @png_set_write_fn(ptr noundef %154, ptr noundef null, ptr noundef null, ptr noundef null)
  %155 = load volatile ptr, ptr %16, align 8, !tbaa !5
  call void @png_set_filter_heuristics(ptr noundef %155, i32 noundef 0, i32 noundef 1, ptr noundef null, ptr noundef null)
  %156 = load volatile ptr, ptr %16, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.png_struct_def, ptr %156, i32 0, i32 0
  %158 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %157, i64 0, i64 0
  %159 = call i32 @_setjmp(ptr noundef %158) #7
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %161, label %162

161:                                              ; preds = %144
  call void @abort() #8
  unreachable

162:                                              ; preds = %144
  %163 = load volatile ptr, ptr %16, align 8, !tbaa !5
  store ptr %163, ptr %8, align 8
  store i32 1, ptr %18, align 4
  br label %164

164:                                              ; preds = %162, %36, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %165 = load ptr, ptr %8, align 8
  ret ptr %165
}

declare ptr @png_create_struct_2(i32 noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #3

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

declare void @png_destroy_struct(ptr noundef) #0

declare void @png_set_mem_fn(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare void @png_set_error_fn(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #4

declare ptr @png_malloc(ptr noundef, i64 noundef) #0

declare void @png_set_write_fn(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

; Function Attrs: noreturn nounwind
declare void @abort() #5

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 returns_twice "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 "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 = { noreturn 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 #6 = { nounwind }
attributes #7 = { nounwind returns_twice }
attributes #8 = { noreturn 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, !11, i64 1192}
!10 = !{!"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, !11, i64 280, !11, i64 288, !11, i64 296, !12, i64 304, !6, i64 416, !11, i64 424, !13, i64 432, !13, i64 436, !13, i64 440, !13, i64 444, !13, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !14, i64 568, !11, i64 592, !11, i64 600, !6, i64 608, !15, i64 616, !15, 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, !15, i64 638, !7, i64 640, !16, i64 644, !17, i64 648, !17, i64 658, !6, i64 672, !11, i64 680, !11, i64 688, !13, i64 696, !16, i64 700, !16, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !18, i64 760, !18, i64 765, !6, i64 776, !17, 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, !11, i64 872, !11, i64 880, !11, i64 888, !11, i64 896, !11, i64 904, !11, i64 912, !13, i64 920, !13, i64 924, !11, i64 928, !11, 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, !11, i64 1040, !6, i64 1048, !6, i64 1056, !13, i64 1064, !6, i64 1072, !7, i64 1080, !15, i64 1082, !15, i64 1084, !15, i64 1086, !11, i64 1088, !11, i64 1096, !7, i64 1104, !7, i64 1105, !11, i64 1112, !11, 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, !11, i64 1192, !11, i64 1200, !19, i64 1208, !11, i64 1240, !11, i64 1248, !6, i64 1256}
!11 = !{!"long", !7, i64 0}
!12 = !{!"z_stream_s", !6, i64 0, !13, i64 8, !11, i64 16, !6, i64 24, !13, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !11, i64 96, !11, i64 104}
!13 = !{!"int", !7, i64 0}
!14 = !{!"png_row_info_struct", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!15 = !{!"short", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!18 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!19 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !11, i64 16, !7, i64 24}
!20 = !{!10, !11, i64 1200}
!21 = !{!10, !6, i64 416}
!22 = !{!13, !13, i64 0}
!23 = !{!7, !7, i64 0}
!24 = !{!10, !11, i64 288}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!10, !11, i64 424}


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

@png_libpng_ver = external constant [18 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [55 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @png_create_write_struct_2(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #2 {
  %8 = alloca ptr, align 8
  %9 = alloca [80 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8)
  %10 = call ptr @png_create_struct_2(i32 noundef 1, ptr noundef %5, ptr noundef %4) #6
  store volatile ptr %10, ptr %8, align 8, !tbaa !5
  %.0..0..0..0. = load volatile ptr, ptr %8, align 8, !tbaa !5
  %11 = icmp eq ptr %.0..0..0..0., null
  br i1 %11, label %62, label %12

12:                                               ; preds = %7
  %.0..0..0..0.3 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %.0..0..0..0.3, i64 1192
  store i64 1000000, ptr %13, align 8, !tbaa !9
  %.0..0..0..0.4 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %.0..0..0..0.4, i64 1200
  store i64 1000000, ptr %14, align 8, !tbaa !20
  %.0..0..0..0.5 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %15 = call i32 @_setjmp(ptr noundef %.0..0..0..0.5) #7
  %.not = icmp eq i32 %15, 0
  %.0..0..0..0.10 = load volatile ptr, ptr %8, align 8, !tbaa !5
  br i1 %.not, label %20, label %16

16:                                               ; preds = %12
  %.0..0..0..0.7 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %.0..0..0..0.7, i64 416
  %18 = load ptr, ptr %17, align 8, !tbaa !21
  call void @png_free(ptr noundef %.0..0..0..0.10, ptr noundef %18) #6
  %.0..0..0..0.8 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %.0..0..0..0.8, i64 416
  store ptr null, ptr %19, align 8, !tbaa !21
  %.0..0..0..0.9 = load volatile ptr, ptr %8, align 8, !tbaa !5
  call void @png_destroy_struct(ptr noundef %.0..0..0..0.9) #6
  br label %62

20:                                               ; preds = %12
  call void @png_set_mem_fn(ptr noundef %.0..0..0..0.10, ptr noundef %4, ptr noundef %5, ptr noundef %6) #6
  %.0..0..0..0.11 = load volatile ptr, ptr %8, align 8, !tbaa !5
  call void @png_set_error_fn(ptr noundef %.0..0..0..0.11, ptr noundef %1, ptr noundef %2, ptr noundef %3) #6
  %.not48 = icmp eq ptr %0, null
  br i1 %.not48, label %.thread, label %.preheader

.preheader:                                       ; preds = %20, %29
  %indvars.iv = phi i64 [ %indvars.iv.next, %29 ], [ 0, %20 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv
  %22 = load i8, ptr %21, align 1, !tbaa !22
  %23 = getelementptr inbounds [18 x i8], ptr @png_libpng_ver, i64 0, i64 %indvars.iv
  %24 = load i8, ptr %23, align 1, !tbaa !22
  %.not49 = icmp eq i8 %22, %24
  br i1 %.not49, label %29, label %25

25:                                               ; preds = %.preheader
  %.0..0..0..0.12 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %.0..0..0..0.12, i64 288
  %27 = load i64, ptr %26, align 8, !tbaa !23
  %28 = or i64 %27, 131072
  store i64 %28, ptr %26, align 8, !tbaa !23
  br label %29

29:                                               ; preds = %.preheader, %25
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not50 = icmp eq i8 %24, 0
  br i1 %.not50, label %30, label %.preheader, !llvm.loop !24

30:                                               ; preds = %29
  %.0..0..0..0.13 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %.0..0..0..0.13, i64 288
  %32 = load i64, ptr %31, align 8, !tbaa !23
  %33 = and i64 %32, 131072
  %.not51 = icmp eq i64 %33, 0
  br i1 %.not51, label %.thread58, label %37

.thread:                                          ; preds = %20
  %.0..0..0..0.1355 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %.0..0..0..0.1355, i64 288
  %35 = load i64, ptr %34, align 8, !tbaa !23
  %36 = and i64 %35, 131072
  %.not5156 = icmp eq i64 %36, 0
  br i1 %.not5156, label %.thread58, label %.thread57

37:                                               ; preds = %30
  %38 = load i8, ptr %0, align 1, !tbaa !22
  %39 = load i8, ptr @png_libpng_ver, align 16, !tbaa !22
  %.not52 = icmp eq i8 %38, %39
  br i1 %.not52, label %40, label %49

40:                                               ; preds = %37
  switch i8 %38, label %.thread58 [
    i8 49, label %41
    i8 48, label %45
  ]

41:                                               ; preds = %40
  %42 = getelementptr inbounds i8, ptr %0, i64 2
  %43 = load i8, ptr %42, align 1, !tbaa !22
  %44 = load i8, ptr getelementptr inbounds (i8, ptr @png_libpng_ver, i64 2), align 2, !tbaa !22
  %.not53 = icmp eq i8 %43, %44
  br i1 %.not53, label %.thread58, label %49

45:                                               ; preds = %40
  %46 = getelementptr inbounds i8, ptr %0, i64 2
  %47 = load i8, ptr %46, align 1, !tbaa !22
  %48 = icmp slt i8 %47, 57
  br i1 %48, label %49, label %.thread58

.thread57:                                        ; preds = %.thread
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %9) #6
  br label %51

49:                                               ; preds = %45, %41, %37
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %9) #6
  %50 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %9, i64 noundef 80, ptr noundef nonnull @.str.5, ptr noundef nonnull %0) #6
  %.0..0..0..0.14 = load volatile ptr, ptr %8, align 8, !tbaa !5
  call void @png_warning(ptr noundef %.0..0..0..0.14, ptr noundef nonnull %9) #6
  br label %51

51:                                               ; preds = %.thread57, %49
  %52 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %9, i64 noundef 80, ptr noundef nonnull @.str.6, ptr noundef nonnull @png_libpng_ver) #6
  %.0..0..0..0.15 = load volatile ptr, ptr %8, align 8, !tbaa !5
  call void @png_warning(ptr noundef %.0..0..0..0.15, ptr noundef nonnull %9) #6
  %.0..0..0..0.16 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %.0..0..0..0.16, i64 288
  store i64 0, ptr %53, align 8, !tbaa !23
  %.0..0..0..0.17 = load volatile ptr, ptr %8, align 8, !tbaa !5
  call void @png_error(ptr noundef %.0..0..0..0.17, ptr noundef nonnull @.str.7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %9) #6
  br label %.thread58

.thread58:                                        ; preds = %40, %41, %.thread, %45, %51, %30
  %.0..0..0..0.18 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %.0..0..0..0.18, i64 424
  store i64 8192, ptr %54, align 8, !tbaa !26
  %.0..0..0..0.19 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %.0..0..0..0.20 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %.0..0..0..0.20, i64 424
  %56 = load i64, ptr %55, align 8, !tbaa !26
  %57 = call ptr @png_malloc(ptr noundef %.0..0..0..0.19, i64 noundef %56) #6
  %.0..0..0..0.21 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %.0..0..0..0.21, i64 416
  store ptr %57, ptr %58, align 8, !tbaa !21
  %.0..0..0..0.22 = load volatile ptr, ptr %8, align 8, !tbaa !5
  call void @png_set_write_fn(ptr noundef %.0..0..0..0.22, ptr noundef null, ptr noundef null, ptr noundef null) #6
  %.0..0..0..0.23 = load volatile ptr, ptr %8, align 8, !tbaa !5
  call void @png_set_filter_heuristics(ptr noundef %.0..0..0..0.23, i32 noundef 0, i32 noundef 1, ptr noundef null, ptr noundef null)
  %.0..0..0..0.24 = load volatile ptr, ptr %8, align 8, !tbaa !5
  %59 = call i32 @_setjmp(ptr noundef %.0..0..0..0.24) #7
  %.not54 = icmp eq i32 %59, 0
  br i1 %.not54, label %61, label %60

60:                                               ; preds = %.thread58
  call void @abort() #8
  unreachable

61:                                               ; preds = %.thread58
  %.0..0..0..0.25 = load volatile ptr, ptr %8, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %7, %61, %16
  %.045 = phi ptr [ null, %16 ], [ %.0..0..0..0.25, %61 ], [ null, %7 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8)
  ret ptr %.045
}

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

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #3

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

declare void @png_destroy_struct(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

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

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #5

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 returns_twice "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 = { nofree 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 #5 = { noreturn 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 #6 = { nounwind }
attributes #7 = { nounwind returns_twice }
attributes #8 = { noreturn 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, !11, i64 1192}
!10 = !{!"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, !11, i64 280, !11, i64 288, !11, i64 296, !12, i64 304, !6, i64 416, !11, i64 424, !13, i64 432, !13, i64 436, !13, i64 440, !13, i64 444, !13, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !14, i64 568, !11, i64 592, !11, i64 600, !6, i64 608, !15, i64 616, !15, 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, !15, i64 638, !7, i64 640, !16, i64 644, !17, i64 648, !17, i64 658, !6, i64 672, !11, i64 680, !11, i64 688, !13, i64 696, !16, i64 700, !16, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !18, i64 760, !18, i64 765, !6, i64 776, !17, 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, !11, i64 872, !11, i64 880, !11, i64 888, !11, i64 896, !11, i64 904, !11, i64 912, !13, i64 920, !13, i64 924, !11, i64 928, !11, 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, !11, i64 1040, !6, i64 1048, !6, i64 1056, !13, i64 1064, !6, i64 1072, !7, i64 1080, !15, i64 1082, !15, i64 1084, !15, i64 1086, !11, i64 1088, !11, i64 1096, !7, i64 1104, !7, i64 1105, !11, i64 1112, !11, 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, !11, i64 1192, !11, i64 1200, !19, i64 1208, !11, i64 1240, !11, i64 1248, !6, i64 1256}
!11 = !{!"long", !7, i64 0}
!12 = !{!"z_stream_s", !6, i64 0, !13, i64 8, !11, i64 16, !6, i64 24, !13, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !11, i64 96, !11, i64 104}
!13 = !{!"int", !7, i64 0}
!14 = !{!"png_row_info_struct", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!15 = !{!"short", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!18 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!19 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !11, i64 16, !7, i64 24}
!20 = !{!10, !11, i64 1200}
!21 = !{!10, !6, i64 416}
!22 = !{!7, !7, i64 0}
!23 = !{!10, !11, i64 288}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!10, !11, i64 424}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass