; LLVM IR from corentinartaud/graphics :: ThirdParty/FreeImage-3170/Source/LibPNG (png)

; 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, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, %struct.z_stream_s, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, i32, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, i32, 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, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, i8, [29 x i8], i32, ptr, ptr, i32, i32, ptr, i8, i8, i16, i16, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, i64, %struct.png_unknown_chunk_t, i64, ptr, i64, i32, i32, ptr, [4 x ptr], %struct.png_colorspace }
%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_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_colorspace = type { i32, %struct.png_xy, %struct.png_XYZ, i16, i16 }
%struct.png_xy = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_XYZ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str.68 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @png_reciprocal(i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_destroy_gamma_table(ptr noalias noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @png_build_gamma_table(ptr noalias noundef %0, i32 noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.png_struct_def, ptr %7, i32 0, i32 82
  %9 = load ptr, ptr %8, align 8, !tbaa !11
  %10 = icmp ne ptr %9, null
  br i1 %10, label %16, label %11

11:                                               ; preds = %2
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.png_struct_def, ptr %12, i32 0, i32 83
  %14 = load ptr, ptr %13, align 8, !tbaa !22
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %19

16:                                               ; preds = %11, %2
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_warning(ptr noundef %17, ptr noundef @.str.68)
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_destroy_gamma_table(ptr noundef %18)
  br label %19

19:                                               ; preds = %16, %11
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = icmp sle i32 %20, 8
  br i1 %21, label %22, label %76

22:                                               ; preds = %19
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.png_struct_def, ptr %24, i32 0, i32 82
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.png_struct_def, ptr %26, i32 0, i32 81
  %28 = load i32, ptr %27, align 4, !tbaa !23
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %30, label %39

30:                                               ; preds = %22
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.png_struct_def, ptr %31, i32 0, i32 152
  %33 = getelementptr inbounds %struct.png_colorspace, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !24
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_struct_def, ptr %35, i32 0, i32 81
  %37 = load i32, ptr %36, align 4, !tbaa !23
  %38 = call i32 @png_reciprocal2(i32 noundef %34, i32 noundef %37)
  br label %40

39:                                               ; preds = %22
  br label %40

40:                                               ; preds = %39, %30
  %41 = phi i32 [ %38, %30 ], [ 100000, %39 ]
  call void @png_build_8bit_table(ptr noundef %23, ptr noundef %25, i32 noundef %41)
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.png_struct_def, ptr %42, i32 0, i32 17
  %44 = load i32, ptr %43, align 4, !tbaa !25
  %45 = and i32 %44, 6291584
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %75

47:                                               ; preds = %40
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.png_struct_def, ptr %49, i32 0, i32 85
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.png_struct_def, ptr %51, i32 0, i32 152
  %53 = getelementptr inbounds %struct.png_colorspace, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 8, !tbaa !24
  %55 = call i32 @png_reciprocal(i32 noundef %54)
  call void @png_build_8bit_table(ptr noundef %48, ptr noundef %50, i32 noundef %55)
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 84
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.png_struct_def, ptr %59, i32 0, i32 81
  %61 = load i32, ptr %60, align 4, !tbaa !23
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %63, label %68

63:                                               ; preds = %47
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.png_struct_def, ptr %64, i32 0, i32 81
  %66 = load i32, ptr %65, align 4, !tbaa !23
  %67 = call i32 @png_reciprocal(i32 noundef %66)
  br label %73

68:                                               ; preds = %47
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_struct_def, ptr %69, i32 0, i32 152
  %71 = getelementptr inbounds %struct.png_colorspace, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !24
  br label %73

73:                                               ; preds = %68, %63
  %74 = phi i32 [ %67, %63 ], [ %72, %68 ]
  call void @png_build_8bit_table(ptr noundef %56, ptr noundef %58, i32 noundef %74)
  br label %75

75:                                               ; preds = %73, %40
  br label %245

76:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.png_struct_def, ptr %77, i32 0, i32 63
  %79 = load i8, ptr %78, align 1, !tbaa !26
  %80 = zext i8 %79 to i32
  %81 = and i32 %80, 2
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %116

83:                                               ; preds = %76
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.png_struct_def, ptr %84, i32 0, i32 88
  %86 = getelementptr inbounds %struct.png_color_8_struct, ptr %85, i32 0, i32 0
  %87 = load i8, ptr %86, align 8, !tbaa !27
  store i8 %87, ptr %6, align 1, !tbaa !28
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.png_struct_def, ptr %88, i32 0, i32 88
  %90 = getelementptr inbounds %struct.png_color_8_struct, ptr %89, i32 0, i32 1
  %91 = load i8, ptr %90, align 1, !tbaa !29
  %92 = zext i8 %91 to i32
  %93 = load i8, ptr %6, align 1, !tbaa !28
  %94 = zext i8 %93 to i32
  %95 = icmp sgt i32 %92, %94
  br i1 %95, label %96, label %101

96:                                               ; preds = %83
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 88
  %99 = getelementptr inbounds %struct.png_color_8_struct, ptr %98, i32 0, i32 1
  %100 = load i8, ptr %99, align 1, !tbaa !29
  store i8 %100, ptr %6, align 1, !tbaa !28
  br label %101

101:                                              ; preds = %96, %83
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.png_struct_def, ptr %102, i32 0, i32 88
  %104 = getelementptr inbounds %struct.png_color_8_struct, ptr %103, i32 0, i32 2
  %105 = load i8, ptr %104, align 2, !tbaa !30
  %106 = zext i8 %105 to i32
  %107 = load i8, ptr %6, align 1, !tbaa !28
  %108 = zext i8 %107 to i32
  %109 = icmp sgt i32 %106, %108
  br i1 %109, label %110, label %115

110:                                              ; preds = %101
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.png_struct_def, ptr %111, i32 0, i32 88
  %113 = getelementptr inbounds %struct.png_color_8_struct, ptr %112, i32 0, i32 2
  %114 = load i8, ptr %113, align 2, !tbaa !30
  store i8 %114, ptr %6, align 1, !tbaa !28
  br label %115

115:                                              ; preds = %110, %101
  br label %121

116:                                              ; preds = %76
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.png_struct_def, ptr %117, i32 0, i32 88
  %119 = getelementptr inbounds %struct.png_color_8_struct, ptr %118, i32 0, i32 3
  %120 = load i8, ptr %119, align 1, !tbaa !31
  store i8 %120, ptr %6, align 1, !tbaa !28
  br label %121

121:                                              ; preds = %116, %115
  %122 = load i8, ptr %6, align 1, !tbaa !28
  %123 = zext i8 %122 to i32
  %124 = icmp sgt i32 %123, 0
  br i1 %124, label %125, label %134

125:                                              ; preds = %121
  %126 = load i8, ptr %6, align 1, !tbaa !28
  %127 = zext i8 %126 to i32
  %128 = icmp ult i32 %127, 16
  br i1 %128, label %129, label %134

129:                                              ; preds = %125
  %130 = load i8, ptr %6, align 1, !tbaa !28
  %131 = zext i8 %130 to i32
  %132 = sub i32 16, %131
  %133 = trunc i32 %132 to i8
  store i8 %133, ptr %5, align 1, !tbaa !28
  br label %135

134:                                              ; preds = %125, %121
  store i8 0, ptr %5, align 1, !tbaa !28
  br label %135

135:                                              ; preds = %134, %129
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.png_struct_def, ptr %136, i32 0, i32 17
  %138 = load i32, ptr %137, align 4, !tbaa !25
  %139 = and i32 %138, 67109888
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %147

141:                                              ; preds = %135
  %142 = load i8, ptr %5, align 1, !tbaa !28
  %143 = zext i8 %142 to i32
  %144 = icmp ult i32 %143, 5
  br i1 %144, label %145, label %146

145:                                              ; preds = %141
  store i8 5, ptr %5, align 1, !tbaa !28
  br label %146

146:                                              ; preds = %145, %141
  br label %147

147:                                              ; preds = %146, %135
  %148 = load i8, ptr %5, align 1, !tbaa !28
  %149 = zext i8 %148 to i32
  %150 = icmp ugt i32 %149, 8
  br i1 %150, label %151, label %152

151:                                              ; preds = %147
  store i8 8, ptr %5, align 1, !tbaa !28
  br label %152

152:                                              ; preds = %151, %147
  %153 = load i8, ptr %5, align 1, !tbaa !28
  %154 = zext i8 %153 to i32
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.png_struct_def, ptr %155, i32 0, i32 80
  store i32 %154, ptr %156, align 8, !tbaa !32
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.png_struct_def, ptr %157, i32 0, i32 17
  %159 = load i32, ptr %158, align 4, !tbaa !25
  %160 = and i32 %159, 67109888
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %184

162:                                              ; preds = %152
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.png_struct_def, ptr %164, i32 0, i32 83
  %166 = load i8, ptr %5, align 1, !tbaa !28
  %167 = zext i8 %166 to i32
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.png_struct_def, ptr %168, i32 0, i32 81
  %170 = load i32, ptr %169, align 4, !tbaa !23
  %171 = icmp sgt i32 %170, 0
  br i1 %171, label %172, label %181

172:                                              ; preds = %162
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.png_struct_def, ptr %173, i32 0, i32 152
  %175 = getelementptr inbounds %struct.png_colorspace, ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 8, !tbaa !24
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.png_struct_def, ptr %177, i32 0, i32 81
  %179 = load i32, ptr %178, align 4, !tbaa !23
  %180 = call i32 @png_product2(i32 noundef %176, i32 noundef %179)
  br label %182

181:                                              ; preds = %162
  br label %182

182:                                              ; preds = %181, %172
  %183 = phi i32 [ %180, %172 ], [ 100000, %181 ]
  call void @png_build_16to8_table(ptr noundef %163, ptr noundef %165, i32 noundef %167, i32 noundef %183)
  br label %206

184:                                              ; preds = %152
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.png_struct_def, ptr %186, i32 0, i32 83
  %188 = load i8, ptr %5, align 1, !tbaa !28
  %189 = zext i8 %188 to i32
  %190 = load ptr, ptr %3, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.png_struct_def, ptr %190, i32 0, i32 81
  %192 = load i32, ptr %191, align 4, !tbaa !23
  %193 = icmp sgt i32 %192, 0
  br i1 %193, label %194, label %203

194:                                              ; preds = %184
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.png_struct_def, ptr %195, i32 0, i32 152
  %197 = getelementptr inbounds %struct.png_colorspace, ptr %196, i32 0, i32 0
  %198 = load i32, ptr %197, align 8, !tbaa !24
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.png_struct_def, ptr %199, i32 0, i32 81
  %201 = load i32, ptr %200, align 4, !tbaa !23
  %202 = call i32 @png_reciprocal2(i32 noundef %198, i32 noundef %201)
  br label %204

203:                                              ; preds = %184
  br label %204

204:                                              ; preds = %203, %194
  %205 = phi i32 [ %202, %194 ], [ 100000, %203 ]
  call void @png_build_16bit_table(ptr noundef %185, ptr noundef %187, i32 noundef %189, i32 noundef %205)
  br label %206

206:                                              ; preds = %204, %182
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.png_struct_def, ptr %207, i32 0, i32 17
  %209 = load i32, ptr %208, align 4, !tbaa !25
  %210 = and i32 %209, 6291584
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %212, label %244

212:                                              ; preds = %206
  %213 = load ptr, ptr %3, align 8, !tbaa !5
  %214 = load ptr, ptr %3, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.png_struct_def, ptr %214, i32 0, i32 87
  %216 = load i8, ptr %5, align 1, !tbaa !28
  %217 = zext i8 %216 to i32
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.png_struct_def, ptr %218, i32 0, i32 152
  %220 = getelementptr inbounds %struct.png_colorspace, ptr %219, i32 0, i32 0
  %221 = load i32, ptr %220, align 8, !tbaa !24
  %222 = call i32 @png_reciprocal(i32 noundef %221)
  call void @png_build_16bit_table(ptr noundef %213, ptr noundef %215, i32 noundef %217, i32 noundef %222)
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.png_struct_def, ptr %224, i32 0, i32 86
  %226 = load i8, ptr %5, align 1, !tbaa !28
  %227 = zext i8 %226 to i32
  %228 = load ptr, ptr %3, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.png_struct_def, ptr %228, i32 0, i32 81
  %230 = load i32, ptr %229, align 4, !tbaa !23
  %231 = icmp sgt i32 %230, 0
  br i1 %231, label %232, label %237

232:                                              ; preds = %212
  %233 = load ptr, ptr %3, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.png_struct_def, ptr %233, i32 0, i32 81
  %235 = load i32, ptr %234, align 4, !tbaa !23
  %236 = call i32 @png_reciprocal(i32 noundef %235)
  br label %242

237:                                              ; preds = %212
  %238 = load ptr, ptr %3, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.png_struct_def, ptr %238, i32 0, i32 152
  %240 = getelementptr inbounds %struct.png_colorspace, ptr %239, i32 0, i32 0
  %241 = load i32, ptr %240, align 8, !tbaa !24
  br label %242

242:                                              ; preds = %237, %232
  %243 = phi i32 [ %236, %232 ], [ %241, %237 ]
  call void @png_build_16bit_table(ptr noundef %223, ptr noundef %225, i32 noundef %227, i32 noundef %243)
  br label %244

244:                                              ; preds = %242, %206
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  br label %245

245:                                              ; preds = %244, %75
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @png_build_8bit_table(ptr noalias noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @png_build_16to8_table(ptr noalias noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @png_product2(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @png_build_16bit_table(ptr noalias noundef, ptr noundef, i32 noundef, i32 noundef) #2

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 }

!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, !6, i64 696}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !13, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !14, i64 320, !6, i64 432, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !10, i64 460, !10, i64 464, !10, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !10, i64 488, !10, i64 492, !10, i64 496, !10, i64 500, !10, i64 504, !10, i64 508, !10, i64 512, !10, i64 516, !13, i64 520, !10, i64 528, !10, i64 532, !10, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !13, i64 592, !10, i64 600, !10, i64 604, !6, i64 608, !15, i64 616, !10, i64 620, !15, i64 624, !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, !7, i64 637, !7, i64 638, !7, i64 639, !15, i64 640, !7, i64 642, !10, i64 644, !16, i64 648, !16, i64 658, !6, i64 672, !10, i64 680, !10, i64 684, !10, i64 688, !10, i64 692, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !17, i64 744, !17, i64 749, !6, i64 760, !16, i64 768, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !10, i64 856, !10, i64 860, !13, i64 864, !13, i64 872, !13, i64 880, !13, i64 888, !10, i64 896, !10, i64 900, !6, i64 904, !6, i64 912, !7, i64 920, !7, i64 921, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !7, i64 968, !7, i64 969, !10, i64 1000, !6, i64 1008, !6, i64 1016, !10, i64 1024, !10, i64 1028, !6, i64 1032, !7, i64 1040, !7, i64 1041, !15, i64 1042, !15, i64 1044, !10, i64 1048, !7, i64 1052, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !6, i64 1104, !7, i64 1112, !10, i64 1116, !10, i64 1120, !10, i64 1124, !13, i64 1128, !18, i64 1136, !13, i64 1168, !6, i64 1176, !13, i64 1184, !10, i64 1192, !10, i64 1196, !6, i64 1200, !7, i64 1208, !19, i64 1240}
!13 = !{!"long", !7, i64 0}
!14 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !13, i64 96, !13, i64 104}
!15 = !{!"short", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, 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, !6, i64 8, !13, i64 16, !7, i64 24}
!19 = !{!"png_colorspace", !10, i64 0, !20, i64 4, !21, i64 36, !15, i64 72, !15, i64 74}
!20 = !{!"png_xy", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!21 = !{!"png_XYZ", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!22 = !{!12, !6, i64 704}
!23 = !{!12, !10, i64 692}
!24 = !{!12, !10, i64 1240}
!25 = !{!12, !10, i64 308}
!26 = !{!12, !7, i64 631}
!27 = !{!12, !7, i64 744}
!28 = !{!7, !7, i64 0}
!29 = !{!12, !7, i64 745}
!30 = !{!12, !7, i64 746}
!31 = !{!12, !7, i64 747}
!32 = !{!12, !10, i64 688}


; 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.68 = external hidden unnamed_addr constant [26 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @png_reciprocal(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_destroy_gamma_table(ptr noalias noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @png_build_gamma_table(ptr noalias noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 696
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %5, label %8

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 704
  %7 = load ptr, ptr %6, align 8, !tbaa !20
  %.not70 = icmp eq ptr %7, null
  br i1 %.not70, label %9, label %8

8:                                                ; preds = %5, %2
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.68) #3
  tail call void @png_destroy_gamma_table(ptr noundef nonnull %0)
  br label %9

9:                                                ; preds = %8, %5
  %10 = icmp slt i32 %1, 9
  br i1 %10, label %11, label %38

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 692
  %13 = load i32, ptr %12, align 4, !tbaa !21
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %15, label %19

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 1240
  %17 = load i32, ptr %16, align 8, !tbaa !22
  %18 = tail call i32 @png_reciprocal2(i32 noundef %17, i32 noundef %13)
  br label %19

19:                                               ; preds = %11, %15
  %20 = phi i32 [ %18, %15 ], [ 100000, %11 ]
  tail call void @png_build_8bit_table(ptr noundef nonnull %0, ptr noundef nonnull %3, i32 noundef %20)
  %21 = getelementptr inbounds i8, ptr %0, i64 308
  %22 = load i32, ptr %21, align 4, !tbaa !23
  %23 = and i32 %22, 6291584
  %.not75 = icmp eq i32 %23, 0
  br i1 %.not75, label %95, label %24

24:                                               ; preds = %19
  %25 = getelementptr inbounds i8, ptr %0, i64 720
  %26 = getelementptr inbounds i8, ptr %0, i64 1240
  %27 = load i32, ptr %26, align 8, !tbaa !22
  %28 = tail call i32 @png_reciprocal(i32 noundef %27)
  tail call void @png_build_8bit_table(ptr noundef nonnull %0, ptr noundef nonnull %25, i32 noundef %28)
  %29 = getelementptr inbounds i8, ptr %0, i64 712
  %30 = load i32, ptr %12, align 4, !tbaa !21
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %24
  %33 = tail call i32 @png_reciprocal(i32 noundef %30)
  br label %36

34:                                               ; preds = %24
  %35 = load i32, ptr %26, align 8, !tbaa !22
  br label %36

36:                                               ; preds = %34, %32
  %37 = phi i32 [ %33, %32 ], [ %35, %34 ]
  tail call void @png_build_8bit_table(ptr noundef nonnull %0, ptr noundef nonnull %29, i32 noundef %37)
  br label %95

38:                                               ; preds = %9
  %39 = getelementptr inbounds i8, ptr %0, i64 631
  %40 = load i8, ptr %39, align 1, !tbaa !24
  %41 = and i8 %40, 2
  %.not71 = icmp eq i8 %41, 0
  br i1 %.not71, label %49, label %42

42:                                               ; preds = %38
  %43 = getelementptr inbounds i8, ptr %0, i64 744
  %44 = load i8, ptr %43, align 8, !tbaa !25
  %45 = getelementptr inbounds i8, ptr %0, i64 745
  %46 = load i8, ptr %45, align 1, !tbaa !26
  %spec.select = tail call i8 @llvm.umax.i8(i8 %46, i8 %44)
  %47 = getelementptr inbounds i8, ptr %0, i64 746
  %48 = load i8, ptr %47, align 2, !tbaa !27
  %spec.select76 = tail call i8 @llvm.umax.i8(i8 %48, i8 %spec.select)
  br label %52

49:                                               ; preds = %38
  %50 = getelementptr inbounds i8, ptr %0, i64 747
  %51 = load i8, ptr %50, align 1, !tbaa !28
  br label %52

52:                                               ; preds = %42, %49
  %.1 = phi i8 [ %51, %49 ], [ %spec.select76, %42 ]
  %53 = add i8 %.1, -1
  %or.cond = icmp ult i8 %53, 15
  %narrow = sub nuw nsw i8 16, %.1
  %.062 = select i1 %or.cond, i8 %narrow, i8 0
  %54 = getelementptr inbounds i8, ptr %0, i64 308
  %55 = load i32, ptr %54, align 4, !tbaa !23
  %56 = and i32 %55, 67109888
  %.not72 = icmp eq i32 %56, 0
  %spec.store.select = tail call i8 @llvm.umax.i8(i8 %.062, i8 5)
  %.163 = select i1 %.not72, i8 %.062, i8 %spec.store.select
  %spec.store.select3 = tail call i8 @llvm.umin.i8(i8 %.163, i8 8)
  %57 = zext nneg i8 %spec.store.select3 to i32
  %58 = getelementptr inbounds i8, ptr %0, i64 688
  store i32 %57, ptr %58, align 8, !tbaa !29
  %59 = getelementptr inbounds i8, ptr %0, i64 704
  %60 = getelementptr inbounds i8, ptr %0, i64 692
  %61 = load i32, ptr %60, align 4, !tbaa !21
  %62 = icmp sgt i32 %61, 0
  br i1 %.not72, label %70, label %63

63:                                               ; preds = %52
  br i1 %62, label %64, label %68

64:                                               ; preds = %63
  %65 = getelementptr inbounds i8, ptr %0, i64 1240
  %66 = load i32, ptr %65, align 8, !tbaa !22
  %67 = tail call i32 @png_product2(i32 noundef %66, i32 noundef %61)
  br label %68

68:                                               ; preds = %63, %64
  %69 = phi i32 [ %67, %64 ], [ 100000, %63 ]
  tail call void @png_build_16to8_table(ptr noundef nonnull %0, ptr noundef nonnull %59, i32 noundef %57, i32 noundef %69)
  br label %77

70:                                               ; preds = %52
  br i1 %62, label %71, label %75

71:                                               ; preds = %70
  %72 = getelementptr inbounds i8, ptr %0, i64 1240
  %73 = load i32, ptr %72, align 8, !tbaa !22
  %74 = tail call i32 @png_reciprocal2(i32 noundef %73, i32 noundef %61)
  br label %75

75:                                               ; preds = %70, %71
  %76 = phi i32 [ %74, %71 ], [ 100000, %70 ]
  tail call void @png_build_16bit_table(ptr noundef nonnull %0, ptr noundef nonnull %59, i32 noundef %57, i32 noundef %76)
  br label %77

77:                                               ; preds = %75, %68
  %78 = load i32, ptr %54, align 4, !tbaa !23
  %79 = and i32 %78, 6291584
  %.not74 = icmp eq i32 %79, 0
  br i1 %.not74, label %95, label %80

80:                                               ; preds = %77
  %81 = getelementptr inbounds i8, ptr %0, i64 736
  %82 = getelementptr inbounds i8, ptr %0, i64 1240
  %83 = load i32, ptr %82, align 8, !tbaa !22
  %84 = tail call i32 @png_reciprocal(i32 noundef %83)
  tail call void @png_build_16bit_table(ptr noundef nonnull %0, ptr noundef nonnull %81, i32 noundef %57, i32 noundef %84)
  %85 = getelementptr inbounds i8, ptr %0, i64 728
  %86 = getelementptr inbounds i8, ptr %0, i64 692
  %87 = load i32, ptr %86, align 4, !tbaa !21
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %89, label %91

89:                                               ; preds = %80
  %90 = tail call i32 @png_reciprocal(i32 noundef %87)
  br label %93

91:                                               ; preds = %80
  %92 = load i32, ptr %82, align 8, !tbaa !22
  br label %93

93:                                               ; preds = %91, %89
  %94 = phi i32 [ %90, %89 ], [ %92, %91 ]
  tail call void @png_build_16bit_table(ptr noundef nonnull %0, ptr noundef nonnull %85, i32 noundef %57, i32 noundef %94)
  br label %95

95:                                               ; preds = %77, %93, %19, %36
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @png_build_8bit_table(ptr noalias noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @png_build_16to8_table(ptr noalias noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @png_product2(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @png_build_16bit_table(ptr noalias noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.umax.i8(i8, i8) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.umin.i8(i8, i8) #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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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, !9, i64 696}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !10, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !9, i64 280, !9, i64 288, !7, i64 296, !7, i64 297, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !12, i64 320, !9, i64 432, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !11, i64 456, !11, i64 460, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !11, i64 488, !11, i64 492, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !11, i64 512, !11, i64 516, !10, i64 520, !11, i64 528, !11, i64 532, !11, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !9, i64 568, !9, i64 576, !9, i64 584, !10, i64 592, !11, i64 600, !11, i64 604, !9, i64 608, !13, i64 616, !11, i64 620, !13, i64 624, !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, !7, i64 637, !7, i64 638, !7, i64 639, !13, i64 640, !7, i64 642, !11, i64 644, !14, i64 648, !14, i64 658, !9, i64 672, !11, i64 680, !11, i64 684, !11, i64 688, !11, i64 692, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !15, i64 744, !15, i64 749, !9, i64 760, !14, i64 768, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !11, i64 856, !11, i64 860, !10, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !11, i64 896, !11, i64 900, !9, i64 904, !9, i64 912, !7, i64 920, !7, i64 921, !9, i64 928, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !7, i64 968, !7, i64 969, !11, i64 1000, !9, i64 1008, !9, i64 1016, !11, i64 1024, !11, i64 1028, !9, i64 1032, !7, i64 1040, !7, i64 1041, !13, i64 1042, !13, i64 1044, !11, i64 1048, !7, i64 1052, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !9, i64 1104, !7, i64 1112, !11, i64 1116, !11, i64 1120, !11, i64 1124, !10, i64 1128, !16, i64 1136, !10, i64 1168, !9, i64 1176, !10, i64 1184, !11, i64 1192, !11, i64 1196, !9, i64 1200, !7, i64 1208, !17, i64 1240}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !9, i64 0, !11, i64 8, !10, i64 16, !9, i64 24, !11, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !11, i64 88, !10, i64 96, !10, i64 104}
!13 = !{!"short", !7, i64 0}
!14 = !{!"png_color_16_struct", !7, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!15 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!16 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!17 = !{!"png_colorspace", !11, i64 0, !18, i64 4, !19, i64 36, !13, i64 72, !13, i64 74}
!18 = !{!"png_xy", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!19 = !{!"png_XYZ", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!20 = !{!6, !9, i64 704}
!21 = !{!6, !11, i64 692}
!22 = !{!6, !11, i64 1240}
!23 = !{!6, !11, i64 308}
!24 = !{!6, !7, i64 631}
!25 = !{!6, !7, i64 744}
!26 = !{!6, !7, i64 745}
!27 = !{!6, !7, i64 746}
!28 = !{!6, !7, i64 747}
!29 = !{!6, !11, i64 688}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass