; LLVM IR from niessner/Matterport :: code/gaps/pkgs/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, ptr, i8, i8, i32, i32, i32, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i32, i32, 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, i32, i32, 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, i32, i32, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr, i8, i16, i16, i16, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, %struct.png_unknown_chunk_t, i32, i32, ptr, i32 }
%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 { i32, 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 }

@.str.4 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.6 = 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

; 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 i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = 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 4, ptr %16) #6
  store volatile i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %21 = load ptr, ptr %14, align 8, !tbaa !5
  %22 = load ptr, ptr %13, align 8, !tbaa !5
  %23 = call ptr @png_create_struct_2(i32 noundef 1, ptr noundef %21, ptr noundef %22)
  store volatile ptr %23, ptr %17, align 8, !tbaa !5
  %24 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %7
  store ptr null, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %182

27:                                               ; preds = %7
  %28 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.png_struct_def, ptr %28, i32 0, i32 130
  store i32 1000000, ptr %29, align 4, !tbaa !11
  %30 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.png_struct_def, ptr %30, i32 0, i32 131
  store i32 1000000, ptr %31, align 8, !tbaa !21
  %32 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %33 = call ptr @png_set_longjmp_fn(ptr noundef %32, ptr noundef @longjmp, i64 noundef 200)
  %34 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %33, i64 0, i64 0
  %35 = call i32 @_setjmp(ptr noundef %34) #7
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %27
  call void @abort() #8
  unreachable

38:                                               ; preds = %27
  %39 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %40 = load ptr, ptr %13, align 8, !tbaa !5
  %41 = load ptr, ptr %14, align 8, !tbaa !5
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  call void @png_set_mem_fn(ptr noundef %39, ptr noundef %40, ptr noundef %41, ptr noundef %42)
  %43 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  call void @png_set_error_fn(ptr noundef %43, ptr noundef %44, ptr noundef %45, ptr noundef %46)
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %81

49:                                               ; preds = %38
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %72, %49
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = load i32, ptr %18, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i8, ptr %51, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !22
  %56 = sext i8 %55 to i32
  %57 = call ptr @png_get_header_ver(ptr noundef null)
  %58 = load i32, ptr %18, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %57, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !22
  %62 = sext i8 %61 to i32
  %63 = icmp ne i32 %56, %62
  br i1 %63, label %64, label %71

64:                                               ; preds = %50
  %65 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_struct_def, ptr %65, i32 0, i32 14
  %67 = load i32, ptr %66, align 8, !tbaa !23
  %68 = zext i32 %67 to i64
  %69 = or i64 %68, 131072
  %70 = trunc i64 %69 to i32
  store i32 %70, ptr %66, align 8, !tbaa !23
  br label %71

71:                                               ; preds = %64, %50
  br label %72

72:                                               ; preds = %71
  %73 = call ptr @png_get_header_ver(ptr noundef null)
  %74 = load i32, ptr %18, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %18, align 4, !tbaa !9
  %76 = sext i32 %74 to i64
  %77 = getelementptr inbounds i8, ptr %73, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !22
  %79 = icmp ne i8 %78, 0
  br i1 %79, label %50, label %80, !llvm.loop !24

80:                                               ; preds = %72
  br label %81

81:                                               ; preds = %80, %38
  %82 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.png_struct_def, ptr %82, i32 0, i32 14
  %84 = load i32, ptr %83, align 8, !tbaa !23
  %85 = zext i32 %84 to i64
  %86 = and i64 %85, 131072
  %87 = icmp ne i64 %86, 0
  br i1 %87, label %88, label %146

88:                                               ; preds = %81
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = icmp eq ptr %89, null
  br i1 %90, label %129, label %91

91:                                               ; preds = %88
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i64 0
  %94 = load i8, ptr %93, align 1, !tbaa !22
  %95 = sext i8 %94 to i32
  %96 = call ptr @png_get_header_ver(ptr noundef null)
  %97 = getelementptr inbounds i8, ptr %96, i64 0
  %98 = load i8, ptr %97, align 1, !tbaa !22
  %99 = sext i8 %98 to i32
  %100 = icmp ne i32 %95, %99
  br i1 %100, label %129, label %101

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

107:                                              ; preds = %101
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i64 2
  %110 = load i8, ptr %109, align 1, !tbaa !22
  %111 = sext i8 %110 to i32
  %112 = call ptr @png_get_header_ver(ptr noundef null)
  %113 = getelementptr inbounds i8, ptr %112, i64 2
  %114 = load i8, ptr %113, align 1, !tbaa !22
  %115 = sext i8 %114 to i32
  %116 = icmp ne i32 %111, %115
  br i1 %116, label %129, label %117

117:                                              ; preds = %107, %101
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i64 0
  %120 = load i8, ptr %119, align 1, !tbaa !22
  %121 = sext i8 %120 to i32
  %122 = icmp eq i32 %121, 48
  br i1 %122, label %123, label %145

123:                                              ; preds = %117
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds i8, ptr %124, i64 2
  %126 = load i8, ptr %125, align 1, !tbaa !22
  %127 = sext i8 %126 to i32
  %128 = icmp slt i32 %127, 57
  br i1 %128, label %129, label %145

129:                                              ; preds = %123, %107, %91, %88
  call void @llvm.lifetime.start.p0(i64 80, ptr %20) #6
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = icmp ne ptr %130, null
  br i1 %131, label %132, label %138

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

138:                                              ; preds = %132, %129
  %139 = getelementptr inbounds [80 x i8], ptr %20, i64 0, i64 0
  %140 = call ptr @png_get_header_ver(ptr noundef null)
  %141 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %139, i64 noundef 80, ptr noundef @.str.5, ptr noundef %140) #6
  %142 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %143 = getelementptr inbounds [80 x i8], ptr %20, i64 0, i64 0
  call void @png_warning(ptr noundef %142, ptr noundef %143)
  %144 = load volatile ptr, ptr %17, align 8, !tbaa !5
  call void @png_warning(ptr noundef %144, ptr noundef @.str.6)
  store volatile i32 1, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 80, ptr %20) #6
  br label %145

145:                                              ; preds = %138, %123, %117
  br label %146

146:                                              ; preds = %145, %81
  %147 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.png_struct_def, ptr %147, i32 0, i32 18
  store i64 8192, ptr %148, align 8, !tbaa !26
  %149 = load volatile i32, ptr %16, align 4, !tbaa !9
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %165, label %151

151:                                              ; preds = %146
  %152 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %153 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.png_struct_def, ptr %153, i32 0, i32 18
  %155 = load i64, ptr %154, align 8, !tbaa !26
  %156 = call ptr @png_malloc_warn(ptr noundef %152, i64 noundef %155)
  %157 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.png_struct_def, ptr %157, i32 0, i32 17
  store ptr %156, ptr %158, align 8, !tbaa !27
  %159 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.png_struct_def, ptr %159, i32 0, i32 17
  %161 = load ptr, ptr %160, align 8, !tbaa !27
  %162 = icmp eq ptr %161, null
  br i1 %162, label %163, label %164

163:                                              ; preds = %151
  store volatile i32 1, ptr %16, align 4, !tbaa !9
  br label %164

164:                                              ; preds = %163, %151
  br label %165

165:                                              ; preds = %164, %146
  %166 = load volatile i32, ptr %16, align 4, !tbaa !9
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %178

168:                                              ; preds = %165
  %169 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %170 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.png_struct_def, ptr %170, i32 0, i32 17
  %172 = load ptr, ptr %171, align 8, !tbaa !27
  call void @png_free(ptr noundef %169, ptr noundef %172)
  %173 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.png_struct_def, ptr %173, i32 0, i32 17
  store ptr null, ptr %174, align 8, !tbaa !27
  %175 = load volatile ptr, ptr %17, align 8, !tbaa !5
  %176 = load ptr, ptr %15, align 8, !tbaa !5
  %177 = load ptr, ptr %13, align 8, !tbaa !5
  call void @png_destroy_struct_2(ptr noundef %175, ptr noundef %176, ptr noundef %177)
  store ptr null, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %182

178:                                              ; preds = %165
  %179 = load volatile ptr, ptr %17, align 8, !tbaa !5
  call void @png_set_write_fn(ptr noundef %179, ptr noundef null, ptr noundef null, ptr noundef null)
  %180 = load volatile ptr, ptr %17, align 8, !tbaa !5
  call void @png_set_filter_heuristics(ptr noundef %180, i32 noundef 0, i32 noundef 1, ptr noundef null, ptr noundef null)
  %181 = load volatile ptr, ptr %17, align 8, !tbaa !5
  store ptr %181, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %182

182:                                              ; preds = %178, %168, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %183 = load ptr, ptr %8, align 8
  ret ptr %183
}

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 ptr @png_set_longjmp_fn(ptr noundef, ptr noundef, i64 noundef) #0

; Function Attrs: noreturn nounwind
declare void @longjmp(ptr noundef, i32 noundef) #4

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

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

declare ptr @png_get_header_ver(ptr noundef) #0

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

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

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

declare void @png_destroy_struct_2(ptr noundef, ptr noundef, ptr 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

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 = { 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 #5 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 1108}
!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, !6, i64 272, !7, i64 280, !7, i64 281, !10, i64 284, !10, i64 288, !10, i64 292, !13, i64 296, !6, i64 408, !14, i64 416, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !14, i64 464, !14, i64 472, !10, i64 480, !10, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !15, i64 536, !10, i64 560, !10, i64 564, !6, i64 568, !16, i64 576, !16, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !16, i64 598, !7, i64 600, !17, i64 604, !18, i64 608, !18, i64 618, !6, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !17, i64 652, !17, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !19, i64 712, !19, i64 717, !6, i64 728, !18, i64 736, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !10, i64 824, !10, i64 828, !14, i64 832, !14, i64 840, !14, i64 848, !14, i64 856, !10, i64 864, !10, i64 868, !14, i64 872, !14, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !7, i64 928, !7, i64 929, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !10, i64 984, !6, i64 992, !6, i64 1000, !10, i64 1008, !6, i64 1016, !7, i64 1024, !16, i64 1026, !16, i64 1028, !16, i64 1030, !10, i64 1032, !10, i64 1036, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !7, i64 1104, !10, i64 1108, !10, i64 1112, !10, i64 1116, !20, i64 1120, !10, i64 1152, !10, i64 1156, !6, i64 1160, !10, i64 1168}
!13 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !14, i64 16, !6, i64 24, !10, i64 32, !14, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !14, i64 96, !14, i64 104}
!14 = !{!"long", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !14, 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, !14, i64 16, !7, i64 24}
!21 = !{!12, !10, i64 1112}
!22 = !{!7, !7, i64 0}
!23 = !{!12, !10, i64 288}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !14, i64 416}
!27 = !{!12, !6, i64 408}


; 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.4 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.6 = 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

; 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 i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca [80 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8)
  store volatile i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9)
  %11 = call ptr @png_create_struct_2(i32 noundef 1, ptr noundef %5, ptr noundef %4) #6
  store volatile ptr %11, ptr %9, align 8, !tbaa !9
  %.0..0..0..0. = load volatile ptr, ptr %9, align 8, !tbaa !9
  %12 = icmp eq ptr %.0..0..0..0., null
  br i1 %12, label %82, label %13

13:                                               ; preds = %7
  %.0..0..0..0.3 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %.0..0..0..0.3, i64 1108
  store i32 1000000, ptr %14, align 4, !tbaa !11
  %.0..0..0..0.4 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %.0..0..0..0.4, i64 1112
  store i32 1000000, ptr %15, align 8, !tbaa !21
  %.0..0..0..0.5 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %16 = call ptr @png_set_longjmp_fn(ptr noundef %.0..0..0..0.5, ptr noundef nonnull @longjmp, i64 noundef 200) #6
  %17 = call i32 @_setjmp(ptr noundef %16) #7
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %19, label %18

18:                                               ; preds = %13
  call void @abort() #8
  unreachable

19:                                               ; preds = %13
  %.0..0..0..0.6 = load volatile ptr, ptr %9, align 8, !tbaa !9
  call void @png_set_mem_fn(ptr noundef %.0..0..0..0.6, ptr noundef %4, ptr noundef %5, ptr noundef %6) #6
  %.0..0..0..0.7 = load volatile ptr, ptr %9, align 8, !tbaa !9
  call void @png_set_error_fn(ptr noundef %.0..0..0..0.7, ptr noundef %1, ptr noundef %2, ptr noundef %3) #6
  %.not50 = icmp eq ptr %0, null
  br i1 %.not50, label %.thread, label %.preheader

.preheader:                                       ; preds = %19, %29
  %indvars.iv = phi i64 [ %indvars.iv.next, %29 ], [ 0, %19 ]
  %20 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv
  %21 = load i8, ptr %20, align 1, !tbaa !22
  %22 = call ptr @png_get_header_ver(ptr noundef null) #6
  %23 = getelementptr inbounds i8, ptr %22, i64 %indvars.iv
  %24 = load i8, ptr %23, align 1, !tbaa !22
  %.not51 = icmp eq i8 %21, %24
  br i1 %.not51, label %29, label %25

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

29:                                               ; preds = %.preheader, %25
  %30 = call ptr @png_get_header_ver(ptr noundef null) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = getelementptr inbounds i8, ptr %30, i64 %indvars.iv
  %32 = load i8, ptr %31, align 1, !tbaa !22
  %.not52 = icmp eq i8 %32, 0
  br i1 %.not52, label %33, label %.preheader, !llvm.loop !24

33:                                               ; preds = %29
  %.0..0..0..0.9 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %.0..0..0..0.9, i64 288
  %35 = load i32, ptr %34, align 8, !tbaa !23
  %36 = and i32 %35, 131072
  %.not53 = icmp eq i32 %36, 0
  br i1 %.not53, label %65, label %40

.thread:                                          ; preds = %19
  %.0..0..0..0.958 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %.0..0..0..0.958, i64 288
  %38 = load i32, ptr %37, align 8, !tbaa !23
  %39 = and i32 %38, 131072
  %.not5359 = icmp eq i32 %39, 0
  br i1 %.not5359, label %65, label %.thread60

40:                                               ; preds = %33
  %41 = load i8, ptr %0, align 1, !tbaa !22
  %42 = call ptr @png_get_header_ver(ptr noundef null) #6
  %43 = load i8, ptr %42, align 1, !tbaa !22
  %.not54 = icmp eq i8 %41, %43
  br i1 %.not54, label %44, label %60

44:                                               ; preds = %40
  %45 = load i8, ptr %0, align 1, !tbaa !22
  %46 = icmp eq i8 %45, 49
  br i1 %46, label %47, label %53

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %0, i64 2
  %49 = load i8, ptr %48, align 1, !tbaa !22
  %50 = call ptr @png_get_header_ver(ptr noundef null) #6
  %51 = getelementptr inbounds i8, ptr %50, i64 2
  %52 = load i8, ptr %51, align 1, !tbaa !22
  %.not55 = icmp eq i8 %49, %52
  br i1 %.not55, label %thread-pre-split, label %60

thread-pre-split:                                 ; preds = %47
  %.pr = load i8, ptr %0, align 1, !tbaa !22
  br label %53

53:                                               ; preds = %thread-pre-split, %44
  %54 = phi i8 [ %.pr, %thread-pre-split ], [ %45, %44 ]
  %55 = icmp eq i8 %54, 48
  br i1 %55, label %56, label %65

56:                                               ; preds = %53
  %57 = getelementptr inbounds i8, ptr %0, i64 2
  %58 = load i8, ptr %57, align 1, !tbaa !22
  %59 = icmp slt i8 %58, 57
  br i1 %59, label %60, label %65

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

60:                                               ; preds = %56, %47, %40
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %10) #6
  %61 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %10, i64 noundef 80, ptr noundef nonnull @.str.4, ptr noundef nonnull %0) #6
  %.0..0..0..0.10 = load volatile ptr, ptr %9, align 8, !tbaa !9
  call void @png_warning(ptr noundef %.0..0..0..0.10, ptr noundef nonnull %10) #6
  br label %62

62:                                               ; preds = %.thread60, %60
  %63 = call ptr @png_get_header_ver(ptr noundef null) #6
  %64 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %10, i64 noundef 80, ptr noundef nonnull @.str.5, ptr noundef %63) #6
  %.0..0..0..0.11 = load volatile ptr, ptr %9, align 8, !tbaa !9
  call void @png_warning(ptr noundef %.0..0..0..0.11, ptr noundef nonnull %10) #6
  %.0..0..0..0.12 = load volatile ptr, ptr %9, align 8, !tbaa !9
  call void @png_warning(ptr noundef %.0..0..0..0.12, ptr noundef nonnull @.str.6) #6
  store volatile i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %10) #6
  br label %65

65:                                               ; preds = %.thread, %53, %56, %62, %33
  %.0..0..0..0.13 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %66 = getelementptr inbounds i8, ptr %.0..0..0..0.13, i64 416
  store i64 8192, ptr %66, align 8, !tbaa !26
  %.0..0..0..0.25 = load volatile i32, ptr %8, align 4, !tbaa !5
  %.not56 = icmp eq i32 %.0..0..0..0.25, 0
  br i1 %.not56, label %67, label %76

67:                                               ; preds = %65
  %.0..0..0..0.14 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %.0..0..0..0.15 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %.0..0..0..0.15, i64 416
  %69 = load i64, ptr %68, align 8, !tbaa !26
  %70 = call ptr @png_malloc_warn(ptr noundef %.0..0..0..0.14, i64 noundef %69) #6
  %.0..0..0..0.16 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %.0..0..0..0.16, i64 408
  store ptr %70, ptr %71, align 8, !tbaa !27
  %.0..0..0..0.17 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %.0..0..0..0.17, i64 408
  %73 = load ptr, ptr %72, align 8, !tbaa !27
  %74 = icmp eq ptr %73, null
  br i1 %74, label %75, label %76

75:                                               ; preds = %67
  store volatile i32 1, ptr %8, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %67, %75, %65
  %.0..0..0..0.26 = load volatile i32, ptr %8, align 4, !tbaa !5
  %.not57 = icmp eq i32 %.0..0..0..0.26, 0
  %.0..0..0..0.22 = load volatile ptr, ptr %9, align 8, !tbaa !9
  br i1 %.not57, label %81, label %77

77:                                               ; preds = %76
  %.0..0..0..0.19 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %78 = getelementptr inbounds i8, ptr %.0..0..0..0.19, i64 408
  %79 = load ptr, ptr %78, align 8, !tbaa !27
  call void @png_free(ptr noundef %.0..0..0..0.22, ptr noundef %79) #6
  %.0..0..0..0.20 = load volatile ptr, ptr %9, align 8, !tbaa !9
  %80 = getelementptr inbounds i8, ptr %.0..0..0..0.20, i64 408
  store ptr null, ptr %80, align 8, !tbaa !27
  %.0..0..0..0.21 = load volatile ptr, ptr %9, align 8, !tbaa !9
  call void @png_destroy_struct_2(ptr noundef %.0..0..0..0.21, ptr noundef %6, ptr noundef %4) #6
  br label %82

81:                                               ; preds = %76
  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 %9, align 8, !tbaa !9
  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 %9, align 8, !tbaa !9
  br label %82

82:                                               ; preds = %7, %81, %77
  %.048 = phi ptr [ null, %77 ], [ %.0..0..0..0.24, %81 ], [ null, %7 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8)
  ret ptr %.048
}

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 ptr @png_set_longjmp_fn(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @longjmp(ptr noundef, i32 noundef) #4

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

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

declare ptr @png_get_header_ver(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 #5

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

declare void @png_destroy_struct_2(ptr noundef, ptr noundef, ptr 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

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 = { 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 #5 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 1108}
!12 = !{!"png_struct_def", !7, i64 0, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !7, i64 280, !7, i64 281, !6, i64 284, !6, i64 288, !6, i64 292, !13, i64 296, !10, i64 408, !14, i64 416, !6, i64 424, !6, i64 428, !6, i64 432, !6, i64 436, !6, i64 440, !6, i64 444, !6, i64 448, !6, i64 452, !6, i64 456, !14, i64 464, !14, i64 472, !6, i64 480, !6, i64 484, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !10, i64 520, !10, i64 528, !15, i64 536, !6, i64 560, !6, i64 564, !10, i64 568, !16, i64 576, !16, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !16, i64 598, !7, i64 600, !17, i64 604, !18, i64 608, !18, i64 618, !10, i64 632, !6, i64 640, !6, i64 644, !6, i64 648, !17, i64 652, !17, i64 656, !10, i64 664, !10, i64 672, !10, i64 680, !10, i64 688, !10, i64 696, !10, i64 704, !19, i64 712, !19, i64 717, !10, i64 728, !18, i64 736, !10, i64 752, !10, i64 760, !10, i64 768, !10, i64 776, !10, i64 784, !10, i64 792, !10, i64 800, !10, i64 808, !10, i64 816, !6, i64 824, !6, i64 828, !14, i64 832, !14, i64 840, !14, i64 848, !14, i64 856, !6, i64 864, !6, i64 868, !14, i64 872, !14, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !10, i64 920, !7, i64 928, !7, i64 929, !10, i64 936, !10, i64 944, !10, i64 952, !10, i64 960, !10, i64 968, !10, i64 976, !6, i64 984, !10, i64 992, !10, i64 1000, !6, i64 1008, !10, i64 1016, !7, i64 1024, !16, i64 1026, !16, i64 1028, !16, i64 1030, !6, i64 1032, !6, i64 1036, !7, i64 1040, !10, i64 1048, !10, i64 1056, !10, i64 1064, !10, i64 1072, !10, i64 1080, !10, i64 1088, !10, i64 1096, !7, i64 1104, !6, i64 1108, !6, i64 1112, !6, i64 1116, !20, i64 1120, !6, i64 1152, !6, i64 1156, !10, i64 1160, !6, i64 1168}
!13 = !{!"z_stream_s", !10, i64 0, !6, i64 8, !14, i64 16, !10, i64 24, !6, i64 32, !14, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !6, i64 88, !14, i64 96, !14, i64 104}
!14 = !{!"long", !7, i64 0}
!15 = !{!"png_row_info_struct", !6, i64 0, !14, 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, !10, i64 8, !14, i64 16, !7, i64 24}
!21 = !{!12, !6, i64 1112}
!22 = !{!7, !7, i64 0}
!23 = !{!12, !6, i64 288}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !14, i64 416}
!27 = !{!12, !10, i64 408}


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