; LLVM IR from Try/Tempest :: Engine/thirdparty/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, i64, i32, i32, ptr, i16, i32, i16, i8, 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, i32, [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 81
  %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 82
  %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 81
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.png_struct_def, ptr %26, i32 0, i32 80
  %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 144
  %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 80
  %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 84
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.png_struct_def, ptr %51, i32 0, i32 144
  %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 83
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.png_struct_def, ptr %59, i32 0, i32 80
  %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 80
  %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 144
  %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 %246

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 61
  %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 87
  %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 87
  %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 87
  %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 87
  %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 87
  %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 87
  %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 %135

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 %135

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

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

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

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

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

147:                                              ; preds = %146, %142
  br label %148

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

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

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

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

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

182:                                              ; preds = %163
  br label %183

183:                                              ; preds = %182, %173
  %184 = phi i32 [ %181, %173 ], [ 100000, %182 ]
  call void @png_build_16to8_table(ptr noundef %164, ptr noundef %166, i32 noundef %168, i32 noundef %184)
  br label %207

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

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

204:                                              ; preds = %185
  br label %205

205:                                              ; preds = %204, %195
  %206 = phi i32 [ %203, %195 ], [ 100000, %204 ]
  call void @png_build_16bit_table(ptr noundef %186, ptr noundef %188, i32 noundef %190, i32 noundef %206)
  br label %207

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

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

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

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

243:                                              ; preds = %238, %233
  %244 = phi i32 [ %237, %233 ], [ %242, %238 ]
  call void @png_build_16bit_table(ptr noundef %224, ptr noundef %226, i32 noundef %228, i32 noundef %244)
  br label %245

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

246:                                              ; preds = %245, %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 680}
!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, !13, i64 576, !10, i64 584, !10, i64 588, !6, i64 592, !15, i64 600, !10, i64 604, !15, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !15, i64 626, !7, i64 628, !10, i64 632, !16, i64 636, !16, i64 646, !6, i64 656, !10, i64 664, !10, i64 668, !10, i64 672, !10, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !17, i64 728, !17, i64 733, !6, i64 744, !16, i64 752, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !10, i64 840, !10, i64 844, !13, i64 848, !13, i64 856, !13, i64 864, !13, i64 872, !10, i64 880, !10, i64 884, !6, i64 888, !6, i64 896, !10, i64 904, !7, i64 908, !10, i64 940, !6, i64 944, !6, i64 952, !10, i64 960, !10, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !15, i64 978, !15, i64 980, !10, i64 984, !7, i64 988, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !7, i64 1048, !10, i64 1052, !10, i64 1056, !10, i64 1060, !13, i64 1064, !18, i64 1072, !13, i64 1104, !6, i64 1112, !13, i64 1120, !10, i64 1128, !10, i64 1132, !6, i64 1136, !7, i64 1144, !19, i64 1176}
!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 688}
!23 = !{!12, !10, i64 676}
!24 = !{!12, !10, i64 1176}
!25 = !{!12, !10, i64 308}
!26 = !{!12, !7, i64 615}
!27 = !{!12, !7, i64 728}
!28 = !{!7, !7, i64 0}
!29 = !{!12, !7, i64 729}
!30 = !{!12, !7, i64 730}
!31 = !{!12, !7, i64 731}
!32 = !{!12, !10, i64 672}


; 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 680
  %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 688
  %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 676
  %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 1176
  %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 704
  %26 = getelementptr inbounds i8, ptr %0, i64 1176
  %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 696
  %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 615
  %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 728
  %44 = load i8, ptr %43, align 8, !tbaa !25
  %45 = getelementptr inbounds i8, ptr %0, i64 729
  %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 730
  %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 731
  %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 672
  store i32 %57, ptr %58, align 8, !tbaa !29
  %59 = getelementptr inbounds i8, ptr %0, i64 688
  %60 = getelementptr inbounds i8, ptr %0, i64 676
  %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 1176
  %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 1176
  %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 720
  %82 = getelementptr inbounds i8, ptr %0, i64 1176
  %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 712
  %86 = getelementptr inbounds i8, ptr %0, i64 676
  %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 680}
!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, !10, i64 576, !11, i64 584, !11, i64 588, !9, i64 592, !13, i64 600, !11, i64 604, !13, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !13, i64 626, !7, i64 628, !11, i64 632, !14, i64 636, !14, i64 646, !9, i64 656, !11, i64 664, !11, i64 668, !11, i64 672, !11, i64 676, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !15, i64 728, !15, i64 733, !9, i64 744, !14, i64 752, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !11, i64 840, !11, i64 844, !10, i64 848, !10, i64 856, !10, i64 864, !10, i64 872, !11, i64 880, !11, i64 884, !9, i64 888, !9, i64 896, !11, i64 904, !7, i64 908, !11, i64 940, !9, i64 944, !9, i64 952, !11, i64 960, !11, i64 964, !9, i64 968, !7, i64 976, !7, i64 977, !13, i64 978, !13, i64 980, !11, i64 984, !7, i64 988, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !9, i64 1040, !7, i64 1048, !11, i64 1052, !11, i64 1056, !11, i64 1060, !10, i64 1064, !16, i64 1072, !10, i64 1104, !9, i64 1112, !10, i64 1120, !11, i64 1128, !11, i64 1132, !9, i64 1136, !7, i64 1144, !17, i64 1176}
!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 688}
!21 = !{!6, !11, i64 676}
!22 = !{!6, !11, i64 1176}
!23 = !{!6, !11, i64 308}
!24 = !{!6, !7, i64 615}
!25 = !{!6, !7, i64 728}
!26 = !{!6, !7, i64 729}
!27 = !{!6, !7, i64 730}
!28 = !{!6, !7, i64 731}
!29 = !{!6, !11, i64 672}


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